Archlinux Pacman Update Fix

I’m writing this up as a quick solution to archlinux’s dreaded pacman update problem. If you have yaourt installed simply update package-query through it and update pacman normally. yaourt -S package-query pacman -Syu Make sure also to delete the SyncFirst option from /etc/pacman.conf

August 25, 2013 · Shane Dowling

Writing Django tests for PostGis

PostGis is awesome, I think I already established this in this post. However when you start writing django tests you might start getting errors complaining that certain postgres libs cannot be found. This is because you’ve failed to create a proper postgres_template database for your test database to work with. Run these commands in your postgres prompt to create the appropriate template. CREATE DATABASE template_postgis ENCODING='utf-8'; UPDATE pg_database SET datistemplate='true' WHERE datname='template_postgis'; sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-1.5/postgis.sql sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-1.5/spatial_ref_sys.sql sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis_comments.sql sudo -u postgres psql -d template_postgis -c 'GRANT ALL ON geometry_columns TO PUBLIC;' sudo -u postgres psql -d template_postgis -c 'GRANT ALL ON geography_columns TO PUBLIC;' sudo -u postgres psql -d template_postgis -c 'GRANT ALL ON spatial_ref_sys TO PUBLIC;' If you decide to name your postgis template something other than template_postgis, make sure you tell Django by putting the below into settings.py ...

August 24, 2013 · Shane Dowling

Install nzbget using salt

Recently I’ve been using vagrant to configure more and more of the local webapps I’m using day to day, simply as I find sticking all the apps I use on my host machine a little messy. I’ve also been picking up salt-stack with salt-states as the provisioner as I personally prefer it a lot more than puppet/chef. As a learning exercise I figured I’d setup nzbget using salt, it’s good because it requires a few config files and some compiling. You can find the repo here. Should be fairly self explanatory, but there’s more details in the README. If you’ve any questions just ask in the comments. ...

August 23, 2013 · Shane Dowling

Octopress back to Wordpress

I’ve been using Octopress for the last while and it felt good having a nice fast static blog as opposed to heavy-old Wordpress. After time passed however, I noticed I wrote less. Having to grab my laptop and pull up vim to write something, then play around with git or a sometimes having dodgy rsync problems it made the whole process less seamless. Jumping straight onto Wordpress anywhere I felt like(even my phone), has made the ability to write much more present during my day and naturally as a result I’m writing more. ...

August 22, 2013 · Shane Dowling

Postgis

from cities.models import City cape_town = City.objects.filter(country__name=‘South Africa’).get(name=‘Cape Town’) nearest = City.objects.distance(cape_town.location).exclude(id=cape_town.id).order_by(‘distance’)[:10000] I must be very damaged from location data being badly implemented in MySQL. I’m still amazed that this request could be under a second, let alone be pretty much instant. Postgis is basically the coolest thing ever. Oh and in case you were curious(which you weren’t), this place is in terms of distance the 10000th closest place to Cape Town. ...

August 19, 2013 · Shane Dowling

GSD 1 — Reducing Distractions

Most of my distractions currently come from within. I hit up social media or news sites. Also my email is a big time waster. I needed a way to remain connected but while preventing regular access. Here’s what helped. Get Shit Done-A cross platform OS level site blocker. Simply install the script, add your distracting sites and run ‘get-shit-done work’ in a terminal. You only notice sheer number of times you find yourself flicking to those distracting sites when a big error is thrown that the site is unavailable. It’s a learning experience. Your browser however, may cache URL lookups and you may still access distracting sites when I shouldn’t and visa-versa. On Firefox there is an extension called DNS Cache. It allows you to prevent Firefox caching DNS entries, I presume this slows down URL requests but I barely noticed a difference and GSD now works as it should. ...

August 3, 2013 · Shane Dowling

Getting Shit Done

I created a number of long term goals recently and have been trying to work out a system within which I can continue to keep my focus on those long term goals and reduce procrastination. I try to promote a daily focus on long term tasks through reminders and regular reviews while reducing procrastination through a set of core tools. I tried multiple tools/tricks and what I’ll post a series on the tools and tricks I used. ...

August 1, 2013 · Shane Dowling

Writing Less

“I didn’t have time to write a short letter, so I wrote a long one instead.” — Mark Twain Lately I’ve been struggling with consistently writing. I find it difficult to sit down in the morning and begin to write. Usually ideas fall out of my head and I get into a flow quite quickly but recently, without a clear idea sitting in my head for a period of time I simply can’t put pen to paper. ...

July 29, 2013 · Shane Dowling

Tired meditation

When I imagine myself doing meditation, I see myself almost leaping out of bed with boundless energy, followed by a full and focused period of breathing exercises. Nothing could be further from the truth. Right now I’m working through the Discovery Series on Headspace and it’s focusing more on looking at your body and how it feels. Now, a lot of what the meditation suggests is, is to use focus to alleviate the negative feelings that occur in your body. This is great and it does help a lot but I have a fairly recurring and distracting problem when meditation. ...

July 25, 2013 · Shane Dowling

South Africa

I’d been in Cape Town for two weeks beforehand, just remotely working and doing some sightseeing around the area. So I had plenty of time for prep for the trip and was pretty relaxed arriving at Ashanti Logde(where the trip starts). The trip was booked through African Budget Safari’s which seemed to the cheapest option around. The dates I had originally planned to travel with(and booked) were unavailable and ABS happily changed my dates and gave me a heavy discount(about 25%). On top of that I declined the free activities in Cape Town, so I was given free upgrade at Ashanti to my own room. So I can definitely recommend African Budget Safari’s as an agent and also chance your arm and see what discounts you can get. ...

July 20, 2013 · Shane Dowling