Skip to content

Instantly share code, notes, and snippets.

View prologic's full-sized avatar
👋
Principal SRE, Founder of Yarn.social and Salty.im

James Mills prologic

👋
Principal SRE, Founder of Yarn.social and Salty.im
View GitHub Profile
@prologic
prologic / getpass
Created February 22, 2015 22:14
created by github.com/tr3buchet/gister
#!/bin/bash
function getpass() {
if [[ -f $HOME/.passwd.cpt ]]; then
password=$(ccrypt -c $HOME/.passwd.cpt | egrep $1 | cut -f 3 -d ":")
else
password=$(egrep $1 $HOME/.passwd | cut -f 3 -d ":")
fi
if [[ $password == "" ]]; then
@prologic
prologic / gist:1542735b78a263290fc7
Created February 20, 2015 04:56
created by github.com/tr3buchet/gister
$ cat .pypirc | sed -e "s/password\: .*/password: xxxx/g"
[server-login]
repository: https://pypi.python.org/pypi
username: prologic
password: xxxx
[testpypi]
repository: http://testpypi.python.org/pypi
username: prologic
password: xxxx
@prologic
prologic / Pkgfile
Created February 18, 2015 03:12
Pkgfile for a Makefile that mutate SRC
# ...
name=foo
version=1.0
source=(...)
build() {
OLD_SRC = $SRC
make
SRC = $OLD_SRC
@prologic
prologic / gist:0b167a68b441194324a2
Created February 13, 2015 08:46
created by github.com/tr3buchet/gister
prologic@daisy
Fri Feb 13 18:35:23
~/contrib/docker-machine
$ fakeroot pkgmk -d
=======> Building '/data/packages/docker-machine#0.1.0-rc3-1.pkg.tar.gz'.
bsdtar -p -o -C /home/prologic/contrib/docker-machine/work/src -xf /data/sources/machine-0.1.0-rc3.tar.gz
+ build
+ export GOPATH=/home/prologic/contrib/docker-machine/work/src/src
+ GOPATH=/home/prologic/contrib/docker-machine/work/src/src
+ cd machine-0.1.0-rc3
@prologic
prologic / Vagrantfile
Created February 13, 2015 00:04
created by github.com/tr3buchet/gister
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "hashicorp/precise64"
config.vm.network "public_network"
@prologic
prologic / .config.diff
Created February 11, 2015 04:43
Kernel Config changes required for Docker 1.4.0 -> 1.5.0 (CRUX)
# diff -u <(zcat /proc/config.gz ) <(cat .config)
--- /dev/fd/63 2015-02-11 14:45:39.309910447 +1000
+++ /dev/fd/62 2015-02-11 14:45:39.309910447 +1000
@@ -132,16 +132,17 @@
CONFIG_ARCH_WANTS_PROT_NUMA_PROT_NONE=y
CONFIG_CGROUPS=y
# CONFIG_CGROUP_DEBUG is not set
-# CONFIG_CGROUP_FREEZER is not set
+CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_DEVICE=y
@prologic
prologic / gist:6d481b69f94233ce7363
Created February 9, 2015 05:39
created by github.com/tr3buchet/gister
#!/bin/bash
# Tool: fix-codebase.sh
# Author: James Mills, prologic at shortcircuit dot net dot au
# Date: 09 February 2015
# Fix a Python codebase that may contain several common issues:
# - PEP8 violations
# - Tabs instead of spaces
# - CRLF (Windows) style line endings instead of LF (UNix) style line endings
@prologic
prologic / fix-codebase.sh
Created February 9, 2015 05:38
created by github.com/tr3buchet/gister
#!/bin/bash
# Tool: fix-codebase.sh
# Author: James Mills, prologic at shortcircuit dot net dot au
# Date: 09 February 2015
# Fix a Python codebase that may contain several common issues:
# - PEP8 violations
# - Tabs instead of spaces
# - CRLF (Windows) style line endings instead of LF (UNix) style line endings
(django-upgrade)➜ ~ diff -u django-template-parser-1.2.py django-template-parser-1.4.py
--- django-template-parser-1.2.py 2015-01-29 15:04:34.579306331 +1000
+++ django-template-parser-1.4.py 2015-01-29 15:03:43.918306352 +1000
@@ -7,28 +7,32 @@
self.add_library(lib)
def parse(self, parse_until=None):
- if parse_until is None: parse_until = []
+ if parse_until is None:
+ parse_until = []
@prologic
prologic / gist:6fd21b797bb6ee9b5c6e
Created January 18, 2015 02:53
created by github.com/tr3buchet/gister
# setup-chroot
bash-4.3# blkid
/dev/sr0: UUID="2015-01-15-04-07-33-00" LABEL="CRUX-3.1-updated" TYPE="iso9660" PTUUID="675ad9ef" PTTYPE="dos"
/dev/sda1: UUID="c85e110e-2f37-4a63-9124-bcecc494b628" SEC_TYPE="ext2" TYPE="ext3" PARTUUID="00005501-01"
/dev/sdf1: UUID="8503f5d8-d5b3-4d06-8679-ee5ad2008c95" TYPE="ext4" PARTUUID="ca70eb3a-01"
bash-4.3# mv /boot/menu.lst /boot/grub.cfg
bash-4.3# cat /boot/grub.cfg
search --no-floppy --fs-uuid --set=root 8503f5d8-d5b3-4d06-8679-ee5ad2008c95
terminal_output gfxterm