Bed's Stuff - Tag OSX

Setting up a Trac Server Under OS X 10.6

Trac is an excellent open source tool that allows you to manage a software project;s development life cycle, incorporating a wiki with issue/bug tracking while integrating with a source control service such as subversion. Months ago I had set up a subversion server which was working great on my iMac. I then wanted to setup a Trac server to go along with it so I could manage all aspects for my projects properly. Here's how I did it.

Installing and setting up Trac

Trac is written in the python scripting language, also requiring a number of other third party libraries. While a compatible version of python comes pre-shipped with OS X 10.6, these prequisite libraries do not. However its extremely easy to install trac along with all its prequisites by using python's great 'easy_install' feature. Simply fire up a command line by launching Terminal.app and run the following command:

sudo easy_install trac

This will download and install everything you need for you without further input, so let it do its thing and when its finished we are ready to create our Trac environment. Because I had previously set up my subversion server under a dedicated OS X user 'svn', I wanted to run trac under the same user. Thus I was going to create my trac environment in the /Users/svn/trac/newproject directory and do so by ensuring it was created with appropriate permissions for the svn user. This can be done by prefixing any command with 'sudo -u svn', which will run the command as the svn user. For steps on setting up a dedicated user for this purpose see my previous subversion howto. Run the following command (after ensuring /Users/svn/trac/ has been created) in the terminal:

sudo -u svn trac-admin /Users/svn/trac/newProject initenv

This will create a whole bunch of directories and files and you can then run the standalone Trac server manually to check that these first steps have worked:

sudo -u svn tracd --port=8000 /Users/svn/trac/newProject

This will make the trac server listen on TCP port 8000, so we can then browse in Safari or the browser of choice to http://127.0.0.1:8000 and see that we have a trac server running. Its not terribly useful yet however, as we still need to create users, assign administrator privileges to somebody and …

Read More

Windows 7 vs OSX Leopard

For nearly the last year I've been using my Mac Book Pro with OSX Leopard as my primary operating system, which replaced years and years of Windows XP. I still had to run XP for work development, which I did in a virtual machine. A few months ago I had to move the VM to Vista to help ensure our application compatibility. So now the Windows 7 public beta was available, I decided to try it out as my work VM. Of course I have a handy backup of my old Vista VM - just in case. However after a week of use, I don't think I'll need the backup. Windows 7 should really be called Vista SP2 and it optimises and polishes off the Vista core. In-fact I would say now that Windows 7 finally catches up to OSX, in terms of being a polished, good looking, efficient, practical modern operating system. Having said that, I will not be moving back to the windows platform as my primary operating system any time soon. I really prefer OSX, and here's why...

Font Rendering

When I first moved to Macs, I thought "everything looks better, text is easier to read without straining my eyes". So I googled and found that there's a ideological difference with how Microsoft and Apple go about rendering their fonts. To get a clear understanding of the differences see "Font smoothing, anti-aliasing, and sub-pixel rendering". Personally, after over ten years of viewing fonts the Microsoft way, it took less than a month to become used to and much prefer Apple's way.

fonts

Task Management

Finally, Microsoft have realised the advantage of a combined application launcher and switcher. The new taskbar acts very much like the Dock now - and personally I think this is a great thing. Icons stay in the same place. Apple dock gives a dot under or next to running applications, while the TaskBar draws a box around running applications. Microsoft have this new 'jumplist' feature - but this has always been present with the Dock by right clicking the app icon to access application specific functionality. However the OSX dock can contain 'stacks', or folders. Just drop a directory on it and you've got an easy menu heirachy, this is not possible with the new windows 7 taskbar.

OSX Dock

Windows 7 taskbar

As for switching tasks, on the OSX side you have exposé, which will display all windows so you can …

Read More

Turning a protected RTSP stream into an iTunes PodCast (with linux and OSX)

A friend of mine does a radio show interstate that interestsme. Unfortunately, being a late night show (midnight) and interstate, for me to listen to this live would require me being awake a t 4am or so. Due to record label copyright permissions, this show is not available as a podcast download - its only available for live or delayed streaming. Undeterred, I wanted to automatically grab the stream and make it available on my iPhone for listening when it suited me, while out and about.

Getting the stream as a file with linux

The availability of the delayed stream, means this problem can be tackled with a cronjob on my gentoo linux server. This particular stream is served with the Real Time Streaming Protocol which means all we really need is the live555 media libraries. For Gentoo this was as easy as issuing "emerge live" as root on the commandline. For Ubuntu this would be "apt-get install liblivemedia-utils".

Then its as simple as calling openRTSP with the stream url. ie:

openRTSP -4 -a -t -d 3900 rtsp://streaming.server.com.au:80/streaming.server.com.au/name.mp4 1>name.mp4

This will write the audio stream  as a file.

The next step is to automate this process with a script being launched by cron. In this case, the name of the stream is in the format radioshow_YY_MM_DD.mp4. So my script will grab today's stream.
radioshow.sh:

1
2
3
#!/bin/sh
filename="radioshow_"`eval date +%Y-%m-%d`".mp4"
openRTSP -a -t -4 -d 7300 rtsp://streaming.server.com.au:80/streaming.server.com.au/$filename > /mnt/download/radioshow/$filename

Since this show is a weekly one, my crontab is setup to download the stream at 1:30pm every thursday.

crontab line: #download behind the mirror every thursday at 1:30pm 30 13 * * 4 /home/bed/radioshow.sh

Converting to a PodCast with OSX

Once we have the files, I wanted to put it in my iTunes library flagged as a PodCast. A commandline tool AtomicParsley enables us to set the appropriate mp4 tags so iTunes sees the file as a PodCast, however AtomicParsley doesn't like the mp4 tags created by openRTSP. To get around this we can load our file in QuickTime, and then re-export it to mp4. This will now be a file with mp4 tags that AtomicParsley can modify. We can then execute the following …

Read More

Backing up an OSX profile to a linux server with rsync

TimeMachine is some nice software, but its overkill for me. I've previously written about this and how I put together a rsync solution and why I did so. In the case that anyone might be interested in doing the same, here is my setup.

Linux Server
I have a gentoo linux server, but this should be a mostly generic rsync server setup. My rsyncd.conf looks like this

# /etc/rsyncd.conf
# This line is required by the /etc/init.d/rsyncd script
pid file = /var/run/rsyncd.pid
use chroot = yes
read only = no
uid = bed
gid = bed
hosts allow = 192.168.42.0/24

[bed-backup]
    path=/mnt/backup/bed
    comment = Beds Backup

and of course rsyncd is in my /etc/init.d and starts automatically at boot.

OSX

I have a simple bash script that I can run that will backup the contents of my home directory, called backup_bed.sh. This will turn sleep off, make sure the network is available (as the machine may have been woken from sleep) and then do the backup.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh
#Bed's rsync backup script

echo `date` Beds Backup > last_backup.log
echo `date` ------------- >> last_backup.log
echo `date` Script Starting at `date` >> last_backup.log

# turn off system sleep
pmset -a sleep 0 2>&1 >> last_backup.log
echo `date` Turned off sleep >> last_backup.log

echo `date` ------------- >> last_backup.log

# wait for network to show up
pingcount=0
trycount=1
failflag=0
while [ $pingcount -eq 0 ]
do
    echo `date` Waiting for network... $trycount >> last_backup.log
    pingcount=$(/sbin/ping -c 3 -o bedentoo | grep "received" | awk -F',' '{ print $2 }' | awk '{ print $1 }')
    trycount=`expr $trycount + 1`
    if [ $trycount -eq 11 ]
    then
        echo `date` network fail - giving up >> last_backup.log
        failflag=1
        pingcount=-1
    fi
done

if [ $failflag -eq 0 ]
then
        #do rsync
        echo `date` RSync started.  >> last_backup.log
        /usr/bin/rsync -a -x -S -v -v --progress --exclude-from=/Users/bed/scripts/backup_excludes.txt  /Users/bed/ bedentoo::bed-backup 2>&1 >> last_backup.log
        echo `date` RSync finished.  >> last_backup.log
fi

#turn system sleep back on
echo `date` ------------- >> last_backup.log
pmset -a sleep 30 2>&1 >> last_backup.log
echo `date` Turned on sleep for 30 …

Read More

MServClientOSX 0.80

logo MservClientOSX is a Mac OSX client for the mserv music server. Version 0.80 supports the following functionality:

  • Viewing the current status of what's playing
  • Play, Stop, Next and volume control
  • Browse and serach the list of tracks available
  • Add tracks to queue
  • Browse and search the queue
  • Configurable menubar status icon
  • Configurable Growl notifications
  • Self-Updating (via the Sparkle framework)

Download MServClientOSX 0.80 and copy to your applications folder.

MServClientOSX Main
Controller

MServClientOSX Track
Browser

MServClient OSXs menubar status
item

Read More

About

Andrew Bednarz - otherwise known as Bed, is a Digitarian who love avant-garde/black/folk metal, jazz, sci-fi, pro-wrestling, point & click adventure games; and of course his wife and cats.