Archive for the ‘General’ Category

My Ubuntu AFP server and the 1.5TB of Doom

Wednesday, December 16th, 2009

The bad part about my girlfriend moving in with me is that my friend who was living with me left and took our local sever with him. We had combined our spare hardware to build us a server and used his old computer because he had 4 ATA controllers and I had only 2. So now I had to configure my old PC to create a new server (’cause you just can’t live without one of those :) and bought an extra 1.5TB hard disk. That caused quite some trouble. Since the first wasn’t properly detected by my onboard SATA controller I returned it and the replacement seemed to work, only to be mounted as read-only after formatting it. After a while the disk wasn’t properly detected at all. I was surprised with two new disks having the exact same problem, fortunately so was the owner of the web shop where I bought it. He actually called me personally to discuss the situation and concluded that my SATA controller was probably to old to work properly with this big modern disk. So I bought an PCI eSATA controller which solved my problems.

Last weekend I took this card to my friend who also bought a new hard disk and was experiencing similar problems. After I put the card back my big disk wouldn’t mount anymore, though it worked fine when I booted the Ubuntu Live CD. Long story short (live cd: works, reinstall ubuntu: works, dist-upgrade: broken, reinstall: works, reboot: broken) there we suddenly some errors in the FS which fsck managed to fix.

Anyway, most of you aren’t at all interested in the above snipped of my life and want some technical information. Which you are going to get in the remaining part of this post. Hey, the benefit of people blogging technical stuff on their personal blog is that you have to read through the irrelevant stuff. Nothing is perfect, right?

Setting up ubuntu as an file server

I followed a great tutorial to set up AFP on my server which was very easy and everything works like a charm. Well, almost everything.

Permissions

Since there are two users connecting to the machine there are files created by both that also need to be accessed by both users. Setting the setgid bit on the shares directories and adding both users to a common group is a start, unfortunately there doesn’t seem to be a way to set the umask for newly created files using netatalk, so in order for other users to be able to write/delete these files I just add the group write permission with a hourly cron job. It’s ugly, but it does the job.

Time Machine

After a short time of backing up with Time Machine I got the infamous error 109.  Since this issue seems to have no solution and chances are slim Apple will do something about it since it they do not support it I decided to make only manual backups at night so they can run uninterrupted, and make backups of my time machine sparsebundle in case the backup gets broken. Yes, that does sound kind of redundant. It’s far from ideal, but a workable situation. I don’t need hourly backups anyway, I just want to have something in case of a hard disk crash or something like that.

Yesterday I read that netatalk 2.0.5 adds time machine support! Since the current version of netatalk in the ubuntu repo is still 2.0.4 I removed it and downloaded the netatalk-2.0.5-2 (and libdb4.8 which it depends on and is also not yet in the ubuntu repo) packages from the debian site and installed them with dpkg. This was all much easier than I expected since people on the web were warning others that this is not the proper way to go and everything might get broken and so on. After some initial errors (removing the .AppleDB directories after error -5014 and removing the old sparsebundle as root after error 109 on an partially removed sparsebundle) it now seems to work just fine.

Interesting to note is that with this new time machine support I indeed do not have to create the sparsebundle by hand and that it is now named Granny.sparsebundle (Granny is my laptops name) without the MAC adres. Also interesting is that TM started to continue backing up in a copy of an old backup I made by hand named Granny_macadres.copy.sparsebundle. Apparently the name of the backup is much more flexible nowadays.

Now I’m just going to make backups wireless hourly without paying attention to it (and thus interrupting it when putting my laptop to sleep) as I used to with my old Time Capsule and see if the new version of netatalk solves the problems I had. For now I’ve interrupted the initial backup several times now and it is still running (and continuing every time where it was interrupted). So far so good, I can at least say that it works more reliable than with the previous version of netatalk.

Update: after some initial success backing up to this AFP share is as unreliable as is was before, still getting a lot of 109 errors. Too bad. I decided to just buy an external USB/eSATA case and put the disk in that. It not expensive and works for sure, though I am deeply unhappy with the situation.

PDO: Configuring Apache, MySQL and PHP on OSX 10.5.7

Tuesday, September 29th, 2009

I’d like to use PDO in conjunction with MySQL, but in the PHP installation shipped with OS X by default only pdo_sqlite is enabled. I do not want to compile my own Apache or PHP so the way to go is to simply add the pdo_mysql module. I followed these instructions but after running phpize there were some warings on my screen and no makefile to be found. My current PHP version is 5.2.8 and I used the source of 5.3.0, so I tried again with 5.2.10 (since no other version was available at the PHP download page). Both yield the same result, namely that it compiles, installs and won’t start.

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20060613/pdo_mysql.so' - (null) in Unknown on line 0

Following instructions in the comment to remove all architectures but the x86_64 have no effect. I think I have to compile my own PHP installation and have apache use that. Which sucks so much I decided to just wait for Snow Leopard and pray that either pdo_mysql is installed or dynamicly loading libraries is allowed there. I am happy to inform you all that the first is the case. Hurray!

Snow Leopard

Tuesday, September 22nd, 2009

Once again I’ve installed some new OS and write a small post about it. This time it’s all about Snow Leopard and as usual this is probably more interesting for myself as a checklist sort of thing than for the world to read.

Installation

I’ve decided not to upgrade my existing installation of Leopard but to go for a fresh clean installation. Leopard was my first OS X installation and I’ve done quite some installating, customization and so forth and it sounded like a good idea to just start fresh. I remember reading something about a clean install option, but the installer just asks me for the location, gives me some options what to install and starts right away. I had to abort, reboot, and then used the disk utility on the installer DVD to first format my hard drive. Installation went smooth from that point on.

First impressions are as expected, it works smooth. I am surprised about the time it takes to wake from sleep, almost instantly, but that can also be because this installation is fresh and I was used to my old cluttered Leopard.

Afterwards

Time to install some.

  • Firefox 3.5
  • Growl 1.2b4, the latest beta of 1.2 because 1.1 is uncompatible with snow leopard. It seems to work fine, as does the HardwareGrowler.
  • Perian 1.1.4
  • Spark 3.0b9 for global hotkeys
  • iWork ‘09 en iLife ‘09
  • Software updates (10.6.1)
  • Textmate
  • Latest flash version since Snow Leopard ships with an unsafe one.
  • MacTex

And to tweak some.

  • Copied my old ~/Music directory, iTunes starts with my good old library. Hurray
  • Copied my old ~/Photos directory, iPhoto cannot open (made with a newer version). Running another software update was the key to success.
  • The first sync with my iPhone authorizes my computer with the iTunes store and gives me all my contacts back. Nice!
  • Uncomment the line LoadModule php5_module libexec/apache2/libphp5.so in /etc/apache2/httpd.conf to enable php5. Fortunately for me, snow leopard provides me with pdo_mysql which Leopard did not (and it wasn’t possible to just add that module).

And to get stuck at some.

  • System clock, going to System preferences > International > Formats > Times (customize button) and changing the medium format doesn’t work anymore :(

My ToDo list also has some.

  • mail multicolumn
  • mail imap subfolder check
  • spark firewall status scripts
  • adium

More Tweaks

Firewall scripts

I take my laptop everywhere so I want to keep the built-in firewall fully closed at all times. I do, however, sometimes take it down if some sharing/program/game doesn’t work, and I almost always forget to enable it again afterewards. Thats what the following script is for. I use the cron daemon to run it every 5 minutes and it checks the firewall status and gives me a growl notification if it’s disabled.

#!/bin/sh
if [ `defaults read /Library/Preferences/com.apple.alf globalstate` -eq "0" ]; then
echo Firewall is currently disabled | /usr/local/bin/growlnotify -a /Applications/System\ Preferences.app -t Warning;
fi

I also added an applescript to a global hotkey in Spark to change the firewall status. It checks the status, displays it with the options to change it with a timeout of 5 seconds.
# brings the dialog window to front
delay 1
tell me to activate
# read status
set fw_status to (do shell script "defaults read /Library/Preferences/com.apple.alf globalstate")
# check status, show dialog
if fw_status is equal to "2" then
set dlg_result to display dialog "Allow only essential services" with title "Firewall Status" buttons {"All", "Specific", "Essential"} default button 3 cancel button 3 with icon note giving up after 10
set res to button returned of dlg_result
else if fw_status is equal to "1" then
set dlg_result to display dialog "Set access for specific services" with title "Firewall Status" buttons {"All", "Specific", "Essential"} default button 2 cancel button 2 with icon caution giving up after 10
set res to button returned of dlg_result
else if fw_status is equal to "0" then
set dlg_result to display dialog "Allow all incomming connections" with title "Firewall Status" buttons {"All", "Specific", "Essential"} default button 1 cancel button 1 with icon stop giving up after 10
set res to button returned of dlg_result
end if
# Check dialog result and set firewall accordingly
if res is equal to "All" then
do shell script "defaults write /Library/Preferences/com.apple.alf globalstate 0"
display dialog "Set to 'Allow all incomming connections'" with title "Firewall Status" buttons {"OK"} default button 1
else if res is equal to "Specific" then
do shell script "defaults write /Library/Preferences/com.apple.alf globalstate 1"
display dialog "Set to 'Set access for specific services'" with title "Firewall Status" buttons {"OK"} default button 1
else if res is equal to "Essential" then
do shell script "defaults write /Library/Preferences/com.apple.alf globalstate 2"
display dialog "Set to 'Allow only essential services'" with title "Firewall Status" buttons {"OK"} default button 1
end if

And now I can easily change the status of my firewall

What is up with Bing?

Wednesday, September 2nd, 2009

I only just learned about Bing, watched a screencast and played around with it. I was hoping to be impressed by the nifty features demonstrated in the screencast, but everything I enter in Bing just gives me a plain old search result. I even read the help documents and entered the examples they gave, but none of those examples gave any special result.

So I am puzzled. Why would Microsoft launch a new product, show off its great features and then put a website live that doesn’t do any of the promised features? Looks to me like they have just doomed Bing.

Lekker plat

Thursday, June 11th, 2009

iTunes Genius - Dikke lul drie bier

Sommige dingen zijn dusdanig banaal dat een genie ze echt niet meer aan kan.

GeekTool

Saturday, June 6th, 2009

GeekTool DesktopThe past couple of days I’ve been playing around with GeekTool a nifty litlle application that can show text files, unix commands output (including scripts), or images (local and from the internet) on your desktop.  There are many sites with examples out there which inspired me to create a GeekTool setup of my own.

I started playing around with several scripts and GeekTool because it looked cool at first and it was fun to do some shell scripting. As the amount of information displayed on my desktop grew I started wondering why I was creating a lot of small processes taking up a little CPU time. I hardly ever look at my desktop because of all the windows in front of it. But the stats now on my desktop are easily accesable with one key (F11), and some starts are already displayed in either the menu bar or my iStat Pro widget. Removing it there gives me more room in the menu bar (which is starting grow full of icons) and saves some resources used by the widget.

Now I shall explain the GeekTool entries I created more detailed.

(more…)

Errors

Tuesday, June 2nd, 2009

Marbleblast Error
Some error messages just do not display the way the developers intended them to.

Twitterfon - not an error
And sometimes being right is wrong after all.

The day the Apples fell from the tree

Sunday, May 17th, 2009

I’m no fanboy per se, I just happen to like my MacBook and iPhone a lot. But not today, as today the battery of my MB broke down and my phone just crashed while making a photo. Also while rebooting I held both keys down to power down the thing which it didn’t respond to until after booting up and showing my background and asking for my passcode just for a second. Of course the timing could also just be a coincidence.

Mosh pit

Wednesday, May 6th, 2009

The fifth of May is liberation day in the Netherlands. I realy like the liberation festivals because there is always a realy unique atmosphere, a bit more relaxed and friendly than other festivals because everybody is celebrating their freedom. Perhaps this is only the case because I am celebrating my freedom and thus experience the festival different, but that doesn’t realy matter to me. I had a great time moshing around at de Heideroosjes concert, but when the band announched we were going to peform an old eighties tradition I realy had no chance to escape to the back (mostly because of all the people going to the front) and was literaly run over in the circle pit. Great fun for me, I just hope nobody got hurt whilst marching over my hard metal wheelchair :)

We are being betrayed!

Saturday, October 18th, 2008

For years I’ve seen commercials on TV urging me to do something about the destruction of the rain forest, which made sense to me because they tell me it’s the earths lungs. Yesterday I saw a commercial on TV telling me that most of the earth’s oxygen is produced in the oceans, for the oceans are the lungs of the earth. Somehow I think there are two organisations competing for protection of the lungs, I just don’t know which one is protecting the real lungs…