Skip to content

2015

Python simple web server

The absolutely fastest way to get a simple web server up and running using Python 3, for development purposes.

cd my_web_root
python -m http.server

Or if you are on Python 2.x:

cd my_web_root
python -m SimpleHTTPServer 8000

Then just access http://your-ip:8000 to access the web server contents. Hit ctrl+c to exit.

CentOS 6 yum errors (and fixes)

Issues

Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again

or

Error: xz compression not available

Fix

yum remove epel-release
rm -rf /var/cache/yum/x86_64/6/epel
yum install epel-release

Flickr dumpr

Downloads all of your flickr albums (original photo/video files). Requires Python 2.7 with the flickrapi module.

Check out the code over at its Github repository.

Installing PySide into a virtualenv

I’ve been struggling to install a portable/relocatable virtualenv with PySide 1.2.2 for Python 2.7. On Windows, this works out of the box but it’s more difficult on Linux and OS X, although I came up with a patch for OS X. This guide will not go into detail on portability/relocatability and will merely touch upon how to get started with PySide in a virtualenv. It looks like PySide 1.2.3 will have substantial changes which will allow for easier portability/relocatability and I will make a post on that as soon as it is generally available.

Getting quick access to new Google Cloud SDK features

There is a two-week delay before gsutil gets updated with the latest and greatest. If you want to try the new stuff out, pip install the SDK!

sudo yum install gcc openssl-devel python-devel python-setuptools libffi-devel
sudo yum install python-pip
sudo pip install -U gsutil

Then execute gsutil like this:

/usr/bin/gsutil

To access beta (or even alpha) features of gcloud, execute gcloud like this:

gcloud beta compute instances ...