Main

3.09.10

file browser screenshot

The best way I've found to access files on a HFS+ formatted drive when running windows is the HFSExplorer by catacombae. It is small, no installation needed, and easy to use. Select files to extract, select target, go.

One downside is it's read only, and you need Java installed on your machine. Therefore don't forget to download JRE (look for the button "download JRE" and select your platform (eg. Windows).

1.12.09

I had to remove a complicated file from an external hard drive. When I tried to delete it via Finder / Trash, it said, unable to remove, file in use. Nevertheless it was possible to unmount the volume without errors, which means none of the current processes actually used that file.

No big deal I thought, let's just force delete it. And use the superuser command just in case it's an access rights problem:

$ sudo rm -f /Volumes/sams186/App.dmg

But this time it did not help: unable to remove. So I found that the resource fork could prevent files from being deleted. The resource fork is a file system structure which allows the system to store additional information to a file that does not belong to the file itself, but isn't a file system attribute either.

Open parenthesis:
File system attributes are properties of a file such as file name, block address, file size, etc. The number of file system attributes available and the constraints who apply vary from one file system format to another, which means HFS+ does not store exactly the same information as FAT32 or EXT3.

In the long listing of a directory, the existence of a resource fork is indicated with an @ after the access rights:

$ ls -al /Volumes/sams186/
-rw-r--r--@   1 damian  damian  224395264 16 Nov  2006 App.dmg

To show more information about the resource forks in the folder listing, use the @ parameter:

$ ls -al@ /Volumes/sams186/
-rw-r--r--@   1 damian  damian  224395264 16 Nov  2006 App.dmg
    com.apple.FinderInfo           32

To display the content of a resource fork:

$ xattr -l /Volumes/sams186/App.dmg

And finally, to delete a part of a resource fork:

$ xattr -d "com.apple.FinderInfo" /Volumes/sams186/App.dmg

Having removed that FinderInfo resource fork, the file could be removed without any problems.

24.03.09

The problem why Windows on a Mac was a pain in the ass is roughly the following:

  • If you use Bootcamp & an NTFS partition, you won't be able to access your Windows data from OS X
  • If you use Bootcamp & an Fat32 partition, you could access your data, but the installation will abort with an hardware abstraction layer (hal.dll) error (also see this german blog)
  • If you delete the 200mb partition, you can get over the HAL-error, but you're not able to remove the Win partition with the Bootcamp assistent anymore.

That was the dilemma... lose the flexibility to remove the Win partition easily, or don't be able to access your data. Until google published Mac FUSE which stands for File-system in USEr space. If you have some knowledge about the architecture of an operating system: this is a driver (running in kernel mode) allowing to use file system implementations in user mode, as the name suggests. But the really interesting feature is its implementation of a Linux file system API, making Linux file system adaptations ready to use on a mac. Amongst other [rethorical pause] NTFS!

Which solves us the problem described above. First install MacFUSE, and then the NTFS 3G driver and enjoy hasselfree Windows!

23.03.09

 

This might apply for any website where you enter text and preview it afterwards. I experienced a browser crash when writing the preceding blog entry. And as if a browser crash wasn't annoying enogh, I discovered I didn't save my blog entry when it was finished. Instead I previewed it and headed off doing other stuff, which ended in killing browser.

Sure, as a golden rule, always copy your text before you submit any form, since any website is suspect to lose your content. But I was young and foolish and didn't do that, and even the built-in autosave mechanism of Movable Type didn't save anything helpful.

But my luck was, I did preview it. The fact of previewing it made it possible to find it in the browsers' cache. I opened the terminal and entered the following:

grep <keyword> -r ~/Library/Caches/Firefox/

whereas <keyword> is to be substituted with a word that is for sure in your text but not very common. The same could be applied to Safari, which cache is accessible under ~/Library/Caches/Safari/. The output of the grep command is the filename followed by the line in which the keyword was found. If you found the right file, you can view the contents of the file with the command cat <path/to/file>.

26.05.08

Perian icon© Perian Project

What I was not aware of... I installed Perian some time ago, and it sat in my System Preferences, quietly doing its job. So, all of the behaviour described in the previous post apply only if you have Perian installed. Thanx to caillou for the hint.

Nevertheless MicroDVD (.sub) formatted subtitles will not work in Quicktime even if it's QT on Perian.

Perian is a great tool every Mac user should install. It doesn't change the way Quicktime looks, behaves, no warnings, no hassle with updates, completely transparent. But it allows you to watch a number of formats which are not supported by QT out of the box.

Summary: no troubles, only benefits - get it!

Did you already notice how Quicktime sometimes displays subtitles, and sometimes not? Yesterday I enlightened another mistery of Apple software. The information given hereafter may only apply to Quicktime 7.4.5 (QT), older (or future) versions may behave different.

For subtitles there are various formats and flavours. For digital movies, these are mostly plain text files with a file type .srt or .sub, usually associated with VLC. (Get a more complete overview on wikipedia)

Apparently QT understands only the SubRip dialect of subtitles, file type .srt. To view the file contents drag it onto the TextEdit icon in the Dock or use your favourite text editor.

1  
00:00:37,920 --> 00:00:40,800  
Love's a bitch

In order to associate the movie and the subtitle file, QT needs the subtitle file to begin with the movie name, i.e. film_name.avi will be matched with film_name_subtitles-whatever.srt. Unfortunately there seems to be no way to disable the subtitles once the movie is opened, except for closing the file, rename the subtitle file, and reopen the movie.

Now sometimes QT won't show the subtitles even if a .srt file is present and correctly named. Then it is possible that the file is in the also very popular MicroDVD format, which usually ends in .sub, but sometimes erroneously is named .srt.

{1271}{1343}Love's a bitch

To convert a format into another, there is a very handy Java application named Jubler which lets you open the subtitles in whatever format, edit, and export to whatever format you like. Enjoy!

Oh, and Jubler might ask you for the framerate (fps) of the respective movie. This is necessary since some formats are frames-dependent, and some are time-dependent. Open your movie in QT, press [CMD-i], and read the FPS indication.

Web resources: subtitles download site, deutsche untertitel platform, subtitles generator app

Update: This only works if Perian is installed. Check the next post for more information.

27.04.08

Keywurl icon©purefiction.net

Safari keyword expansion can be pretty frustrating. I usually have an plugin to fasten search on the web, I type "w Firefox" and the browser expands it to "http://en.wikipedia.org/wiki/Firefox". The use is supposed to be analoguous to the behaviour I described in Firefox autocomplete some time ago, hence the title of this post.

But, these plugins often get out-dated. Either they don't work with the new Safari version, or I update the underlying SIMBL package and break the compatibility, or both of them.

Up to now, I've had 3 plugins:

  • AutoCompleter by Catchy Software, which ... "has now closed for business" probably in 2007 already.
  • SafariSIA (Search In Address) by Alloc Software, of which the last release dates to ... *surprise* ... 09/18/2006
  • Keywurl by purefiction.net, which was released on Mar 21, 2008!

Finally, my search has an end. Now I'm using:

  • Mac OS X 10.5.2
  • Safari 3.1 (5525.13)
  • SIMBL 0.8.2
  • Keywurl 1.3.5

And it works! Now I'm not sure if I should dare that Safari to v3.1.1 which is waiting. Never change a running system!

Update 22.05.08: Finally I dared to update to Safari 3.1.1, and I am glad to say, it works, even Pithhelmet!

4.02.08

head of a leopard

My MacBook Pro finally runs with Leopard. Though the update ran quite seamlessly, some nuisances remain:

  • the Dock is plain ugly, on the bottom *and* on the side
  • CocoaSuite (formally CocoaGestures) is not yet Leopard compatible, fortunately a beta is available
  • ForgetMeNot somehow won't work, though supposed
  • my favourite text editor (SubEthaEdit v.2) and IM client (Fire v1.5) crashes on launch

But there are also positive changes to note:

  • the Leopard version of FrontRow is *way* better
  • the transparent MenuBar is less irritating than I had expected
  • DVD-Player, FrontRow and Quicktime are more coherent in user interface
  • PithHelmet finally works again
  • iCal icon in the Dock always shows the correct date, not only when opened
  • Time Machine is very easy to set up and use

More to follow...

27.01.08

Install Mac OS X icon

Speaking of backups... Yesterday my Mac mini suddenly showed an empty background and didn't react to any keyboard commands. Once rebooting it always hang after the command

kernel[0]: IOBluetoothHCIController::start Idle Timer

So now I'll give a chronical of how I tried to fix it.

  • Boot from Tiger (10.4) install disk, Disk Utility, Verify Disk
    Volume needs repair
    Repair Disk
    Repairing disk failed. Underlying task reported failure
    still not booting
  • Boot from Leopard (10.5) install disk, Disk Utility, Verify Disk
    The volume appears to be OK
    still not ...
  • Boot from Panther (10.3.7) install disk, Disk Utility, Repair Disk
    Repairing disk failed. Underlying task reported failure
    still ...
  • Boot from DiskWarrior (3.0.2) emergency Disk
    computer hangs during boot from CD
  • Boot into FireWire Target mode, host is running Tiger (10.4.11), Disk Utility, Repair Disk
    Verify/repair finished on volume
    ...
  • Boot from Tiger (10.4) install disk, Disk Utility, Verify Disk
    The volume appears to be OK

Apparantly the file system is okay now, but the files have been corrupted. So I re-install the system, choosing the option "Archive & install", which is actually not the best option. I should have chosen the standard "Upgrade" which would have kept my user settings the way they were. Like this I had to do some fiddeling with the old user account until it was ready to use.

12.08.07

ipod with exclamation point screen© Apple Inc.

Today, without any reason an application popped up, I've never seen it before, and it tells me, there are "currently no conflicts to resolve." The one and only button of the window quits the application, and as sudden as it has come up, it has vanished again.

Ooookayy?!? Quite startled from that intermezzo I google for this app, and find an entry in the Apple Mac OS X 10.4 Help describing the app:

Occasionally when synchronizing the information on your computer, Mac OS X synchronization services may discover two or more different copies of the same record on .Mac, on your computer, or on one of your devices. (...) In this case, .Mac synchronization services presents the Conflict Resolver and asks you which of these changes you wish to keep.

Aha. Not that I'm really relieved to know that anything anywhere in my system is sync'ing without my knowlege... and additionally lanches the Conflict Resolver for no reason. Hope that no security issue will be published these days!

Kurzfassung auf Deutsch: Heute machte ich Bekanntschaft mit einem neuen Programm in OS X: dem Sync-Abgleich. Das Programm hilft, wenn Versionskonflikte bei einem Synchronisationsprozess auftreten. Dabei war ich gar nicht am synchronisieren ... seeeeehr interessant! Nicht dass ich es beruhigend fände, wenn mein System irgendwo irgendetwas synchronisiert, und dann zu allem Überfluss noch den Sync-Abgleich startet, nur um mir mitzuteilen, dass es "zurzeit keine zu lösende Probleme" gibt. Hoffentlich kommt nicht in den nächsten Tagen eine Sicherheitslück mit der Beschreibung!

20.07.07

sad mac icon© 1995-2003 Apple

How to add a folder permanently to the PATH variable of your Mac OS X environment:

echo 'export PATH=/your/path/:$PATH' >> ~/.bash_profile

Notes:

  • /your/path/ for instance could be /usr/local/bin/
  • the config file for the standard terminal in OS X is not .bashrc
  • sometimes .bashrc contains instructions although not used, you may want to keep these by using mv ~/.bashrc ~/.bash_profile
  • make sure you use the apostrophe and not quotation marks, because "$PATH" would replace $PATH with the actual content of the path variable
  • the >> is used to append the output of the preceding command to the file, thus preserving the contents of the file
  • to check what your current bash profile looks like, use cat ~/.bash_profile

Update: I forgot to mention, but you can similarly export any environment variable permanently, for instance:

echo 'export SVN_EDITOR=VIM' >> ~/.bash_profile

18.06.07

emi copy controlled logo

Eben wollte ich die CD einer Freundin auf meinem Rechner abspielen. Nach dem einschieben tauchten 2 CD-Icons im Finder auf, eine AUDIO und eine Audio-CD. iTunes, welches bei mir automatisch beim Einlegen einer Musik-CD automatisch gestartet wird, reagierte nicht mehr und musste über Sofort beenden... [CMD-ALT-ESC] abgeschossen werden, das Festplattendienstprogramm ebenfalls.

Ein Blick auf die CD-Hülle verriet den Übeltäter: "Copy Controlled", der Kopierschutz von EMI. Grund genug, die Sache mal genauer unter die Lupe zu nehmen:

Die AUDIO-Partition enthielt eine Player-Software für Windows, und für OS 9 / Classic – welches auf der Intel-Architektur nicht mehr unterstützt wird.
Die Audio-CD-Partition zeigte die auf der CD gespeicherten Stücke als AIFF-Dateien an.

Also hab ich mal die Dateien im Finder auf den Rechner kopiert. Funktioniert. Dann die CD ausgeworfen, und iTunes gestartet. Die Dateien in iTunes importiert – ohne Probleme. Erweitert > Auswahl konvertieren in AAC, und *hopp* ist die Musik in der Bibliothek.

So long, EMI, and thanks for all the fish! *

Nachtrag: Ich merke gerade, dass der Kopierschutz nicht mal zuverlässig funktioniert. Eine CD, die mit demselben System versehen war, liess sich in iTunes öffnen und sogar ohne Umwege importieren.

* Zitat der Delphine aus Douglas Adams "Hitchhiker's Guide To The Galaxy" HHGTG

6.06.07

MP hat wieder mal einen Dauerbrenner aufgegriffen: zuwenig Platz auf der Festplatte. Also muss etwas gelöscht werden. Aber was bloss?

Das findet man mit Hilfe von GrandPerspective am besten heraus: wo sitzen die grössten Speicherfresser?!

Für die Geeks: Interessant finde ich, dass sein Screenshot und meiner (oben) nicht soviele Ähnlichkeiten aufweisen. Aber das Gewusel an kleinen Dateien am linken Rand, das findet sich bei ihm in der rechten oberen Ecke wieder, das sind /System und /Applications.

Bei mir ist die grösste Datei, die zu sehen ist, /private/var/vm/sleepimage und die hat unabänderlich die Grösse meines Rams. Die restlichen grösseren Dateien wurden fast alle wegrationalisiert.

@MP: deine Platte ist 60GB gross? Das ist auch nicht gerade luxuriös, da kanns schnell mal zu eng werden.

28.05.07

apple mail with voice over cursor

Recently my mom called me, complaining her mac was very slow and there was a strange black frame around some buttons, often following the mouseclicks. The symptoms so far were unknown to me, so I told her to send me a screenshot.

A google search showed, that it was due to OS X's built-in voice over feature which gives an optical feedback where the current focus is. Thus my mother should hear her mac talking, and she's not yet old enough to have bad hearing.

files on desktop

But even the best ears won't help, if you turned the volume down... I told her to press command-F5 and everything was back to normal. (If she would've worked on a notebook, it would've been CMD-FN-F5.)

tab with voice over cursor

In retrospective, I wonder why there was no info panel in the bottom right corner. On my computer it showed up automatically. Maybe I've activated it by chance in the VoiceOver Utility, tab "Display", checkbox "Show Caption Panel".

files on desktop

Kurzfassung auf Deutsch: wenn du mal so komischen schwarzen Rahmen in OS X begegnen solltest, die nicht verschwinden, egal in welchem Programm, so ist wohl das Vorlese-Feature ausversehen aktiviert worden. Den Spuck wird man wieder los durch Apfel-F5 drücken (bei einem Laptop Apfel-fn-F5).

5.04.07

wait cursor

Today my mac hung when it ran out of battery. Well, it not actually hung in the sense freeze, rather the applications refused to work. I could switch between apps, some worked, but some showed me the spinning beachball of death. The symptoms where just as if you leave the network without unmounting a network volume.

After a while of patient waiting, I force-quitted most of the apps, but I had to use the power switch to really finish it...

wait cursor
After the reboot, I had a look in the console. I found up to 60 entries per 10 milliseconds (!) of the following error:

kernel[0]: SmartBatteryManager: retrying command 0x0f; retry due to absurd value _zero_

Sure, my battery showed to be empty, but still the computer worked. The sensors reported a completely empty battery: a condition under which the computer normally wouldn't work anymore. Probably the software ran into a never-meant-to-reach bit of code.

Suprisingly I found myself to be (according to google) the first person to have noticed this problem.

14.02.07

Apple AdressBook icon© 2007 Apple Inc.

Als ich mit Apple Adressbuch begonnen habe, meine Kontakte zu organisieren, habe ich nicht gerechnet, irgendwann mal im Ausland zu arbeiten. Ich habe meine schweizer Nummern ohne internationale Vorwahl eingegeben - was sich als Fehler erweisen sollte: Wenn ich mich im Ausland aufhalte, kann ich keine gespeicherte Nummer anrufen, die nicht mit 00 bzw. + beginnt.

Eine Suche bei Google nach Vorwahl und Applescript führte mich zu der Seite andare.ch, auf der David Reindl bereits ein gutes Applescript vorbereitet hatte. Allerdings führt das Ding einen vorbereitenden Test aus, um Fehlbedienung zu verhindern, der mir in die Quere kam. Also habe ich es umgeschrieben, so wie ich es brauchen kann: vorwahl_aendern.zip

Es arbeitet in 2 Schritten:

  1. Die Nummern mit internationaler Vorwahl 00xyz, die bereits Ausland-kompatibel sind, werden zu +xyz umgeschrieben.
  2. Die Nummern mit lokaler Vorwahl 0xyz werden international kompatibel umgeschrieben zu +41xyz.

Mit dieser Logik können unter der Voraussetzung, dass alle ausländischen Nummern bereits mit 00xyz oder +xyz notiert sind, fehlerfrei alle Nummern in einem Rutsch (naja, für Perfektionisten: mit zwei Loops) internationalisiert werden. Spart einen Haufen Zeit und Klickerei!

Das Skript kann natürlich auch schnell angepasst werden für Deutschland, Österreich oder sonst ein Land: Im Skripteditor die "+41" auf der 5.letzten Zeile mit der jeweiligen Landesvorwahl ersetzen. Vorausgesetzt wird jedoch, dass man ausschliesslich Nummern von einem Land ohne internationale Kennung hat.

16.01.07

Install Mac OS X icon© 2007 Apple Inc.

This post is an add-on to the post about shrinking an OS X DVD from september due to a question I received.

The Problem with the disk image file is the following: it stores the data in a precise logical block. When burning the DMG file, the logical block will become the physical block. If any data resides in the last block of the disk, the hdiutil command is not able to relocate this data onto another, empty block of the disk. Or rather than not being able it is not supposed to relocate any data since the DMG format is supposed to give an exact copy of the original disk.

So what can You do if You still want to resize an OS X DVD disk image? The only way I achieved to resize the file is to delete all the files in /System/Installation/Packages, resize the file, and put the packages back on. It is not absolutely sure this works since it depends on the low level layout of the original disk, but for mine it worked.

If You are interested in further information about file systems, You may want to visit the following pages:
wikipedia.org/HFS_Plus
wikipedia.org/Inode

7.01.07

iCal icon© 2007 Apple Inc.

Why does iCal suck for professional use? You don't have week numbers!

Remedy: Use NumSemaine to generate a calendar telling you the week. My favourite settings is "Mark on the 1rst day, schedule event 07:00" as my iCal day begins at 7AM. Like this it doesn't add an all-day event which consumes too much space in my eyes.

This year, there was no confusion about week 01 since the first of January was a Monday. But next year, week 01 will start with the 4. of January according to the ISO specification:

[...] the first week of a new year is the week that has the majority of its days in the new year. Week 01 might also contain days from the previous year [...]

In the case that week 01 contains days from the previous year, you also can set the start date manually.

17.12.06

In the backend movable type shows the number of written post. But how can You tell? Since in the frontend there is no counter displayed, you have to use a little helper application: WordService (download).

This application shows up in any Cocoa application in the Services menu. It features (amongst other): Remove multiple spaces, sort lines, format caps and lowercase, rotate 13, and statistics. So mark all the entries in my full post list and select the statistics function in the Services menu – and here You go.

6.12.06

forget-me-not-2.jpg Forget-me-not is not only the name of a pretty tiny flower but also of a very useful software. I am even tempted to write "very" in italic to stress how useful it is.

It helps me be less aggressive to my Mac: About 5 minutes ago I felt a savage whish to throw something across the room. Now why, you're asking. Not that the Mac made a mistake, it was me who made the mistake. But it didn't prevent me from making the mistake to close Safari with about thousand tabs open. And for some unknown reason Taboo has not yet been compiled as universal binary.

So ForgetMeNot doesn't ask if You are sure to close Safari even with tabs, but it remembers the tabs and reopens the websites if You reopen Safari. The upside: You can even keep surfing across a Security Update with reboot. The downside: any form data (such as a blog entry) is lost if the forma hasn't been submitted.

12.11.06

After lots of testing and rebooting I have found that any (primary) hard drive partitioning beyond boot camp is not really trivial.

My experiment:

  1. Create a "normal" boot camp setting (OS X & Win XP)
  2. Modify the created partitions in order to boot another Tiger (true OS X dual boot)
  3. Re-instate the former setting of an HFS+ partition and a FAT32 partition without complete repartition

After extensive testing of virtually any OS X programm and command I've found that there is one very important thing: boot from another drive. OS X doesn't allow such modification as described above on the primary hard disk. If You've once booted from an external (or secondary) drive, You can use the following command:

diskutil eraseVolume [format] newName <nonbootable>

i.e. diskutil eraseVolume "HFS+" SecondOSX disk0s3
or diskutil eraseVolume "MS-DOS FAT32" Win disk0s3

I'm not really sure whether You ought to use sudo or not, so if it won't work You know what to do. And don't try to use these commands when booting from Your primary hard disk – it might not tell You that the command didn't complete successfully, but it really won't work.

Oh, I almost forgot: I'm back online again! What a luxury to have internet at home! But, as always, You don't know what You've got until it's gone...

19.09.06

Ever being hassled by the alert: "This software cannot be installed on this computer."? Make it the last time:

rm "/Volumes/Mac OS X Install Disc 1/System/Installation/Packages/OSInstall.mpkg/Contents/OSInstall.dist"

At the beginning of the installation, it will show the dialog that the installer will verify the hardware, but it will perform no checks anymore.

While I was already at it, I tried to copy the my favourite OS X App's (such as DiskWarrior) into the Applications/Utilities folder of the image. I modified the file

/System/Installation/CDIS/Installation\ Log.app/Contents/Resources/InstallerMenuAdditions.plist

to make those custom applications show in the menu during installation along with the Terminal and Disk Utility, but somehow this did not work. There must be some kind of protection that keep unintende applications from showing in that menu, but at least in the cleartext files I haven't found any hint.

Also I wonder if the PowerPC binary really would work, i.e. if Rosetta is present during the installation.

18.09.06

Actually, this is not really specific for intel DVD's but it might work for any OS X DVD:

  • Use Disk Utility to make a read-write image of the (dual layer) original Apple DVD, mine is called AppleOSX_DVD.dmg and resides on the Desktop
  • In order to make it fit on a single layer DVD, remove stuff from the disk image that won't be used: The XCode Tools Folder, and all files in /System/Installation/Packages (You can still put folders back onto the disk image after resizing the image file).
  • In the Terminal: hdiutil resize -size 4.3g ~/Desktop/AppleOSX_DVD.dmg (online man page)

According to well informed resources on TUAW and onmac.net this works. Now if You receive the error: hdiutil: resize request is below minimum size allowed then You have not really deleted all the directories I indicated. Check back with hdiutil resize -limits ~/Desktop/AppleOSX_DVD.dmg and find the minimum size (first number, in 512b sectors) equal the current size (second number). And don't forget to empty the trash ;)

2.09.06

The plan
My sister's iMac G3 needed a new installation of OS X due to a harddisk failure. The Computer was currently running, but when it hit a bad spot on the drive, it became inreactive (spinning beachball of death) for about 5min. 'Easy job' I thought, 'pretty straight forward:'

  • Prepare and configure a fresh OS X on an external firewire 2,5'' harddisk
  • Buy a new internal 3,5'' hardisk and install it
  • Boot from the external drive
  • Carbon copy clone the system from the external to the interal drive

The problems
But things are not always as easy as they seem at first glance...

  • For some unknown reason, the iMac will not boot from the external drive
  • The system CD of a Mac Mini G4 I brought along will not install: "Hardware doesn't meet requirements"
  • When booting from that CD there is no Terminal nor Finder available which could be used to copy the files (I really was convinced there was a Terminal available?!?)
  • The 2,5'' disk can't be used as interal harddisk because I have no 2,5'' IDE adapter

The solution
I took me quite a second to figure out how I can transfer the system. But here is the solution:

  • Boot from the system CD
  • Use the Disk Utility to create a disk image of the firewire drive and save it to the internal harddisk:
    • Utilities -> Disk Utility
    • Select the partition on the external disk
    • File -> New -> Disk Image from disk1s3 (or similar)
    • Image Format: read-only
    • Save to the internal drive
  • Restore the disk image with the Disk Utility to the internal drive (target can be the same partition where the disk image resides, thus disk image and target partition sizes doesn't have to match)

After all, easy job. If I'd only known from the beginning!

20.08.06

The symptoms:
An external firewire harddrive behaves normal right after startup. But after a short time, any attempt to access the drive will result in the "rotating wheel of death" - be it the finder, diskutility or the terminal. If I wait patiently for about 20 minutes, the functionality comes back to normal, until I want to access the damaged harddrive.

Failed remedy:
DiskWarrior, which is usually quite successfull, found the disk to be "too severely damaged for repair." What now? Give up all the data on the drive? Not before having tried all available means! (And, basically, the data is still there and accessible, at least for a moment after startup).

The home-grown remedy:

  • Boot the computer into single user mode (press CMD-S at startup)
  • Start the operating system but stay in single user mode: % sh /etc/rc
  • Connect the firewire drive and check which device number it has got:
    % ls dev (the device will have a name like disk1, the partition on it will be numbered subsequently disk1s1 and so on; usually, the partition You want is disk1s3)
  • Mount the partition sudo diskutil mount disk1s3 (although You are logged in as root You still have to use sudo to make it work)
  • Optionally check if the partition has mounted without troubles: % df
  • Access the data You want using % cp or % rsync (I suggest % sudo rsync -avPE [SRC] [DEST] since it continues the data transfer where it has left it)
  • Unmount the partition with % sudo diskutil unmount force disk1s3 if it is not responding (this may take quite a while, so you better be patient)

For me, this worked. I cannot yet tell whether it is a hardware or a software problem, but at least I got my data back.

18.08.06

Short description of how I backup today. Far less elegant than the coming TimeMachine feature of Leopard, not as complete, and not automated. But I hope until the release of the beast it will do.

As every average geek I have an other machine than my main computer around which is up about 24/7. This computer, in my case a Mac mini, disposes of much more HD space than my laptop (via external FireWire Rack).

The basic syntax of the command I use: rsync [OPTION] SRC [USER@]HOST:DEST
How the command for my purpose looks: sudo rsync -avzPE --stats --timeout=600 --exclude-from=.excludefilelist / damian@dbirdz.dyndns.org:/Volumes/300barracuda/MacBirdPro

What the different parts mean:

  • sudo : makes certain system files accessible and is necessary to preserve file owner
  • -a : archive mode (recursive; preserve symlinks, permissions, times, group, owner, devices)
  • -v : verbose, so You see what's going on
  • -z : compress file data, greater CPU load but less network traffic, thus mostly faster (not recommended if backup destination is on the same machine)
  • -P : keep partially transferred files (very important, avoids redundant data transfer) and show progress during transfer
  • -E : copy extended attributes (i.e. Mac specific resource fork)
  • --stats : give some file transfer stats after having finished
  • --timeout=600 : if a transfer fails, retry while 10min to finish job before giving up
  • --exclude-from=excludefilelist : it may be clever to exclude some file from the backup. my file looks about as follows (entries preceeded by a # are ignored):
#/Volumes  
.vol  
/dev  
/Network  
#/private/var/vm  
/private/var/vm/sleepimage  
#/Developer
  • / : indicates which is the source directory, thus the whole root partition
  • damian : the username on the remote machine
  • dbirdz.dyndns.org : DNS name or IP of the remote machine
  • /Volumes/300barracuda/MacBirdPro : path to the remote directory where the backup will be written

If rsync is not yet installed on Your machine, You can get it via fink or from the rsync homepage directly.

12.07.06

On a nightly ramble through the web I found a cool list of software essentials for advanced mac users on macworld.com.

A software gem that I'd like to share with you is GrandPerspective, and I can tell You it is really very useful. Thanks to the scan of this utility, I found out that the file /Users/damian/.psync.db eats up 8gb of my harddisk space.

E-I-G-H-T gigabites!!

I thought I was dreaming. If this ain't no (memory) leak the I'm going to distribute the presents instead of Santa Claus next Christmas!

What have we learned?

  1. Never trust a leaking application you haven't programmed yourself
  2. If You're rather short of disk space (as every computer geek), use GrandPerspective to analyse your disk space waste
  3. Never never ever again use psync!
    (try fink remove psync and sudo rm -f /usr/bin/psync)

update: A friend just informed me about a very similar tool called Disk Inventory X which:
a) seems to have wider functionality than GrandPerspective (first impression)
b) is not yet universal binary (though beta available)
and c) which seemed very hungry for resources on the first try (I didn't do any extensive testing).

9.07.06

Although usuall installers for OS X feature a GUI installer, there is the possibility to install via the command line:

sudo installer -pkg <pathToPackage> -target <mountPoint>
in concrete this could be
sudo installer -verbose -pkg /Volumes/Mono/Mono.macos10.ppc.pkg -target /

Fortunately not interactive (at least not as far as I know) therefore very effective!

22.06.06

Using Firefox's shortcut bookmark access system in combination with the Autocomplete Manager plugin can be quite tricky. It took me a moment to figure out a good way of handling it.

  1. Extras > Autocomplete Manager
  2. Autocomplete component in use: custom
  3. Suggestion Selection: Include bookmark addresses
  4. Suggestion Popup: Complete best match inline

This configures the autocomplete the way Safari handles it. But now the inline complete behaviour interferes with the shortcuts (sd, w) we are using, as it adds "http://www." in front of your shortcut. This can be avoided by: either typing very fast, which is not really realiable. Or rather beginning your shortcuts with a letter / symbol which is never first in an url – such as a hyphen.

You configure your bookmark keywords all with a hyphen in front, and it works great:

  • w –> http://www.what-ever-website-autocompleted.com
  • -w –> http://en.wikipedia.org/wiki/%s
  • -w Firefox –> http://en.wikipedia.org/wiki/Firefox

20.06.06

The application icon:

cp -f \   
/Applications/Safari.app/Contents/Resources/compass.icns \  
/Applications/Firefox.app/Contents/Resources/firefox.icns

Export your Bookmarks
use Safari Bookmark Exporter

Rename the application
o in the Finder/Dock shows up "Safarí": mv /Applications/Firefox.app /Applications/Safari\314\201.app

Make Firefox a nice browsing experience

Intelligent Bookmarks
Last but not least, use Firefox's clever Bookmark system for easy website access:

  • Open the bookmark manager
  • Select the properties of a bookmark
  • Name: slashdot
    Address: http://slashdot.org/
    Keyword: sd
  • Name: wikipedia
    Address: http://en.wikipedia.org/wiki/%s
    Keyword: w
  • Name: fizzle
    Address: chrome://fizzle/content/fizzle.xul
    Keyword: f

This enables you to type "sd" in the address bar, hit enter, and slashdot.org pops up. To access Wikipedia, you can type "w firefox", and you get the Firefox article of wikipedia "http://en.wikipedia.org/wiki/Firefox". To check your RSS feeds, type "f" and fizzle opens.

Update: see post firefox autocomplete for more precise information!

8.05.06

Ever wanted to transform a normal folder into a folder with a "Burn" button? Basically, if the folder has a burn button, it ist just folder with the (hidden) extension ".fpbf". But if you try to rename a folder in the Finder manually there will an error telling you that .fpbf ist a reserved extension and you cannot use it. Unless you get the terminal at hand: % mv my_folder new_cd.fpbf and *poof* you can burn the folder on CD's as you like.

5.05.06

The other day I thought about means to enhance battery life of my MacBook Pro. I'm used to the very looooong battery life of an 12" iBook, so the MBP's battery doesn't seem terrific to me. Besides the usual low brightness screen setting I disabled the second core via the Processor preference pane which is installed along with the CHUD tool from the developer tools.

Then I thought it would be great if, everytime you wake the system from sleep, a little script would check if the power adapter is plugged in and set the core's activities in function of that. It doesn't seem that there is a possibility to call a script on wakeup, but I found an alternative which can be called from your favourite app-launcher:

Use this link to create the applescript document or open the Scripteditor.app and paste the code below. Just preceed as described in the previous post: save as, enter a name, Application bundle. If you want to reactivate the core again, you have to change the applescript by uncommenting the line click menu item "2" of menu 1 of pop up button 1 and commenting the other line with two hyphens.

To change the number of active cores now, I hit [cmd][space] and type "mono" to save battery or "duo" when I need more power.

tell application "System Preferences"
    activate
    try
        set current pane to pane "Processor"
    on error
        display dialog "System Preferences pane \"Processor\" is not available.
You need Apple's CHUD-tools to be installed to change the number of active cores."
    end try
    try
        tell application "System Events"
            tell application process "System Preferences"
                activate
                tell window "Processor"
                    click pop up button 1
                    --to activate 2 cores:
                    --click menu item "2" of menu 1 of pop up button 1
                    --to activate 1 core:
                    click menu item "1" of menu 1 of pop up button 1
                end tell
            end tell
        end tell
        tell application "Finder"
            set visible of process "System Preferences" to false
        end tell
    on error
        tell application "System Preferences"
            activate
            set current pane to pane "com.apple.preference.universalaccess"
            display dialog "UI element scripting is not enabled. 
Check \"Enable access for assistive devices\""
        end tell
    end try
end tell

3.05.06

The last days I noticed that the MacBook Pro has a very inefficient sleep mode. If you are on the road for 4 hours not using your MBP, batter power is already below the critial 95%, and if you leave it over night, it wakes in the morning with less than 90%. This is quite annoying because every charge cycle decreases your battery capacity.

I've been looking for a way to activate hibernate on demand and found the hint "A helper script to enter SafeSleep on demand" on macosxhints.com. If you follow the discussion you see that there are other ways to do so, but the original hint works fine with me.

  • Use this link to create the Applescript document or open the Scripteditor.app and paste the code below:

    do shell script "/usr/bin/pmset -a hibernatemode 1" password "_password_" with administrator privileges
    ignoring application responses
        tell application "Finder" to sleep
        do shell script "(/bin/sleep 20 && /usr/bin/pmset -a hibernatemode 3) &> /dev/null &" password "_password_" with administrator privileges
    end ignoring
    
  • replace _password_ with your administrator password

  • save as; enter a name you want; select format "Application Bundle"; activate option "Run Only"
  • in the original hint it says you should add the following lines to the Info.plist file (rightclick on the application , show package contents, open contents, open the file):

    <key>LSUIElement</key>
    <string>1</string>
    

    I am not very sure what this is supposed to do but you might want to change it.

The number 20 tells how many seconds the computer presumably needs to go into hibernate sleep. After that the sleep mode is set back to normal sleep. If your computer goes into hibernate mode all the time you want to activate normal sleep, 20 seconds might be too short. The MBP takes rather long to go into sleep compared to PPC macs, so if you run this script on a PPC machine (with a rather small amount of RAM) you might substitute 20 with 15 or even 12.

11.04.06

The other day a friend sent me the link to a blogpost entitled like this one. I read the whole thing, but somehow it didn't work as expected. I always got an error upon opening the preferences panes for AutoPairs saying:

Preferences Error
You cannot open AutoPairs preferences pane on this computer. Contact the developer of this software for a newer version.

Very frustrated from this permanent error I wrote a comment to the blog, asking if this was just a hoax or something.

Then, after receiving a mail, I finally understood what to do:
  1. Rename the /Applications/System Preferences.app (lets say to "PPC Prefs.app") of a PPC System and make a ZIP file of it
    or download a diskimage containing the PPC Prefs App from me
  2. Then extract the PPC Prefs App in your Application folder of the Intel System and run it
  3. If you have AutoPairs on your System installed (i.e. it lingers in a Library/PreferencesPanes folder), you will be able to configure AutoPairs as you like, and it works as it used to on the PowerPC Mac!

(... and now I have to get rid again of that damn' reflex of making a closing bracket right after the opening one *g*)

2.04.06

Recently I discovered a quite handy thing: you can execute any PHP from the terminal using
% php my_script.php

Why would you want to do so? Because
  • no restriction in run time duration
  • runs with user or superuser rights
    % sudo php script.php
  • output can be redirected easily into a file
    % sudo php script.php > output.txt

More information on using PHP from the CLI in the PHP documentation.

29.03.06

Well, i admit the title was a little exagerated. I will explain how You can install the software on an Apple OS X install DVD that ships with a Mac on any other Mac.

Careful: It will not describe how to install the OS that comes with a Mac on another Mac but only the software bundled with it. I encountered this problem when I wanted to install some additional software from my MacBook Pro DVD on my older iBook.

First, where to find the Packages:
/Volumes/Mac OS X Install Disc 1/System/Installation/Packages/.packages/ on the first install disc:
  • Booth.pkg
  • CPU_ComicLife.pkg
  • CPU_QuickBooks.pkg
  • CPU_OfficeTDD_disc.pkg
  • CPU_OmniOutliner.pkg
  • Nanosaur
  • Marbleblast
  • and so on …

/Volumes/Mac OS X Install Disc 2/Packages/
on the second install disc (sometimes also /Volumes/Mac OS X Install Disc 2/Packages/.packages):
  • GarageBand.mpkg
  • iDVD.mpkg
  • iMovieHD.mpkg
  • iPhoto.mpkg
  • iWeb.mpkg
  • iWork Trial.mpkg

How to get there:
  • Open the Finder
  • press [CMD]-[SHIFT]-G
  • copy and paste the path given above into the dialog box
  • Finder opens directly a Folder with all the software packages

Some packages will be easy, some a little more difficult. If a package has the ending .pkg, such as Booth.pkg, You can double-click, and it will install.
But if a package has the ending .mpkg it is likely that You get an error when trying to install saying "The Software cannot be installed on this computer". Then You have to use the following workaround to trick the verification:
  • Open the Finder
  • right-click on the correspondig package
  • select "Show package contents"
  • open the "Contents" folder
  • open the "Resources" folder
  • double-click the all the packages You find and install them one by one; this way there will be no verification whether You are allowed to install the software or not

The software installed will work fine if the OS and CPU is compatible. For instance iLife '06 works great on my iBook.

19.03.06

I had some difficulties to get the emulator Q (based on QEMU) running on my Intelmac. Here is a little HowTo install Windows98 on OS X:
  • Download the unstable Build from kberg.ch/q/ or get it from my mirror.
  • If you already used a previous version, delete the preferences files
    ~/Library/Preferences/ch.kberg.q.plist
    ~/Library/Preferences/ch.kberg.qemu.plist
  • Open Q.app, click on the plus to add a new pc.
  • Disable the checkbox "Drivers: Show Disk with Q Windows Drivers".
  • Go to tab "Hardware", select in the "Harddisk" drop-down "Create other Diskimage...", go with the suggested settings (1024mb qcow).
  • Change "Boot from" to "CD-Rom" and finish your configuration with a click on "Create PC".
  • Insert the Windows98 installation CD into your Mac and press the run button (Start PC).
  • In the DOS prompt appearing follow the instructions to install windows:
    • Boot from CD ROM
    • Run Windows 98 Setup
    • Continue
    • Configure free space
    • Yes activate support
    • Confirm
    • Boot from CD ROM
    • Run Windows 98 Setup
  • And then follow the normal steps to install good ol' Win98.

18.03.06

Usually when you have an unreactive application, you can terminate it with the cmd-alt-esc dialog "quit application immediately". But sometimes it is a process which won't show up in that list. Then I get the terminal at hand, type top -u to find the PID, quit top with q and type kill . For most of the processes, this will do it perfectly. But today I had a process which was using up 100% of one of my cores and will not terminate with the above method.

How I got it killed finally:
$ kill -stop 24730
$ kill -term 24730
$ kill -kill 24730

After the kill -stop, the process stopped using my CPU at 100%. Maybe it would have been enough with only -stop and then -kill directly, but I haven't yet had the opportunity to test it.

Update: Well, it happened again, and I could verify my theory.

Update 2: I just found out that sudo kill -kill is actually sufficient to end a process who won't react to a 'normal' kill.

6.03.06

When I think back to that keynote of Steve when he revealed Apples switch to Intel... I was one of the harshest critics of that decision. I shook my head in front of my iBook G4 and thought "where are You going Apple?" Other computer manufacturers were switching to the Cell chip, and Apple turns the back on the modern, slick and powerful PowerPC architecture.

And now I am one of the first people to own an Intel-based mac, the MacBook Pro. Why this? Because I wouldn't ever want to change away from Apples smoothly designed hardware. And even more important I have gotten used to the practical and intuitive operating system OS X.

(Just to make myself clear - I don't think the turn towards the x86 CPU architecture was inevitable. For economic reasons it may have been the best decision. But it gave away a bit of the "be different" mentality of Apple. And now I gotta live with what I can't change… )

My first impressions of the MacBook Pro I am writing on: this is truly the Rolls Royce of all the Notebooks. Features like the integrated iSight camera, the indeed very very bright screen or the backlight keyboard make You just love this baby.

The system is faster than ever, the universal (Intel&PowerPC) software pops right into life when you want it, and Rosetta does its best to serve You any software you want to use. Any? A small bunch of app's will not run in rosetta an haven't been adapted yet.

The most painfully missing app's I've encountered so far - You only know the true value of something when it's gone!
  • CocoaGestures why won't that damn tab not close?
  • PithHelmet where has all that useful information gone among these ads?
  • AutoPairs there is a key for closing a bracket?

To the CocoaGesture and PithHelmet there is a fairly easy solution: activate the checkbox "Open using Rosetta" in the information window in the Finder of your favourite browser. The next time You open the application it will take a little longer to launch, but once the app is running, the speed loss is neglectable.

One thing I was very suprised to see working without any problems is the Cisco VPN. Just get the latest version (1.6 according to the official count, whereas it will report as 4.9.00 (0050) in the Finder), install it, and it works. And it works even better than before: I haven't had a problem with the kernelextension so far, wich was pretty frequent with the older version.

30.12.05

short summary of what didn't work with os x 10.4.3 and the x86 emulator bochs:
  • download the latest package from the bochs sourceforge page: the package would not compile. neither version 2.2.1 nor 2.2 can be compiled, not with .conf.macos nor .conf.macosx nor any other options.
  • get the latest build via cvs. same symptomes, compilation aborts.
  • download precompiled version with fink support: crashes without even prompting. download precompiled no-fink version (i have fink installed!!): open and run dlxlinux/bochs.scpt, prompts for action, but exits ASAP with the message: [MEM0 ] ROM: System BIOS image undefined.

and after about 5 hours of testing – when suicide has become a very attractive alternative – finally a magic window appeared in a bright light, surrounded by singing angels, with the words in it:
VGA BIOS - Version 2.40
...

a precise description of the narrow road to salvation:
  1. download Bochs-2.1.1-macos10.2noFink.dmg and copy the application to your hard disk
  2. launch the terminal. go to the dlxlinux folder inside the Bochs-2.1.1-folder. then launch bochs with the following magic command:
    % ../bochs.app/Contents/MacOS/bochs


21.09.05

sometimes spotlight turns foolish when you connect an external harddrive. you notice that your harddrive is under continous usage, the cpu usage is nearly 100% all the time, and a process with the name mds is using up your cpu.

the remedy to this situation is to turn spotlight indexing off for the specific volume. this can be done with the command mdutil.

there are several options to mdutil: mdutil [-pEs] [-i on | off] volume ...
volume ist the path to the volume, i.e. /Volumes/MacHD/
-i sets the indexing status
-E erases the store (database)
-s shows the indexing status

so to find out what status your drives are, you can run
sudo mdutil -s /Volumes/*

if you turn the indexing off for a volume, you might want to remove the store also to free up drive space:
sudo mdutil -E -i off /Volumes/ExternalDrive/

be careful about removing stores, it will take some time till they are rebuild from scratch. but sometimes spotlight behaves buggy, and then your only choice is to remove the store and begin over.

11.09.05

today i wondered why the dialogs are so slow on my mac mini. then it occurred to me that on my ibook i used a micro-hack to speed up appearance and disappearance time of certain dialog boxes.

defaults write NSGlobalDomain NSWindowResizeTime .07

this sets the animation time to what i think is the lower limit. if you enter a smaller time value, the animation will not look fluent any more. you might also set it to .001, which will not animate the dialogs anymore but they merely pop onto your screen.

a very nice variation is also to view the animation in full length and detail by setting the value to something like 2.0. with this setting, though, it is impossible to work productively. and if you perfectly liked the rather cosy speed of os x by default, then you can reset the value to .2.

for more defaults write tips, see the blog entry useful defaults write.

12.08.05

i've spent all morning around the net, looking for a smooth way to copy the harddisk of my pc to a new drive using my mac. i did not want just all files from the old drive on the new one, but i want a real low-level copy of the FAT32 partition including the MBR (master boot record) and the partition table and everything. (me personally, i would call it a binary copy, because it is a bit by bit copy, but apparently no one else calls it this way.)

the ultimate answer to this question, the universe, and everything was not 42 but exactly as short: dd

the most useful parameters of dd are:
  • if input file
  • of output file
  • bs block size (default 512)
  • count how many blocks to copy

a typical use of dd would be
dd if=/dev/disk1 of=~/file.iso
if the input and output file parameters are omitted, then dd just reads from standard input and writes to standard output.

the whole magic solution to my problem now is:
dd if=/dev/disk2 of=/dev/disk3
this will give me an exact bit by bit copy of my harddisk. i'm working with external harddrives and mac OS X - under linux, the device might be called /dev/hda or hdb. to find out which harddrive corresponds to which device use df. now before you write to a device, unmount it, else your OS might become instable. to unmount, use the diskutility of OS X or the disktool command: disktool -u disk3. the only hard thing is to trust your computer that its working, because there is no status indication. but if the drive is of a usual size, it might soon take an hour or two.

to copy a MBR of a FAT32-formatted drive to another one:
dd if=/dev/hda of=/dev/hdb bs=446 count=1
this can be done because the MBR is always located within the first 446 byte of your harddrive. in my case, i would use dd if=/dev/disk4 of=/dev/disk3 bs=446 count=1.

links:
Wonders of 'dd' and 'netcat': Cloning OS harddrives
Martin McKeay's Network Security Blog: Using DD to clone a HD

17.05.05

some interesting features of your os x can only be activated through modification of preferences, those files with the .plist extension. but if you don't have the developer tools, with which comes the property list editor app, then it is very cumbersome to modify these xml files.

for this case there exists the special command "defaults write" which will just do as well as the property list editor. open the terminal, paste the command, finish. here i note down the most common usages of this command.

  • defaults write com.apple.dashboard mcx-disabled -bool YES
    this disables the dashboard permanently. if you want to get rid of your dashboard because you use it rarely and don't want to waste your ram and cpu, just shut it down.

  • defaults write com.apple.itunes invertStoreLinks -bool YES
    ever noticed these small arrows in the itunes of your friend? they're very useful to jump to the selected artist or album - but!! usually, they jump to the itunes music store. unless you keep the alt-key pressed while klicking the link. or you change your preferences to stay local as default with the above command.

  • defaults write com.apple.Safari IncludeDebugMenu 1
    this activates the safari debug menu. for anybody with interests in web development there are some interesting options such as changing the the user agent string or viewing the dom tree.


all the above options should be executed while the corresponding application is not running (itunes, safari) or take effect on relaunch of the system (dashboard). they can be undone by substitute YES with NO or 1 with 0.

update: see also this entry: defaults write to speed up os x

14.05.05

today i noticed that php has no yet been activated on my tiger. so ... let's go to the terminal, get vim at hand, and learn some basic commands for this powerful unix text editor!

sudo vim /etc/httpd/httpd.conf
use sudo because the file is read-only for mortals. enter password, and welcome to vim. now type:
/php[enter] . . . . . . . . search for the first occurrence of the string "php"
0 . . . . . . . . jump to beginning of the line
x . . . . . . . . delete character under cursor (just in case: use u to undo...)
n . . . . . . . . find the next occurrences of the previous search string
nn . . . . . . . . continue search
0 . . . . . . . . jump ...
x . . . . . . . . delete ...
:wq . . . . . . . . write and quit.

so far for editing the config file. now restart the http-deamon with sudo apachectl graceful and your password. and there is your php, up and running.

just to mention some more useful vim commands:
64gg . . . . . . . . jump to line 64
gg . . . . . . . . jump to beginning of file
G . . . . . . . . jump to end of file
i . . . . . . . . change to insertion mode ("textmode")
[esc] . . . . . . . . end insertion mode
u . . . . . . . . undo last command
[ctrl]R . . . . . . . . redo last undo
. . . . . . . . . repeat last command
dd . . . . . . . . delete current line
yy . . . . . . . . copy current line (yank)
p . . . . . . . . paste line after cursor (put)
:q! . . . . . . . . quit and discard changes
for a more complete reference, see http://tnerual.eriogerg.free.fr/vim.html


13.05.05

before diving into the problem, i have to warn you: the problem is not yet solved, so don't expect any solutions. it's just attempts and approaches.

since updating to tiger, my motorola c350 via mini-usb is not recognized by isync any more. i then wanted to hack the isync 2 app and import code from the first version of isync. but it turned out not to be that simple... i will just tell what i know up to now:

  • in general, tiger recognizes the motorola. in the system profiler, i find:
    Motorola Phone (C350):
    Version: 0.01
    Bus Power (mA): 500
    Speed: Up to 12 Mb/sec
    Manufacturer: Motorola Inc.
    Product ID: 0x3802
    Vendor ID: 0x22b8

  • motorola knows no firmware update, at least not for the c350 via mini-usb. on the phone side, there is nothing i could change to make it work.

  • isync 2 works a lot different from isync 1.x. all isync2 device class definitions are stored inside the /Applications/iSync.app/ whereas with 1.x they where in the /System/Library/SyncServices/. the phone identifiers are stored in
    /Applications/iSync.app/Contents/PlugIns/, ApplePhoneConduit.syncdevice/Contents/PlugIns/, PhoneModelsSync.phoneplugin/Contents/Resources/MetaClasses.plist
    this corresponds partly to the list from version 1.x found in the file
    /System/Library/SyncServices/, MotorolaConduit.bundle/Contents/Resources/USBDevice.plist

  • in the MetaClasses.plist file, the phone is always referred to as "C350", whereas in the old USBDevice.plist, it is named "C350_GSM". i duplicated the section of the C350 and replaced all occurrances of C350 with C350_GSM, but with little success. sure pretty naive attempt, but i had to try it ;)

  • i opened the usb prober to see how the phone identified on low level communication:
    Full Speed device @ 2 (0x3B100000): Communication device: "Motorola Phone (C350)"
    ...
    Product String: 2 "Motorola Phone (C350)"
    ...
    Device VendorID/ProductID: 0x22B8/0x3802 (Motorola PCS)
    ...
    not really surprisingly, the information is the same also in the MetaClasse.plist, line 170:
    com.motorola.C350

    Identification

    com.apple.gmi+gmm
    "Motorola CE, Copyright 2000"+"GSM1900","GSM850","MODEL=C350"

    InheritsFrom

    com.motorola.usb.0x22B8/0x3802

    Services


    ServiceName
    com.apple.model
    ServiceProperties

    ModelName
    C350
    PhoneIcon
    MOTC350.tiff




so... thats all i found and tried out. in german you'd say "ich bin am ende meines lateins", which means as much as i have run out of ideas. if anyone has an idea, i am grateful for any hint.

ah, and by the way, my sources of inspiration were:
http://www.macgeekery.com/hacks/software/moto_v551_and_hacking_isync
http://www.macosxhints.com/article.php?story=20030916190731316

... to be continued ...


21.04.05

the other day i wanted to download some music and make a cd of it. unfortunately i did not see that the audio encoding was mpc or musepack format. i never heard of an os x compatible player for mpc, but a google search showed that there is a cli converter distributed by fink.
long story short, there are several issues i encountered today:

  1. $PATH:
    the environment variable didn't contain the path to my fink installation. seemed that the installation was somewhat old and the environment has not been set up. execute this command
    echo '. /sw/bin/init.sh' >> ~/.bash_profile
    and open a new terminal window. (thx to fritschi for the hint.)
    (for completeness sake, if you want to export any path to your $PATH variable: echo 'export PATH=/my/path:$PATH' >> ~/.bash_profile)

  2. fink:
    fink apropos mpc shows that there is only one matching package, namely mppdec. if you launch now the usual fink install routine with fink install mppdec, you will have to install "the following 7 additional packages:
    audiofile audiofile-bin audiofile-shlibs esound esound-bin esound-common esound-shlibs". this will probably take its time, so we will go for the precompiled libraries:
    sudo apt-get install mppdec

  3. mppdec:
    at first glance the mppdec command did not seem too complicated, but it took me some minutes to figure out how to make it work.
    mppdec --aiff /Users/damian/Desktop/myMusic/*.mpc /Users/damian/Desktop/myMusic
    did it pretty well for me. watch out for spaces or special chars in your path, it might make your shell cough. and notice that there is no trailing slash when indicating the output folder!

  4. mpc2aiff:
    for those who hate cli applications and don't like to work in the terminal (i can completely understand), there exists a gui or rather graphical frontend to mppdec called mpc2aiff.



13.04.05

my university provides means to access the intranet from outside or from wireless lan via a virtual private network. a client for os x has been developed as for windows and linux.

the installation is straight forward, and after a reboot the cisco vpn client lets you connect over a secure channel to the unifr network.

but sometimes the vpn client will not connect anymore, no matter what you do: restart the client, reconnect the wlan connection, logout and login. you had to restart the whole operating system just to get your f***ing vpn working again...

...up to now! because today, during distributed system classes, i had an enlightening idea: what about just restarting the vpn deamon? a quick
top -l 1 | grep -i "vpn" showed that the deamon cvpnd is also quit when exiting the vpn client. thus, there is no deamon permanently active. but what about a kernel extension? this was a more promising approach.
locate ".kext" | grep -i "vpn" showed me where to attack.

thus, the solution to the 'dead' vpn client is:

cd /System/Library/Extensions/
sudo kextunload CiscoVPN.kext
sudo kextload CiscoVPN.kext

.....aaaand you can enjoy your wireless freedom again! ain't life great?!

update:
i forgot to mention that you should quit your vpn client, and maybe also desactivate your airport card while reloading the kernel extension. i did not yet have another outage, so i couldn't do any further testing.

18.03.05

in os x, every user has a long name, like "Administrator", and a short name, like "admin". throughout the system they can be used as synonyms, except if you work with unix tools in a terminal. on unix level, only the short name is registered.

the long name can be modified from the system preferences, but having the short name set up once, it stays the way it is - officially, there is no way to change it. inofficially, there are ways to do it nevertheless.

a nearly complete guide can be found on www.rts-software.com. i made a local copy just in case the link broke. it indicates you the most important steps. but if the user name you want to change is the primary user (and administrator) of the computer, there are some additional steps to take:

  1. after replacing the home folder, there might be a folder which has the same name as your old user, because programs you use (or quit) after changing the home folder name will write files into your old ~/Library folder. delete this folder using the root account.
  2. after new login with new name, the current user has no rights to write in the applications folder. this is because the user is not yet registered as administrator. i guess there are two possibilities:
    • open the system preferences, select accounts, the newly created account, tab security, and mark the field "allow this user to administer this computer".
    • when doing the action described above, you enable the new user to administer, but you don't disable the old one. to make this more properly, open the netinfo manager, select /groups/admin, and replace the old with your new name.
  3. also in the netinfo manager, the old user continues to exist in /groups. select it, replace the old name with the new, and save.
  4. and finally, your system may still have a computer name related to the old name, accessible in the sharing settings of the system preferences.

now all traces of the old username should be gone. enjoy your new user!

(i will indicate the changes also to bryan schappel from rts-software.com so you might find some steps mentioned twice.)

5.03.05

if you want to write tex / latex files, there are two components you need: first a editor, and second the latex engine.

the editor can be any basic texteditor such as vim or emacs, or it can be more specified for the task of creating latex files, such as texshop, itexmac or texmaker. i will concentrate on texmaker and give here a detailled installing instruction.

you can get the latex engine with fink, or also with i-installer, which i will use here.

download (make sure you go for the II2.dmg and not the source code from sourceforge.net), copy to your hard drive, launch the i-installer. close the welcome dialog (dismiss) and select "known packages i-directory..." from the i-package menu. select the tex package and click "open i-package". in the new window that opens you choose the button "install & configure", and most probably a basic installation will do. also the 2004 version is your best choice.

for the texmaker editor, you best get the binary package for os 10.3 from www.xm1math.net/texmaker/, and follow the instructions on the website - untar, go to the directory, launch sudo sh INSTALL.sh.

if you get the "could not start the command" error when trying to build a latex file, then you should execute the ADDTEXPATH.sh script, logout and back in again. if it still doesn't work then, you probably have no latex engine installed, see the beginning of this entry.

if the texmaker binary doesn't work for you, you might want to checkout the entry to compile texmaker from scratch.

to be able to compile texmaker from scratch, you will need the qtlib. i will give you a step-by-step instructions to compile texmaker and qtlib from scratch:

  1. get the qt-mac-free from www.trolltech.com
  2. install the qtlib:

    • unzip the archive
    • copy it to /Developer
    • rename the folder to qt
    • execute the following commands in your terminal:
      QTDIR=/Developer/qt
      PATH=$QTDIR/bin:$PATH
      DYLD_LIBRARY_PATH=$QTDIR/lib:$DYLD_LIBRARY_PATH
      export QTDIR PATH DYLD_LIBRARY_PATH
      ln -s $QTDIR/doc/man $QTDIR/man
      cd $QTDIR
      ./configure
      /usr/bin/make

      (get yourself a good book, it took 2h20' on my ibook 12'' 1.2ghz)

  3. download the texmaker source from www.xm1math.net/texmaker/ and uncompress it.
  4. execute the following commands:
    cd /path-to-your-unzipped-texmaker-source
    sudo sh ./BUILD.sh

  5. enter the requested information:
    path to QT3: /Developer/qt
    PREFIX: /usr
    SYSTEM: 2

after successfull termination there is a texmaker application in your /Applications/Texmaker folder.

15.01.05

after i did this startup item thing, i soon noticed that it does not work properly:
for some strange reason, the command netstat will be terminated after runnning about 24h.

so, i went back to my good ol' cron jobs and added the netstat command, too:
# kill the netstat process
2 0 * * * root killall netstat
# restart the netstat proc
5 0 * * * root netstat -i -w 60 >> /Library/Logs/netstat.log &

this means, that any instance of netstat will be killed at the indicated intervall with the command killall, in contrast with kill you don't give a PID as argument, but a name (or also half a name). any process matching this pattern will be killed, so handle this command with care. as an additional security measure you have to have root rights to execute killall.

adding the netstat command to the crontab would have the inconviency that it is not actually startet at system startup, but:
  1. i do not reboot my server a lot, actually rather never, so i wouldn't care
  2. i did not yet remove the startup item. at boot, it is started, and the next midnight it is killed, and the crontab takes over seamlessly

5.01.05

i found a way to start netstat at system startup time. after some google searches to see what is executed at system startup, it found some very useful information on www.kernelthread.com, entitled "Mac OS X System Startup". there i read about /System/Library/StartupItems and /Library/StartupItems, which contains items to be executed at system startup.

after all, now that i have set up everything, i have to say that maybe i would have better done this in /Library, instead of /System/Library.

so here are some excerpts of my terminal to show what i did:
$ sudo mkdir /System/Library/StartupItems/NetStat
Password:
$ sudo emacs /System/Library/StartupItems/NetStat/NetStat

then i modified the file to look as follows:
#!/bin/sh

##
# Start the Network Statistics
##

. /etc/rc.common

ConsoleMessage "Starting netstat Network Statistics"
/usr/sbin/netstat -i -w 60 >> /Library/Logs/netstat.log &

having this set up analogous to, lets say, /System/Library/StartupItems/CrashReporter/CrashReporter (1), there is another file which seems to be needed:
$ sudo cp /System/Library/StartupItems/CrashReporter/StartupParameters.plist /System/Library/StartupItems/NetStat/

the presence of this file is necessary, otherwise the startupitem won't be executed, although its contents are secondary.
$ sudo emacs /System/Library/StartupItems/NetStat/StartupParameters.plist

now the correct properties to make it executable
$ sudo chmod 755 /System/Library/StartupItems/NetStat/NetStat

and leave no traces - the files with the ~ are automatically generated by emacs which creates a backup every time you open a file.
$ sudo rm -f /System/Library/StartupItems/CrashReporter/CrashReporter~
$ sudo rm -f /System/Library/StartupItems/NetStat/StartupParameters.plist~

now netstat is launched at startup, you can check it in system.log, look for a message "ConsoleMessage: Starting netstat Network Statistics".
combined with the log file treatment i introduced yesterday, this makes a useful tool for your network statistics.

(1) while you're at it, you may want to disable the annoying crashreporter - just comment out with hash key # the line which says /usr/libexec/crashreporterd and it will not launch at startup any more.

update: see also the information given some days later.

4.01.05

i have been looking for a utility on mac os x which would allow me to track or log my network traffic. after a fruitless search for a program who would do this for me, i got a hint for a command line tool: netstat

after having a look at the man page of netstat i knew that this is the utility i was looking for. now how to organize it so i can record and manage the activities in a useful way?

i need:
  • some independency from the terminal, i.e. write logs to a file
  • netstat should run all the time
  • logfile should not become too big

solutions i found:
$ sudo netstat -i -w 60 >> /Library/Logs/netstat.log &
calling netstat with parameter i makes it select the default network interface;
parameter w 60 makes it wait 60 seconds before it prints again.
sudo executes the command as root user.
>> appends the output to netstat.log, where i can access it easily with console.app.
& at the end frees the terminal, so i can use it again for other things.
watch out: if the terminal window is closed, also netstat is gone!

then, to keep this file at a reasonable size, i edited the crontab:
$ sudo emacs /private/etc/crontab
this is the file which keeps information about processes which have to be carried out regularly, so called cron jobs (1). it can only be changed changed with root rights, therefore use sudo.

it contains the following lines now:
1 * * * * root echo ============== >> /Library/Logs/netstat.log
1 * * * * root nice -n 20 date >> /Library/Logs/netstat.log
1 * * * * root echo ============== >> /Library/Logs/netstat.log
to make it easier to navigate in the log file, i print the hour and date every hour.
# each day at 00:03 backup the current netstat.log
3 0 * * * root nice -n 20 cat /Library/Logs/netstat.log >> /Library/Logs/netstat_bak.log
# after having made a backup, erase the current netstat.log
4 0 * * * root nice -n 20 rm -rf /Library/Logs/netstat.log
# erase at week interval the backup file
2 0 * * 1 root nice -n 20 rm -rf /Library/Logs/netstat_bak.log
adding the nice command before the actual command will cause the command to be executed with lowest priority (range is from -20, the highest, to 20, the lowest). for more information see $ man nice.

so this gives a handy solution which doesn't require any human intervention, except at startup i have to run the netstat command manually.

(1) a tutorial for crontab can be found on www.macdevcenter.com, which is actually entitled "learning the mac os x terminal" but in which the functionality of crontab is described pretty well.

update: see also the information given the following day.