How to setup Python Twitter Tools

I’m just playing around with Python Twitter Tools but given that I am new to Python, I can’t work out to set it up. Step 1: Download and unzip the files from: https://github.com/sixohsix/twitter Step 3: Install python-pip on your computer which is a tool for installiing Python software: apt-get install python-pip Step 4: Browse the … Read more

How to change the font size of SyntaxHighlighter

I’ve just installed SyntaxHighlighter on this blog to style the code snippets. The default font-size was too large for the website. They don’t seem to have any documention or setting to adjust the font-size. The solution is to add some custom css to your theme style:

How to pipe Apache logs to a python script

I wanted to pipe the output of my Apache’s error logs to a Python script. To do this you need to set the a CustomLog directive in your Apache Config. Edit /etc/apache2/sites-available/default and add the following line: To read the input into Python you need to setup a non-blocking read from stdin. Obviously, this script … Read more

Only running command if file doesn’t exist Ansible

I have a simple build script which installs wkhtmltophf on a server. However I only want this script to be run if the software isn’t already installed. Essentially, I want an if statement or check statement in Ansible. I.e. If file doesn’t exist then run this command. I have read the Ansible documentation multiple times … Read more

How to import maxmind ip locations in mysql

I’m just building a map of some ip addresses and need to geolocate them. I decided to use the MaxMind database. I found these two brilliant resource without which I could not have imported the databases properly. There are: http://www.dbasquare.com/2012/06/01/implementing-efficient-geo-ip-location-system-in-mysql/ http://nickbartlett.com/wordpress/using-maxmind-geo-city-lite-database-on-your-website/

How to secure an Ubuntu Server

Just going through the process of making an Ubuntu server PCI compliant and found this really nice post about how to secure an Ubuntu server. http://www.thefanclub.co.za/how-to/how-secure-ubuntu-1204-lts-server-part-1-basics