« März 2005 | Main | Mai 2005 »

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.

7.04.05

i am administering a page for an association which is hosted by a university. the address is http://www.my-university.tld/association/. because this is annoying to type, we registered the domain association.tld to provide direct access. but the regulations (dt: reglement) do not allow the computer department to host any other domains on the university's servers.

so i found a webhost provider who hosts us the domain, only to redirect it to the university page. up to now we used to redirect with a html tag in the header:
http-equiv="refresh"
content="0;URL=http://www.my-university.tld/association/">

this solution works, but i is not very elegant, because:
  1. the page with the redirection has to be loaded first, it slows down the process
  2. the redirection page will be displayed for a moment (though only for a short moment it is unnecessary)
  3. any file or folder request except the association.tld/index.html will result in a 404 file not found error.

to find a more elegant solution, i looked at the apache rewrite mod. it is sort of hard to understand, but after looking around a little i found a solution:
RewriteEngine On
RewriteRule ^(.*) http://www.my-university.tld/association/$1 [R]

this is the text to place in the .htaccess file in the root folder of the association.tld server. now, every request for a file on association.tld will be forwarded, for example www.association.tld/folder/file.html will go directly to
www.my-university.tld/association/folder/file.html.

some resources to the topic of the mod_rewrite:
Module mod_rewrite URL Rewriting Engine
Apache 1.3 URL Rewriting Guide
mezzoblue § rewrite! (see also comments)
mactechnews.de forum: Apache Modul mod_rewirte konfigurieren (german)