Tuesday, December 04, 2007
May have to get a Treo...
Treo 750 gets WM6 and HSDPA, finally. Even a free download for AT&T versions on the Palm site... Now, I just need to find out when my current plan dies. Don't really think I want to spend the $550 for the unlocked version, but will have to compare and contrast before making a decision on what and when to buy. Also kinda interested in the BlackJack II, but like the idea of being able to use the same bluetooth receiver and an updated version of the GPS software I've been using on my WM5 PPC.
Sunday, December 02, 2007
GigaPan-tastic
Hopefully, the consumer GigaPan robotic mount will come out of beta soon, but will have a cost similar to its sub-$300 beta price. Sure, you can accomplish the same thing manually, but having a motorized automated mount would be pretty darn wicked! It's also pretty cool that you can browse a growing library of these interactive images not only on the GigaPan site, but also in Google Earth (minimum version 4.2).
Wednesday, November 21, 2007
Free Vectorization Utility
Stanford University's Vector Magic lets you make a vector-based (EPS or SVG) from your image files -- scale away happily after converting...
Labels:
vector
Sunday, November 18, 2007
Saturday, October 27, 2007
More on bash, arrays, and index values
So, if you "man bash", you will see the following:
Copy and paste the following into a file, and then run it using your favorite implementation of bash (Cygwin, OS X, Linux, BSD, etc.) to see how it all works:
ArraysWhat does all that mean? It means that index values don't get reset when you unset array elements, so you shouldn't rely on ${#name[*]} in loops, unless you know that the index values are contiguous. So, if you want to loop based on the number of elements, you had better reset the index values by using something like: name=(`echo ${name[*]}`)
Bash provides one-dimensional array variables. Any variable may be
used as an array; the declare builtin will explicitly declare an array.
There is no maximum limit on the size of an array, nor any requirement
that members be indexed or assigned contiguously. Arrays are indexed
using integers and are zero-based.
...
Any element of an array may be referenced using ${name[subscript]}.
...
${#name[subscript]} expands to the length of ${name[subscript]}. If subscript is * or @,
the expansion is the number of elements in the array.
...
The unset builtin is used to destroy arrays. unset name[subscript]
destroys the array element at index subscript. unset name, where name
is an array, or unset name[subscript], where subscript is * or @,
removes the entire array.
Copy and paste the following into a file, and then run it using your favorite implementation of bash (Cygwin, OS X, Linux, BSD, etc.) to see how it all works:
#!/bin/bashHappy bash-ing...
function show_array {
echo There are ${#NUMBERS[*]} numbers in the array.
echo The index positions and values are:
IDX=0
while [ $IDX -lt ${#NUMBERS[*]} ]; do
echo -e $IDX \\t ${NUMBERS[$IDX]}
let IDX+=1
done
}
function pause () {
read -p "$*"
}
echo Bash Shell Array Element Index Handling
echo ----------------------------------------
NUMBERS=(zero one two three four five six seven eight nine)
show_array
pause "Press Enter "
echo ----
echo Now, let\'s unset number five, and see what happens...
unset NUMBERS[5]
show_array
echo Eek!, looks like there\'s a NULL element in there.
echo So, the number of elements has been reset, but the indexing has not.
echo Indexing is non-contiguous by design, so this isn\'t a bug. However,
echo this means that we do not get to see all of the elements if we are
echo looping based on the number of elements in the array.
pause "Press Enter "
echo ----
echo Let\'s try to unset number 1 this time...
unset NUMBERS[1]
show_array
echo Looks like there\'s another NULL element in there, now.
echo Again, the number of elements has been reset, but the indexing has not...
echo The \${#NUMBERS[*]} does not count NULLs, but index values do not
echo change. The while loop produces apparent garbage after some elements
echo have been unset.
pause "Press Enter "
echo ----
echo Enter the cheesy work-around:
echo "It looks like this: NUMBERS=(\`echo \${NUMBERS[*]}\`)"
echo This kills the NULL values and resets the indexing so it is
echo contiguous again...
NUMBERS=(`echo ${NUMBERS[*]}`)
show_array
Labels:
scripting
Friday, October 26, 2007
GPG Extension for Firefox!
FireGPG is a Firefox browser extension that can handle crypto tasks. I'm going to have to try to integrate this with my "Portable Apps" install of Firefox so that I can use crypto on Gmail and Hotmail from anywhere... Looking forward to trying it out this evening!
Update: Seems to work just fine -- both for encrypting and decrypting. I had to over-ride the default keychain location for GPG and the default GPG location for the extension... Will need to try from a different machine to be completely sure, but I think I've nailed it!
Update: Seems to work just fine -- both for encrypting and decrypting. I had to over-ride the default keychain location for GPG and the default GPG location for the extension... Will need to try from a different machine to be completely sure, but I think I've nailed it!
Labels:
cryptography,
GPG,
security
Saturday, October 20, 2007
Rejected Ubuntu Release Names
As I pointed out previously, Ubuntu Releases have all been alliterative animal phrases. While the initial two releases were "Warty Warthog," and "Hoary Hedgehog," the adjectives in these phrases have become somewhat more flattering since, featuring: Breezy, Dapper, Edgy, Feisty, and (currently) Gutsy. With this trend in mind, it is fun to imagine some of the submissions that may have been received and rejected by the Ubuntu team. I submit the following alphabetically-aligned alliterative adjective/animal amalgamations that are unlikely to ever be associated with any project or product:
|
|
Friday, October 19, 2007
Virtual Gutsy
Updated my Ubuntu 7.04 (Feisty Fawn) virtual machine to 7.10 (Gutsy Gibbon) -- nice and smooth via the network install. Since it's in a VM, I don't see the fancy 3D interface elements. C'est la vie...
In other Ubuntu news, the next version has already been given a name (Hardy Heron). I would like to be the first to propose the following properly alliterative animals for future versions:
That ought to last a couple of years...
In other Ubuntu news, the next version has already been given a name (Hardy Heron). I would like to be the first to propose the following properly alliterative animals for future versions:
That ought to last a couple of years...
Labels:
Ubuntu,
virutalization,
VMWare
Wednesday, October 17, 2007
Monday, October 15, 2007
Array Variables in bash
In my efforts to improve my NTFS-3G mount/re-mount script, I had to learn how to implement an array variable. Turns out it's painfully simple, and now I feel that I should go back and eradicate the evil temporary files that I used in some of my earlier quickly-generated scripts. But, I digress... Here are some quick basics that proved useful:
- Array variables can be implicitly declared, e.g. PETS=(dog cat bird fish) builds a four-element array.
- To show the whole array, use ${PETS[*]}
- To show the number of elements in the array, use ${#PETS[*]}
- Element index starts at zero so ${PETS[1]} will return cat
#!/bin/bash
# build an array of partitions (OS X), populated only with disk#s# for each partition
TEST=(`diskutil list | egrep disk.s. | awk '{print $NF}'`)
PARTS=0
# Build a menu that shows each partition in the array
# but start numbering at 1 instead of 0
while [ $PARTS -lt ${#TEST[*]} ]; do
let COUNT=PARTS+1
echo "$COUNT".\) ${TEST[$PARTS]}
let PARTS+=1
done
# Prompt for / grab user input, and see if it matches something on the menu
echo -n Please select a partition from the menu above:
read TRYIT
case $TRYIT in
[1-${#TEST[*]}])
# NOTE: [1-3]is an expression that matches 1, 2, or 3...
echo You typed a valid number: $TRYIT;;
*)
echo You typed a bad number: $TRYIT;
exit 100; # set a non-zero exit code
esac
Labels:
scripting
Sunday, October 14, 2007
Photo Map Updates
Added a few gallery links to my (Google) photo map:
- Glacier National Park (Placemark @ Logan Pass)
- Saint Louis (Placemark @ The Gateway Arch)
- West Virginia (Placemark @ The New River Gorge Bridge)
NTFS-3G Mount/Re-Mount Script for OS X
Requirements:
Features:
[Oct. 15] Version 1.1:
Features:
- Optional Command-Line Parameters:
- Partition to mount or re-mount (must be specified as the first parameter)
- Use the force option at mount (can be specified as either first or 2nd parameter)
- If no parameters are entered, script enters "interactive mode," and prompts user with a menu of confirmed NTFS partitions
- Handle volumes that are currently using the (read-only) kernel NTFS driver
- Prompt to unmount, custom exit level if user-aborted
- Capture name that is assigned in Finder
- Remount as read/write using the same Finder name
- Handle volumes that are not currently mounted
- Mount and assign a default Finder name: NTFS-disk#s#
- Input Sanitizing
- Volumes can be entered as "/dev/disk#s#" or (preferably) as "disk#s#"
- Script throws custom exit level if volume does not exist
- Script throws custom exit level if mount command fails due to non-NTFS volume
- Script throws custom exit level if it encounters NTFS-3G errors during mount
- (Possible Future Enhancements)
- Add a -? or --help option to the script for über-completeness
- Silent output -- rely only on the exit codes (Why? -- I can always redirect to /dev/null if I want to call it from within another script)
- Something I haven't thought of yet...
- bzip2 compressed version of the script (now includes updates through 1.4).
[Oct. 15] Version 1.1:
- Implemented volume-unique mount points, so more than one disk can be mounted
- Implemented menu (via array variable) for volume selection -- type a number instead of having to type disk#s#
- Implemented actual type detection using File System field from "diskutil info disk#s#"
- Previous method used reasonable speculation based on type field from "diskutil list"
- Learned that array index values can be non-contiguous, and are not changed when array elements are unset. (This led to a later post.)
- Added current mount point information to menu (yep, another array)
- Added header bar to menu
- Added Quit option to menu
- Implemented the file system type detection for volumes that are input from the command line.
- Previously, this was only implemented for volumes on the menu in "interactive mode."
- Added an exit level for "Not an NTFS Volume."
Thursday, October 11, 2007
Stop Apostrophe Abuse!
Another blog dedicated to improper punctuation in all of "it's" forms. Guess there are a lot of folks out there who need to read Eats, Shoots, and Leaves
Labels:
Punctuation
Tuesday, September 11, 2007
Friday, September 07, 2007
My Plate Runneth Over...
When discussing workloads, we often invoke the analogy of "the plate," and we talk about how "full" our plate is. In this context, we've been consistently reminded of the lessons of youth regarding the need to "clean our plate" at every meal; leaving the merest morsel of work uneaten is one of the few cardinal sins at the dinner table of employment. We're discouraged from over-committing ("take what you want, but finish what you take"), but the illusion that we have control over what we "take" repeatedly breaks down -- especially during "special," or difficult, times. (For now, we'll neglect that "difficult times" tend to become the norm when "Management by Crisis" is the foundational culture of the organization. This management technique, while outwardly easy -- because humans naturally seek leaders in a time of crisis -- is most often really a sign of a "crisis of management" caused by an endemic, and apparently irrevocable, lack of foresight.)
Allow me to extend the analogy of the plate, as it applies in "special times" -- regardless of whether such times have become the rule rather than the exception: Today is a special day, say, your birthday... Your family has taken you to a certain Amarillo steakhouse with a particular penchant for excess. Because you've been raised to "take what you want, but finish what you take," you order the 8 oz. sirloin. Your doctor would advise you to only consume 3-4 oz. of red meat during the course of a meal, but this is a "special day," and this particular steak is the 2nd-most humble slab of beef on the whole menu -- you wouldn't want to disappoint your family, after all. Well, it turns out that your family maintains their traditional values, and therefore can't pass up the opportunity to save some money ("waste not, want not"); so when you get up to wash your hands, your father calls over the wait staff and substitutes the *FREE* 72 oz. steak for your already-slightly-too-robust sirloin. Your meal arrives, and you protest that there clearly must have been some mistake, but your father calmly explains how much money you'll be saving for the family -- if only you can polish off four and a half pounds of beef in under an hour. Even though what your ordered would have cost $16 at the end of the meal, and this abomination costs $72 up front (refunded only if you complete the "challenge" successfully), your father smiles about how much money he is saving for the family, and encourages everyone to "dig in" to their meals. At that point you stop staring at your own plate for a moment and look around the table for the first time; you see that all of your siblings are facing a similar quandary. Since you're not alone, you feel obligated to try; since the clock is already inexorably counting down what remains of your precious hour, you suppress the urge to protest further and start cutting, piercing, shoveling, and chewing... Needless to say, there is an intrinsic -- but unstated -- requirement that you (and all of your siblings) rise to this challenge, lest the whole family should be forced to suffer as a result of your gastronomic ineptitude...
At least that's what seems to happen where I work...
Allow me to extend the analogy of the plate, as it applies in "special times" -- regardless of whether such times have become the rule rather than the exception: Today is a special day, say, your birthday... Your family has taken you to a certain Amarillo steakhouse with a particular penchant for excess. Because you've been raised to "take what you want, but finish what you take," you order the 8 oz. sirloin. Your doctor would advise you to only consume 3-4 oz. of red meat during the course of a meal, but this is a "special day," and this particular steak is the 2nd-most humble slab of beef on the whole menu -- you wouldn't want to disappoint your family, after all. Well, it turns out that your family maintains their traditional values, and therefore can't pass up the opportunity to save some money ("waste not, want not"); so when you get up to wash your hands, your father calls over the wait staff and substitutes the *FREE* 72 oz. steak for your already-slightly-too-robust sirloin. Your meal arrives, and you protest that there clearly must have been some mistake, but your father calmly explains how much money you'll be saving for the family -- if only you can polish off four and a half pounds of beef in under an hour. Even though what your ordered would have cost $16 at the end of the meal, and this abomination costs $72 up front (refunded only if you complete the "challenge" successfully), your father smiles about how much money he is saving for the family, and encourages everyone to "dig in" to their meals. At that point you stop staring at your own plate for a moment and look around the table for the first time; you see that all of your siblings are facing a similar quandary. Since you're not alone, you feel obligated to try; since the clock is already inexorably counting down what remains of your precious hour, you suppress the urge to protest further and start cutting, piercing, shoveling, and chewing... Needless to say, there is an intrinsic -- but unstated -- requirement that you (and all of your siblings) rise to this challenge, lest the whole family should be forced to suffer as a result of your gastronomic ineptitude...
At least that's what seems to happen where I work...
Tuesday, September 04, 2007
World's Largest Photograph
The world's largest photograph was made by converting an aircraft hangar into both a giant camera and giant darkroom.
Useless? Perhaps. Cool? Definitely.
Useless? Perhaps. Cool? Definitely.
Saturday, September 01, 2007
Bluetooth GPS and VMWare Fusion
Yes, VMWare Fusion does indeed support mapping the MacBook Pro's built-in Bluetooth radio to a Windows VM. As this screencast movie demonstrates, once the radio has been remapped, you can use your Bluetooth devices from within the virtual machine.
Only two minor caveats for my fellow adventurers:
Only two minor caveats for my fellow adventurers:
- Fusion will warn you that you need to load the BootCamp drivers on the VM when you enable the Bluetooth radio for the VM. This can be safely ignored if you are using a physical BootCamp partition as a VM, but is important to keep in mind if you are using a file-based Windows VM onto which you haven't previously installed the Apple built-in Bluetooth radio's driver for Windows.
- The COM port mappings for Bluetooth devices will be different depending on whether you've accessed the BootCamp partition physically (by rebooting and holding "Option / Alt") or as a virtual machine (from VMWare Fusion). Just be aware of this, and be sure to configure your devices before using them.
The MBP w/ BootCamp Seamless HDD Upgrade
When I got my MacBook Pro (2.33GHz C2D), the biggest 7200rpm drive that Apple offered was too dang small for my tastes, so I opted for the (cheaper) 5400rpm 160GB drive. I had everything configured nicely, but had only carved off 18GB (NTFS) for my XP Pro BootCamp partition. Well, when one game (TOCA 3, which I absolutely refuse to uninstall) sucks up ~6GB of that space, that obviously isn't going to be adequate. Also, since I like to produce vacation videos to commemorate my travels, I need a significant amount of working space on the OS X (HFS+) partition, and didn't want to sacrifice the ability to work a good-sized project without having one of my external drives tethered.
The Problem
I wanted to execute the HDD upgrade -- gaining more space for both OS options, and switching to a 7200rpm mechanism to help whilst performing the aforementioned untethered video work, Photoshop activities, et.al.; however, I would consider a requirement of performing a reinstallation of either OS to constitute failure.
The Hardware for the Solution
First I went to OWC, and procured their Mercury On-the-Go 2.5" SATA external enclosure. I opted for the USB 2.0 / eSATA combo version; after giving strong consideration between the FW800 and eSATA options, I chose the more future-proof eSATA version. After looking at the prices of the versions that included a drive, I realized that I could go to NewEgg and get the Hitachi 7200rpm 200GB SATA-2 2.5" drive (including shipping) while still saving a significant chunk of money vs. the pre-assembled drive from OWC.
The Software for the Solution
I needed a way to replicate or image both OS X and Windows XP. A couple of seconds of Google Search action resulted in finding SuperDuper!, which appeared to fit the bill nicely for my OS X duplication and future bootability requirements.
Since I've been a "PC Guy" for a long time, I had a licensed copy of Symantec's Norton Ghost laying around, and thought that it may meet my needs on the XP side. But, alas, that would have been too easy -- the version I had (Ghost 2003, a.k.a. version 9.0) didn't support the GPT partition scheme, and couldn't make a partition image of the XP BootCamp partition. I had another brilliant idea, and tried to execute the Ghost imaging process from within VMWare Fusion, but Ghost couldn't see the C: drive via the VMWare driver (Curiously, it could see my external drive -- close, but no cigar...) I couldn't see any clear indication that the current Ghost 12 package would resolve this for me, and they wanted $50 (upgrade price) just for the chance to try -- no thanks, I just spent enough hard-earned cash on the hardware... There are also some widely-discussed problems trying to use a *.DMG disk image from OS X's Disk Utility to successfully image BootCamp, so I started the Windows phase of the game with 2 strikes...
Luckily, there are some clever folks out there who know how to leverage tools that have been in development for quite some time and make them accomplish new tasks. Enter WinClone, which is heavily based on the hard work by the good folks at the Linux-NTFS project. This little gem lets you save off an image of your NTFS partition and restore it to another partition. The use of the ntfstools is executed nicely, and WinClone manages to pull off the restoration in a way that continues to make BootCamp happy and bootable.
High-Level Description of the Process
After the upgrade, VMWare Fusion couldn't start the VM that was based on the physical BootCamp partition, because the partition table was different. It recommended removing and re-adding the disk to the VM config file, but there's an easier way. I simply deleted the VM config file (/Users/ [your_user]/Library/Application Support/VMWare Fusion/Virtual Machines/Boot Camp/[your /dev/disk#]/Boot Camp partition.vmwarevm), and then let VMWare Fusion rebuild the VM file... That did the trick, and I just hit cancel to avoid re-installing the VMWare tools (since they're already installed).
Mission Accomplished!
That's it: a few hours of time resulted in more space for both OS environments, and a little more speed as well. I also accomplished my prime objective of not having to reinstall either OS, re-apply any customizations, re-download any tools, etc... Oh, yeah, and I walk away with a pretty sweet 160GB bus-powered USB 2.0 HDD that happens to also support connection via eSATA.
The Problem
I wanted to execute the HDD upgrade -- gaining more space for both OS options, and switching to a 7200rpm mechanism to help whilst performing the aforementioned untethered video work, Photoshop activities, et.al.; however, I would consider a requirement of performing a reinstallation of either OS to constitute failure.
The Hardware for the Solution
First I went to OWC, and procured their Mercury On-the-Go 2.5" SATA external enclosure. I opted for the USB 2.0 / eSATA combo version; after giving strong consideration between the FW800 and eSATA options, I chose the more future-proof eSATA version. After looking at the prices of the versions that included a drive, I realized that I could go to NewEgg and get the Hitachi 7200rpm 200GB SATA-2 2.5" drive (including shipping) while still saving a significant chunk of money vs. the pre-assembled drive from OWC.
The Software for the Solution
I needed a way to replicate or image both OS X and Windows XP. A couple of seconds of Google Search action resulted in finding SuperDuper!, which appeared to fit the bill nicely for my OS X duplication and future bootability requirements.
Since I've been a "PC Guy" for a long time, I had a licensed copy of Symantec's Norton Ghost laying around, and thought that it may meet my needs on the XP side. But, alas, that would have been too easy -- the version I had (Ghost 2003, a.k.a. version 9.0) didn't support the GPT partition scheme, and couldn't make a partition image of the XP BootCamp partition. I had another brilliant idea, and tried to execute the Ghost imaging process from within VMWare Fusion, but Ghost couldn't see the C: drive via the VMWare driver (Curiously, it could see my external drive -- close, but no cigar...) I couldn't see any clear indication that the current Ghost 12 package would resolve this for me, and they wanted $50 (upgrade price) just for the chance to try -- no thanks, I just spent enough hard-earned cash on the hardware... There are also some widely-discussed problems trying to use a *.DMG disk image from OS X's Disk Utility to successfully image BootCamp, so I started the Windows phase of the game with 2 strikes...
Luckily, there are some clever folks out there who know how to leverage tools that have been in development for quite some time and make them accomplish new tasks. Enter WinClone, which is heavily based on the hard work by the good folks at the Linux-NTFS project. This little gem lets you save off an image of your NTFS partition and restore it to another partition. The use of the ntfstools is executed nicely, and WinClone manages to pull off the restoration in a way that continues to make BootCamp happy and bootable.
High-Level Description of the Process
- Gather all the required HW and SW for the process
- Install the replacement HDD in the enclosure, attach the enclosure to the MBP via USB
- "Initialize" the new drive: make a single partition that consumes the whole disk (we'll make the new BootCamp partion later), format it as HFS+, and name it "Macintosh HD" (because we're shooting for a seamless transition)
- Use SuperDuper! to make a full and bootable copy using the Backup -- All Files method
- Reboot, hold in the "Option / Alt" key, and boot from the newly-cloned drive to make sure it works.
- (Optional) Reboot back to the original internal HDD for now.
- Run WinClone, create an image file from your BootCamp partition (mine was the 3rd partition -- or slice -- on the first disk on my MBP, namely /dev/disk0s3), and save it as a file somewhere that you'll be able to access later (I would suggest one of your HFS+ partitions, and the clone is a good choice for this purpose, because you won't have to tether an external drive to restore it).
- Shut down the computer completely, and prepare for the disassembly. I used a #000 Philips and a T6 Torx driver to perform the dirty work. You can refer to the ExtremeTech or iFixIt guides to complete the diasassembly [remove the plethora of itty-bitty screws that are required to remove the palmrest / top cover (4 on one side, 4 on the other side, 4 on the bottom, 2 on the back, 2 near the memory cover, 2 under the front lip beneath the battery, etc...), disconnect the keyboard/trackpad cable, and remove the drive (2 more screws, some tape, and an interface cable).] Needless to say, use your brain to avoid ESD zapping of your computer's sensitive and/or delicate parts... Note: There were some minor differences between my MBP and the first-gen model used in the iFixIt guide, but they were farily trivial (e.g. no bluetooth board, and different HDD mounting assembly on the right-hand side).
- Take the replacement drive out of the external enclosure, migrate the HDD mounting bushings (and / or brackets on other systems) to the replacement drive, install the replacement drive into the system, and put the bloody thing back together...
- Boot to your migrated OS X system (if you haven't been following along , you may be horrified that you --temporarily -- have no BootCamp partition). Since you tested it in step 5, you should already know that this will just work. Thanks, again, to SuperDuper! for making this so part of the migration so dang easy.
- Run BootCamp Assistant and carve off a new BootCamp partition on your new internal HDD (I chose 45GB this time, because I want more than 2 games on my Windows XP installation).
- Start the Windows installation, and get past where you've formatted the C: drive as NTFS. Note: you don't have to finish the Windows installation.
- Reboot back into OS X, and run WinClone to restore from the file created in step 7 to your newly-created BootCamp partition (now you can clearly see why I suggested storing the file on the new drive).
- Reboot, hold "Option / Alt", boot to Windows, let it run chkdsk, then repeat to complete the Windows portion of the migration.
- Grab a cold one, and enjoy...
After the upgrade, VMWare Fusion couldn't start the VM that was based on the physical BootCamp partition, because the partition table was different. It recommended removing and re-adding the disk to the VM config file, but there's an easier way. I simply deleted the VM config file (/Users/
Mission Accomplished!
That's it: a few hours of time resulted in more space for both OS environments, and a little more speed as well. I also accomplished my prime objective of not having to reinstall either OS, re-apply any customizations, re-download any tools, etc... Oh, yeah, and I walk away with a pretty sweet 160GB bus-powered USB 2.0 HDD that happens to also support connection via eSATA.