Archive for the ‘Geekery’ Category.

Autohotkey is Great

I’ve been using Autohotkey for keyboard macros for a while now. I find it virtually indispensable to work quickly and productively. It rocks.

Here are the most useful macros I use on a regular basis, lifted straight from my AutoHotkey.ahk:

; hit ctrl-space to make the current window always on top. From http://www.labnol.org/software/tutorials/keep-window-always-on-top/5213/
^SPACE:: Winset, Alwaysontop, , A

:o:..3::My address
:o:..4::415-…My phone number
:o:..9::94110

^!r:: ; Run gedit with Ctrl-Alt-r
;IfWinExist, Notepad++
; I found the name of the window by using “AutoIt3 Window Spy”, which comes with autohotkey
IfWinExist, ahk_class gdkWindowToplevel
WinActivate
else
Run, “C:\Program Files\gedit\bin\gedit.exe”
return

^!c:: ; Run Calc with Ctrl-Alt-c
IfWinExist, Moffsoft FreeCalc
WinActivate
else
; Run, calc.exe
Run, “C:\Program Files\Moffsoft FreeCalc\MoffFreeCalc.exe”
return

^!t:: ; Run Truecrypt with Ctrl-Alt-t
IfWinExist, TrueCrypt
WinActivate
else
; Run, calc.exe
Run, “C:\Documents and Settings\Lee\Desktop\My Truecrypt file.tc”
return

^!d:: ; Run Chrome with Ctrl-Alt-d
IfWinExist, New Tab – Google Chrome ; If there is already a blank window, bring it to front
{
WinActivate, New Tab – Google Chrome
}

else
{
IfWinExist, ahk_class Chrome_WidgetWin_0 ; grab a Chrome window and click ctrl-n to make a new window
{
WinActivate
Send ^n
}
}

WinWaitActive, New Tab – Google Chrome, , 1 ; wait to see if the command worked

IfWinNotExist, New Tab – Google Chrome ; if we don’t have a new chrome window by now (IE, clicking ctrl-n didn’t work) then

start it manually
{
Run, “C:\Documents and Settings\Lee\Local Settings\Application Data\Google\Chrome\Application\chrome.exe”
WinWait, New Tab – Google Chrome, , 3
WinActivate, New Tab – Google Chrome
}

return

^!w:: ; Run Windows Explorer with Ctrl-Alt-w
IfWinExist, My Documents
Run, explorer.exe
else
Run, explorer.exe
return

:o:.address::My full address{enter}San Francisco, CA 94110{enter}

:0:.80::123456789012345678901234567890123456 >40< 3456789012345678901234567890123456 >80{enter}

:o:.–::{- 50}{down}{home}
:o:.-=::{- 50}{enter}

:o:.=-::{enter}{- 50}{ENTER}{- 50}{down}{home}
:o:.==::{enter}{- 50}{ENTER}{- 50}{enter}

:o:.ms::——– Original Message ————-{enter}

:o:.me::——– End of Original Message ——{enter}

:o:.ss::—- Start of Snippet —-{home}{down}

:o:.se::—- End of Snippet —-{enter}

:o:.s::San Francisco
:o:.sc::San Francisco, CA
:o:.c:: California

:o:.b::Berkeley
:o:.bc::Berkeley, CA

:o:.date:: ; This hotstring replaces “]d” with the current date and time.
FormatTime, CurrentDateTime,, M/d/yyyy h:mm tt ; It will look like 9/1/2005 3:53 PM
SetKeyDelay 0 ; This sets the keystrokes below to be sent faster than the default.
Send %CurrentDateTime%
return

To get you excited in case you can’t read this configuration file, here are some examples:

:o:..3::My address

I type “..3(Return)” and it replaces that text with my street address. I use this all the time when buying stuff on websites. Oh, it’s a “3″ because my address starts with a 3, making it easy to remember

^!d:: ; Run Chrome with Ctrl-Alt-d

I hit Control-Alt-D and it starts Google Chrome. Or if there is already a blank Chrome window open, it gives it the focus. This is sooo much faster than picking up the mouse and clicking the icon a thousand times a day.

^!c:: ; Run Calc with Ctrl-Alt-c

Pull up the calculator with a quick key combination

:o:.ms::——– Original Message ————-{enter}

I type “.ms” (short for “message start”) and it replaces it with, well, I’ll let you guess. Similarly, “.me” is short for “message end”.

Android Essentials?

I just got an Android phone, AT&T Samsung Captivate SGH-i897.

What are the essentials for this phone? Here’s what I’ve got so far to change the phone from PITA to awesome

Google Voice – ($free) to avoid the ancient “You have 2 new messages. To listen to your messages, press 1″ and replace it with visual voicemail on my phone and computer. Installing it was ridiculously easy after spending an hour hunting on the forums. I went to my (pre-existing) google voice account online and clicked Settings | Voice Settings | Activate Voicemail next to the description of my phone. I typed a few characters into my phone to enable forwarding and Tada!

Touch Calendar Free – ($free) so I can look at my entire calendar at a glance. I can’t navigate around it smoothly but it’s better than the default calendar

RealCalc - ($free) stupid Samsung put the buttons on their calculator in the wrong places! It’s stupid! RealCalc has the buttons in the right places and a lot of bells and whistles that don’t get too in the way

Hi-Q MP3 Recorder – ($3.00) the built in voice recorder sounds like crap and has a mediocre interface. This one is a lot better.

Screen Filter – ($free) The phone is blindingly bright at night. Even at the lowest brightness, it is an excellent flashlight. It is dangerously bright when trying to use the GPS in the car. Screen filter works well to put some kind of “software filter” in front of the screen. Sometimes it turns itself off but it mostly works great.

No fix yet – The AT&T Samsung Captivate (SGH-i897) has 4 buttons at the bottom of the screen. Actually they are “soft” buttons with no tactile feedback. Well, after 3 seconds of inactivity, they turn off, making it impossible to find the buttons in the dark! I don’t have a fix for this yet. I heard of an app called something like “Keep the Lights On” or some such but I lost the reference to it and I have to root my phone to install it. PITA.

I’m still not ready to switch to Gmail as my primary email but it’s working well enough. I’m not switching because: 1- last week the gmail at the office was running slow a while due to Google’s fault. 2- Also last week Google switched our office’s Google Docs interface to something newer and betterer. I wish they had asked/told us before doing that!! I don’t care how new and exciting the new whatchamacallit is, not mentioning that things will be changing freaks me out. It reminds me of the absolute power they have over my email.

NoLed - ($free) when you miss a call, there is no blinking light on the phone telling you that you missed it. Uncool. NoLed fixes that. It might draw too much battery, the jury is still out.

3G Watchdog – ($free) It is difficult… impossible to tell what apps are doing on the phone. They could be downloading porn, burning up your monthly data quota. This should tell me if that happens. The ethos of the platform is pretty much that programs can run in the background whenever they want. That kinda freaks me out.

Battery Graph – ($free) I’m a program to keep track of my battery usage because I haven’t really figured out what drains the battery the most. Some users see 5 hours of battery life, some 30. I really really want to have 30 and not have to think about it.

Installing programs is nerve-wracking because so many apps want access to my data. Does Facebook need access to my Contacts list? If I give that cute new game the power to read and write to the SD card, will it be able to steal data and send it to Russian spammers? The “community” is no help because as of yet, I haven’t come across any group that has recognized malware; there is no procedure for dealing with malware!

The places to look for help appear to be (in decreasing order of usefulness)

http://googlemobile.blogspot.com/

http://androidforums.com/

http://www.xda-developers.com/

http://www.appbrain.com/

http://www.androidcentral.com/

http://www.androlib.com/ ??

http://www.samsung.com/us/support/owners/product/SGH-I897ZKAATT

So, dear reader, what am I missing? Comments welcome.

How to Make a Bootable dban USB Thumbdrive to Wipe Hard Drives

The instructions from PendriveLinux.com work almost perfectly for me. There is one bother that makes the instructions from Pendrivelinux not work but I figured out a workaround :-)!

  1. Download the dban-2.2.6_i586.iso
  2. Download and run Universal USB Installer, select DBAN 2.2.6 from the drop down list and follow the onscreen instructions
  3. Once the installation to USB is complete, restart your PC and set your BIOS or Boot Menu to boot from the USB device, save your changes and reboot

If all went well, you should be booting from your DBAN USB.

Notes: The DBAN autonuke feature may also Nuke the Flash Drive (and as usual, any other drive it detects). I am not sure how to prevent this from happening. So if you use the autonuke feature, you might wipe DBAN from the USB Flash Drive as well.

Here is how to prevent autonuke from wiping the thumbdrive: remove the thumbdrive after the dban has loaded but before it has started wiping drives.

Dban has started. I just typed "autonuke" and the dban.bzi system is being loaded.

The dban image finished loading and it is looking for hard drives to wipe. Now is the time to remove the thumbdrive! You have about 10 full seconds to remove the drive.

Apparently, dban fully loads itself in memory because at the end of the wiping session, it shows a message saying that it has completed it’s job. It doesn’t hang or anything nasty.

When I tried to use interactive mode on dban (to avoid autonuke destroying the data on my flash drive), dban crashed :-(. I’ve seen many complaints of this online with no fixes.

Here is another way I use to wipe hard drives. It isn’t as high security, but it’s pretty good.

  1. Use the System Rescue CD bootable thumbdrive image built by my coworker
  2. xinit (xwindows yay)
  3. gparted (see what drives we’ve got and unallocate the partitions)
  4. dd if=/dev/zero of=/dev/sda (and sdb, sdc etc to run other terminal windows) bs=16777216 (a 160 gig drive…) count=10240

How to Recover Files From Your Google Chrome Cache

I lost a bunch of files off of a web server. But I was able to recover some of them by looking in the cache in my browser. Here are some ways to find those files:

type about:cache in the browser. It will show you all the files in your cache. When you click on the links, it gives you info about each file. To see the actual files, strip down the url a little. For example, change
chrome://view-http-cache/http://lee.org/blog/wp-admin/images/fade-butt.png
to

http://lee.org/blog/wp-admin/images/fade-butt.png

————————————————–

If you have a lot of files to recover, try using chromecacheview, that’s chrome cache view. As their website says,

ChromeCacheView is a small utility that reads the cache folder of Google Chrome Web browser, and displays the list of all files currently stored in the cache. For each cache file, the following information is displayed: URL, Content type, File size, Last accessed time, Expiration time, Server name, Server response, and more.
You can easily select one or more items from the cache list, and then extract the files to another folder, or copy the URLs list to the clipboard.

————————————————–

You can try looking in the google chrome cache database on your computer but it’s all a bunch of crazy gobbly-gook.

————————————————–

You can also try recovering files that have already been deleted from your recycle bin. Recurva does a good job.

How to enable Quicklaunch in Windows 7

I can’t believe Windows 7 hid Quicklaunch. Quicklaunch is a toolbar where you can put all the programs you use most often and launch them easily. It is incredibly useful. I use it 100 times a day. Here’s my Windows XP Quicklaunch.

Well, you can turn it back on in Windows 7. Here’s how (via)

1. Right click on a empty space on the taskbar, then select (hover on) Taskbar and click on New Toolbar. (See screenshot below)

2. In the Folder line, type or copy the location below. (See screenshot below)
%userprofile%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch

3. Click on the Select Folder button. (See screenshot above)

Done!

You can edit the list in Quicklaunch or manipulate the files directly in
C:\Users\(user-name)\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch

There’s more tidbits on the site I found this tip on.

How to Install Pan-o-Matic in Hugin

Hugin is a terrific free open source panorama stitching tool. It does not come with automatic control point software pre-installed, I suppose leaving the choice to the user. It takes a long time to set control points by hand and virtually no time to have the computer do it for you. Here is how to set up one of the automatic control point creation tools.

After you have set this up, you will be able to open up Hugin, select your images to stitch and about 3 clicks later have an awesome panorama image like this:

Sunset on a rooftop in Riyadh. Right-click download to view it full size!

  1. Download and install Hugin (I’m using version 2010.2.0 released October 2010 on Windows)
  2. Download Pan-o-matic (local copy of version 0.9.4 just in case) and unzip to some permanent location, let’s say it’s c:\stuff\pan-o-matic
  3. In Hugin, go to File | Preferences. Select Control Point Detectors
  4. Delete all the existing Control Point Detector Programs in the list
  5. Make a new one called (it doesn’t matter exactly) Panomatic
  • Description: Panomatic
  • Program: c:\stuff\pan-o-matic\Panomatic.exe
  • Arguments: -o %o %i
  • Type: Autopano-SIFT

Done setting up!

Now, when you want to stitch images, do the following:

  1. Start Hugin
  2. From the Assistant tab, click “Load Images…”. Select the images you want to stitch.
  3. Click “Align” and wait a while for processing
  4. Click “Create Panorama”

Done!