If you want to use Graphserver to do some analysis with GTFS, you will need to convert GTFS into the database. This is how I did it.
I used the following AMI. If you have enough memory, you don’t need to do this.
ami-7000f019 Lookup and read the GTFSDB INSTALL.txt document
sudo apt-get install mercurial hg clone https://gtfsdb.googlecode.com/hg/ gtfsdb sudo apt-get install python-setuptools sudo easy_install psycopg2 sudo apt-get install build-essential ubuntu@domU-12-31-39-00-5D-B8:/mnt/gtfsdb$ pwd /mnt/gtfsdb sudo python setup.py install sudo wget http://cdn.kelvinism.com/google_transit.zip sudo apt-get install python-psycopg2 EDIT 16-03-2025: I’ve since removed these files.
Read Converting GTFS to GraphServerI decided it was time to take a vacation. There was a problem, however: I was under a lot of pressure to finish school-related work. Is it possible to take a vacation without taking a vacation? I came up with the idea of flying to Perth over the Easter long weekend and then catching the Indian Pacific back to Sydney.
On April 22, I caught an early-evening Qantas flight to Perth and took a taxi to my guesthouse. Although tired from the flight, or perhaps from the two beers I had with dinner, I decided to explore the CBD. The lights were blazing and, despite it being the start of Easter weekend, plenty of people were out. Perth appeared more diverse than I had anticipated, with a strong Asian influence. Many …
Read Perth to Sydney (Indian Pacific)I’ve had several conversations with neighbors and co-workers about the “lack” of forward thinking, or at least the lack of forward action. Of course, I keep in the back of my mind that we aren’t “experts”, and the more I learn about transport the more I learn how complex it is. Dr. Sussman’s CLIOS process (Complex, Large-
Scale, Integrated, Open Systems) appears more and more true the longer I work in and study transport. There is a plethora of excuses that can be made, but the general conclusion was that the earlier we prepare the better. I can remember working near Zhongshan 7-8 years ago and driving around on huge roads in the middle of empty fields. There …
Read Visualizing TransportI’ve been cleaning up my personal blog a bit, and I noticed that my tagging system recently broke. I’ve investigated the cause, and it appears to be because I removed some apps but the contenttypes remained. This meant that whenever I tried calling a tag with a TaggedItem that had been deleted, I was getting this error:
'NoneType' object has no attribute '_meta' The solution is to first list all app_labels for contenttypes, and then delete any not in use.
Read Removing Unused ContentTypesI recently had the desire to send small updates to my so called lifestream page via XMPP/GTalk. I played around with Twisted Words and several other Python XMPP clients, but I didn’t really want to keep a daemon running if unnecessary. It turns out imified took a lot of the pain out of it. The steps for me were as follows:
Create an account with imified, and create a URL, e.g. /app/api/
We then configure the urls.conf
Read Integrate imified into DjangoI was having some issues with my personal mail server (Postfix) and my phone (Android). The logs depicted the below issue:
Jan 9 09:19:53 ip-11-222-23-223 postfix/smtpd[12345]: NOQUEUE: reject: RCPT from 12-13-14-15.abc.com.au[12.13.14.15]: 504 5.5.2 <localhost>: Helo command rejected: need fully-qualified hostname; from=<emailaddr kelvinism.com="kelvinism.com"> to=<emailaddr gmail.com="gmail.com"> proto=ESMTP helo=<localhost> </localhost></emailaddr></emailaddr></localhost> We can see here that the stock Android email client is doing a ‘helo localhost’. One part of my main.cf file specifies this:
Read Stock Android and PostfixI’ve recently returned from a short trip home, and I had a wonderful time. I had the opportunity to visit family and friends, eat plenty of delicious food, and generally relax. I reduced the amount of old belongings stored under the house by 80% and gave away all my old books, which are archived on Goodreads.
Read Home by Christmas, but Not for ChristmasA few weeks ago I saw an opening to give a 5-10 minute lightening talk at SyPy (Sydney Python), and with two nights to prepare, decided it would be interesting to explore Splunk’s usage of Python. You can see the presentation video
Read Hacking Splunk with PythonI like using Ubuntu’s UFW command, but today I needed to allow outgoing ICMP. I received results as so:
$ ping 4.2.2.2 PING 4.2.2.2 (4.2.2.2) 56(84) bytes of data. ping: sendmsg: Operation not permitted ping: sendmsg: Operation not permitted ping: sendmsg: Operation not permitted To allow outbound icmp I edited ‘before.rules’ and added the following lines.
$ sudo vi /etc/ufw/before.rules # allow outbound icmp -A ufw-before-output -p icmp -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT -A ufw-before-output -p icmp -m state --state ESTABLISHED,RELATED -j ACCEPT
Read Enable ICMP through UFWI recently had the need to add some HTML to the label for a form field using Django. The solution is pretty easy, except I didn’t see it written explicitly anywhere, and I missed the memo of the function I should be using.
My form first just had the HTML in the form label as so:
from django import forms class AccountForm(forms.Form): name = forms.CharField(widget=forms.TextInput(), max_length=15, label='Your Name (why?') However, when I displayed it, the form was autoescaped.
Read Using HTML in a Django form label