It’s been a while since I experimented with using SQLite from Swift (like a few years). I found it painful the last time I tried, but thought I’d revisit it again. To my delight, it turns out to be straightforward.
Emacs, gpg and pinentry on Mac
(setenv "GPG_AGENT_INFO" nil) (require 'password-cache) (require 'epa-file) (epa-file-enable) (setq password-cache-expiry (* 15 60)) (setq epa-file-cache-passphrase-for-symmetric-encryption t)
Automating my life
Lately I've been doing a lot of work on automating my life. It's been a lot of fun! I've been using Python and Jupyter a lot to create scripts to make myself more productive. I have been customising my notebook to create an optimal work environment. I've been setting up my Emacs environment to make it more effective. It's been nice having the space to do this!
Installing PostgreSQL from source on my Mac
git clone git://git.postgresql.org/git/postgresql.git
I then built it:
cd postgresql
./configure
gmake
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
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 http://twitter.com/oauth/request_token to https://api.twitter.com/oauth/request_token, etc.
callistevents now on GitHub
I wrote a small command-line program this morning called callistevents (from Calendar List Events). It is a Mac OS/X program that lists all the events in a specific calendar between 2 dates.
Renaming XCode Projects
Starting apache on OS/X Mountain Lion
Apache is still bundled with Mountain Lion, but you can no longer start it using the "Sharing" icon under the "System Preferences" app.
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