Archive for category Mac
Scrup – a better skitch replacement
A brief history:
* Skitch was great. It was an app for taking screenshots on a mac, editing them (in simple ways like adding text, arrows, cropping etc.), and uploading them to your own web hosting (or the app-supplied hosting, which I think no one ever used). Easily the most useful app I had on my mac. And it was free.
* Evernote bought (or somehow got involved with) Skitch, integrated it with all their other crap, removed most of the useful things from it, and basically destroyed it (this was about a year ago, maybe a bit more).
* Public outcry ensued.
* In an attempt to placate all their existing users, they kept the old version of skitch alive, and even updated it once or twice. Sadly though, it hasn’t been updated in a while, and now it looks like it’s been abandoned.
* Along came OSX 10.9, which looks like it has broken Skitch entirely. Even the recently-updated “Evernote-skitch” is broken.
So, today I went looking for, and found, a replacement: Scrup.
And what a replacement it is!
It does essentially the same thing (but much more sensibly). And it’s FREE, and OPEN SOURCE. And it works a treat on 10.9. I just adore that the code is there for all to see on github: there isn’t anything I’d change in it yet, but I just love being able to!
Building Libtorrent-rasterbar on OSX
Posted by Bricky in Mac, Programming, Torrents on May 3, 2013
Compiling Rasterbar Libtorrent on OSX 10.7 or 10.8 (tested on both 10.7.5 and 10.8.4), without brew and all the crap it brings with it.
First, you’ll need to install XCode, and command-line tools.
Then, you’ll need to download and build boost:
http://www.boost.org/users/download/
Click on ‘Download’, and download the latest .tar.gz. In my case this was boost_1_53_0.tar.gz
tar -zxvf boost_*.tar.gz
cd boost_*
./bootstrap.sh
./b2
sudo ./b2 install
This all ran cleanly in my case, but googling would seem to imply that it often gives errors.
Next, download the libtorrent source:
http://code.google.com/p/libtorrent/downloads/list
And again, download the latest .tar.gz. In my case this was libtorrent-rasterbar-0.16.9.tar.gz
tar -zxvf libtorrent-rasterbar-0.16.9.tar.gz
cd libtorrent-rasterbar-0.16.9
./configure --enable-python-binding
make
sudo make install
That should be it, but in my case for some reason the python bindings were put into /usr/local/lib/python2.6/site-packages/ (where the correct site-packages is in fact /Library/Python/2.6/site-packages). I’m not really sure why this happened, but it’s easy enough to fix. Continuing from where we were above:
cd bindings/python
sudo python setup.py install
And it gets the correct directory this time around.
Update (Sept 2, 2013): Tested with libtorrent 0.16.11 and boost 1.54 on Max OSX 10.9. Works as described above. Boost gives lots of deprecation warnings, but it runs without issue.
Netatmo Menu Bar app for OSX
Posted by Bricky in Mac, Programming on March 29, 2013
For some peculiar reason, Netatmo don’t have an OSX app for viewing their devices (however their iOS one is simply brilliant). So, me being me, I wrote one. Very simple app to put together in fact (but then, it doesn’t do all the fancy history stuff that the iOS one does).
Read the rest of this entry »
Sickbeard + iPlayer: requirements
Posted by Bricky in Linux, Mac, Programming, TV on March 5, 2013
Note: Since this post was written, TvTumbler was born. Going forward, all new development will be in TvTumbler.
I’ve just merged the iplayer branch of my Sickbeard fork into master, as it’s been working ok for me for the last few days, and I think it’s ready for some others to check it out.
But, be warned: it has prerequisites. In short, these are:
- Perl: any *nix will have this
- ffmpeg:
- On linux, you probably just need to do
sudo apt-get install ffmpeg
(or whatever the rpm equivalent is). - On OSX, take a look at my recent post about how to build ffmpeg.
- On linux, you probably just need to do
- rtmpdump:
- On linux, again, you can probably just do
sudo apt-get install rtmpdump
(or the rpm equivalent). - On OSX, building this is just too simple:
git clone git://git.ffmpeg.org/rtmpdump
cd rtmpdump
make SYS=darwin
sudo make install SYS=darwin
- On linux, again, you can probably just do
If you’re on a *nix machine, there’s a strong likelihood that you have all these installed already, so best to check first.
Windows users: you’re on your own here, sorry. I believe that get_iplayer will run on Windows, but I simply don’t have a copy of the OS installed on which to check it. You’ll probably need to get both ffmpeg and rtmpdump also too I’m afraid. If you do have success with windows (or indeed any other OS), let me know in the comments and I’ll add the instructions here.
All of this is made possible of course by the work from infradead on the get_iplayer script (latest version included in the sickbeard code, but you can install your own if you prefer).
Please note: for this to work you must either be *in* the UK, or have some kind of VPN connection to the UK. iPlayer downloads are restricted to UK ip addresses. (of course there are other ways around this, but I’m not going to discuss those here).
Building ffmpeg on OSX 10.7
Posted by Bricky in Mac, Programming on February 27, 2013
Note-to-self post again.
I can take no credit for this – it’s a copy of Hunter Ford’s script from here, with some minor changes I had to make to get it to run cleanly on 10.7.5.
Prerequisite: XCode, with command line tools installed.
OSX: Using the second monitor while in full screen mode
I have an old macbook pro (circa 2008 I think) running 10.8 with an external monitor. Today I started running Avatron’s Air Display on it (a wonderful piece of software by the way), which runs in full screen mode. This left the laptop display itself useless, displaying that grey cloth background which apparently means “This is how OSX fullscreen works – get used to it”.
Anyway, I wanted to run Terminal.app on the main laptop screen, while running Air Display fullscreen on the external monitor. Apparently there are two ways:
1. It seems that you can “trick” OSX to allow this, by using the trackpad to slide between spaces, and opening Terminal.app (via spotlight) mid-slide. I couldn’t get this to work however, as my trackpad doesn’t do multi-touch (it’s too old), and it seems you need it. Works for a lot of other people though.
See this hint on macworld for details.
2. You can modify Terminal.app’s Info.plist file to make it a background app. Then, if you open Terminal.app (again, via spotlight) while viewing the fullscreen app, it won’t switch out of fullscreen mode.
To do this:
* Quit Terminal.app if running.
* Right-click on it, and Show Package Contents.
* Open the file Contents/Info.plist, and add the bold text below at the end (before the last “</dict>”):
</dict> </dict> </array> <key>LSUIElement</key> <string>1</string> </dict> </plist>
Note that this has some serious side-effects! Most notably, the terminal will no longer appear as running in the dock, and you won’t be able to ALT-TAB to it.
(some general info regarding LSUIElement is available here)
That’s it. I’d be interested in hearing if there are other (easier!) ways.
Building goaccess on OSX 10.8.2
Posted by Bricky in Mac, Programming on October 12, 2012
Title says it all really. Copy/paste of what was needed to build goaccess on 10.8.2, without pissing around with brew et al.
tar -zxvf goaccess-0.5.tar.gz
cd goaccess-0.5
curl -L http://ftp.gnu.org/pub/gnu/gettext/gettext-0.18.1.1.tar.gz -o gettext-0.18.1.1.tar.gz
tar -xf gettext-0.18.1.1.tar.gz
cd gettext-0.18.1.1
./configure CC="gcc -arch i386 -arch x86_64" CXX="g++ -arch i386 -arch x86_64" CPP="gcc -E" CXXCPP="g++ -E"
echo '--- gettext-tools/gnulib-lib/stpncpy.c.orig 2007-10-07 23:29:35.000000000 +0300' > gettext.patch
echo '+++ gettext-tools/gnulib-lib/stpncpy.c 2011-03-11 23:34:40.000000000 +0200' >> gettext.patch
echo '@@ -24,7 +24,7 @@' >> gettext.patch
echo ' #include
echo ' ' >> gettext.patch
echo ' #ifndef weak_alias' >> gettext.patch
echo ' -# define __stpncpy stpncpy' >> gettext.patch
echo ' +//# define __stpncpy stpncpy' >> gettext.patch
echo ' #endif' >> gettext.patch
echo ' ' >> gettext.patch
echo ' /* Copy no more than N bytes of SRC to DST, returning a pointer past the' >> gettext.patch
patch -p0 < gettext.patch
make -j2
sudo make install
curl -L http://ftp.gnome.org/pub/gnome/sources/glib/2.27/glib-2.27.0.tar.bz2 -o glib-2.27.0.tar.bz2
tar -xf glib-2.27.0.tar.bz2
cd glib-2.27.0
./configure --with-libiconv=native
echo '--- glib-2.27.0-orig/glib/gconvert.c2010-09-17 17:33:50.000000000 -0500' > glib.patch
echo '+++ glib-2.27.0/glib/gconvert.c 2010-10-27 00:01:39.000000000 -0500' >> glib.patch
echo '@@ -61,9 +61,6 @@' >> glib.patch
echo ' #if defined(USE_LIBICONV_GNU) && !defined (_LIBICONV_H)' >> glib.patch
echo ' #error GNU libiconv in use but included iconv.h not from libiconv' >> glib.patch
echo ' #endif' >> glib.patch
echo '-#if !defined(USE_LIBICONV_GNU) && defined (_LIBICONV_H)' >> glib.patch
echo '-#error GNU libiconv not in use but included iconv.h is from libiconv' >> glib.patch
echo '-#endif' >> glib.patch
echo ' ' >> glib.patch
echo ' /**' >> glib.patch
echo ' * SECTION:conversions' >> glib.patch
make
sudo make install
cd ..
./configure
make
sudo make install
Air Video addon for XBMC
Posted by Bricky in Linux, Mac, Programming, Windows on September 11, 2012
This is simple enough really: an addon for XBMC that allows you to browse (and stream) from an Air Video server.
Download Air Video Plugin for XBMC
To install this in XBMC, download the zip file above, save it somewhere you can find it, then
System -> Settings -> Addons -> Install from zip file
and browse for the file you just downloaded
Be sure to configure the “Location” in the preferences before use (this should be the ip address of your air video server).
I can take very little credit for this. Most of the Air Video code comes from Jeremy Debate’s port of JP Hastings-Spital’s ruby library for interacting with Air Video, with some minor modifications here and there to get it to work from within XBMC.
Note that I’ve only tested this on Frodo, the latest development build. I would expect it to work without issue in Eden also however.
UPDATE: Please note that if you open a video by simply selecting/clicking it, it will not be transcoded (xbmc will simply attempt to play the file as-is). Transcoding requires opening the file via the context menu/right-click/’C’-key, and does not appear to work correctly in current versions of XBMC due to lack of support for the stream format. Please read the comments below for further details.
(Thanks for signorRossi for this information).
AppleScript desktop dialer for Asterisk
Posted by Bricky in Mac, Programming, VOIP on February 12, 2011

Asterisk Desktop Dialer
You’ll need a mac (obviously), a desktop phone (even more obviously), and an asterisk server (most obviously), preferably on your lan, which you can configure to allow network access to the AMI (Asterisk Manager Interface).
Read the rest of this entry »
Install python lxml 64 bit on OSX 10.5
Posted by Bricky in Mac, Programming on February 11, 2011
This is one of those note-to-self style posts again.
I’m not really clear on why this has to be so damned complicated: every time I mess with lxml on OSX it costs me half a day!
The second-last time I had to do this, I actually stripped everything but the 32 bit executable out of apache to force it into 32 bit mode, so that I wouldn’t have to compile a 64bit lxml! (and yes, that’s just stupid, don’t do it).
Anyway, this is how I managed to get it to compile this time:
mkdir /tmp/lxml-build
cd /tmp/lxml-build
curl -O http://codespeak.net/lxml/lxml-2.3.tgz
tar -zxf lxml-2.3.tgz
cd lxml-2.3
mkdir libs
cd libs
curl -O ftp://xmlsoft.org/libxml2/libxml2-2.7.3.tar.gz
curl -O ftp://xmlsoft.org/libxml2/libxslt-1.1.24.tar.gz
cd ..
Here we need to modify the build code for lxml. (Yes, I know this shouldn’t be the case, but the arch is hardcoded in there for 10.5 as i386, and we simply have to change it).
Open the file buildlibxml.py
, and, at around line 284, find the following lines:
if minor_version < 6: env.update({ 'CFLAGS' : "-arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -O2", 'LDFLAGS' : "-arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk", 'MACOSX_DEPLOYMENT_TARGET' : "10.3" }) else:
… changing them to the following …
if minor_version < 5: env.update({ 'CFLAGS' : "-arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -O2", 'LDFLAGS' : "-arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk", 'MACOSX_DEPLOYMENT_TARGET' : "10.3" }) elif minor_version < 6: env.update({ 'CFLAGS' : "-arch x86_64 -arch i386 -O2", 'LDFLAGS' : "-arch x86_64 -arch i386", 'MACOSX_DEPLOYMENT_TARGET' : "10.5" }) else:
i.e. we change the first case to 10.4 and earlier, and add a case for 10.5 (the minor_version < 6 stuff).
We can now continue with the compilation as follows:
ARCHFLAGS='-arch x86_64' python setup.py build --static-deps --libxml2-version=2.7.3 --libxslt-version=1.1.24
ARCHFLAGS='-arch x86_64' sudo python setup.py install
And that should be it.
If something goes wrong, do a make clean
before changing the build options. And note that you’ll probably need to restart apache (sudo apachectl restart
) to pick up on changes.
OS X: Fix Argentina DST October 2009
Well, at almost the last minute, DST was cancelled in Argentina this year. And this broke things, mostly computers. (Not for the first time either, the same thing happened two years ago here).
The debian folk came out with a fix at the last minute: so that fixed the linux machines, but OS X is a slower beast to move, so it’ll be a while before any change works its way through. In the meantime, Mac users in Argentina are left with broken clocks.
Argentina_DST_Update_2.pkg – for 10.6.x only!
(Updated 2010-03-15)
I am no Mac expert, and this isn’t entirely tested, so be warned.
Anywho, this is how to update the tz data (aka zoneinfo), which should, in theory, fix the problem:
mkdir tzfix
cd tzfix/
curl ftp://elsie.nci.nih.gov/pub/tzdata2009n.tar.gz | tar -zxvf -
vi +219 southamerica
Change the two lines:
Rule Arg 2008 max - Mar Sun>=15 0:00 0 -
Rule Arg 2008 max - Oct Sun>=15 0:00 1:00 S
to the following
Rule Arg 2008 2009
- Mar Sun>=15 0:00 0 -
Rule Arg 2008 only - Oct Sun>=15 0:00 1:00 S
(i.e. just two words to change). If it makes you feel better, here’s a diff.
Ok, save & close, and then compile it as follows:
sudo zic southamerica
sudo cp /usr/share/zoneinfo/America/Argentina/Buenos_Aires /usr/share/zoneinfo/America/Buenos_Aires
The sudo is necessary because you’re changing /usr/share/zoneinfo
.
And that’s mostly it. Verify that it worked as follows:
zdump America/Argentina/Buenos_Aires
America/Argentina/Buenos_Aires Sun Oct 18 20:43:42 2009 ART
(note that the timezone is now ART, not ARST as previously).
So that fixes things for most of the command-line stuff. But you’ll notice that the clock on your desktop, iCal, and others, are still incorrect. We need to fix the ICU database also. Thankfully the latest sources are available for this from apple itself:
curl -O http://www.opensource.apple.com/tarballs/ICU/ICU-400.37.tar.gz
tar -zxf ICU-400.37.tar.gz
cd ICU-400.37/icuSources
ICU doesn’t come with the tzdata, but the readme in tzcode helpfully notes that if we place the tzdata*.tar.gz file in tools/tzcode/ it will be compiled automatically. You can pack up your own tzdata2009n.tar.gz
that we used earlier if you wish, or use the one I prepared here:
cd tools/tzcode/
curl -o tzdata2009o.tar.gz
http://brickybox.com/wp-content/uploads/2009/10/tzdata2009otar.gz
cd ../../
./runConfigureICU MacOSX --with-data-packaging=archive
gnumake
sudo install -o root -g wheel -m 0644 -Sp data/out/icudt40l.dat /usr/share/icu/icudt40l.dat
And that’s it. We have a new ICU database. Reboot to see the changes.
Update (21st October):

southamerica
file onto the phone somewhere, and run (as root):
zic southamerica
cp /usr/share/zoneinfo/America/Argentina/Buenos_Aires /usr/share/zoneinfo/America/Buenos_Aires
And you can simply copy the data/out/icudt40l.dat
you created for OS X into /usr/share/icu/icudt40l.dat
on the iPhone. It causes Springboard to crash, but after a reboot everything works perfectly.
Update (10th November): I can’t believe it, today 10.6.2 update broke the damn icu stuff again.
mkdir 10_6_2_fix
cd 10_6_2_fix/
curl -O http://www.opensource.apple.com/tarballs/ICU/ICU-400.37.tar.gz
tar -zxf ICU-400.37.tar.gz
cd ICU-400.37/icuSources/tools/tzcode/
curl -O ftp://elsie.nci.nih.gov/pub/tzdata2009r.tar.gz
cd ../../
gnumake
sudo install -o root -g wheel -m 0644 -Sp data/out/icudt40l.dat /usr/share/icu/icudt40l.dat
Thanks to Jonathan Tapicer for pointing out that the tzdata file name has been updated (now at version R).
Update (5th February): I’ve had several requests to package this up in an installer, so here goes:
Argentina_DST_Update.pkg – for 10.6.x only!
(I don’t have a 10.5.8 any longer, so I can’t compile for it, sorry)
Update (15th March 2010): Yes, the ICU fix is broken again today. The problem seems to be more to do with automatic timezone detection (which OS X is now seeing as GMT -4) than anything to do with zoneinfo. For now, to fix it:
- Download and install the new Argentina_DST_Update_2.pkg – for 10.6.x only!
- Open a terminal and type:
systemsetup -setusingnetworktime off
systemsetup -settimezone America/Argentina/Buenos_Aires
This is fairly straightforward: it disables automatic timezone detection, and sets the timezone manually (you can use the -listtimezones switch to see a list of available timezones). If anyone knows how to update DateAndTime.prefPane (which appears to use GeoKit) please let me know.
Update (4th April 2010): I’m pleased to announce that 10.6.3 includes updated tzdata for Argentina (and elsewhere) that fixes all this silliness. Get it now (via software update) to make this problem go away.