I have written about Streamripper before, it’s an interesting little application that I use now and then. I originally wrote about compiling it back on OS 10.5 Leopard, at that time the current version was a bit busted but in the end I got it to work and posted the details here. Times have changed and software changes so I thought I would update the world on my use of Streamripper. After all the messing about I had with the 1.62.x range of Streamripper I had settled on using 1.61.27 with security patches. I used this for quite a while, last year I thought I would checkout the newer versions of Streamripper and found that they had taken the great little tool and added a whole bunch of stuff that had a dependency on the glib2 library, which is massive when you just want a single little tool. I suppose it’s ok if you are running on a Linux box where you have glib2 installed as it gets used by lots of applications, but on other platforms it’s just overkill and I can’t be bothered with it.

With this I mind I got the source code for the last of the standalone versions 1.62.3, it does everything, and doesn’t have a massive dependency problem like the recent versions. I made a small change to the source, compiled it and life is good again, much easier than compiling for 10.5 and all that bag of hurt of the older versions :)

The reason I have suddenly posted this is I have just re-compiled Streamripper for Snow Leopard using the new Clang and LLVM-GCC compilers. As all of Snow Leopards utils are in x86-64 I did Streamripper as x86-64, a few years back I never thought I’d be compiling Streamripper as 64-Bit just seems overkill, but why not :)

I won’t bother with all the building stuff like my last post on the subject as it’s not that hard really.

Enjoy!

Downloads

Download (Streamripper 1.62.3 x86-64)
SHA1: 390c33ce08b5a3f9d72f15cc77523fd153ed9379

Download (Streamripper 1.62.3 Modified Source Code)
SHA1: f4d8d01cc0293dc21e968cb08dc249513fd0e42c

Download (Streamripper 1.61.27 Modified Source Code)
SHA1: 060ebfda63f4edf1a91ce835f6abd68eeccb08c7

On Mac OS X 10.5 the default compiler is GCC 4.0.1, Apple does provide GCC 4.2.1 as part of the XCode Developer Tools releases for 10.5 but it isn’t setup as the default.

The main tools are located in /usr/bin. In this folder you will find both gcc 4.0 and 4.2 along with g++ 4.0 and 4.2. The commands gcc, g++, cc, and gcov are all symbolic links to the default 4.0 versions. To make 4.2 the default we just need to modify the symbolic links.

To do this we need to go in to the Terminal and issue the following commands:

cd /usr/bin
sudo ln -Fs c++-4.2 c++
sudo ln -Fs gcc-4.2 cc
sudo ln -Fs g++-4.2 g++
sudo ln -Fs gcc-4.2 gcc
sudo ln -Fs gcov-4.2 gcov

Now you should have a complete working gcc 4.2.1 tool chain. If there is a problem you can verify the symbolic links are pointing at the correct targets by typing ls -l Hope this helps someone else.

I’ve been having some rather odd Safari problems today for the first time since I can remember. I really dig Safari, it’s everything I want in a browser and getting better with each release. I’ve been using Safari since the public beta back in January 2003 back when Mac OS X 10.2 was the main OS.

Anyway this afternoon I noticed that Safari kept using 100% CPU and becoming un responsive. I kept force quitting it but the problem kept coming back after about 10 mins. I tried the usual repair permissions, delete preferences and caches etc to no avail. I then thought I would try the Safari 4 Developer Preview, I downloaded it and installed it. It was perfectly stable and very fast, can’t wait for the finial release of that badboy! At this point I was still stumped as to why 3.2.1 was holding the CPU hostage but Safari 4 was fine. I uninstalled Safari 4 and reinstalled 3.2.1.. On restarting everything seemed fine but yet again it took all the CPU, back where I started. Just launching Safari and then closing the window and waiting would cause the CPU to be held hostage again.

I ran a filesystem trace to see what files Safari was touching, I basically sat and waited until the high CPU condition happened then took a look to see what files were accessed. After an hour of watching and timing the problem it seemed that Safari was continuously reading from the filesystem which is what was causing the massive CPU load. It was triggered by an unusual cache file hit, I did a check to see what network connections were established and saw some odd looking google server addresses, it then dawned on me that Safari 3.2 features anti-phishing protection that uses a blacklist provided by google.

This also explained why the the Safari 4 Developer Preview worked correctly as it doesn’t yet have the anti-phishing stuff. I turned off the anti-phishing stuff in Safari 3.2.1 and sure enough everything went back to normal. Me being me I was still bothered because why would it suddenly cause problems, it’s been working fine until today. I went back and took a look at the cache files it was using for the blacklists, I thought that corruption of some kind was most likely so I deleted them. I then re-enabled the anti-phishing mode in Safari 3.2.1, now been three hours and all is well again.

To kill the blacklist cache (which is rebuilt afterwards) first quit Safari then open the Terminal and type the following:

sudo rm -r /private/var/folders/*

Relaunch Safari and all should be well. I couldn’t find any references to this problem online so I though I would post something.

I decided to have a go at building FLAC from source today which was very simple. I built two versions of FLAC, one was a normal Mac OS X Universal Binary with both the PowerPC and Intel binaries, the other was a pure PowerPC binary optimized for the G4 (the PPC7450 line).

I then decided to test the performance of them, I wasn’t very scientific I just used the stopwatch on my iPod to time the encode of a song. I encoded the same song using the –best option three times with each just to make sure that no caching was happening and the result was as accurate as I could get it. The outcome was pretty interesting.

PPC/x86 Universal Binary
28 Seconds

PowerPC G4 Optimzed
10 Seconds

Thats quite a difference!

I then found something pretty odd, if I encoded the track with the G4 version and tried to decode it using the Universal version I would get the error “ERROR, MD5 signature mismatch” and vice versa when encoding the other way round, very odd. I tried decoding both encodes with a third party app and that decoded both fine. I’ll encode a song and see if someone else has a problem decoding it.

If anyone wants a copy of my binaries let me know and I’ll package them up for you to play with.

Please see the latest post on Streamripper as this is all outdated. Latest Post.

A couple of years back I used an application called StreamRipperX which had a pretty bad rep as it was said to contain some form of spyware, this was an open source GUI on top of the open source StreamRipper application for Unix / Windows / Linux etc…. StreamRipperX (The GUI with the spyware) no longer works so I had a look around and the same guy now offers a new application that does the same thing but it’s now for pay (git).

Me just wanting to rip a stream I had a look around and couldn’t find any other apps so I headed over to http://streamripper.sourceforge.net/ and downloaded the latest source code for the main application (1.62.1) and tried to compile it, well no cigar seems there are some problems that I will get around to reporting. Next I tried the previous release 1.62.0 and again I couldn’t get it to compile. I then downloaded the old source code for 1.0.5 which is well old (November 2004) and that built ok and worked fine.

Not wanting to give up I looked around and found that MacPorts / DarwinPorts has 1.62.0 listed as a package, this meant that it would compile on Mac OS X. MacPorts is a ports system that has a catalog of unix apps, it downloads all the source and dependencies and builds the apps for you. On my main system I do not have the Apple Developer tools installed and also I like to keep the system nice and clean, so no big dependency libs for a small command line applications. I did some digging around and found the information needed to build a full install of StreamRipper, to do a full install you would need libogg libvorbis and libiconv. Since I don’t want to rip ogg streams libogg and libvorbis weren’t needed, OS 10 has iconv so that was no problem. At this point I could get the application to build but not install. This was a simple fix I just changed the permissions on the install script and all was well at last.

I noticed that StreamRipper 1.62.0 built quite a few extra bits for the TRE library and some other bits, this was fine I installed it and tried using it. For some reason it would start getting the stream but not the track info so every stream would overwrite the previous as they had the same name. I was getting really pissed off by this point so went to the last stable build on the last branch which was version 1.61.27. This built fine in the same way with the changes and works great, no TRE dependencies just two nice files :). Anyway here is the instructions I pieced together and got it going with.

StreamRipper 1.62.3 Mac OS X Build Instructions

  1. First grab the Apple Developer Tools from developer.apple.com and install them.
  2. Download the unix source code from http://streamripper.sourceforge.net/ and unpack it to your desktop.
  3. You should now have a folder named streamripper-1.61.27 on your desktop or where ever you put it. Open up the Terminal and navigate to the folder. cd ~/desktop/streamripper-1.61.27 Next we need to change the permissions on the install-sh file, so just type chmod 755 install-sh
  4. Now comes the all important configure command, for what ever reason the standard ./configure doesn’t work too well, my example doesn’t use ogg so if you want it you have to sort it. Ok well type the following.
    env CFLAGS=”-O3 -g -isysroot /Developer/SDKs/MacOSX10.5.sdk -fno-omit-frame-pointer” CXXFLAGS=”${CFLAGS}-felide-constructors \
    -fno-exceptions -fno-rtti”./configure –without-ogg –without-vorbis –with-included-tre –disable-dependency-tracking

    Next you will see the configure stuff going by.
  5. Once the prompt is back just type sudo make installThis will build and then install StreamRipper into /usr/local/bin
  6. You should be done. Type streamripper -h and you should see the help options. Your now done, Enjoy!

If you can’t get it to run best to check it’s installed correctly. Still in the Terminal go to cd /usr/local/bin and then type ls -a if you see streamripper then it’s installed ok. You can test it here by typing ./streamripper -h. Once you have verified that it is working you might as well add /usr/local/ to your path so that you can just type streamripper in any Terminal window.

To add this path and the man path to your system go in to your home folder using cd ~/. Next we need to create a Terminal profile, this is pretty simple type nano .profile once inside the nano editor copy and paste the code bellow in.

# export the users executable and man page paths.
export PATH=”/usr/local/bin:$PATH”
export MANPATH=”/usr/local/man:$MANPATH”

Now just press control and X to exit, answer Y to save the file. Close the current Terminal window and open a new one and test your new streamripper install! Once you have set this path you won’t need to do it again, it will work for all apps you install.

Spotlight is the search system built into Mac OS 10.4 or higher, whenever you make a change to a file spotlight comes along and indexes the metadata of that file. This feature is great it means that you can find stuff really fast. Whenever you attach an external disk to the system Spotlight will index the drive also, this can be very annoying if say for example you have a separate partition with another copy of Mac OS X that you don’t won’t indexed, or it could be a partition containing your backups.

There is a configuration panel in System Preferences for things to exclude from the Spotlight search but drives don’t seem to stick. Under the hood of the OS there are some utils that can help here. one is called mdutil. mdutil which I suppose is named metadatautil really lets you turn Spotlight on/off and lets you delete the metadata store so that it could be rebuilt.

To deactivate Spotlight on a certain drive (in my case my firewire drive called “TinyDrive”) just enter the terminal and do the following.

sudo mdutil -i off /Volumes/TinyDrive

You can get a list of drives on your system by listing to the Volumes directory.

ls -a /Volumes

If you want to reactivate Spotlight use the main command above but changing off to on

Hope this helps

Thought this might be a useful addition to my other post “Installing MySQL on Mac OS X”

To start off go and get the latest version of MySQL. Hopefully you have downloaded a nice diskimage (.dmg) this should contain the startup item install package (.pkg) and the MySQL package (.pkg) there is normally also a control panel in the diskimage. I don’t use the startup item as I like to just turn on MySQL when I want it.

Ok make sure MySQL is off, if you have MySQL installed and the control pannel just go to ‘System Preferences’ and click the MySQL icon and hit the ‘Stop MySQL button. Ok Install the the MySQL package, this will install MySQL in the directory /usr/local/ . Sorry but this bit need the terminal people so open it up. Do the following :

  1. Goto to where it lives
    cd /usr/local
  2. Go to the old install so for example on my machine :
    cd \mysql-standard-5.0.25-osx10.4-powerpc
  3. All you will see in here is a directory called “data”. Copy this to the new install. (The install package puts a symbolic link in the main dir to the latest MySQL install so this makes life easy.)
    cp -r data /usr/local/mysql/
    if you have problems use
    sudo cp -r data /usr/local/mysql/
    now your new version has all your databases and settings you need to set them up or you will just getting errors when starting MySQL.
  4. Ok navigate the current MySQL install
    cd /usr/local/mysql
    Now we need to set permissions for the data file for it to work. Type the following.
    sudo chown -R mysql data/
    Enter you password and you should be done.
  5. Now you start your new version and test all is well. If all is well you can now trash the old install directory and also the old install package receipt found in /Library/Receipts

I wrote this of the top of my head so let me know if you have a problem.

First download the right MySQL installer .pkg from the MySQL site. This should mount as a disk image on the desktop. Double click and install the package, then double click the Mysql.prefpane and it will offer you two choices : Install for all users or install for current user. Select which you want then load up the terminal.

In the terminal type the following :

cd /usr/local/mysql
sudo chown -R mysql data/
sudo echo
sudo ./bin/mysqld_safe &

At this stage you close the terminal window and open a new one and do the following :

/usr/local/mysql/bin/mysql test

You should get some thing like “Welcome to MySQL” type thing at this point, that means it’s all fine and working. Type \q to quit the montior. Next we need to setup the root password for MySQL by doing the following:

/usr/local/mysql/bin/mysqladmin -u root password thepasswordyouwant

Thats it you should be done, to control the system and add users check the documentation or you can use things like the MySQL administrator app or phpMyAdmin, there is plenty of bits out there.

Tested using Mac OS X 10.4.5 and MySQL 5.0.18