Archive for October, 2007
Tech-mojo partially restored
Finally was able to get Leopard to install on my Macbook – I can hold off for awhile in calling AppleCare I guess :-/
After installing Leopard I discovered that my primary GMail account is now IMAP enabled – so now my email is nicely synced between my Windows XP desktop, my OSX laptop, and my iPod Touch.
Hurray for me – now if only my xbox would magically start working perfectly.
Everyone gets their chance with CSI
An Addendum: tech-mojo
… Jenn kindly reminded me that GMail also hates me. I won’t go into the “I was an early adopter and I deserve to have IMAP support first and don’t” whine – but that basically sums it up. I check email on 3-4 devices throughout a busy day of work and school, and IMAP support in gmail is something I have been waiting for for years.
My tech-mojo has gone on vacation.
… and with it, took my Xbox 360 and my laptop.
More or less my Xbox has decided to start red ringing and working intermittently – it will soon be shipped back to Microsoft in a coffin if it doesn’t straighten its act out.
Last night I tried to install my shiny new copy of Leopard retail, only to discover that my Macbook dvd drive refuses to read dvd’s 19 out of 20 times. I really don’t want to bring that to the Apple store, because it will definitely result in my trusty Macbook being shipped to Apple for repair – which could take awhile.
In the mean time I will just have to live vicariously through upgrading other laptops to Leopard.
Quick Rant
I HATE it when people use the urinal in the mens lavatory and feel its okay to leave without washing their hands. I mean, come on people! I takes 15 seconds to wash your hands, and another 15 seconds to dry them. Heck, Thomson is even paying for you to wash your hands – for the sake of everyone else that has to touch the door handle to leave the lavatory Please wash your hands!
grape (50% daily dose)
So who would have thought, that a bottle of tasty purple vitamin water was created by the rapper 50 cent?
He[50 cent] worked with glacéau to create and market a grape flavored Vitamin Water drink called Formula 50. In 2007, Coca-Cola purchased glaceau for US$4.1 billion. 50 Cent, who owns a stake in the company, was estimated by Forbes to have earned $100 million after taxes.
Honestly, they didn’t create something different here… its grape flavored water! But oh it tastes good, and because its owned by Coke, is available just about everywhere. The bottle itself gives no indication of its affiliation (if you don’t think too hard about its name anyway: formula 50).
I noticed yesterday afternoon, that under the bottle’s wrapper (ooh, there could be a clever pun here!) (which is unbelievably impossible to peel off) is a 50 cent promotion:
i’ve got your digits. and when i speak… people listen.
So with every bottle of grape vitamin water, you get a code to send someone a sweet 50 cent message on their cellphone – sign me up! Really. Do it.
I am quite tired of all these “stars” that think its cool to change their name to something ridiculous… I mean, 50 cent? What? How is that even remotely considered a name? Retarded – use the name your mom gave you. From now on, I will call you Curtis James Jackson III, and your stupid (but tasty) drink will be Formula Curtis James Jackson III.
(In all fairness, “50 cent” is his stage name – and his name is still legally Curtis, but do you ever see a star with a stage name referred to by their real name?)
For those about to rock… I salute you
The latest installment of the Guitar Hero series comes out Sunday, Guitar Hero III: Legends of Rock. For the Xbox 360 it will be retailing at a gentle $99.99.
Ninety nine ninety nine.
What?
Guitar Hero I and II for PS2 were each $75-80, including game and peripheral. GHII for the 360 was $89. Why must GHIII for 360 be a hundred bucks? Outrageous. But I will still buy it.
The game sports a very impressive track list, and some new multiplayer features that really have me drooling. I’ll finally have a chance to win a few 1vs1 playoffs against my friends that are too good to be playing the game in the first place.
Hit the link above for the details on this fine game.
Dive Into Greasemonkey, at Thomson West’s Weekly Developer Forum
This afternoon I’ll be giving a quick presentation to a bunch of developers on the Firefox extension Greasemonkey, and some of the scripts I have written for it to aid my work here at Thomson.
Should be fun.
So where are my iPod Touch / iPhone applications?
Short story: I’ve been busy! Life is crazy, I no longer am a geek with too much time on my hands.
Long story: I’ve reinstalled 10.4 (from Leopard dev build) – and have compiled the iPhone toolchain. For some unfortunate reason my gcc is refusing to compile UIKit applications, but console applications seem to compile just fine. I hope to get this resolved soon, and in the near future there will be some native iPhone / iPod Touch applications available here on npike.net.
Some of my ideas:
- Google Calendar.app (duh!)
- GMail Notifier
- Jezzball
- Audiofications (Audio notifications for events the operating system doesn’t handle on its own)
mmm hacked iPod Touch

iShot the Sheriff
… and broke my iPod Touch out of Jail!
My iPod wasn’t in the local slammer here in Rochester – but it was locked down by Apple to prevent installation of third party and unsigned code.
The FreeBSD jail mechanism is an early implementation of operating system-level virtualization that allows administrators to partition a FreeBSD-based computer system into several independent mini-systems called jails.
The need for the FreeBSD jails came from service providers willing to establish a clean cut between their services and those of their customers, mainly for security and ease of administration reasons. Instead of adding a new layer of fine-grained configuration options, the solution adopted was to compartment the system, both its files and its resources, in a way that can only be accessed by the right compartment.
You can read more about BSD Jails at Wikipedia here.
The process was a little crazy – I have already jailbreaked (??) two iPhones previously (Jenn and Kevin). The process for that was ridiculously simple and safe, as the process had been out for weeks and had had time to be refined.
Yesterday an exploit was made public by a programmer with the handle Naicin (I am not going to link to his site). This exploit took advantage of a bug in MobileSafari on the iPod: namely, loading a cleverly crafted TIFF image that contained assembly code could remount the internal file system as Writable, instead of readonly.
This is all he released – no instructions, no easy way to install applications ALA iPhone. The rest was up to the user.
Many, many, many kids attempted and had to restore their iPods to factory defaults – but I took my chances and did it anyway, and was extremely successful.
I now have the iPhone apps on my iTouch that I so desire:
- Calendar (with add ability)
- Notes
- Google Maps
I now also have a few third party apps installed.
Pictures of the hacked iPod Touch below:
Google Maps!
Many more icons on the desktop (compare with the original here )
And last but not least, a third party application on the iPod Touch: Lights Off!
The Woz
This weekend was Brickcity (Homecoming) at RIT – I’ve never really participated in any of the Brickcity events in the past 4-5 years, but this year Steve Wozniak was the distinguished speaker. For those of you who don’t know, Steve Wozniak is the cofounder of apple.
Co-Founder of Apple Computer, a Silicon Valley icon and philanthropist, Steve Wozniak is best known for revolutionizing the personal computer industry. Wozniak helped develop more “user-friendly” personal computers such as the Apple I, Apple II, and influenced the popular Macintosh. His honors and awards include the National Medal of Technology, the nation’s highest honor for innovators, being inducted into the Inventors Hall of Fame, and the prestigious Heinz Award for Technology, The Economy and Employment. Wozniak is also a published author with the release of his autobiography in 2006, iWoz: Computer Geek to Cult Icon. Wozniak is currently Co-Founder and Chief Technology Officer and Chief Visionary Officer for Jazz Technologies, Inc.
The lecture was supposed to last an hour, but unfortunately RIT had to mess that up – with a 15 minute speech from the SG President and the new RIT Presiden Dr.Destler.
Woz got to about 1983 in his lecture – the point where he and Steve Jobs were located in his garage building Apple II’s with color screens – and then the SG President walked onto the stage and just stood there…
I wanted to scream – let the man talk! You brought the Woz, and Howie Mandel – It’s RIT, all we really care about is the Woz! We paid good money to hear him, do not cut him off!
But of course they did, but he opened it up to a quick Q&A session.
The first kid to talk actually hit Woz up for mentoring of his Student Club… way to put ‘em on the spot!
The last person though – an editor at The Reporter – did the unthinkable – one of those questions that makes me absolutely hate RIT.
“As you well know Steve, one of our freshmen this year is the kid who hacked the iPhone [waits for applause] – what do you think about that?”
He waited for applause – yes he did. He brought it up with the biggest smirk on his face. Who cares what Woz thinks of that? Woz doesn’t even work for Apple anymore.
Anyway, it really makes me want to watch Pirates of Silicon Valley again… maybe tonight, or some other afternoon this week.
My life will be complete tomorrow
Half-life Orange box will be released tomorrow for the Xbox 360 and PC. Included in this one box is:
- Half-life 2
- Half-life 2 : Episode 1
- Half-life 2 : Episode 2
- Portal
- Team Fortress 2
For those few uninformed, for a brief time I played Team Fortress Classic (for Half-Life 1) competitively, and still belong to the retired clan TheServerAdmins.
My class of choice is the Pyro. I started playing and creating Half-life maps with SA when I was 14 or 16 (it was a long time ago!). During that time SA has maintained a NeoTFC server and several Natural Selection servers. A few times we entertained the idea of professional/competitive NS – but the team was just not ready for it.
So Valve is finally releasing Team Fortress 2 – which is more or less TFC on the Source engine, with new models and stylization. I will be picking this up for both the Xbox and the PC (once I can get just TF2 for the PC – as I already have HL2).
I will be one happy man come Tuesday afternoon.
Sci vs Fi – Halo 3 Documentary
For those of you that missed the 20 minute special on the SciFi channel last week, heres the Sci vs Fi Halo 3 Documentary in all its glory (I think).
Remotely executing shell commands in a bash script with ssh and expect
So an on going project of mine at work had been to create a bash shell script, that could be run at regular intervals, that would check that all servers in an environment were identical compared to their “master server”.
This would require comparing each server against its master with a specific set of criteria:
- Network Filesystem Mounts
- User accounts
- Groups
- Group ID’s and User IDs
My approach was simple, for each criteria use a set of commands to retrieve the necessary information, and save it to a text file in a sorted manner. Then compare that against a file generated in the same manner for the master server in that environment.
This is all fine and peachy, until you actually want to send these commands to several servers spread out across a network, without the need for human interaction.
The method of sending commands and retrieving their output was an SSH connection to each machine, but unfortunately you can’t send your SSH password on the command line. So to fix this hurdle, I used the expect binary, which basically watched standard output for a string, and sends your response.
Searches on the interwebs came up with sparse results on this matter, so below is my contribution so that hopefully a fellow geek won’t have as much non-luck as I with Google.
linux_ssh.expect
###
# 2007 – Nicholas Pike
#
# This script takes 4 parameters, and will execute a command (or set of commands) on a remote server.
# hostname
# password
# username
# command
#
###
set hostname [lindex $argv 0]
set password [lindex $argv 1]
set username [lindex $argv 2]
set command [lindex $argv 3]
spawn ssh $username@$hostname $command
expect “password: ”
send “$password\r”
send — “\r”
expect eof
From within a bash script, you can call this file with the expect binary like so:
# runRemoteCommand takes 3 parameters (See below). This will run a command (or series of commands) on
# all machines listed in $BOX_LIST for the current environment specified in run()
# The output of these commands will be written to a file located:
# box_compare/commandLabel/environment/[nameofserver]
# After the polling is complete, the output files of the slave servers are diff’d against the
# master servers output.
# The results are appended to the text report for this environment.
#
# runRemoteCommand “helloWorld” “Hello World” “echo \”hello world\”; ls”
#
# first parameter is command label
# second parameter is criteria name
# third parameter is command
#
runRemoteCommand() {
mkdir $PATH_COMPARE/temp/$1
mkdir $PATH_COMPARE/temp/$1/$ENVIRONMENT
COMMAND=$3
# run the remtoe command for each server in the box list for this environment
for server in `echo $BOX_LIST`
do
EXPECT_COMMAND=”"$COMMAND”"
expect -f linux_ssh.exp $server $PASSWORD $USERNAME “$EXPECT_COMMAND” > $PATH_COMPARE/temp/$1/$ENVIRONMENT/$server
done
}
The important line of course being:
Ta-da!
So there ya go, a quick and “easy” way to send shell commands via SSH in a bash script to other *nix based computers.
