Bed's Stuff - Articles by bed

One time… at bandcamp...

A friend brought to my attention the site bandcamp, which is really quite an awesome site for musicians of all sizes, easy to set up tracks and maintain a clean looking page with streaming and downloading capacities. While my really older stuff is just too low quality to put up there, I've created an account put my more recent stuff up in an album. More will follow; for the last six months I've been getting itchy feet with regards to developing some more music, I have some ideas and some new tools, the pressing issue is always time. Time is something that needs to be allocated and just done. Motivation is the key and this is rising. To be continued….

Read More

Fugliest iPhone App EVER

I didn't think it was possible for any iPhone application to be as ugly as a windows mobile application. I was wrong.

fugly

Its so bad it makes my eyes bleed. How did this get past the Apple approvers? My mind boggles.

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 …

Read More

About

Andrew Bednarz - otherwise known as Bed, is a Technical Director at Shadowboxer. Husband. Father. Nerd. Former and occasional software engineer. An optimisitic pessimist 🤘