Category Archives: Scripting
Alternate Data Streams (Metadata) on Files in NTFS
Introduction Alternate Data Streams (ADS) allow arbitrary metadata to be associated with files and directories on Windows NTFS. Alternate data streams are the Windows implementation of forks. The apparent size of the file will be unchanged, and most applications and … Continue reading
Converting MP3 to AAC
Here is a Windows command shell 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 … Continue reading
SSH Tunneling Windows RDC
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 … Continue reading
Organizing Files by Date Using Find
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, … Continue reading
Extracting a Version Number From a Text File Using Batch Files and Cygwin
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 … Continue reading
Stripping Vertical Whitespace Using tr
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 … Continue reading