Category Archives: Software

iTunes Cover Art without iTunesaccount on Intel Macs

If for some reason you don’t want to
use your iTunes account to fetch cover art for your music
collection, maybe this is for you.
fetchart
Aric Friesen has written an iTunes script called Fetch Art to fetch cover art for your songs from
Amazon.
Unfortunately it will only work on powerpc Macs, as it uses some
compiled perl modules which are not yet universal/intel.
Although the author stated that he is willing to build an universal
application if he would get donations (which according to some
guestbook entries, he already received), there is still no updated
application for intel Macs available, and the application will
crash, when it comes to downloading the cover art.”holy me”

Now don’t panic….
…so what we need to do is to call the perl module in Rosetta
mode.

What calls the perl module ?
– Perl.

Lets check perl:
kobaans-computer: kobaan$
which perl
/usr/bin/perl

kobaans-computer: kobaan$ file /usr/bin/perl
/usr/bin/perl: Mach-O universal binary with 2 architectures
/usr/bin/perl (for architecture i386): Mach-O executable i386
/usr/bin/perl (for architecture ppc): Mach-O executable
ppc

So, perl, is actually a universal binary, that means an intel
platform Mac will call the intel code natively.
Let’s correct this for the runtime of Fetch Art.

FIRST: make a backup of your original perl binary
kobaans-computer: kobaan$
sudo cp /usr/bin/perl /Users/kobaan/perl

SECOND: strip the intel code from the perl binary
kobaans-computer: kobaan$
sudo lipo -remove i386 /usr/bin/perl -o
/Users/kobaan/perl-ppc

THIRD: copy the stripped ppc-only binary of perl over the original
“location” of perl
kobaans-computer: kobaan$
sudo cp /Users/kobaan/perl-ppc /usr/bin/perl

What have we done:
kobaans-computer: kobaan$
file /usr/bin/perl
/usr/bin/perl: Mach-O universal binary with 1 architecture
/usr/bin/perl (for architecture ppc): Mach-O executable
ppc

What will happen if we call the Fetch Art script from within iTunes now….
… select your files, (choose your amazon store in preferences), and fetch the cover
art,
WOOOO its working using Rosetta, not fast, but working.

NOW, THE IMPORTANT LAST THING TO DO !!!
After using the script for your collection, quit Fetch Art, and copy back your original “universal” perl
binary.
kobaans-computer: kobaan$
sudo cp /Users/kobaan/perl /usr/bin/perl

Done . Everything back to normal.

Save your donations,
Kobaan.

Switching browser defaultapplications on Mac

Since I had to search a bit hard on
this one, you might be interested in HOW TO CHANGE A DEFAULT
APPLICATION that is called when you open a file within your
browser.I just wanted to click on a link, that proofed to be a
mms-video-stream, to open in my favorite video player VLC, instead it ended up
opening in the rosetta-translated ages old windows media player for
mac. That was simply a no go.

“was”

Searching through various preferences in Mac OS and its
applications, even within Firefox as
it is done on Windows…
…I found this entry (already fixed):

kobaans-computer:~ kobaan$
defaults find mms

Found 1 keys in domain ‘com.apple.LaunchServices’: {
LSHandlers = (
{LSHandlerRoleAll = “org.videolan.vlc”; LSHandlerURLScheme = mms;
}

Since modifying plist files can be tricky for some people (not
using developer tools, or being familiar with “vi” and/or
“defaults” class syntax) I found that great application (actually a
preferences panel) called RCDefaultApp, which can be used to change and inspect
almost every file/mime/uri/… handling on Mac OS easily.

Enjoy.
Kobaan.

First Steps Cocoa Programming

Well, if you wonder why my blog has
some gaps recently, it’s because of me doing my first steps towards
Cocoa
programming on MacOS
with XCode.
I didn’t do programming for a longer time, and a friend of mine
gave me that great book, that helps me a lot now to get into the
Objective-C slang, used for Cocoa.
In short terms, its really amazing how simple and structured Cocoa
programming with XCode actually is. And the best thing is,
objective-C has already implemented reference counting as this was
one of the best features of the Crystalspace 3D
Framework
, for which I contributed to for 3 years.
These are some screenshots of applications of my first steps
programming with the previous mentioned book.
A lottery application:
lottery
More or less, the same application in a GUI frontend:
randomapp
A letter counting GUI application:
lettercount
And my latest finished training chapter, a speaking text
application, with choose-able voices.
sayit
Really, really, big fun… stay tuned for more within the next
days.
Further I’m really looking forward to see all the great new
features of MacOS
Leopard’s XCode 3.0
, which is said to have graphical instant
performance tuning of running code…. wow… I really wanna see
this…
So far,
Kobaan.

Mac Mail application speedup,cleanup

For those of you experiencing
slowdowns on Mac OS’s Mail application over some time, this might
be a cheap trick for you to get back speed and disk-space.
Mail, is keeping track of mail message subjects in a database, to
quickly scan, search and organize threading in your
mailboxes.The good thing is: once you delete a mail, it is also gets deleted
in the database…
The bad thing is: a database needs to be maintained, and this is
not done automatically…

What does this mean now….
…your database deletes items by reference, but it does not free
up the allocated disk-space, thus blowing up your overall database
size which leads to longer access times as more (empty) data needs
to be parsed through.

The solution:

While your Mail application is NOT running…
…use a terminal and go into “cd ~/Library/Mail”…
…open the database with: “sqlite3 Envelope Index”…
…and free up the already deleted database disk-space using:
“vacuum subjects;”…
…et voila, quit sqlite3 and you’re done.

Mail will be quite fast again, and your disk capacity should show a
few more free blocks.

Mac – Eve of destruction

So less bytes and so deadly:
maceve
524946464407030057415645666D7420
1000000001000100007D000000000000
000000006461746120070300

I’m starting to get angry now, as I filed in this bug 1 year ago,
and there’s still no fix for such a trivial bug.
Also I filed it in as a security issue since you can crash every
Mac from remote with these little numbers, but Apple degraded it to
be cosmetic only as it is not possible to alter or execute
code.
I guess they’re not anymore interested in fixing Tiger, as the
Leopard is waiting for its victims…..

Hint: Check for zero values before dividing…..