Skip to content

Instantly share code, notes, and snippets.

View fvoges's full-sized avatar
:octocat:

Federico Voges fvoges

:octocat:
View GitHub Profile
@hunner
hunner / .gitconfig
Last active September 26, 2016 09:25
Pretty format `git lg`
[alias]
# See http://cat.pdx.edu/~hunner/git-lg.png for an example
lg = "log --decorate --pretty=format:'%C(yellow)%h%C(reset) %C(green)%G?%C(reset) %C(blue)%an%C(reset) %C(cyan)%cr%C(reset) %s %C(auto)%d%C(reset)' --graph --date-order"
@blueyed
blueyed / Puppet config snippet to define a Launchpad PPA
Created February 25, 2011 23:48
This defines pparepo which allows to add a PPA (Personal Package Archive) repository from Launchpad to a client. It uses apt::key, which I have taken (and maybe modified) from http://projects.puppetlabs.com/projects/1/wiki/Apt_Keys_Patterns (blog post at
# Setup a PPA repo, where the name is "user/ppaname", e.g. "blueyed/ppa" ("ppa" being the default)
define pparepo($apt_key = "", $dist = $ppa_default_name, $supported = ["lucid", "hardy"], $ensure = present, $keyserver = "keyserver.ubuntu.com") {
$name_for_file = regsubst($name, '/', '-', 'G')
$file = "/etc/apt/sources.list.d/pparepo-${name_for_file}.list"
file { "$file": }
case $ensure {
present: {
if ($dist) and ($dist in $supported) {
File["$file"] {
@epegzz
epegzz / Monaco_Linux-Powerline.ttf
Created January 18, 2012 17:19
Monaco for vim-powerline
@dfox
dfox / update-route53-dns.sh
Created January 25, 2012 17:19
A script to update DNS on Route 53
#!/bin/sh
# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
# Load configuration
. /etc/route53/config
@antaflos
antaflos / foreman-ubuntu-12.04.preseed
Created June 14, 2012 16:33
Foreman Ubuntu 12.04 preseed provision template
d-i debian-installer/language string en
d-i debian-installer/country string AT
d-i debian-installer/locale string en_IE.UTF-8
d-i localechooser/supported-locales en_US.UTF-8, en_IE.UTF-8
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/xkb-keymap string de
d-i keyboard-configuration/layoutcode string de
d-i keyboard-configuration/modelcode string pc105
d-i console-keymaps-at/keymap string de-latin1-nodeadkeys
@antaflos
antaflos / foreman-ubuntu-12.04.pxe
Created June 14, 2012 16:34
Foreman Ubuntu 12.04 PXE provision template
default Ubuntu
label Ubuntu
kernel <%= @kernel %>
append initrd=<%= @initrd %> video=vga16fb:off vga16fb.modeset=0 interface=eth0 url=<%= foreman_url("provision")%> ramdisk_size=10800 root=/dev/rd/0 rw auto=true priority=critical hostname=unassigned-hostname DEBCONF_DEBUG=5 language=en locale=en_IE.UTF-8 console-setup/ask_detect=false keyboard-configuration/layoutcode=de console-keymaps-at/keymap=de-latin1-nodeadkeys keyboard-configuration/xkb-keymap=de debian-installer/country=AT debian-installer/fb=false BOOTIF=<%= mac %>
@antaflos
antaflos / foreman-ubuntu-10.04-12.04.ptable
Created June 14, 2012 23:15
Foreman Ubuntu 10.04/12.04 partition table
d-i partman-auto/disk string /dev/vda
d-i partman-auto-lvm/guided_size string max
d-i partman-auto-lvm/new_vg_name string vg_sys01
d-i partman-auto-lvm/no_boot boolean true
d-i partman-auto/method string lvm
d-i partman-auto/purge_lvm_from_device boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman/confirm_write_new_label boolean true
@knowshan
knowshan / puppet-pre-commit.sh
Created July 16, 2012 20:34
A Git pre-commit hook for Puppet to validate syntax and style
#!/bin/bash
# Description: A Git pre-commit hook for Puppet manifests
# Validates Puppet manifest syntax amd style
# * Syntax validation: Using puppet parser as documented on Puppet wiki
# - http://projects.puppetlabs.com/projects/1/wiki/Puppet_Version_Control
# * Style validation: Using puppet lint
# Requirements:
# * Ruby 1.8.7
@tsileo
tsileo / duptools.sh
Created July 19, 2012 22:08
A bash script to simplify backup management with duplicity (encrypted incremental backups on amazon S3)
#!/bin/bash
export AWS_ACCESS_KEY_ID=YOUR_ACCESS_KEY
export AWS_SECRET_ACCESS_KEY=YOUR_SECRET_ACCESS_KEY
export PASSPHRASE=YOU_PASSHRASE
# directories, space separated
SOURCE="/home/thomas/backup /home/thomas/bin /home/thomas/documents"
BUCKET=s3+http://mybucket
LOGFILE=/home/thomas/tmp/duplicity.log
# set email to receive a backup report
#!/bin/bash
#
# This is the script responsible for updating our Puppet master data,
# which includes modules, manifests, hiera data, etc. All of this data is
# managed in a git repository and upon "deploy" it is synced into the Puppet
# master.
#
# This script mirrors the remote git repository, looking for branches that
# match "env-*" (such as "env-production" or "env-test"). Each of these branches
# is setup as an environment into the Puppet master's data files. The