Skip to content

Instantly share code, notes, and snippets.

for FILE in $(find . -type f -name \*.template.yml) ; do
NEW_FILE=${FILE::${#FILE}-4}
python -c 'import sys, yaml, json; yaml.dump(json.load(sys.stdin), sys.stdout, indent=4)' < $FILE > $NEW_FILE
done
@gabereiser
gabereiser / preseed.cfg
Created February 21, 2016 20:25
Ubuntu Server Preseed
#### Contents of the preconfiguration file (for xenial)
### Localization
# Preseeding only locale sets language, country and locale.
d-i debian-installer/locale string en_US
# The values can also be preseeded individually for greater flexibility.
#d-i debian-installer/language string en
#d-i debian-installer/country string NL
#d-i debian-installer/locale string en_GB.UTF-8
# Optionally specify additional locales to be generated.
@gabereiser
gabereiser / gist:8833668
Created February 5, 2014 21:36
IPv6 node.js server
var http = require('http')
var server
function onRequest(req, res) {
console.log('[' + this.name + ']', req.method, req.url)
res.writeHead(200, {'Content-Type': 'text/plain'})
res.end('Hello World\n')
}
function onListening() {
@gabereiser
gabereiser / q_rsqrt.c
Created January 13, 2014 20:52
Q_rsqrt
float Q_rsqrt( float number )
{
long i;
float x2, y;
const float threehalfs = 1.5F;
x2 = number * 0.5F;
y = number;
i = * ( long * ) &y; // evil floating point bit level hacking
i = 0x5f3759df - ( i >> 1 ); // what the fuck?
@gabereiser
gabereiser / .profile
Last active February 16, 2017 20:12
My mac .profile I use on almost every mac
function git_prompt_info()
{
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "("${ref#refs/heads/}")"
}
# define colors
C_DEFAULT="\[\033[m\]"
C_WHITE="\[\033[1m\]"
C_BLACK="\[\033[30m\]"