Aug 24

I like programs that put themselves in the tray when I’m not using them and, while extension exist for windows, unfortunately firefox and thunderbird don’t have native tray support.  Enter alltray.   Alltray is an excellent little program that allows you to minimize pretty much any program to the tray. Just run your program like so

alltray firefox

and marvel at the tray icon glory before you!

Jul 30

I have to setup a couple of hundred laptops carried by sales folks in the field to connect to a new WPA2-PSK network for work.  Fortunately, windows XP has a nice little utility that lets you automate creating a new wireless connection. You’ll need a USB thumbdrive for a little bit to make this work, but you won’t need to distribute it.

  • In Control Panel, Run the Wireless Network Setup Wizard and enter in all of your network specifics.
  • When prompted, choose the”Use a USB flash drive” Method. Make sure you have a flash drive plugged into your computer.
  • Pick the drive letter and hit next,  once it has copied the files over, you can just hit cancel and exit out of the wizard.

On your thumbdrive you now have two files (setupsnk.exe and AUTORUN.inf) as well as a directory (SMRTNTKY) with various files in it. If you wanted to, you could distribute this thumbdrive as is and just have people click on the setupsnk.exe to configure their machines. I need to email these settings out, so I did this instead.

  • Create  a folder, C:\Wireless
  • copy  those two files and the entire folder into C:\Wireless
  • create a batch file called “Install_Wireless.bat” and place it into C:\Wireless
  • put the following in that batch file

SET CUR_DIR=%cd%
subst z: “%CUR_DIR%”
chdir /D Z:
Z:\setupsnk.exe
sleep 60
subst /D Z:

The batch file just creates a temp drive (z) that points to C:\wireless, the current executing bat files directory, changes to that drive and runs the setup. setupsnk assumes that it is being run directly from a drive letter, hence the mapping.  We wait for 60 seconds after the run and then remove the drive mapping assuming that you were able to click the ok button twice in 60 seconds (the whole process takes like 2 seconds).

Now, just zip that all up and distribute it.  The key piece is that everything gets extracted to C:\wireless.   I tried the old Relative paths in batch files trick, but it didn’t work for whatever reason and I’m in a bit of a hurry on this one.  If anyone can get that part working, you would be teh awesome. I get to claim that awesome sauce.   %~dp0 wasn’t working for whatever reason, but %CD% does, so I’ll take it.

Jul 30

I picked up these regex strings awhile back somewhere on the internets and have used them in a couple of perl scripts. Thought they might come in handy.

To filter a string to make sure it’s a valid ip address..
/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/

And this one for mac addresses
/^[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}$/

Extract web address
((?:http|ftp)s?://)?(((([\d]+\.)+){3}[\d]+(/[\w./]+)?)|([a-z]\w*((\.\w+)+){2,})([/][\w.~]*)*)

Jul 28

Using mailx and uuencode on a unix host, you can send a message from the command line with an attachment like so.

uuencode FILE | mailx -s “test message with an attachment” youraddy@yourhost.com

I add one more step and send a zipped directory to my self every night

zip -j -q -r -/tmp/directory/ | uuencode tmp.zip | mailx -s “test message with a zip attachment” me@me.com

May 27

ssh has a great config file for the client that is rarely used by most folks, but can make life a lot easier with just some minor knowledge.  For example, here is a .ssh/config file from my home directory that says anytime I connect to this website, connect as a user other then my default and alias that host to be “www” instead of cyborgworkshop.org .

Host www
HostName cyborgworkshop.org
User Remote_User

now if I just run

ssh www

it’s the same as running

ssh Remote_User@cyborgworshop.org

It doesn’t stop there though, you can specify key files to use, encryption and compression, etc. Man ssh_config for more shtuff!

« Previous Entries Next Entries »