Brandon's Notepad

January 30, 2012

Getting Google Maps

Filed under: How-To,Online Tools,Perl,Programming — Brandon @ 4:08 pm
Tags: , , , , , , , , ,

So, I’d like to have a current traffic map delivered to my e-mail at the precise moment I’m leaving work for the day. Call me lazy, but this is the sort of thing that can be automated pretty easily and I don’t want to go look it up, I want it delivered. Someday, I’ll get around to setting this up, but as they say, a journey begins with a single step. In this case, the step is to find a way a good to download Google Maps with a script. For now, that is the scope of this post.

Here’s some initial research to plow through:
Mapki: Google Map Parameters Best reference so far!
Google Static Maps API*
A PERL/Wget solution
A Python script
MapTileCacher in PERL
In Bash
Discussion on Google blocking tile downloads

* On 2/7/2012, I tried using the Google Static Maps API and received Error 400 (malformed or illegal request) when using the URL described therein. I have had more luck using Google Maps directly to frame the map, getting the (perma)link, and tweaking the parameters.

June 28, 2011

Wiping Linux File Systems

Filed under: How-To,Linux — Brandon @ 9:00 am
Tags: , , , , , ,

Home > My Lists > Technical Notes > Wiping Linux File Systems

Here are two Linux commands that can be used to overwrite disks with random bits:

badblocks -c nnnn -s -w -t random -v /dev/sdb

dd if=/dev/urandom of=/dev/sdb

The badblocks command searches for bad blocks on the disk and the parameters used above put it into write-mode (-w), writing random data (-t random) to the disk. The dd command takes longer but uses a higher quality of encryption. Also, /dev/random device is more secure but has higher enthropy than /dev/urandom.

Incidentally, the Wikipedia entry for dd explains that its JCL roots give the “Data Description” utility its name, but that “it is jokingly said to stand for ‘disk destroyer’, ‘data destroyer’, ‘death and destruction’, or ‘delete data'”. Personally, I thought it stood for “disk dup” because my experience has always been centered around writing boot/root disks and usb drives for Linux installs. I probably based this assumption on other utilities, such as the Tandem “FUP DUP” command.

April 15, 2011

Creating Movie DVD ISO Images

Filed under: How-To,Linux — Brandon @ 1:05 pm
Tags: , , ,

I’ve taken an interest in networked media players, like the WD TV Live series of devices. Some of these devices will play DVD ISO images. The idea is that an ISO file can be mounted and read just like the filesystem on the DVD itself. From what I’ve read, this is not necessarily as easy as running the trusty ‘dd’ command – something to do with variable block sizes or something like that, but I’ll leave that for others to explain for now. This is a how-to page for creating ISO images that play.

Incidentally, I don’t advocate stealing music or movies in any way. Artists absolutely deserve to be payed for their work, so I buy my albums and movies. I find nothing wrong with creating backup copies of these things for non-public use, and I’m fairly certain that U.S. law still permits this (fair use).


I already use this utility to burn CDs and such. I have used it to burn ISO images to data CDs, primarily Linux distros, but I’ve not tried using it for audio or video projects yet. More to come…


This is a command-line utility and it looks promising. I will try this one after trying K3B above. For now, here are some useful links: vobcopy manpage, a newbie tutorial, Mac-based tutorial on YouTube (I think this guy was stoned while filming), this insightful snippet. The vobcopy utility just copies the VOB files – the ISO file must be compiled with mkisofs. More to come…


On the list to try. Sourceforge project page More to come…


On the list to try. Sourceforge project page More to come…


Is it possible that the ‘cat’ command will work? The example provided on this page is ‘cat /dev/dvd/ > $HOME/video.iso’. Call me skeptical, but I’ll have to verify this one for myself – I have a feeling this is what copy protection prevents.


According to this post, Ubuntu (8.10) provides a ‘Copy Disc’ option. This, too, should be easy to test out once I obtain a player.

July 30, 2010

Programmatically Creating Windows Shortcuts

Filed under: Computer Software,How-To,Windows — Brandon @ 7:50 am
Tags: , , , , , ,

Home > My Lists > Technical Notes > Programmatically Creating Windows Shortcuts


Windows shortcut files can be created using a script. This is useful in circumstances when you need to distribute shortcuts across multiple computers, possible as part of a software installation procedure. The shortcuts themselves seem to be fairly portable, but this is a more pure way of controlling their content.


My Shell Example

I do a lot of work from the command line, so I take advantage of tried-and-true DOSKEY macros and other useful tools. I like to have these loaded for me whenever I open a new command prompt, so I maintain a shortcut that runs a batch file similar to the .login or .cshrc files used on Unix platforms prior to displaying the prompt. This is the pruned version of the script I use to maintain this shortcut definition:

Shell = new ActiveXObject(“WScript.Shell”);
link = Shell.CreateShortcut(“MyShell.lnk”);
link.TargetPath =”%SystemRoot%\\system32\\cmd.exe”;
link.Arguments = “/K %HOMEDRIVE%\dosrc.bat”;
link.WorkingDirectory = “%HOMEDRIVE%” + “%HOMEPATH%”;
link.IconLocation = “%SystemRoot%\\system32\\progman.exe,6”;
link.Description = “MyShell shortcut by B Brinkley”;

This is based on the example provided in the MSDN article linked above. The arguments are specific to cmd.exe, I rely heavily on environment variables for path info, and the icon is the long-standing MS-DOS logo with the interlocking letters.

March 8, 2010

Back Up WordPress ‘Blog With Wget

Filed under: How-To — Brandon @ 1:22 am
Tags: , , , , , ,

One risk of keeping my notepad online is the eventual disappearance of Backing up my ‘blog is of utmost importance. WordPress has a built-in export function, which I do use, but it is most useful for reloading the ‘blog into a WordPress-driven site. I also wanted a way to create a local copy of my notepad for local browsing and for quick upload to a non-Wordpress site if the need arose. Enter, wget.

Wget is one very useful tool. In a nutshell, it gets files, even entire sites, from the Web. I did a quick search and found this posting that provides a recommended set of command line options. I removed the -w and -H parameters and limited the -D parameter to my ‘blog only. Also, I used the shorter flags for brevity (e.g. -m for –mirror, -k for –convert-links, etc.).

wget -m -p –E -k -P ~/var/tmp/Notepad

Now I can keep a local copy or even burn it to for use on other machines.

June 7, 2009

Getting Things Done

Short URL:
Home > My Research > Improvement > Getting Things Done

I’m doing something different these days, Getting Things Done. It is a personal time management method made popular by businessman and author, David Allen. Now, I’m not into fads or quick fixes, and I believe that many of the various time management methods will work if they are properly implemented, but too much of this method makes sense. I saw results, even after only a few weeks of implementation.

One word of warning, GTD is easy to implement, but it does require discipline to keep it going. The good news is that, once you get used to it, the practice is easy to resume if you do fall out of practice.

The Book
The book is an easy read and well worth the time. There is a good summary available on Wiki Summaries and a lot of folks have written their own summaries on personal sites as well. Here is another good one someone posted on Scribd.

The Experience
Instead of explaining in detail the generic method, replicating what a million sites already do, I thought it would more useful to post how I actually put it to use. Doing so will provide an easily-accessed reminder for my self and may assist others by example. To set the stage, I think Allen’s high-level description of the method is very succinct and worth quoting, “No matter what the setting, there are five discrete stages that we go through as we deal with our work. We (1) collect things that command our attention; (2) process what they mean and what to do about them; and (3) organize the results, which we (4) review as options for what we choose to (5) do.” [D.Allen-1, p. 24]

My Implementation
@Work (Part 1)
@Work (Part 2)
@Work (Part 3)
GTD Advent Calendar
Commitment Management START HERE!
Well-Formed Context Lists
The Two-Minute Rule
Shopping Lists
GTD & The New Age
Getting Things Done Software
The Paper Tiger

May 28, 2009

Linux & Mobile Phones

Filed under: How-To,Linux — Brandon @ 7:22 am
Tags: , , , ,

At the time of this writing, I use a Motorola KRZR K1m for my personal mobile phone. Needless to say, the phone comes with software that runs on Windows, not Linux, so I have a 1GB Micro SD card for transferring pictures to my PC. I’ve done a little research on how to make the phone interact with Linux and my findings are as follows.

A program called moto4lin is available on Sourceforge and is based on the P2K platform. It allows you to view the phone’s file system and edit files. While the app isn’t ancient, there doesn’t appear to be any active development at the time of this writing. I first made note of this app in July 2007, the site was last updated in mid-September 2008 and the last comment on the Main Page was added in May 2006.

This page by Stephen Evanchik details adding ringtones to a RAZR V3, and I suspect the same method can be used with the K1m. The basic steps are:

  1. Convert a sound/music file to a 20 second MP3 file (44.1kHz, 64kbps, <200kb).
  2. Copy the MP3 file to /a/mobile/audio on the phone.
  3. Set phone to silent mode.
  4. Delete the MyToneDB.db & TempToneDB.db files.
  5. Reboot the phone, remove from silent mode and browse for the new ringtone.

Finally, here are a few links on setting up Bluetooth on Ubuntu:

January 5, 2009

Guitar Circuits

Filed under: Electronics,How-To — Brandon @ 12:04 pm
Tags: , , , , ,

I just finished building a portable guitar amp as a Christmas gift for a friend. It runs on a 9v battery, fits into an Altoids tin and drives headphones so that the whole family isn’t disturbed during a midnight jam session.

Here’s the schematic I used:

For reference, here are some links for guitar-related electronics:
Wiki article on guitar effects
Awesome collection of schematics!
The good stuff is under “projects”
Cannibalized Tape Player
A Discrete FET Guitar Preamp
Active preamps, MODboards, and other parts

Some more general information:
Electronic Cookbook
Altoids headphone amp

Links to process:

February 18, 2008

Linux, Broadcom & NDISwrapper

Filed under: Computer Hardware,How-To,Linux — Brandon @ 10:02 am
Tags: , , , , , , ,

Home > My Lists > Technical Notes > Linux, Broadcom & NDISwrapper

At the time of this writing, many laptops, including Dell and HP/Compaq, contain Wifi cards made by Broadcom. In the past, there has been no ‘official’ driver written by Broadcom for these devices for Linux. A tried and true way of using these cards with Linux is through the use of the NDISwrapper utility.

General Procedure

  1. Install NDISwrapper package if not already installed.
  2. Download the Wifi drivers from Dell, Compaq, etc.
  3. Extract the necessary files (e.g. bcmwl5.inf & bcmwl.sys). This may require running a “self-extracting” file under Wine.
  4. Install the driver: sudo ndiswrapper -i /dir_path/bcmwl5.inf
  5. Verify the hardware is present: sudo ndiswrapper -l
  6. Load the driver: sudo modprobe ndiswrapper
  7. Update the configuration: sudo ndiswrapper -m

Related Links

Create a free website or blog at