Archive for October, 2006

Subversive behaviour

Wednesday, October 18th, 2006

I’m a big fan of version control. I use RCS to control versions of files I’m editing on my machines, and these days I use Subversion (instead of the venerable, but less cross-platform and more annoying CVS) for version control on projects I’m working on.

I’m still learning about Subversion, annoyingly it seems you can’t check out a single file, which of course makes sense because it would then leave Subversion nowhere to write its hidden version information directory (I wonder if that’ll change with the advent of Subversion using a single file to store all its working copy information). I did try to ’svn export’ a single file from the repository, but I got the error message “”.

Subversion does however have the ’svn cat’ command, which dumps the contents of a file. So using the ‘power’ of unix you can pipe that file to a shell thus:

svn cat svn+ssh://username@example.com/SVN/trunk/evilshellscript.sh | /bin/sh

thus you could put some more svn commands in evilshellscript.sh and it could checkout more files from the repository, take over your machine, or do all sorts of nasty stuff. I use it to checkout and put some more files and put them in the right place.
My vision is of walking up to a pristine new Mac, entering one command, and having the machine download and install all the software I use and setting itself up just the way I like it.

PackageMaker v the home directory

Tuesday, October 17th, 2006

So, it turns out that if you want to use a shell script in PackageMaker (say the post-installation ‘postflight’ script file), if you try referring to the user’s home directory using ‘~’ you wind up referring to a directory at the root level (ie /~/blah), which is invariably what you don’t want. The solution referred to on the Apple discussion boards is to create a shell script that moves everything to the home directory then execute that from the install script.

So we start by getting the username. But of course, the postflight script is running under sudo so it’s username probably isn’t the same as the logged in user.

>sudo id -p
Password:
login   testuser
uid     root
groups  wheel daemon kmem sys tty certusers operator admin staff

Looks like the ‘login’ line is the one we want, and we can get it using grep.

>sudo id -p | grep login
Password:
login        testuser

But we need the second column (ie just “testuser” rather than “login testuser”). awk lets us get at the second column using

>sudo id -p | grep login | awk '{print $2}'
testuser

In the end you could try something along the lines of the following in your PackageMaker postflight script. Note that the backticks “ evaluate the expression contained within them.

set username="blah" # otherwise bash seems to whinge that username is undefined on the next line
username="`sudo id -p | grep login | awk '{print $2}'`"
mv whatever /Users/$username/wherever/

This seems to work as long as you’re not doing the install via Apple Remote Desktop’s Install Package option. Because if you do that the user is root and the package probably can’t be meaningfully installed in root’s home directory. The only solution I could come up with is to install your files in a location that’s commonly accessible to all users.

Keeping the world safe from the scum of the Internet

Monday, October 16th, 2006

I was trying to work out why someone’s mail server bounced mail from my server when I browsed the Spamhaus.org page. Aside from the latest stupid legal judgement from US spammers aimed at them, I noticed that the bottom of their homepage says “Powered by Xserve”. Even more amusing is that the URLs indicate that they’re running OmniPilot’s Lasso.

Cool AppleScripts

Sunday, October 15th, 2006

If you’re after some cool AppleScripts, check out djodjodesign. They’ve got PodTube for putting YouTube video onto an iPod, orĀ  iMeet iCal for copying your Meeting Maker meetings into your iCal calendar so you can iSync it with your devices.

Sydney Mac C++ Software Engineering Job

Saturday, October 14th, 2006

Saw this Sydney MacJob ad today. Probably in the Telecomms industry gathering from the recruiting company’s blurb.

Giving up on multisite Gallery2

Saturday, October 14th, 2006

Looking for some way to put my photos up on the net, I chose Gallery2, as I’d used Gallery before, and Gallery2 actually uses a real database (yes, postgresql folks, I’m going to call MySQL a real database :), rather than some evil serialised php files on disk.
The installation process was relatively simple, however the problem was that after several attempts I could not get the Gallery2 multisite installation to actually work. Ideally this should mean (I believe) sharing the same Gallery2 source code between both sites and having separate databases and pictures folders (of course, would have been much nicer if I could just have one pictures folder and a database that pointed different sites at differently organised views of that folder, but I digress).

So eventually the installation was to use two separate Gallery2 installs, one for each site, and ignore the evil multisite option, then upload the photos using n

Sadly I suspect I could have written my own basic album software in the time it took to mess around with the more complex multisite Gallery2 configuration. Although then I’d also have to write the Wordpress plugin.
I guess I could always check out CopperMine. Sadly I’d prefer the ‘direct from iPhoto’ approach of myPhoto, but I’ve never been able to get it to work for me.

Hopefully the pictures should be appearing in the sidebar now, so please give them a look.

A long 30 days

Saturday, October 14th, 2006

Did anyone else notice that their copy of BBEdit 8.5 gives you a 30 day demo period and when it expires says that you can only use the product for another 30 days? I’m guessing that’s one of the undocumented fixes in BBEdit 8.5.1.

Apple fights AIDS with iPods

Saturday, October 14th, 2006

Apple have announced they’re giving US$10 to the Global Fund to fight AIDS in Africa with every purchase of (what they seem to be calling ) “iPod nano PRODUCT (RED)”, a name that’s sure to strike fear into the hearts of anyone who has to say it out loud.

Unfortunately it’s only available in the 4Gb version. I’d opt for the 8GB version and a $20 donation if it was available. Or I guess I could just buy two and duct tape them together or something.

Although the idea of a red American Express card is appealing, even if it does look kind of pink.

Death, taxes, security updates

Tuesday, October 10th, 2006

So, now I have to update PHP, (due to an error that’s actually an unfixable race condition design flaw according to the Hardened PHP folks and AusCERT), phpMyAdmin, and OpenVPN.

And when I ran the usual fink-selfupdate it told me that the 10.4-transitional branch is now superseded by 10.4, and I need to either get the installer and start from scratch, or run the updater script which complains to me:

Can’t locate Fink/Bootstrap.pm in @INC (@INC contains: /System/Library/Perl/5.8.6/darwin-thread-multi-2level /System/Library/Perl/5.8.6 /Library/Perl/5.8.6/darwin-thread-multi-2level /Library/Perl/5.8.6 /Library/Perl /Network/Library/Perl/5.8.6/darwin-thread-multi-2level /Network/Library/Perl/5.8.6 /Network/Library/Perl /System/Library/Perl/Extras/5.8.6/darwin-thread-multi-2level /System/Library/Perl/Extras/5.8.6 /Library/Perl/5.8.1/darwin-thread-multi-2level /Library/Perl/5.8.1 .) at ./update.pl line 36.

Mac OS X 10.4.8 kernel panic on Mac Pro software RAIDed boot volumes

Tuesday, October 10th, 2006

Apple have released a tech note that indicates if you’re updating a Mac Pro that boots off a software RAIDed volume to 10.4.8 you should do it whilst booted off a different volume, otherwise you’ll get kernel panics at boot.

  • JoyOfTech

  • Recent Comments

  • Was it useful? Was it funny? Was it weird? Please tip the author!
  • Pages

  • Archives

  • Meta