last.fm's Taste-o-meter
I'm not a big fan of social networking sites, but last.fm is different. It actually has a point - you can use it to discover new music, keep tabs on your more distant friends, create groups, track events etc. It's useful and actually fun to use.

One thing I think could work better is the Taste-o-meter. It seems it's also the basis of the Neighbours feature. It could be a little smarter - instead of just counting the artists two users have in common, it could compare the relative "rareness" of that particular artist. Everyone listens to Foo Fighters or Tool or DJ Shadow or whatnot but that doesn't mean they actually have anything else in common. This creates the anomaly where someone with 40 000 played tracks is suddenly neighbours with everyone. Now if two people both listen to an obscure Finnish accordion-jazz ensemble, the chances are, they have a lot more in common as well and that they should definitely check out what other tracks they've played.

I thought this idea was pretty cool so I sent it in to last.fm but they never even acknowledged it, so I thought I'd stick it up here instead of just having it vanish into the ether.
|
Postmaster
Giving your (admin) account the "postmaster" alias doesn't actually do anything because /etc/postfix/aliases hardwires postmaster to root and that sends mail to /dev/null. I fixed this by setting the "root" config var in aliases.

In other news, watch out for failed user-specific crontab entries. Sometimes (more than once) running
> crontab -u user -e

will simply hang, creating a tmp.something into /var/cron/tabs. This drives cron mad, eating up all the cycles it can. To fix is to basically pull a:
$ rm -rf /var/cron/tabs/tmp.*
$ killall cron -SIGHUP

|
Emulators over RDC
Always remember to keep the sound option at "Play on remote computer". I tend to leave mine at "Do not play" and then wonder why the S60 emulator will launch and then quit after about 20 seconds.

Pasted Graphic

|
Amavis gone haywire
The problem:
Jan 22 17:57:59 server postfix/qmgr[29037]: warning: mail for [127.0.0.1]:10024 is using up 20000 of 20000 active queue entries
Jan 22 17:57:59 server postfix/qmgr[29037]: warning: you may need to reduce smtp-amavis connect and helo timeouts
Jan 22 17:57:59 server postfix/qmgr[29037]: warning: so that Postfix quickly skips unavailable hosts
Jan 22 17:57:59 server postfix/qmgr[29037]: warning: you may need to increase the main.cf minimal_backoff_time and maximal_backoff_time
Jan 22 17:57:59 server postfix/qmgr[29037]: warning: so that Postfix wastes less time on undeliverable mail
Jan 22 17:57:59 server postfix/qmgr[29037]: warning: you may need to increase the master.cf smtp-amavis process limit
Jan 22 17:57:59 server postfix/qmgr[29037]: warning: please avoid flushing the whole queue when you have
Jan 22 17:57:59 server postfix/qmgr[29037]: warning: lots of deferred mail, that is bad for performance
Jan 22 17:57:59 server postfix/qmgr[29037]: warning: to turn off these warnings specify: qmgr_clog_warn_time = 0


The solution (found from the postsuper manpage):
> mailq | tail +2 | awk  'BEGIN { RS = "" } / spam@host$/ { print $1 }' | tr -d '*!' | postsuper -d -
/ snip /
postsuper: Deleted: 39819 messages


The cause:
I wish I knew...
|
Bruce Is Back!
The Final Cut mascot. It turns out that starting from 5.1 you have to call up the Video Scopes and control-click in the vectorscope. He's alot braver now too. You can actually move the FCP windows around and he'll just sit there. This picture was taken with the Finder as the background:

Pasted Graphic 1

|
As If Nothing Ever Happened
To restore a customised and updated machine so that it looks as if it's never been booted:

Boot to single-user mode
> mount -uw /
> rm -rf /Users/* /var/db/netinfo/local.nidb /var/db/.AppleSetupDone /Library/Preferences/* /Library/Caches/*
> shutdown now

|
Remembering the QTVR Pan Angle
This only works with Safari:
QT_WriteOBJECT_XHTML (
'myVRmovie.mov', 800, 600, '',
'controller', 'true',
'id', 'myvrmovie',
'cache', 'true',
'pan', getAngle ());

... where getAngle() just uses a cookie:
function getAngle ()
{
return document.cookie.split ('=')[1];
}

... which is set with setAngle () like thus:
function setAngle ()
{
document.cookie = 'angle=' + Math.floor (document.myvrmovie.GetPanAngle ());
}

Finally, the hotspots are wired to go through this function:
function openPage (url)
{
setAngle ();
window.location (url);
}

|
Creating Empty Files of Any Size
This is again one of those cool things that you could never do with OS 9 or older:
> dd count=`echo $((1024*1024/512*sizeinmegs))` if=/dev/zero of=myfile.zeros

Perfect for testing drives, networks or file transfer apps.
Update:
man mkfile

|
A Good Year
Speaking of MacWorld and Apple history, here's a "blast from the past" I found while going through some old stuff:

mw-small
That was a pretty good year! And it'll be 10 years this year since Jobs came back, btw.

|
Revitilizing Camino's Flashblock
I noticed the little FlashBlock checkbox in CaminoTools wasn't actually doing anything. It's supposed to disable all flash content until you click on it. Turns out this is achieved with simple CSS and here's how you enable it:
> cd ~/Library/Application\ Support/Camino/chrome
> cat > ./flashblock.css << EOF
/* Prevent flash animations from playing until you click on them. */
object[classid$=":D27CDB6E-AE6D-11cf-96B8-444553540000"],
object[codebase*="swflash.cab"],
object[type="application/x-shockwave-flash"],
embed[type="application/x-shockwave-flash"]
{ -moz-binding: url("http://www.cs.hmc.edu/~jruderma/clickToView.xml#ctv"); }
EOF

and then just include that css file in your userContent.css:
> echo "@import url(flashblock.css);" >> ./userContent.css

I think this is a pretty useful thing to do to Camino since many Flash objects seem to slow it down to a crawl.
|
Smartphone Market Share
I'm really excited about the iPhone. Finally a mobile device that looks great, tackles some serious UI problems with fresh ideas and sports a "real" operating system, made by the same house as the HW to boot (although the specs on that one are still nowhere to be found). They could've dropped the camera to maybe squeeze some extra batter life out of it, but nevermind. Got me excited about mobile app development again! A couple of things I didn't quite get:

Pasted Graphic 2


The mobile phone market - 952 million units. Yeah, but how many of those were actually smartphones? Hard to find any exact evidence, but Symbian reports shipping 37 mil units in 2006 and they're almost 73 % of the whole smartphone market. In other words, smartphones sell waaay less than digital cameras. Frankly, I'm quite surprised they'd let this kind of bug slip into the Keynote.

CalDAV support. One of the biggest reasons why companies buy expensive Nokia Communicators with even more expensive Exchange servers is they provide an end-to-end "cross platform" solution. OK, you can make Exchange email work over IMAP, but what about collaborative services, ie calendards? Apple's planning to put CalDAV support into Leopard server, but to this day thre's not a single CalDAV client for mobiles out there. Would've been nice if he'd touch on this subject, or at least showed a glimpse of the client running.

Good show otherwise. Apple TV looks really cool too. Thinking of buying one just for the sake of trying to make it work without iTunes (although I'm sure someone will have had it figured out by the end of this week).

One things's for sure - WWDC's gonna be awesome!

|
Are We Or Aren't We?
Everyone knows this by now. This is nice and I couldn't agree more:

1101061225_400

However, I found the Chrysler ad they run before this story on time.com to be a little umm... conflicting?

Pasted Graphic 3Pasted Graphic 4

I have a fairly sarcastic sense of humour, but even I don't get it. Are we or aren't we? Would be kind of a downer if they ran that after the story.

|
I Love Akamai (from now on)
Here's a cool 22 minute video showing how Akamai works which I found when researching for my thesis. Impressive would be an understatement. It's a little long, but definitely worth watching if you're into statistics or online content delivery:



There's actually all sorts of goodies on their site. Like this Dashboard Widget that shows you how much music business there's out there or the realtime metrics visualizations. Plus, they look cool too!

Pasted Graphic

|
Giving .doc an Icon
I don't work much with Word files, but when I do, the only major "problem" I have is that if you only have Pages and TextEdit installed, .doc files have a generic-looking white icon. It's easy to fix though:

/Applications/TextEdit.app > Show package contents > Contents > Resources
Duplicate rtf.icns and rename copy to doc.icns
From the Contents folder open Info.plist and into the CFBundleDocumentTypes array append:
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>doc</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>doc.icns</string>
<key>CFBundleTypeName</key>
<string>Microsoft Word Document</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>W8BN</string>
<string>W6BN</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>

Then flush the LaunchServices cache (this will reset all document/app associations so be prepared to be annoyed):
> cd /System/Library/Frameworks/ApplicationServices.framework/Frameworks/LaunchServices.framework/Support
> ./lsregister -kill -r -domain local -domain system -domain user

Pasted Graphic 1

|
ADC Student Membership
There doesn't seem to be much info out there on this subject, so here's my experience. Bought the student membership for 99 EUR, solely for the hardware discount (I'm sure that's the case for most people). The product listing also says you get the current version of OS X and a copy of XCode as well, but they're bundled with the machine anyway.

> priceOfMembership=99
> priceOfHardware=1408
> newPriceOfHardware=1275
> echo 'Total discount: ' $(($priceOfHardware-$newPriceOfHardware-$priceOfMembership)) 'EUR (' $(($newPriceOfHardware/$priceOfHardware*100)) '% )'
Total discount: 34 EUR ( 0 % )


The percentage is 0 because Bash's arithmetic's only deal with integer values (it's actually about 10%), but it may as well be, because you should also factor in the 30 min on the phone. From some online reports, you get the impression that the discount should be around 20 %. Is Apple discriminating it's European customers... again? It's bad enough they don't state the discount percentage in advance.

I'm having a hard time hiding my disappointment. All the hassle of getting the school papers, faxing them in, solving problems (it took more than 2 weeks for my student status to be verified, finally was able to get the student certificate in through email thanks to the helpful people at ADC, kudos to them) and waiting on the phone for 34 EUR? I understand that it's more useful when you buy something really expensive, but you'd think that student members aren't necessarily the ones driving those shiny Mac Pros or even MBP-s. Most of them can't even afford a Mac at all!!!

This was the first time I ever bought an ADC product. May very well be the last as well.
|
Display Sleep
I usually leave my Mac on when I go to bed. This means setting the display sleep to now or the next best thing, 1 minute. The most obvious way to do it is from System Prefs, but I wanted something faster:
> sudo pmset displaysleep 1

is great, but requires root prvileges (due to some of the other things you can do with it) so it's out for any kind of automation/scripting purpose.

Enter Apple Remote Desktop. Among other niceties, ARD includes a CLI utility called systemsetup that you can use to set various system preferences, like so:
> /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/systemsetup -setdisplaysleep 30

Nice. Time to wrap this into something Mac-like and give it a keyboard shortcut:
property ARDPath : "/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/systemsetup"

set currSleep to do shell script ARDPath & " -getdisplaysleep"

if (currSleep) does not end with "1 minutes" then
set newSleep to 1
else
set newSleep to 30
end if

do shell script ARDPath & " -setdisplaysleep " & newSleep

Throw that into ~/Library/Scripts and give it a fitting shortcut in System Prefs/Keyboard & Mouse.
|
Audio Transcoding with Automator
Got a bunch of FLAC files that I wanted to add to the iTunes library. Options: a) install the FLAC component and hope it works b) decode them with flac, import wavs to iTunes, delete the wavs or c) do point b), but with a click of a button:

Pasted Graphic

Pretty nice. I only wish QuickTime Player had such a nice Automator Library...

|