Skip to content

Instantly share code, notes, and snippets.

View bionix's full-sized avatar

Markus Baumann bionix

View GitHub Profile
@bionix
bionix / gist:6856917
Created October 6, 2013 17:43
A puppet cron job snippet for a poll cron task for puppet runs
# establishes a cron entry that runs the puppet agent every 30 minutes, starting
# at a time that is derived from the primary ip-address
# largely based on http://projects.puppetlabs.com/projects/1/wiki/Cron_Patterns
$timeoffset1 = ip_to_cron(1,29)
$timeoffset2 = $timeoffset1 + 30
cron { "puppet":
ensure => present,
command => "puppet agent --onetime --no-daemonize --environment ${environment} --fqdn ${hostname}.${dnsdomain} --logdest syslog > /dev/null 2>&1",
user => "root",
minute => [ $timeoffset1, $timeoffset2 ],
#!/bin/bash
set -e
case "$PACKER_BUILDER_TYPE" in
virtualbox-iso|virtualbox-ovf)
echo "==> Start VBoxGuestAdditions installation"
# The netboot installs the VirtualBox support (old) so we have to remove it
if test -f /etc/init.d/virtualbox-ose-guest-utils ; then
user nginx;
worker_processes 1;
error_log /var/log/nginx/error_log_pipe warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@bionix
bionix / gist:dab8b8e88346871eb0e3
Last active August 29, 2015 14:05
Upgrade pgsql 9.1 to 9.3 (Gitlab + Debian Wheezy)
echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-9.3 postgresql-server-dev-9.3 postgresql-contrib-9.3 -y
sudo su - postgres -c "psql template1 -p 5433 -c 'CREATE EXTENSION IF NOT EXISTS hstore;'"
sudo su - postgres -c "psql template1 -p 5433 -c 'CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";'"
sudo su - postgres -c "service postgresql stop" # // service postgresql stop
sudo su - postgres -c '/usr/lib/postgresql/9.3/bin/pg_upgrade -b /usr/lib/postgresql/9.1/bin -B /usr/lib/postgresql/9.3/bin -d /var/lib/postgresql/9.1/main/ -D /var/lib/postgresql/9.3/main/ -O " -c config_file=/etc/postgresql/9.3/main/postgresql.conf" -o " -c config_file=/etc/postgresql/9.1/main/postgresql.conf"'
sudo apt-get remove postgresql-9.1 -y
@bionix
bionix / subtlety.tmw
Last active August 29, 2015 14:12 — forked from kelsin/subtlety.tmw
^1^T^SNumGroups^N2 ^SGroups^T ^N1^T ^SPoint^T ^Sy^F7459061113028608 ^f-48^Sx ^F-4960995390783488^f-45 ^t^SRole^N1 ^SColumns^N5 ^SOnlyInCombat^B ^STree2^b ^SGUID^STMW:group:1KVCcgq_hOx2 ^STree1^b ^SIcons^T ^N1^T ^SType^Scooldown ^SName^SEviscerate ^SGUID^STMW:icon:1KVCegGqASOz ^SFakeHidden^B ^SConditions^T ^N1^T ^SType^SCOMBO ^SOperator^S>= ^SLevel^N5 ^t^Sn^N1 ^t^SEnabled^B ^t^N2^T ^SShowTimer^B ^SBuffOrDebuff^SHARMFUL ^SType^Sbuff ^SName^SRupture ^SGUID^STMW:icon:1KVCegGv6G2c ^SShowTimerText^B ^SShowWhen^N3 ^SUnit^Starget ^SDurationMaxEnabled^B ^SFakeHidden^B ^SOnlyMine^B ^SConditions^T ^N1^T ^SType^SCOMBO ^SOperator^S>= ^SLevel^N5 ^t^Sn^N1 ^t^SEnabled^B ^SDurationMax^N8 ^t^N3^T ^SShowTimer^B ^SType^Sbuff ^SName^SSlice~`and~`Dice ^SGUID^STMW:icon:1KVCegGx62r_ ^SDurationMaxEnabled^B ^SShowTimerText^B ^SShowWhen^N3 ^SEnabled^B ^SFakeHidden^B ^SConditions^T ^N1^T ^SType^SCOMBO ^SOperator^S>= ^SLevel^N5 ^t^Sn^N1 ^t^SOnlyMine^B ^SDurationMax^N10 ^t^N4^T ^SShowTimer^B ^SBuffOrDebuff^SHARMFUL ^SType^Sbuff ^SName^SHe
@bionix
bionix / .tmux.conf
Last active August 29, 2015 14:13 — forked from v-yarotsky/.tmux.conf
### INSTALLATION NOTES ###
# 1. Install Homebrew (https://github.com/mxcl/homebrew)
# 2. brew install zsh
# 3. Install OhMyZsh (https://github.com/robbyrussell/oh-my-zsh)
# 4. brew install reattach-to-user-namespace --wrap-pbcopy-pbpaste && brew link reattach-to-user-namespace
# 5. Install iTerm2
# 6. In iTerm2 preferences for your profile set:
# Character Encoding: Unicode (UTF-8)
# Report Terminal Type: xterm-256color
# 7. Put itunesartist and itunestrack into PATH
@bionix
bionix / .tmux.conf
Last active August 29, 2015 14:13 — forked from eseceve/.tmux.conf
### INSTALLATION NOTES ###
# 1. Install Homebrew (https://github.com/mxcl/homebrew)
# 2. brew install zsh
# 3. Install OhMyZsh (https://github.com/robbyrussell/oh-my-zsh)
# 4. brew install reattach-to-user-namespace --wrap-pbcopy-pbpaste && brew link reattach-to-user-namespace
# 5. Install iTerm2 (https://code.google.com/p/iterm2/downloads/list)
# 6. In iTerm2 preferences for your profile set:
# Character Encoding: Unicode (UTF-8)
# Report Terminal Type: xterm-256color
# 7. Get scripts for status-right
#! /bin/bash
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
@bionix
bionix / redis_
Last active August 29, 2015 14:16
#!/usr/bin/perl -w
#
## Copyright (C) 2009 Gleb Voronich <http://stanly.net.ua/>
##
## This program is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License
## as published by the Free Software Foundation; version 2 dated June,
## 1991.
##
@bionix
bionix / muttrc
Last active August 29, 2015 14:21 — forked from xnyhps/muttrc
set imap_pass = `security find-internet-password -g -a "johndoe" -s "example.com" -r "imap" -w`
set smtp_pass = `security find-internet-password -g -a "johndoe" -s "example.com" -r "smtp" -w`