Archive for the ‘Scripting’ Category

Converting MP3 to AAC

Friday, February 5th, 2010

Here is a script I wrote to convert MP3 files to AAC for my Softbank 821SC phone. The script uses FFmpeg, which I downloaded from here. @echo off REM --------------------------------------------------------------------------- REM Set the following variable to the ffmpeg.exe path on your system. REM --------------------------------------------------------------------------- set FFMPEG_PATH="c:\tools\FFmpeg\ffmpeg.exe" REM make sure the user provided an argument. if ...

SSH Tunneling Windows RDC

Sunday, July 5th, 2009

This article explains how to securely port-forward Windows Remote Desktop (Terminal Services) over SSH, using standard SSH command line syntax. If you prefer to use GUI SSH tools, such as PuTTY, there are other guides for that. Terminology Notes My terminology assumes that you are connecting to a machine on your ...

Organizing Files by Date Using Find

Sunday, July 13th, 2008

I had taken pictures using a friend's SD card. He copied all the files to my flash drive, but this left me without a nice, tidy directory structure. Normally, I organize my photos like: 2008 2008_06_27 2008_06_28 2008_06_29 First off, I needed to list ...

Extracting a Version Number From a Text File Using Batch Files and Cygwin

Friday, July 11th, 2008

We have a version.h file. It contains lines such as: #define VERSION_MAJOR 3 #define VERSION_MINOR 1 By piping this through grep, I can get the line I'm looking for: c:\>grep "VERSION_MAJOR" version.h #define VERSION_MAJOR 3 But what I really want is the version ...

Stripping Vertical Whitespace Using tr

Monday, June 16th, 2008

The Translate command, tr, is available on all Unix-y systems, including Cygwin. tr -d will delete the specified characters from a stream. Several handy escape sequences are provided for stripping newlines, carriage returns, and form-feeds: \f - form feed \n - new line \r - return Since tr is deleting characters, ...