Skip to content

Instantly share code, notes, and snippets.

@anl
anl / streisand_prereqs.sh
Last active Jul 1, 2016
Installing streisand prereqs in a virtualenv on OS X
View streisand_prereqs.sh
brew install gmp
brew install libffi
virtualenv ~/virtualenvs/streisand
. ~/virtualenvs/streisand/bin/activate
pip install -U pip
pip install -U setuptools
env "CFLAGS=-I/usr/local/include -L/usr/local/lib" pip install pycrypto
pip install ansible
View compress_ghe_logs.sh
# Undocumented, unsupported means to compress GitHub Enterprise logs:
yes | ghe-unlock
sudo -u git gzip /var/log/github/unicorn.log.1
ghe-lock
View pre-commit
#!/bin/bash
# Adapted from a puppet pre-commit hook at:
# http://blog.snijders-it.nl/2011/12/example-puppet-27-git-pre-commit-script.html
#
# install this as .git/hooks/pre-commit to check DNS zone files
# for errors before committing changes.
rc=0
@anl
anl / purge-vm.sh
Last active Oct 13, 2015
Purge Ubuntu VM prior to imaging on SmartOS; tested with 12.04.
View purge-vm.sh
#!/bin/bash
# This script assumes:
# 1) Joyent's vmtools are installed; and
# 2) /etc/rc.local contains:
# /usr/sbin/dpkg-reconfigure openssh-server
# or the equivalent.
/usr/bin/apt-get update
/usr/bin/apt-get -y dist-upgrade
@anl
anl / smartos-graphite.sh
Created Dec 10, 2012
Bootstrap Graphite on SmartOS
View smartos-graphite.sh
dataset=$(zfs list | grep data | awk '{print $1}')
sudo zfs set mountpoint=/data $dataset
sudo groupadd graphite
sudo useradd -c "Graphite User" -m -d /data/graphite -g graphite -s /bin/bash graphite
sudo pkgin up
sudo pkgin -y ug
sudo pkgin -y in gcc47
sudo pkgin -y in openldap-client
View site.config.m4
APPENDDEF(`confENVDEF', `-UNIS')
APPENDDEF(`confENVDEF',`-DSTARTTLS')
APPENDDEF(`confLIBS', `-lssl -lcrypto')
APPENDDEF(`confENVDEF', `-D_FFR_TLS_1')
View sendmail.mc
divert(-1)dnl
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
VERSIONID(`setup for linux')dnl
OSTYPE(`linux')dnl
define(`confDEF_USER_ID', ``8:12'')dnl
define(`confTO_CONNECT', `1m')dnl
define(`confTRY_NULL_MX_LIST', `True')dnl
define(`confDONT_PROBE_INTERFACES', `True')dnl
define(`PROCMAIL_MAILER_PATH', `/usr/bin/procmail')dnl
View drop_tarball.pp
# Small define to expand a tarball at a location; assumes File[$title]
# definition of tarball and installation of pax:
define baselayout::drop_tarball($dest, $dir_name, $dir_sub='') {
# $dest: cwd in which expansion is done
# $dir_name: name of top level directory created in $dest
# $dir_sub: regexp to -s for pax - not supported for .zip archives
if ($dir_sub) {
View qimo.pp
# How obsessive sysadmins install Qimo for their four year olds at home:
class qimo {
# # Qimo lives in the universe repository - activate if necessary, assuming @apt::repo["universe"]
# # elsewhere in Puppet config (uncomment require in Package["qimo-session"] as well):
# realize Apt::Repo["universe"]
package { "qimo-session":
ensure => present,
# require => Apt::Repo["universe"],
View slapd.default
# Location of the slapd configuration to use. If using the cn=config
# backend to store configuration in LDIF, set this variable to the
# directory containing the cn=config data; otherwise set it to the location
# of your slapd.conf file. If empty, use the compiled-in default
# (/etc/ldap/slapd.d).
SLAPD_CONF=/opt/openldap/etc/openldap/slapd.conf
# System account to run the slapd server under. If empty the server
# will run as root.
SLAPD_USER="openldap"
You can’t perform that action at this time.