Bob's Notepad

Notes on projects I have done and things I have learned saved for my reference and for the world to share

Thursday, March 12, 2009

Using USB devices on Windows under VMware ESXi (Aladdin Hardlock)

VMware is quickly becoming the best way to run servers of all kinds and now that ESXi is free we're going to continue to see more and more functions moved onto a virtualized platform. Recently I've been working on a project for one of my customers which involves installing software for their Trumpf metal working equipment and ran into a small issue that I was able to overcome.

In short, this hardware requires the use of a USB dongle or "Hardware key" in order to run (this is an anti-piracy feature). The problem with ESXi is that you are not able to pass a USB device through to a virtual machine. Thankfully, a handful of companies have created Networked USB Hubs such as the Belkin F5L009. Everything immediately worked by plugging this in.... well, sort of :)

The issue that occurs inside of a VMware server is when you install Windows there is no USB root devices found so Windows does not install the proper USB support files. In this case, it's only a single file, USBD.SYS, that is missing.

1- Connect your USB hub to your network
2- Install the Belkin client software as the instructions explain
3- Ignore any new hardware wizards that occur.
4- Locate a USBD.SYS file. Often times you can find this on the same machine but, if needed, look on another Windows machine or in the i386 folder on your Windows installation CD. Copy this file to C:\windows\system32\drivers\
5- Reboot the virtual machine
6- Once the machine reboots, complete installation of your software, hardlock drivers, or any other USB device that you connect. Everything should function as intended and you have a little box that holds physical USB ports for your virtual machine.

Some notes on my installation.

* If you are using an Aladdin Hardlock USB key, you can most likely find new drivers on Aladdin's Hardlock Page.

* My Belkin Network USB Hub is running firmware version 1.2.0

* I found it's extremely handy to dedicate the USB hub to a single machine and to tell it to auto connect new devices. This literally makes the box just like real USB ports on the virtual machine. There are lots of options to play with as far as sharing devices to other specific machines but I did not play with any of that.

* Auto-connecting Hardlock keys is essential if you are running some type of server. If you tell your key to only connect manually your software may start before you mount the USB device and a pissed off program would likely ensue :)

* There are a few vendors that make an identical product but, from my research, I found that the Belkin is about 1/3 of the cost of most of them and also has some additional features. Digi makes a product that many people are using with VMware since it's marketed as being compatible with VMware but you will spend lots of money for that sentence -- and that's really all it is because this type of a device really has NO interaction with VMware at all since its a physical device communicating directly with your virtual machine on the network.

Labels: , , , , , ,

Reference Link


Wednesday, October 15, 2008

MythNetTV on LinuxMCE

There is a utility for MythTV called MythNetTV which can be found here. This utility does a great job at grabbing videos from an RSS feed and importing them in to MythTV's database as recorded programs. Set up is quite simple in LinuxMCE but is done via the command line.

  • Login to a shell as linuxmce
  • Switch to a suitable directory. We'll just use /home/linuxmce
  • wget http://www.stillhq.com/mythtv/mythnettv/source/release-5/mythnettv-release-5.tgz
  • tar -xzvf mythnettv-release-5.tgz
  • cd mythnettv5-release
  • sudo apt-get install python-feedparser
  • sudo apt-get install python-ctypes
  • sudo apt-get install python-mysqldb
  • sudo apt-get install mencoder
  • mkdir data
  • Subscribe to Shows
  • ./mythnettv subscribe "URL" "Title of Show"

For example, if you want to subscribe to Tekzilla you would issue:

./mythnettv subscribe "http://revision3.com/tekzilla/feed/quicktime-large?subshow=false" "Tekzilla"

Repeat that step for any shows that you want to subscribe to

Get your shows and import them

./mythnettv update
./mythnettv download 1

(the number that follows "download" is how many of each show MythNetTV should download and import)

That's all there is to it.... The shows you subscribed to will now appear in LinuxMCE's Video category as well as in your MythTV Front Ends

Automating the process

In your mythnettv directory you can create a script that will automate this process and then add that to cron to automate the process.
touch get-shows
chmod +x get-shows
nano get-shows

When editting the get-shows script, just add the following lines:

cd /home/linuxmce/mythnettv-release-5/
./mythnettv update
./mythnettv download 1

Press Ctrl-X to save the file and then test it:
./get-shows

Now you can add it to cron so that it will be run automagically every day
cd /etc/cron.daily
sudo ln -s /home/linuxmce/mythnettv-release-5/get-shows mythnettv

Labels: , , , , ,

Reference Link


Sunday, August 24, 2008

Panduit S050X150YAJ Label Template

So I've come up with a system of labeling each end of a cable with a "serial number" so that when your running cables between racks of servers inside of bundles of wires you can locate which 2 cable ends connect. Then adding the serial number of the cables that are plugged into a server in your server database you're able to easily track them. My customer I am working on this project ordered a pack of Panduit cable labels (S050X150YAJ) that can be printed with a laser or inkjet printer. Panduit also makes their own software for labeling, etc but its at least $200 depending on what options you want. I created a template for these labels and I wanted to post that template here in case anyone else could benefit from it. This is in the open document format and will work in Open Office and should also work in Microsoft Office (but you may need a plugin).

Template: Panduit-S050X150YAJ-Blank.odt

Just for reference, I put this together in NeoOffice 2.2.2 Patch 11 on a MacBook and based on a Samsung ML-2010 printer. It should be universal but if something is wildly different, you may need to tweak it.

Labels: , , ,

Reference Link


Saturday, August 09, 2008

OSX is refusing to eject a CD

I had an ordeal tonight..... I needed to burn an ISO to a blank CD so I put a, what I assumed was blank, CD in my MacBook and Toast informed me that it was not writable. What was it? Some Windows CD, I guess. The problem was my machine refused to eject it. I clicked the eject button multiple times (both on the keyboard and in finder) and it just wouldn't do anything. I figured if I did a reboot of the machine I could eject it when it came back up -- wrong. Whatever was going on on this CD was confusing the hell out of OSX. After the reboot finder never loaded for me and half of my typical start up applications got stuck during boot up. I happened to have Disk Utility in my dock so I tried to open that and, again, no luck.

First thing to try (did not work for me):
  • Put the computer into sleep mode
  • Press the eject button on the keyboard


Second thing to try (this worked for me):
  • Power down your mac
  • Hold the mouse button (or trackpad button) down
  • While holding the button press the power button
  • After 30-120 seconds your mac should eject the CD
  • Let got of the mouse button and the machine should boot the OS


I will now list the three biggest wishes I have for Mac computers and despite how small and petty they seem they make a night and day difference to me (Please, Steve Jobs, take note):
  1. CD-Rom eject button and/or emergency pin hole
  2. Hard drive activity light
  3. Network (NIC) lights for activity and link

Labels: , , , , ,

Reference Link


Tuesday, July 08, 2008

USB to PS/2 Chipsets

I've been dealing with a lot of issues with repeating keys (sticky keys) when using USB to PS/2 adaptors. My one client needs to use these because the Startech IPKVM solutions mixed with the Aten masterswitch KVM switches requires it now that ATEN has discontinued the CS1216. We've recently ordered in a bunch of different brands and I checked to see what the chipsets were in each of these devices. It appears that the majority of them use a chipset by CHESEN and from what I am seeing that is the chipset that seems to have the most problems. I don't have a solid solution for anyone with the problem but the Q-Stor is looking good at this point. I simply want to post this list so that it is documented since I havent been able to find this information anywhere. If I end up getting more brand names I will append this list. If anyone has any reviews on any of these or another brand please leave a comment with the information.

-----------
Startech USBPS2PC

PS2 to USB Converter:
Version: 0.10
Bus Power (mA): 500
Speed: Up to 1.5 Mb/sec
Manufacturer: CHESEN
Product ID: 0x0205
Vendor ID: 0x0a81
-----------
SIIG USB to PS2 (UPC: 6 62774 02359 5)

USB to PS2 Adaptor V3.10:
Version: 3.10
Bus Power (mA): 500
Speed: Up to 1.5 Mb/sec
Manufacturer: Composite USB PS2 Converter
Product ID: 0x0001
Vendor ID: 0x0b39
-----------
Belkin F5U119vE1

PS2 to USB Converter:
Version: 0.10
Bus Power (mA): 500
Speed: Up to 1.5 Mb/sec
Manufacturer: CHESEN
Product ID: 0x0205
Vendor ID: 0x0a81
-----------
Keyspan UPS2A

PS2 to USB Converter:
Version: 0.10
Bus Power (mA): 500
Speed: Up to 1.5 Mb/sec
Manufacturer: CHESEN
Product ID: 0x0205
Vendor ID: 0x0a81
-----------
Rosewill RCW-606

PS2 to USB Converter:
Version: 0.10
Bus Power (mA): 500
Speed: Up to 1.5 Mb/sec
Manufacturer: CHESEN
Product ID: 0x0205
Vendor ID: 0x0a81
-----------
Q-Stor QUPCBL

Generic USB K/B:
Version: 0.01
Bus Power (mA): 500
Speed: Up to 1.5 Mb/sec
Product ID: 0x0017
Vendor ID: 0x13ba
-----------
Cables to Go 27225

USB To keyboard Mouse Converter:
Version: 0.01
Bus Power (mA): 500
Speed: Up to 1.5 Mb/sec
Product ID: 0x8329
Vendor ID: 0x04b4
-----------

Labels: , , , , , , ,

Reference Link


Tuesday, May 06, 2008

Rapidly flashing light on MacBook

There seems to be a huge lack of information on this so I wanted to share it here. If all of a sudden your MacBook or MacBook Pro refuses to start and all you get is the rapid flashing sleep light then the problem is most likely related to the RAM. The MacBook tends to have RAM that is tough to install and, in mnay cases, you have to push the RAM into the slots MUCH harder than you would expect. Since this is the case it is also highly likely that the RAM wasn't 100% installed at the factory and simply the normal moving of the laptop can losen it enough to create this issue.

This isn't really a HOW-TO but just a bit of information for if your MacBook suddenly gives you the rapidly flashing light :)

Labels: , , , , ,

Reference Link


Tuesday, April 22, 2008

Using sudo on a remote rsync session (via ssh)

I have been using rsync to back up almost a dozen servers for years now and I am convinced that it is the best solution for remote back ups. A couple of months ago I ran into a situation where I need to rely on one of those backups and everything went expected.... well, sort of. All of my data was there and I was able to get things back up and running on a new server in only a few hours but it would have been much quicker if the permissions and file ownership was preserved. Once I got the system back up and running I wanted to make sure my the back up process was going to start preserving the file permissions and ownership. I found that the to accomplish this you absolutely had to be putting the files on the remote server as root. Of course, this is a security concern. The solution was permitting the rsync process to have access to sudo.

Step 1:
On the server that is receiving the back ups you need to add the following line to the /etc/sudoers file:

  • username ALL= NOPASSWD:/usr/bin/rsync


You will, of course, want to replace "username" with the user that the sending server will be logging in as through the rsync process.

Step 2:
Now you'll need to make sure that your rsync command is using the -a flag and then use the --rsync-path flag to tell it to run the rsync process on the remote via sudo. Here is an example command line:

  • rsync -av -e "ssh" --rsync-path="sudo rsync" /source/ user@server.com:/destination/


You're all set

You can combine this with using automated SSH login keys. Also, I want to note that this can compromise security in some scenarios.

Labels: , , , ,

Reference Link