Installing PostgreSQL from source on my Mac

In order to build PostgreSQL from source on my MacBook Pro running El Capitan, I first downloaded the git repo:

git clone git://

I then built it:

cd postgresql
sudo make install

This will install the binaries to the default location of “/usr/local/pgsql”.

I already had a user called “_postgres” in my /etc/passwd file, so I configured to run PostgreSQL as this user:
Continue reading “Installing PostgreSQL from source on my Mac”

Python OAuth2 failing with X509 error

I’ve just spent about 20 minutes trying to authenticate with Twitter using the Python OAuth2 module. I kept on getting an X509 error, specifically:

ssl.SSLError: [Errno 185090050] _ssl.c:343: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib

The solution to this is that the cacerts.txt file in the Python installation is only readable to the root user / wheel group. In order to fix that up, first find the cacerts.txt file:

find /Library/Python/ -name cacerts.txt

Then modify the permissions on the file:

sudo chmod 644 /Library/Python//2.7/site-packages/httplib2-0.7.7-py2.7.egg/httplib2/cacerts.txt

Note that the URL endpoints for twitter on the python-oauth2 Github page are currently wrong. To use the “Twitter Three-legged OAuth Example” change to, etc.

Renaming XCode Projects

It turns out that renaming XCode projects is easy! This StackOverflow thread showed me the trick. All you need to do is double-click slowly on the Project Name in the project hierarchy tree. This allows you to change the name. You then get a dialog showing the refactoring of everything related to the new project name.

Bug with streaming audio to Apple TV

So it appears that there is a occasionally a problem in streaming music to the Apple TV from the Mac. The symptom is that you can see the “Audio TV” device in your Sound -> Output window, but every time you try to select it, the selection reverts to the “Internal Speakers” line.

The easiest way to reset this, is to go up to the menu bar at the top of the screen and switch off your Wifi Network, leave it off for a second, then switch it back on. When you reconnect to your wifi network you should be able to select the “Apple TV” device in your Sound/Output pane in the System Preferences.

Restarting Fitbit on the Mac

I seem to have a problem with my Fitbit Ultra and my Mac Air running OS/X 10.8. What happens is the fitbit daemon doesn’t seem to work properly if I suspend the notebook by closing the lid. After awakening, my Fitbit profile never seems to update with the latest data from the device. A solution to this problem is to restart the fitbit daemon. You can use launchctl to stop and restart the daemon, which should mean that your data then gets transferred from the device properly.

sudo launchctl stop com.fitbit.fitbitd
sudo launchctl start com.fitbit.fitbitd

Hacking the EZ430 Chronos Watch on the Mac

Today my TI EZ430 Chronos Watch arrived, and I spent a little bit of time hacking it on my MacBook Air. It turns out that even though the documentation seems to require either a Windows machine or a Linux box, you can communicate with the watch from the Mac by modifying the serial port information in the TCL source. I learnt this from a Google Groups post, and I’ve copied the modified TCL source onto my Github account.

Continue reading “Hacking the EZ430 Chronos Watch on the Mac”

How to get Maplin’s USB Microscope working on a Mac

I just brought Maplin’s USB Digital Microsoft with 400x magnification, which is advertised as having Windows-only drivers. System Profiler identified the chipset as being from Vimicro Corporation. I went to the Driver Download section of their website and downloaded (and installed) the DRV_ZC0301PLus_070305 driver. I then opened up Photo Booth, and was able to select the Vimicro camera as the video source. What I should have done was just try and access the Microscope using Photo Booth before I installed the driver, as I half suspect that there was no actual need to install that driver.

Close-up of a new razor blade
Close-up of a new razor blade

Please try to use the microscope with Photo Booth first before downloading the driver, and let me know in the comments if that works.

Emacs cmd-key on Mac

Emacs on my Macbook Pro uses the “alt” key (the one to the left of the “cmd” key) to be the Alt (meta) key when doing things like Alt-Backspace to delete backwards by word. This is quite annoying for me as I naturally try and use the command key for this. To fix this put the following in your .emacs file.

(setq mac-command-modifier 'meta)