Skip to content

Instantly share code, notes, and snippets.

View mzupan's full-sized avatar

Mike Zupan mzupan

View GitHub Profile
@otukutun
otukutun / uninstall_chefdk_for_mac.sh
Created May 24, 2014 03:35
uninstall_chefdk_for_mac
#!/bin/bash
if [ -e /opt/chefdk ]; then
rm -rf /opt/chefdk
else
echo "can not found chefdk"
fi
rm /usr/bin/berks
rm /usr/bin/chef
@jyap808
jyap808 / encrypt_decrypt_gpg_armor.go
Created January 4, 2014 01:12
Symmetrically encrypting a string into ASCII armored GPG format and then Decrypting it in Golang
package main
import (
"bytes"
"code.google.com/p/go.crypto/openpgp"
"code.google.com/p/go.crypto/openpgp/armor"
"fmt"
"io/ioutil"
"log"
)
@rraptorr
rraptorr / stunnel-4.53-xforwarded-for.diff
Created June 25, 2012 17:50
X-Forwarded-For stunnel 4.53 patch
diff --git a/doc/stunnel.8 b/doc/stunnel.8
index 589d968..f56f5c0 100644
--- a/doc/stunnel.8
+++ b/doc/stunnel.8
@@ -693,6 +693,10 @@ This options has been renamed to \fInone\fR.
.RE
.RS 4
.RE
+.IP "\fBxforwardedfor\fR = yes | no" 4
+.IX Item "xforwardedfor = yes | no"
@futuremill-ltd
futuremill-ltd / gist:2318876
Created April 6, 2012 11:00
Building Ruby 1.9.3 package for Debian Squeeze
# From a fresh install of squeeze
apt-get install ruby rubygems # Need ruby to use fpm
gem1.8 install fpm --no-ri --no-rdoc
apt-get install build-essential openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev ncurses-dev libyaml-dev
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
tar -zxvf ruby-1.9.3-p125.tar.gz
cd ruby-1.9.3-p125
rm -rf /tmp/ruby193
@jpfuentes2
jpfuentes2 / rbenv-install-system-wide.sh
Created March 8, 2012 19:47
CentOS: rbenv install and system wide install
#!/bin/bash
# CentOS rbenv system wide installation script
# Forked from https://gist.github.com/1237417
# Installs rbenv system wide on CentOS 5/6, also allows single user installs.
# Install pre-requirements
yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel \
make bzip2 autoconf automake libtool bison iconv-devel git-core
@phatduckk
phatduckk / tail_profile.py
Created August 3, 2011 02:24 — forked from bwmcadams/tail_profile.py
Tail the Slow Query Log on MongoDB
#!/usr/bin/python
# Connects to localhost, 27017 by default
import sys
import pymongo
import time
if len(sys.argv) < 2:
print >> sys.stderr, "Usage: ./tail_profile.py <dbName> [hostname] [port]"
sys.exit(-1)
@oesmith
oesmith / puppet-install.sh
Created June 28, 2011 12:05
Install Puppet 2.6.2 from lenny-backports on Ubuntu 10.04 LTS
cat > /etc/apt/preferences.d/backports <<EOF
Package: puppet puppet-common puppetmaster facter
Pin: release a=lenny-backports
Pin-Priority: 900
EOF
cat > /etc/apt/sources.list.d/backports.list <<EOF
deb http://backports.debian.org/debian-backports lenny-backports main contrib non-free
EOF
@bwmcadams
bwmcadams / tail_profile.py
Created February 26, 2011 14:32
Tail the Slow Query Log on MongoDB
#!/usr/bin/python
# Connects to localhost, 27017 by default
import sys
import pymongo
import time
if len(sys.argv) < 2:
print >> sys.stderr, "Usage: ./tail_profile.py <dbName> [hostname] [port]"
sys.exit(-1)
@jpwatts
jpwatts / mac-homebrew-pyexiv2.sh
Created February 10, 2011 00:33
In which I finally get pyexiv2 working on my Mac using Homebrew and a series of disgusting hacks
#!/bin/sh
brew install python boost exiv2
curl -O http://launchpadlibrarian.net/61465005/pyexiv2-0.3.0.tar.bz2
tar xjvf pyexiv2-0.3.0.tar.bz2
cd pyexiv2-0.3.0
# https://answers.launchpad.net/pyexiv2/+question/140742
echo "env['FRAMEWORKS'] += ['Python']" >> src/SConscript
@defunkt
defunkt / resque.py
Created November 3, 2009 19:49
Resque client in Python
from redis import Redis
import simplejson
class Resque(object):
"""Dirt simple Resque client in Python. Can be used to create jobs."""
redis_server = 'localhost:6379'
def __init__(self):
host, port = self.redis_server.split(':')
self.redis = Redis(host=host, port=int(port))