msgbartop
A cronological documentation test project, nothing serious, really!
msgbarbottom

17 Aug 2009 Search Wikipedia using the command line

This post describes how you can search Wikipedia from the command line using a DNS tool like nslookup in Windows or dig in linux.
Handy if you don’t wan’t to open a Internet browser to do a simple Wikipedia query.

Windows
This is how it’s done in Windows

  1. Choose Start -> Run
  2. Write “cmd” and press OK
  3. Write “nslookup” and press ENTER
  4. Write “set type=txt” and press ENTER
  5. Write <topic>.wp.dg.cx and press ENTER

Using linux
This is how it’s done from a console window in linux

# dig +short txt search_keyword.wp.dg.cx

Example

# dig +short txt oslo.wp.dg.cx
"(formerly Christiania) is the capital and largest city in Norway. Metropolitan Oslo or the Greater Oslo Region makes up the third largest urban area in Scandinavia after Metropolitan Stockholm and Metropolitan Copenhagen. http://en.wikipedia.org/wiki/Oslo"

Source: http://lifehacker.com/5329014/search-wikipedia-from-the-command-line

Tags: , ,

Posted by Hans-Henry Jakobsen

14 Aug 2009 Getting VMware vSphere Client to run on Windows 7 RTM

This post describes how you can get your VMware vSphere Client version 4 running on a 32-bit Windows 7 (RTM) installation until VMware makes an update to fix this Microsoft .Net problem. Be aware that this method of getting the client to run is not recommended in a production environment since you are running the client in development mode.

First you need to edit the VpxClient.exe.config file located in your C:\Program Files\Vmware\Infrastructure\Virtual Infrastructure Client\Launcher folder and make it look like the code below

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.net>
<connectionManagement>
<clear/>
<add address="*" maxconnection="8" />
</connectionManagement>
</system.net>
<appSettings>
<add key = "protocolports" value = "https:443"/>
</appSettings>
<runtime>
<developmentMode developerInstallation="true"/>
</runtime>
</configuration>

Next we have to ensure that you we the .Net system.dll from a non Windows 7 machine.

It’s possible to download the config file and the DLL filer from here.

Place the modified config file in your C:\Program Files\Vmware\Infrastructure\Virtual Infrastructure Client\Launcher folder.

Then we create a new folder called Lib in the folder noted above and place the downloaded DLL file in the folder.

windows-7-environment-settings
windows-7-environment-settings-2Reboot your PC and VMware vSphere Client should now work without any error messages.

Edit your system properties and create a new ‘Environment Variable” Name it “Devpath” with the value of C:\Program Files\VMware\Infrastructure\Virtual Infrastructure Client\Launcher\Lib. You can locate these variables under Control Panel –> System and Security –> System –> Advanced system settings

This post came to life after reading this thread on the VMware Communties discussion forum. The thread also describes how to make VMware vSphere Client to work on 64-bit Windows 7 but I’m not going to describe that in this post.

Tags: , ,

Posted by Hans-Henry Jakobsen

15 May 2009 Simple Windows Print Accounting using Event Viewer data

This post continues where my previous post titled Export events including Event Properties from Windows Event Viewer left off.

The data I’m going to work with was exported using eventquery.vbs and saved in a CSV-file, comma separated file and it is presented in the form shown below.

"Information","10","12.05.2009 13:24:48","Print","Servername","None","AD\username","Document 232, filename.pdf owned by username was printed on printername via port IP_192.168.0.254. Size in bytes: 279232; pages printed: 18"

I’m interested in the username, date/time printed and pages printed and will now show how I’ve accomplished that using some simple linux console commands.

awk -F, '{print $7 " " $3 " " $4 " " $NF}' Event_Viewer_System.csv | grep printername | awk '{print $1 "," $2 "," $3 "," $NF}' | sed 's/\"//g'|sort > PrintAccounting.csv

Result

username,14.05.2009,12:58:41,18
username,15.05.2009,09:24:13,2
username,15.05.2009,09:25:00,37
username,15.05.2009,09:30:03,2
username,15.05.2009,09:30:29,2
...

Where the fields contain username, date, time and the amount of printed pages.

A short description on whats being done

  • print out column 7, 3, 4 and last column where the separator is a comma (,) from the file Event_Viewer_System.csv
  • filter out the printer you are interested in
  • filter out again the data we are interested in
  • remove quote sign (“) from the list
  • sort the list ny username
  • redirect the output to a file

And that’s how you make a primitive print accounting system from data gathered in a Windows Server.
This particular example has been testen on data from a Windows 2003 Server, but I think it can be performed on other versions of Windows as well.

Tags: , , ,

Posted by Hans-Henry Jakobsen

13 May 2009 Export events including Event Properties from Windows Event Viewer

This post came to life after a request to produce an overview of how many prints every user produced on a special printer from our print server. Since we have no print accounting software installed on our Windows 2003 Server I had to come up with a new solution to this problem. The actual print accounting part will be posted in another post…

The solution I came up with was to enable auditing on printing and then gather information from the System log in the Event Viewer. But first I had to export the necessary data from the Event Viewer since a normal export using the “Export List…” function by right clicking a log would not give me a good enough detail level including Event Properties.
Event Viewer

After some research I found a Windows tools called eventquery.vbs which is located in the windows/system32 folder on most Windows PCs. It’s a script that lists the events and event properties from one or more event logs.

Export log info
This is the switches I used to export Event Viewer events from System

cscript c:\windows\system32\eventquery.vbs /fi "Type eq Information" /fi "Source eq Print" /fi "ID eq 10" /v  /l System /fo csv > Event_Viewer_System.csv

The syntax I used was to filter (/fi) out

  • Events equal the type “Information”
  • filter out Source equal to “Print”
  • filter out ID equal “10″
  • and have a verbose (/v) output
  • from the System log (/l System)
  • output as comma separated file (/fo)
  • and redirect the result to a file > filename.csv

More info about the eventquery.vbs tool can be found by following the link under Sources.

The result from this export can look something like this

"Information","10","12.05.2009 13:24:48","Print","Servername","None","AD\username","Document 232, filename.pdf owned by username was printed on printername via port IP_192.168.0.254. Size in bytes: 279232; pages printed: 1"

If you look at the image below you’ll understand where I got the filter type info from.
Event Properties

These data now gives me the opportunity to filter out the data I need to create a simple print accounting on my users, and that is posted in the post named Simple Windows Print Accounting using Event Viewer data.

Source: eventquery.vbs

This post can also be used to export from any Event Viewer data log like Application, Security, Internet Explorer or other logs you have on your system.

Tags: , , ,

Posted by Hans-Henry Jakobsen

14 Apr 2009 Tools to recover Windows CHK-files

This post links to two Windows programs that can help you determine the extension of CHK-files.

A CHK-file is a file that is created when you run a disk repair tool like chkdsk, scandisk or other Windows disk tools.
Often these CHK-files are placed in a FOUND.000 folder and contains several FILE0001.CHK FILE0002.CHK … files and are being deleted by users because they don’t know what to do with them.

I’ve successfully used UnCHK and FileCHK in Windows Vista to recover many file extension/suffix and open them in the right program and higly recommend others to try it if they have lost important files.

Always remember to take backup before using these tools.

Source: http://www.ericphelps.com/uncheck/

Tags: , , , ,

Posted by Hans-Henry Jakobsen