Skip to content

Instantly share code, notes, and snippets.

View fvoges's full-sized avatar
:octocat:

Federico Voges fvoges

:octocat:
View GitHub Profile
@npwalker
npwalker / puppet_cron
Last active October 7, 2016 21:03
A puppet manifest to disable the pe-puppet daemon and instead enable a cron job to run puppet with a random starting time. This will help avoid a thundering herd problem.
$runinterval = 30 #minutes
$first_run = fqdn_rand($runinterval)
$second_run = $first_run + $runinterval
cron { 'cron.puppet':
command => "/opt/puppetlabs/bin/puppet agent -t > /dev/null",
user => "root",
minute => [ $first_run, $second_run ],
}
@bradleyboy
bradleyboy / nginx.conf
Last active March 22, 2022 19:46
nginx rewrite setup for Koken
# Enable gzip. Highly recommending for best peformance
gzip on;
gzip_comp_level 6;
gzip_types text/html text/css text/javascript application/json application/javascript application/x-javascript;
# By default, do not set expire headers
expires 0;
# Set expires header for console CSS and JS.
# These files are timestamped with each new release, so it is safe to cache them agressively.
@frimik
frimik / gist:4730558
Last active December 7, 2016 06:59
Foreman + Libvirt

TheForeman + Libvirt notes

Foreman+KVM on the same physical host

Set up a bridge

  • virsh iface-bridge eth0 br0
  • If you had NM_CONTROLLED=no in there, re-add it to both ifcfg files because virsh probably just removed it for you.
@tsileo
tsileo / glaciervault.py
Created October 17, 2012 20:12
Wrapper for uploading/download archive to/from Amazon Glacier Vault
# encoding: utf-8
import os
import shelve
import boto.glacier
import boto
from boto.glacier.exceptions import UnexpectedHTTPResponseError
ACCESS_KEY_ID = "XXXXXXXXXXXXX"
SECRET_ACCESS_KEY = "XXXXXXXXXXX"
SHELVE_FILE = os.path.expanduser("~/.glaciervault.db")
@endolith
endolith / export_google_starred_locations.py
Created October 16, 2012 02:29
Export Google Maps starred locations
# -*- coding: utf-8 -*-
"""
Go to Google Bookmarks: https://www.google.com/bookmarks/
On the bottom left, click "Export bookmarks": https://www.google.com/bookmarks/bookmarks.html?hl=en
After downloading the html file, run this script on it to generate a KML.
"""
#!/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
@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
@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
@fvoges
fvoges / debian_install.sh
Last active May 16, 2025 08:45
Quick & Dirty rcfiles install
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get update && sudo apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade -y && sudo apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" dist-upgrade -y && sudo apt-get autoclean && sudo apt-get autoremove -y;sudo update-grub2
sudo apt-get install -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" ack-grep apt-file bash-completion bsdmainutils ccze colordiff curl git htop jq lftp lynx make mc mutt net-tools psmisc rsync sysstat telnet tree wget vim-nox && \
curl -q https://gist.githubusercontent.com/fvoges/741de3b432e19c11c9bb/raw/rcinstall.sh|sudo -i bash
curl -q https://gist.githubusercontent.com/fvoges/741de3b432e19c11c9bb/raw/rcinstall.sh|bash
@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