RSS Feed for How ToCategory: How To

Recover iPod & iPhone Serial Numbers from iTunes »

If you need your iPod or iPhone serial numbers, but haven’t written them down, iTunes keeps a list of devices it’s seen in a file called iPodDevices.xml. I found mine in:

C:\Users\myusername\AppData\Local\Apple Computer\iTunes\

I’m running Windows 7 and iTunes 9.0.2, so different versions might have different results. At the very least you can search your computer for iPodDevices.xml.

Good luck!

How to Cancel a Stuck VMware Tools Install from the ESX CLI »

Q: I’m trying to evacuate a machine that is suffering a hardware failure, and one of the VMs thinks it is installing the VMware Tools, so it won’t VMotion. The error is “The virtual machine is installing VMware Tools and cannot initiate a migration operation.” I also cannot right-click the VM in vCenter and choose “End VMware Tools Install.” Is there a way for me to end the VMware Tools installation from the ESX command line?

A: Yes, it’s a two-step process once you’ve logged into the console OS of the ESX server where the VM is executing.

First, you need the ID of the VM (all on one line if it wraps):

/usr/bin/vmware-cmd /vmfs/volumes/datastore-name/vm-folder/vmx-file.vmx getid

Then you can do a:

/usr/bin/vmware-vim-cmd vmsvc/tools.cancelinstall idnumber

Have fun!

Windows Losing its Default Printer »

For months now my Windows Vista, and now Windows Server 2008 desktop has been losing its default printer every night. I haven’t been able to figure it out until now: it’s the Remote Desktop Client remapping my printers when I connect from home.

There are three fixes for this:

1. You can tell your RDP client to not map printers, in the “Local Resources” options tab. This is easy but you have to remember to do it.

2. On the host side on Windows Server 2008 you can go into Administrative Tools->Terminal Services->Terminal Services Configuration, right click the RDP-TCP connection, pick “Properties,” and disable it under the “Client Settings” tab.

3. On the host side on Windows Vista you can follow Microsoft KB article 268065 and add a registry value in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd.

Now you know, and as they say in G.I. Joe, knowing is half the battle.

How To Reassemble Your Faucet’s Aerator »

Took your faucet’s aerator apart to clean it? Trying to figure out how to put it back together again? Internet absolutely no help because it tells you that you should have noted how it came out in the first place? Yeah, I’m with you, pal, and you’ve come to the right place. This is how. Click on the photos for larger versions.

First, I numbered everything so I could refer to them (this is also the order they go back into #1):

aerator-parts

The part I got hung up on was where you put part #3 into part #2 first, because it seems like it’d block all the water. It goes in like this:

aerator-screen

Then stick that in part #1:

aerator-semi-assembled

Top it all off with part #4:

aerator-mostly-assembled

Put part #5 on top, screw it all back into the faucet, and you’re done.

Disabling iPhone Photo Import under Windows Vista »

In hindsight this seems obvious, but several Google searches did not reveal the answer so I am documenting it now in the hopes that others who are stymied by this can do something about it, too. As always if there’s a better way to do this leave me a comment. Thanks!

I was being annoyed by Windows importing and tagging the photos on my iPhone, often several times per sync. I want to be able to plug my iPhone in, have it sync, and then leave. Instead I’d get “No new pictures or videos were found on this device” dialogs, requiring that I click OK. If I didn’t click OK fast enough I’d get “This device is already being used by ‘Windows’” as it tried syncing a second time:

Turns out the fix is easy. With your phone connected to the PC go into Control Panel, then into AutoPlay. Scroll down to the bottom, under Devices, and change the action from “Import pictures using Windows” to “Take no action” (or whatever you want it to do). Then click Save:

That’s it. Like I said, easy to do once you know where to look.

How To Configure Linux Serial Consoles »

Need a serial console on your Linux box, just in case something happens to the network? Yeah, me too. It’s fairly simple to get it running (at least on Red Hat Enterprise Linux 4), if you have the right steps.

This is not an in-depth tutorial on serial consoles, it’s just designed to get you moving faster. I assume you know how to install packages, edit files, etc., or are at least resourceful enough to figure it out. I also assume you’re s-m-r-t enough to try this on a machine you can get to easily, if you mess it up the first time.

On newer machines there are often BIOS serial redirection options, too, which might be useful. Conveniently, check your BIOS! :-)

1. Figure out what speed your terminal server wants to go, as well as the number of data, parity, and stop bits. 9600 is a common default, and the other parameters are often 8, N, and 1. Faster speeds generally mean it’s less annoying to work on them, but it has to be set the same on both sides, and you can go too fast for the cables you have.

You can verify the settings with “/usr/bin/screen /dev/ttyS0″ (as suggested by Greg in the comments), or /usr/bin/minicom (installed as the “minicom” package from Red Hat). If you ever used Telix for DOS you’ll be right at home with minicom. Hit Ctrl-A, then O to get to the configuration menu. Once it is set up properly you should be able to type in Minicom and have it appear on the terminal server, and vice versa. Don’t go on until you can do that.

/dev/ttyS0 is COM1, /dev/ttyS1 is COM2, etc.

From here on out replace 9600, 8N1, and ttyS0 in my examples with the right parameters for your setup.

2. Add the following to /etc/inittab, remembering to substitute the right serial port, and the terminal type you want:

# Serial Console Access
S0:2345:respawn:/sbin/agetty ttyS0 9600 vt100

Have ‘init’ reread inittab by issuing the command “sudo /sbin/telinit q” and you should be able to see something via the terminal server. You might need to hit enter a couple of times to get its attention.

3. If you want to see stuff at boot, edit /etc/grub.conf. Add the following, substituting the proper serial port in “unit”:

serial --unit=0 --speed=9600 --word=8 --parity=no --stop=1
terminal --timeout=10 serial console

(two lines, “serial” and “terminal,” if it wraps)

4. Comment out any line in /etc/grub.conf that starts with “splashimage.” The splash image doesn’t work so well with character-only interfaces.

5. Add “console=ttyS0,9600n8″ to the proper kernel entry in /etc/grub.conf. So your original entry:

title Red Hat Enterprise Linux AS (2.6.9-67.EL)
  root (hd0,0)
  kernel /vmlinuz-2.6.9-67.EL ro root=/dev/sda1 rhgb quiet
  initrd /initrd-2.6.9-67.EL.img

becomes something like:

title Red Hat Enterprise Linux AS (2.6.9-67.EL)
  root (hd0,0)
  kernel /vmlinuz-2.6.9-67.EL ro root=/dev/sda1 rhgb quiet console=ttyS0,9600n8
  initrd /initrd-2.6.9-67.EL.img

(that’s four lines if it’s wrapping)

6. Reboot and check it out. Party like it’s 1989.

If it isn’t working you’ll have to comment out the inittab line and “telinit q” again to free up the serial port, before you try Minicom or screen.

If I have messed something up here let me know in the comments. Thanks!

How to Install a tftp Server on Red Hat Enterprise Linux »

I install a tftp server about once every three years. As such I never remember what needs to happen, and this time a Google search didn’t have a nice answer for me. So, as my latest contribution to the world of HOWTOs, I present the non-idiot’s concise guide to installing and configuring a tftp server.

As always if you have suggestions or corrections just add them as comments, and I’ll update the text here.

This will give you the default /tftpboot directory. I assume that if you need a filesystem there you can handle adding one there on your own. :-) If you want to change the filesystem you can do that in /etc/xinetd.d/tftp, in the server_args field. Don’t forget to reload xinetd after you change it.

1. Install the tftp server software and enable it:

/usr/bin/up2date tftp-server
/sbin/chkconfig tftp on

3. Because it runs via xinetd reload that to pick up the configuration file change:

/sbin/service xinetd reload

4. Edit /etc/sysconfig/iptables-config and edit the IPTABLES_MODULES line to read:

IPTABLES_MODULES="ip_conntrack_tftp"

If you already have something in that line just add the new module with a space as a delimiter, like:

IPTABLES_MODULES="ip_conntrack_ftp ip_conntrack_tftp"

5. Add firewall rules to /etc/sysconfig/iptables. You probably only need UDP, though I always add the TCP rules, too (they’re both listed in /etc/services for port 69):

-A RH-Firewall-1-INPUT -s 10.1.0.0/16 -m tcp -p tcp --dport 69 -j ACCEPT
-A RH-Firewall-1-INPUT -s 10.1.0.0/16 -m udp -p udp --dport 69 -j ACCEPT

(two lines here if it’s wrapping)

6. Restart iptables to pick up the changes from steps 4 and 5:

/sbin/service iptables restart

7. Add the proper lines to /etc/hosts.allow:

in.tftpd: 10.1.

8. Put something in /tftpboot to retrieve with a client, for testing.

9. Use a client from an allowed IP range to test:

$ tftp my.tftp.server.com
tftp> get filename.bin

9. If you get an error check /var/log/secure and /var/log/messages on the server, and start eliminating potential problems one at a time (disable iptables, put ALL in hosts.allow, etc.) until you find the problem.

Have fun!

How To Use A Linksys Router to Bridge »

Do you want to use your Linksys wireless access point & router to bridge another wired network to wireless?

There isn’t a mode for it in the Linksys setup. There are firmware hacks, but those are another thing completely.

My simple suggestion: instead of using the WAN port for the router’s uplink, just plug the uplink into one of the switch ports on the Linksys. Ta-dum! Instant bridging.