Windows command escape character

Apparently the escape character for cmd.exe is ^.

So if you want to do the equivalent of echo "\$PATH = $PATH" in Windows, you would do echo "^%PATH^%=%PATH%"

In PowerShell, things are a bit different. They decided to change the variable identifier to $, which is nice and consistent with unix. Still didn’t use the \ character for escaping, though. The reason is that it overlaps with the path separator from DOS. So instead, you must use ` (back tick). Of course, this messes with me since in bash back tick is used to execute a command and return the output in to a variable.

CMD.EXE Escape characters
PowerShell Escape Sequences

Killing all child processes in a shell script

If you have a shell script that runs a lot of jobs in the background, you will want to clean these processes up at the end of the execution ( say the user hits CTRL-C or kills the job). To do so is fairly easy if you know how to do it. No need to keep track of pids, just do kill 0 as part of the signal trap execution. eg.


trap "kill 0" SIGINT SIGTERM

runprogram &
otherprogram &


Found at:

Killing a stuck SSH or TELNET session

Useful thing I found today. To kill an ssh session that is hung (host down, network outage, etc… while ssh connected), just hit the enter key and type ~.

found at:

Also, to end a telnet session, you do CTRL-] and type quit.

found at:

NAB Nightlights

I’m up to 7 NAB nightlights via Es!

The rest will be pretty hard to get as they are not in the usual paths and/or KSTP or WCCO will blow them away locally. It is too bad that WCCO and KSTP didn’t shut down their nightlights on the 12th like half of them did. Then I’d have a chance at some of the channel 4 and 5 stations.

I’d really like to get KCBS and WCBS. That would be sweet!

TV Frequency Chart

I’ve made a handy dandy TV Frequency chart in plain html viewable here:

Windows 7

So apparently Microsoft showed off Windows 7 today and PCPRO ran through the new features. It seems they have finally come in to the 21st century and added snapping windows! Ho-ly-crap! I am so excited I’ve already pre-ordered Windows 7 Uber-Ultimate-Fuck-Me-in-the-Ass Edition! Man is this gonna be great! Oh, and they have revamped the taskbar, taking inspiration from the Mac OS X dock! Oh, I just can’t contain myself… The also added “Jump Lists” – basically allowing an application to override the default context menu on its task bar entry and add frequently used options. Haven’t applications always been able to do this? I know cmd.exe annoys the piss out of me when it is not responding and I right click on its task bar entry and go to the first item in the context menu which is normaly close, but is now Properties… Oh joy! Can’t wait to look forward to another stellar Microsoft OS.

Countdown to openSUSE 11.0

Email is was such a pain

Here’s a little thing about me: I hate email and here’s why: It’s such a headache. You see, being the nerd I am, I like to have access to my email wherever I go, so one would think that webmail would be the way to go right? Wrong! Webmail sucks. I have sub-56k dialup internet, which means wading through webmail is a pain. It also means I don’t have reliable internet, so we move on to the offline mail. Most ISPs (and some webmail providers, sometimes for a fee) will give you POP mail. However POP mail has problems of it’s own. Like I said before, I like to keep all of my computers synced with each other so I can access my mail wherever, however POP mail is more not meant for this type of scenario. POP stands for Post Office Protocol. In a sense, it allows you to download your messages from the POP server (in a sense, post office) to your computer (home). However, after you download the messages, they are no longer on the server, so you can’t download them to your other PCs. Sure you can leave a copy on the server, but then you are redownloading the messages all the time. You could also just download unread messages and mark the downloaded ones as read. But then your other computers would never download the messages since they are marked as read! So we are back at square one. Luckily some one smart invented IMAP, the Internet Message Access Protocol. With IMAP, the client communicates to the server and gives you access to your mail which resides on the mail server. The client shows a list of folders and messages that are on the server, including any status they are in (like read, unread, important, etc…) and allows you to view each message from the server. “But, wait,” you say, “Didn’t you want to be able to view your email without having to be online?” This is where cached IMAP comes in, using a cache of all your mail, you can view your email when not online, just as if it were downloaded using a POP client. Also, using Kontact on KDE, I can store my calendar, journal, tasks, notes, and contacts on my IMAP server and share them between computers. So now I don’t have to add appointments or dates on both my PC and laptop, I just check my email and my contacts and calendar are automatically updated. Neat huh? The best part is I also have a webmail view so I can get to my email from any computer with an internet access and a web browser. Too bad popular webmail clients like Yahoo and GMail don’t provide IMAP access, since I like their webmail interfaces much better than Squirrel Mail.


So I decided to actually do something with the domain I’ve had for like 9 months now. I never seem to have the time or initiative to actually build a damned blog/photo sharing site for myself so I just decided to fuck it and install WordPress. It was much easier and faster (1 click to install, wait about 5 minutes and then config it a bit). I’ve been meaning to do this for a while since I’ve been starting to write some software for myself and want to share it, but my previous fugly site prevented me from doing anything with it.

So here is the first fruits of my labors: renamer2.rb and riprenamer.rb These two ruby scripts are designed to allow easy renaming of all your (legally) downloaded tv shows! The way it works is this: you run the script from within the folder that you have a bunch of tv shows. It scans the folder for video files and tries to guess the show title, season number, and episode number and then it goes off to and scans the site for the episode name. Then it renames it in this fashion: Show Name-S-EE-Episode Name.extension, where S is the season number and EE is the episode number with a leading zero if necessary (ie 01, 02, 03, … 09, 10). If for some reason epguides uses a different show directory than the title that the renamer guesses, you must use a text file named shows.txt located in your home directory ( /home/username on linux or C:\Documents and Settings\username on windows) this file should be in this format: input show name <tab> directory name <tab> custom rename string. You can find the directory name by going to epguides and searching for the show title and clicking on the show name page — the directory is everything after without the trailing slash, so, for example, the show Charmed has a page at and you would put “Charmed” in the shows.txt file (without the quotes of course). The rename string can be used to fix errors in the script since it has no way of knowing the proper capitalization of a show and so will only capitalize the first letter of every word.

All this information should be in a readme as well as a license and an installer and everything else, but oh well. Maybe later when all the bugs are out of it.

Return top