Much ado about scripting, Linux & Eclipse: card subject to change

2006-10-28

Patch & Buddy, Verminators

Another day, another dead raccoon. And two rather muddy dogs. I've lost count over the years, but I'm sure this has to be at least the 10th raccoon they've discouraged from knocking over trash and recycling bins in my neighbourhood. I've heard Toronto has the highest raccoon population of any large city in Canada, so it's a daunting task, but they do it with pride.

After a leap from the top of the bluff west of Livingston Rd., they proceeded to slide down the side of the bluff after a rather massive raccoon (wider than either of them), who as usual was no match for a pair of experienced Pointers. After a few minutes and a few yards of sliding though the mud, they were done. We walked home and they were bathed shortly thereafter. More photos here.

2006-09-28

You'd think common sense would negate the need for a law here

This summary is not available. Please click here to view the post.

2006-09-20

News from Google

Two items to report:

  • Google Personalized Homepage now includes tabs and collapsable modules (though there seems to be a bit of a caching bug)...
  • Just found the blog Google Operating System which is awash with tips, tricks, and insights from the world of Google's APIs and toys. A must read for the Google-obsessed.

2006-09-16

The Wicker Man

Yowza. Got dragged out to see the remake of 1973's The Wicker Man, starring my most beloved of craptactular actors, Nicholas Cage. It was great to escape the clutches of the office for a few hours, and for that I'm grateful... but geez. I suppose I should have expected this from the cast, which includes:

* Diane Delano, whose only role in the film was to remind me of Kathy Bates in About Schmidt and worry me for nearly 90 minutes that there'd be a similar scene here - though thankfully there's nothing so scary in this flick; and

* Molly Parker, who reminds me that some Canadians should stick to Canadian films, like the highly entertaining Men With Brooms.

If you're thinking of seeing this, I recommend renting it or seeing it in a nigh-empty theatre so you can MST3K the hell out of it as you watch it - yes, it's that bad. (Or good, depending on your point of view.)

Some quotes from rottentomatoes.com, which gave this remake a rather fitting 14% freshness rating.

"Watching Cage karate chop Leelee "Made-for-TV" Sobiesky into submission is almost worth the price of admission. Well, assuming admission was free."
"Nic meets his ex-fiancé, Willow, whose submarine-sized lips seem to be gradually folding around her head like a collagen Venus Flytrap."
"For viewers, the biggest challenge may be holding back screams of laughter as Summersisle is revealed to be the Island of Awful Acting. ... the original film ended with a sudden shock, this one climaxes with high hilarity."
"The plot is nonsensical but the cast and Edenic setting is worth a look."
"The most risible backwoods thriller since M. Night Shyamalan traveled to The Village."

I'm afraid I have to agre with that last one, and so, to quote Seth Green and the gang from Robot Chicken, "What a tweest!"

2006-09-09

Picasa rocks!

I've recovered most of the photos that were online before I was hacked last fall, and posted them here. (Note the new sidebar item too.)

2006-09-01

Testing out Picasa2 for Linux

  Still looking for a simple solution to publish pics online (instead of my old technique of running Photoshop macros and a bit of manually updated PHP). Testing, testing, one-two... Posted by Picasa

(BTW, this is a shot of Lynn Canyon taken in March 2006.)

2006-08-28

Blogger is busted

Went to check my blog tonight and found this instead. Ah, well, could have been worse, much worse... however, after a few minutes worth of 'trying again in 30 seconds' it became clear that something was serious foobared here.

2006-08-26

Beyond CVS for Linux

Solved a long-standing annoyance this week - using the BeyondCVS Eclipse plugin on Linux.

One day, if I have time I'll try to turn this into a fragment so that it'll work without outside effort, but for now, here's the HOWTO:

0. Install WINE using yum, apt-get, etc. as appropriate for your linux distro. (Chances are this is already installed.)

1. Install beyond compare, from Scooter Software. I installed it using wine into /opt/beyondcompare2:

 $ wine beycomp.exe 
2. Create a script (eg., ~/bc2.sh) to handle passing commandline args. Your script might require a different drive letter prefix, depending on your wine install - I've had to use both s: and z:. chmod your script so it's executable (chmod +x ~/bc2.sh).
#!/bin/sh

# collect commandline params and turn them into wine-friendly paths
opts="";
while [ "$#" -gt 0 ]; do
  opts=$opts" s:"$1; shift 1;
done

/usr/bin/wine /opt/beyondcompare2/BC2.exe $opts
3. Test your script by running it in a console window.
$ ~/bc2.sh

4. Install BeyondCVS plugin and feature into your Eclipse 3.2+ install (or using a .link file).

5. Start Eclipse. Open up Help > Window > Preferences... > External Tools Launcher > Beyond Compare. In the field Path To Beyond Compare, enter the path to your shell script, eg., /home/nickb/bc2.sh. Leave the Show Debugging Info? checkbox enabled.

6. Select two files or folders in your Package Explorer or Navigator. Beyond Compare should launch under WINE. If it doesn't, open a console and run your bc2.sh script, passing the same two parameters shown in the debug info popup in Eclipse. As noted above, you might have to change the drive letter from s: to z: or something else so that WINE can find the files you passed it. If all worked, you can remove the Show Debugging Info? checkbox in the Preferences panel.

Happy comparing!

2006-08-16

The cow says...

Logging in today, I actually got the BOFH cow to randomly mention division by zero!

To enable this in your ~/.bashrc or /etc/bashrc, install cowsay and fortune, then add this to the end of your script. Note that on some systems you get different fortune options than the ones I've got below.

if [ "$TERM" != "dumb" ]; then
  # define some colour codes to use 
  # eg., 36: cyan, 35: purple, 34: blue, 33: yellow, 32: green, 31: red
  # can also use darker version with 0;36, 0;36, etc.
  col="\033[1;35m"; 
  norm="\033[0;39m"; 

  echo -e -n $col; # change colour

  # get a fortune and pipe it to cowsay, using the apt cow
  fortune -a 20% riddles 30% literature 10% fortunes 40% excuses     | cowsay -n -f apt.cow; 
  echo -e $norm; # return to normal
fi
If you want to create your own fortunes, have a look in /usr/share/games/fortunes, then create a text file with each line being a unique message. In the example below, I called this file BOFH_excuses.txt, sourced here. Process the file with gawk to change this:
High line impedance.
Someone set us up the bomb.
Power surges on the Underground.
into this:
The BOFH says: High line impedance.
%
The BOFH says: Someone set us up the bomb.
%
The BOFH says: Power surges on the Underground.
%
$ gawk -F: '{ print "The BOFH says: "$1"\n%" }'  BOFH_excuses.txt > excuses; 

Now, each entry in excuses ends with a newline and a "%". Multi-line entries are also separated by "%" - see other files in the /usr/share/games/fortunes folder for examples.

To index your new file so that fortune can use it, you must run it through strfile:

$ strfile excuses excuses.dat

Finally, to test your new fortunes, run this:

$ fortune excuses

How'd you get your Notes email address?

From the 'answered too many times to count' department:

So, why codeslave in the first place?

I used to be nboldt... until I found a badly-documented feature in Lotus Notes (circa 6.0 or 6.5, I think) that lets you request a new shortname - that is, to change from nboldt@mydomain.com to codeslave@mydomain.com. I think the reason for its being there was so that when women got married they could change their shortname to match their new lastname, eg. jsmith -> jjones.

So I became codeslave. I've also seen fivetwelve, zx and mo.

If you're using Lotus Notes 7.0b3 (aka NUL, or Notes Under Linux, though I always picture Nibbles from the show ReBoot when I think of NUL), this feature is still available. Sorta.

  File > Security > User Security
      > Your Identity > Your Names > [Name Changes...]

  To change your names, you should contact ________________ [Send Mail]

Oddly enough, the window says "You can request changes to your Notes user name, alternate name, and aliases," but if you click Send Mail, it only prompts for the new name, not the shortname... and while there's a handy li'l tool for sending a prefilled email...

  Please change my name to 'Nick Boldt'.  My ID containing the 
  new name is attached in case it is needed.

... it doesn't provide the name of the admin to send it to in the To: field. ;-)