Skip to content

Instantly share code, notes, and snippets.

View andrewspiers's full-sized avatar

Andrew Spiers andrewspiers

  • Adelaide, Australia
View GitHub Profile
@andrewspiers
andrewspiers / BuildingOfflineDocumentationForSetuptools
Last active January 1, 2016 16:08
Building Offline Documentation for Setuptools
Building Offline Documentation for Setuptools
---------------------------------------------
1. Download setuptools from pypi
2. Navigate to the top level directory, that contains setup.py
3. >>> python setup.py build-sphinx
There is a Makefile in the docs directory
that gets used to build the documentation, but it cannot be used directly
from that directory.
@andrewspiers
andrewspiers / speedjenkins.sh
Created October 16, 2013 15:49
speed jenkins with puppet for centos 6
#!/bin/bash
#install puppet
rpm -ivh http://yum.puppetlabs.com/el/6/products/i386/puppetlabs-release-6-7.noarch.rpm
#puppet one liner to install java (works as well as yum -y install)
puppet apply -e 'package {"java-1.7.0-openjdk": ensure => installed, }'
#grab someone else's code to install jenkins:
puppet module install maestrodev/jenkins
#use it
puppet apply -e 'include jenkins'
import sys
def seconds(line):
"""
convert a string like 5:32
which means five minutes 32 seconds
to one like 332 (seconds)
"""
splitted = line.split(":")
assert len(splitted) == 2