Monday, December 17, 2012

WSD port monitor for Printers and TCP/IP ports, what is the difference?

SkyHi @ Monday, December 17, 2012

There is a lot of discussion about IP addresses etc for printer problems. There is no mention of a new feature for porting for printers, WSD port for plug and play of printers, I assume that IP addresses do not matter with WSD, My printer is confusingly set up for WSD port and TCP/IP port, can someone please expain


The WSD Port Monitor is a new printer port monitor in Windows Vista and Windows Server 2008.  This port monitor supports printing to network devices that are designed to include Web Services for Devices (WSD) technology.  Web Services for Devices allows network-connected IP-based devices to advertise their functionality and offer these services to clients by using the Web Services protocol.  WSD-based devices and clients communicate over the network using a series of SOAP (Simple Object Access Protocol) messages over UDP and HTTP(S).  WSD for Devices provides a network plug-and-play experience that is similar to installing a USB device.  Web Services for Devices also defines a security profile that may be extended to provide additional protection and authentication using device-based certificates.
The WSD Port Monitor is installed by default on Windows Vista.  On Windows Server 2008, the port monitor is installed along with the Print Services server role.  Web Services for Devices is not available for Windows XP or Windows Server 2003.  These clients can print to WSD-based devices that are shared on computers running Windows Vista or Windows Server 2008.  There are four main tasks performed by the WSD Port Monitor:
  • Discover and connect to WSD-based network printers
  • Send print jobs to WSD printers
  • Monitor the status and configuration of the WSD printers and update the printer object status accordingly
  • Respond to bidirectional queries from WSD printers
These are the same functions provided by other port monitors (for example the Standard TCP/IP port monitor, tcpmon.dll).  The WSD Port Monitor is implemented in wsdmon.dll.  This DLL is loaded under the print spooler process (spoolsv.exe) and is defined as a port monitor in the following registry key:HKLM\SYSTEM\CurrentControlSet\Control\Print\Monitors\WSD Port.  For WSD-based print devices, the WSD Port Monitor is used by default.  If the print device does not support the WSD Port Monitor, then the Standard TCP/IP Port Monitor is used instead.
Now that we know what the WSD Port Monitor does, let's look at the communications mechanism used by WSD.  When a WSD-based printer is connected to a network, it sends out an unsolicited "Hello" message to advertise its presence.  Computers running Windows Vista or Windows Server 2008 listen for these advertisements and add the printer to their list of available network printer resources.  When a WSD-based device is gracefully removed from the network it sends another message (a "Bye" message) to advertise that it is no longer available.  In addition, Windows Vista and Windows Server 2008 machines can discover WSD-based printers by using a "Probe" message when searching for printers via Network Discovery or the Add Printer Wizard.  A typical WSD communication sequence is shown below:
WSD-Communication
Let's examine each piece of this sequence:
  1. To find a printer, the client sends a multicast Probe message.  The Probe indicates that the client is looking for a print service.  The probe also indicates whether or not the client requires security.
  2. The WSD-based device listens for Probe messages and responds directly to the client with a Probe Match message since it hosts a print service.
  3. To find out more about the WSD device and what services it hosts, a client sends a Get Metadata message directly to the device using unicast.  Prior to sending a Get Metadata message, a client may also send a Resolve message if the name of the WSD device is known.
  4. The device replies with its metadata.  The metadata may either be in-line within the response message or the device may send a pointer to the metadata.  Besides information like the device manufacturer, serial number and firmware version, the metadata also includes the endpoint reference for each of the services hosted by the device.
  5. To find out more about the print service itself, the client may send a Get Metadata message directly to the service.
  6. The service replies with its metadata, including information about the operations that the service supports and printer-specific metadata (ability to print in color, pages per minute, number and size of paper trays etc).
  7. The client sends a message to start a print job.
  8. The service responds with a status to acknowledge the client request to start a print job.
  9. To receive updates on the status of the job or about the overall status of the print service, the client may send a Subscribe message to the print service.
  10. The Subscribe response message include an identifier for the subscription and when it will expire.  If the client needs status information after the expiration, it has to renew the subscription.
  11. The client sends the print job itself to the print service, encoding large images as attachments to the message.  Attachments are an optimization for transmitting a SOAP message by selectively re-encoding portions of the message while still presenting the required XML to the SOAP application.
  12. The print service responds to indicate that the job has been accepted.
  13. The print service sends an event to the client, informing it of, for instance, a change in the print job, number of pages printed, paper jam, completion etc.
Hello, Bye, Probe, Resolve and Get messages are all generated without network solicitation.  These messages are used to announce device state, issue a search request, or obtain metadata.  ProbeMatches, ResolveMatches, and GetResponse messages are generated in response to Probe, Resolve and Get messages.  Hello, Bye, Resolve and ResolveMatches messages are sent by UDP multicast to port 3702.  Get and GetResponse metadata messages occur over HTTP (TCP port 5357) or HTTPS (TCP port 5358).  Probe and ProbeMatches messages are sent over UDP (port 3702) unless they are "directed" messages.  A "directed" message is one where the WSD device name is known and accessed directly by name.  For directed messages, the Probe and ProbeMatches messages use the same ports as the Get and GetResponse metadata messages.  Obviously, to allow WSD network discovery, the Network Discovery firewall exceptions for the listed ports must be enabled in the Windows Firewall.  Finally, you can disable Multicast by setting the IGMPLevel value to 0 in the following registry key: HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters.
And that brings Day Eleven to a close.  Tomorrow we'll be looking at Printer Driver Packages.  Until next time ...
Additional Resources:

REFERENCES

Wednesday, December 12, 2012

How to make a table in Wikipedia

SkyHi @ Wednesday, December 12, 2012
REFERENCES
http://en.wikipedia.org/wiki/Wikipedia:How_to_make_a_table_in_Wikipedia

Sunday, December 9, 2012

How to Delete an Address from the Outlook Auto-Complete List

SkyHi @ Sunday, December 09, 2012
Outlook remembers every address you have typed in a To:Cc: or Bcc: field. This is good: when you start keying in a name or address, Outlook automatically suggest the contact in its entirety.
Unfortunately, Outlook remembers the mistyped and old as well as the correct and current — and suggest it indiscriminately. Fortunately, getting rid of entries you no longer want to appear in the auto-complete list is easy.

Delete an Address from the Outlook Auto-Complete List

To remove a name or email address from Outlook's auto-complete list:
  • Create a new email message in Outlook.
  • Start typing the name or address you want to remove.
  • Use the down arrow key to highlight the desired (undesired) entry.
  • Press Del.

Want to Edit the Outlook Auto-Complete List?

For more control over Outlook's email address auto-complete file, try a tool like Ingressor.

Prevent Outlook Address Auto-Completion Altogether

You can also stop Outlook from suggesting email addresses as you type:
  • Select Tools | Options... from the menu.
  • Go to the Preferences tab.
  • Click E-mail Options....
  • Now click Advanced E-mail Options....
  • Make sure Suggest names while completing To, Cc, and Bcc fields is not checked.
  • Click OK.
  • Click OK again.
  • Click OK once more.

If the above doesn't work, you have to go "contacts" folder and modify accordingly.

REFERENCES
http://email.about.com/od/outlooktips/qt/et_del_autocomp.htm

Thursday, December 6, 2012

GNU screen Kill detached screen session

SkyHi @ Thursday, December 06, 2012

== ISSUE THIS COMMAND
[xxx@devxxx ~]$ screen -ls


== SCREEN RESPONDS
There are screens on:
        23487.pts-0.devxxx      (Detached)
        26727.pts-0.devxxx      (Attached)
2 Sockets in /tmp/uscreens/S-xxx.


== NOW KILL THE ONE YOU DONT WANT
[xxx@devxxx ~]$ screen -X -S 23487.pts-0.devxxx kill
or
[xxx@devxxx ~]$screen -S 23487 -X quit
== WANT PROOF? [xxx@devxxx ~]$ screen -ls There is a screen on: 26727.pts-0.devxxx (Attached) 1 Socket in /tmp/uscreens/S-xxx.

REFERENCES
http://stackoverflow.com/questions/1509677/kill-detached-screen-session

Friday, November 30, 2012

Windows 7: Japanese not displaying in Windows

SkyHi @ Friday, November 30, 2012
Your problem probably stems from the fact that you're font chache probably is corrupted; delete the fileC:\Windows\system32\FNTCACHE.DAT and restart, your problem should be solved.


Windows XP had a “supplemental language support” section under Regional and Language options. You had to select them and perform the installation (which required the CD and was annoying) if you wanted to work with Asian languages. This was removed with Vista and support for these languages came by default. Windows 7 turns out to be a little different, however.
I usually do not find what Microsoft chooses to hide from the UI very useful. Why do I need to hit the alt key to see the file menu for example? This started with Internet Explorer and seems to be applied to other apps as well, including Windows Explorer. All of a sudden, the menu disappeared… Yes, it provides a little more space on the screen, but that space is not very useful as menu bar is not located at direct eye sight anyway. Does anybody browse the Internet full screen? No.
Lets get back to the Font issue. I launched an html document with Japanese strings in Notepad and was presented with a bunch of boxes! Boxes are how Windows expresses “I don’t know how to display this character”. I went to Format > Font to pick a font which supports Japanese script but none existed! Ah, must be the newest victim of Microsoft hiding team…
Windows 7 hides fonts depending on your language settings. Go to Control panel > Fonts > Font settings and uncheck “Hide fonts based on language settings”
Hiding the fonts is supposed to simplify the font selection in applications. I am not sure which applications are targeted for this but Notepad is definitely not one of them. The font selection dialog has always been and is still far from being user friendly and having 80 fonts instead of 200 doesn’t really provide any improvement.
I picked MS Minco for the font and Japanese for the script and there we go. No more boxes!


REFERENCES
http://superuser.com/questions/372928/windows-7-japanese-not-displaying-in-windows
http://www.emreakkas.com/windows-tips/how-to-enable-hidden-fonts-in-windows-7
http://mangahelpers.com/forum/showthread.php/3709-How-To-Enable-Japanese-Language-Windows

Thursday, November 29, 2012

Find command: Exclude / Ignore Files ( Ignore Hidden .dot Files )

SkyHi @ Thursday, November 29, 2012


Q. How do I ignore hidden .dot files while searching for files? How do I ignore or exclude certain files while running Linux / UNIX find command?

A. Find command support standard UNIX regex to match or exclude files. You can write complex queries easily with regex.

Find command and logical operators

Find any file whose name ends with either 'c' or 'asm', enter:
$ find . -type f \( -iname "*.c" -or -iname "*.asm" \)
The parentheses must be escaped with a backslash, "\(" and "\)", to prevent them from being interpreted as special shell characters. The -type f option force to only search files and not directories. The or operator either find .c or .asm file.

Understanding find command operators

Operators build a complex expression from tests and actions. The operators are, in order of decreasing precedence:
( expr )Force precedence. True if expr is true
expr
-not expr
True if expr is false. In some shells, it is necessary to protect the ‘!’ from shell interpretation by quoting it.
expr1 -and expr2And; expr2 is not evaluated if expr1 is false.
expr1 -or expr2Or; expr2 is not evaluated if expr1 is true.
WARNING! The '-or', '-and', and '-not' operator are not available on all versions of find. Usually GNU find supports all options. Refer your local find command man page for more information.

How do I ignore hidden .dot files while searching for files?

Find *.txt file but ignore hidden .txt file such as .vimrc or .data.txt file:
$ find . -type f \( -iname "*.txt" ! -iname ".*" \)
Find all .dot files but ignore .htaccess file:

REFERENCES
http://www.cyberciti.biz/faq/find-command-exclude-ignore-files/

Find Command Exclude Directories From Search Pattern

SkyHi @ Thursday, November 29, 2012


How do I exclude certain directories while using the find command under UNIX or Linux operating systems?

You can use the find command as follows to find all directories except tmp directory:
find /path/to/dest -type d \( ! -name tmp \) -print
Find all directories except tmp and cache:
find /path/to/dest -type d \( ! -name tmp \) -o \( ! -name cache \) -print
The -prune option make sure that you do not descend into directory:
find /path/to/dest -type d \( ! -name tmp \) -o \( ! -name cache -prune \) -print
You can find all *.pl find except in tmp and root directory, enter:
find /  \( ! -name tmp \) -o \( ! -name root -prune \)  -name "*.pl" -print


References
http://www.cyberciti.biz/faq/linux-unix-osx-bsd-find-command-exclude-directories/