Skip to content

Instantly share code, notes, and snippets.

View thwarted's full-sized avatar
🥓
increasingly at large

Andy Bakun thwarted

🥓
increasingly at large
View GitHub Profile
#!/bin/bash -x
set -e
rm -rvf /srv/mypup/ /var/lib/puppetmaster/*
# Where you'll deploy puppet configuration (this is what you want version controlled)
# You may expect this to be /etc/puppet or /etc/puppetmasters, but deploying regularly
# updated stuff to /etc makes my sysadmin sense tingle (in a bad way), and the
# manifests can get kind of large
@thwarted
thwarted / gist:7667199
Created November 26, 2013 22:07
pretty printed git log
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
https://coderwall.com/p/euwpig
@thwarted
thwarted / start-minimal-apache
Created November 27, 2013 07:58
minimum Apache command line to start up a single shot web server with directory indexes and logging to the terminal. Uses compiled in default for ServerRoot (so modules can be found)
httpd \
-f /dev/null \
-C 'LoadModule autoindex_module modules/mod_autoindex.so' \
-C 'LoadModule log_config_module modules/mod_log_config.so' \
-C 'LoadModule dir_module modules/mod_dir.so' \
-C "DocumentRoot $( readlink -f .)" \
-C 'Listen 7000' \
-C 'ErrorLog /dev/stdout' \
-C 'PidFile /tmp/pidfile' \
-C 'LogFormat "%h %l %u %t \"%r\" %>s %b" common' \
@thwarted
thwarted / tmux-keep-ssh-agent-socket.sh
Last active June 10, 2022 22:31
the shell function tmx will start a new, persistent (meaning you can be connected to it multiple times at the same time), with the ssh-agent connection available even if you get disconnected and reconnect
#!/bin/bash
# source this file in the shell
#
# the shell function tmx will start a new, persistent (meaning you can be
# connected to it multiple times at the same time), with the ssh-agent
# connection available even if you get disconnected and reconnect
#
# start or connect to an instance named "default"
# tmx
@thwarted
thwarted / heroku-toolbelt.spec
Last active January 2, 2016 10:29
rpm .spec file for heroku-toolbelt
Name: heroku-toolbelt
Version: 3.2.1
Release: 1%{?dist}
Summary: Heroku Toolbelt Client
Group: Development
License: Unknown
URL: https://toolbelt.heroku.com/
#Source0:
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist>
<array>
<dict>
<key>AudioList</key>
<array>
<dict>
<key>AudioBitrate</key>
<string>320</string>
@thwarted
thwarted / auto.nfs4
Last active November 21, 2017 14:59
pure nfsv4 autofs dynamic map (doesn't rely on nfsv3 mountd)
#!/bin/bash
# name this script /etc/auto.nfs4 and make it executable
PATH=/bin
tryconnect() {
local host="$1"
# if you don't have nmap-ncat, but your bash does support pseudo-redirection
@thwarted
thwarted / ldd.out
Created March 19, 2014 20:22
mysql and postgres ODBC setup for SSL, notes on iodbc and unixODBC
# this uses iodbc, compile postgresql-odbc with --with-iodbc
$ ldd /usr/lib64/psqlodbcw-iodbc.so | grep odbc
libiodbc.so.2 => /lib64/libiodbc.so.2 (0x00007f686e30a000)
libiodbcinst.so.2 => /lib64/libiodbcinst.so.2 (0x00007f686e0f7000)
# this uses unixODBC, compile postgresql-odbc with --with-unixodbc
$ ldd /usr/lib64/psqlodbcw-unixodbc.so | grep odbc
@thwarted
thwarted / python-softlayer.spec
Last active March 14, 2016 03:59
the bare-boniest spec file used to build the softlayer python module; generated with "rpmdev-newspec -t python python-softlayer.spec"
# sitelib for noarch packages, sitearch for others (remove the unneeded one)
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
Name: python-softlayer
Version: 773ab17
Release: 1%{?dist}
Summary: softlayer python interface
License: Softlayer
@thwarted
thwarted / Vagrantfile.aws
Created April 1, 2014 05:28
a simplisitic Vagrantfile for use with vagrant-aws; vagrant up --provider=aws
if not ENV['AWS_ACCESS_KEY_ID'] or not ENV['AWS_SECRET_ACCESS_KEY']
puts "Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY in the environment"
exit
end
Vagrant.configure("2") do |config|
config.vm.box = "dummy"
config.vm.provider :aws do |aws, override|
#aws.region = "us-west-2"