Skip to content

Instantly share code, notes, and snippets.

View bacongobbler's full-sized avatar

Matthew Fisher bacongobbler

View GitHub Profile
@bacongobbler
bacongobbler / install_es.sh
Last active December 16, 2015 17:19
Install elasticsearch into /opt and start running. Change verison number based on which one you want.
#!/bin/sh
VERSION="0.90.1"
apt-get update
apt-get install -y openjdk-7-jre-headless
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-$VERSION.tar.gz
tar -xzf elasticsearch-$VERSION.tar.gz
mv elasticsearch-$VERSION /opt/elasticsearch
rm elasticsearch-$VERSION.tar.gz
@bacongobbler
bacongobbler / daemon.py
Created May 14, 2013 19:00
Daemon class for Python 2.7. Subclass this class and override the run() method to use it. Pulled from http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/
#!/usr/bin/env python
import sys, os, time, atexit
from signal import SIGTERM
class Daemon:
"""
A generic daemon class.
Usage: subclass the Daemon class and override the run() method
@bacongobbler
bacongobbler / bacongobbler_cowsay.txt
Created May 16, 2013 03:46
My name using cowsay. Because I can.
______________
< bacongobbler >
--------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
@bacongobbler
bacongobbler / git-install.sh
Last active December 17, 2015 11:49
install and configure git
sudo apt-get install -y git
git config --global user.name "Matthew Fisher"
git config --global user.email me@bacongobbler.com
git config --global alias.co checkout
git config --global alias.ci commit
git config --global alias.s status
@bacongobbler
bacongobbler / install.sh
Last active December 18, 2015 07:29
Base installation of the tools I need in my development machine.
#!/bin/sh
PACKAGES="python-pip python-dev libpq-dev golang virtualbox virtualbox-dkms virtualbox-qt curl xchat vim"
sudo apt-get install -qy $PACKAGES
# install sublime text; requires a key to be added to the repositories
curl https://gist.github.com/bacongobbler/5747364/raw/75474b51394497f14c31ab613852391bddd016c9/sublime_text.sh | sh
# install git with config
@bacongobbler
bacongobbler / stackato-api
Last active December 18, 2015 08:19
Script to make calls to the Stackato API
#!/bin/sh
TARGET=$(cat ~/.stackato/client/target)
TOKEN=$(json < ~/.stackato/client/token [\"$TARGET\"])
curl -X $1 --silent -k --header "Authorization:${TOKEN}" $TARGET$2
@bacongobbler
bacongobbler / .conkyrc
Created June 19, 2013 08:11
My .conkyrc configuration. Works nicely with the XTerm colour scheme (green text on black background). usage: copy this file to ~/.conkyrc, run 'sudo apt-get install conky', then 'conky &'.
# bacongobbler's conky config
background yes
use_xft yes
xftfont Sans:size=8
xftalpha 1
update_interval 1
total_run_times 0
own_window yes
own_window_transparent yes
own_window_type normal
@bacongobbler
bacongobbler / nsswitch.conf
Created July 4, 2013 17:17
mdns config at /etc/nsswitch.conf
# Begin /etc/nsswitch.conf
passwd: files
group: files
shadow: files
publickey: files
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
networks: files
@bacongobbler
bacongobbler / replace
Last active December 19, 2015 22:58
sed in-place replacement. Usage: './replace <old_string> <new_string> <file>'
#!/bin/sh
sed -i '' "s/${1}/${2}/g" $3
#!/bin/bash
#
# This script installs all dependencies needed on a Ubuntu 12.04 x64
# computer for developing custom services on Stackato. Run this
# script as root (either logged in as root, or with sudo).
#
PACKAGES="virtualbox virtualbox-dkms virtualbox-qt curl vim git wget"
apt-get install -y $PACKAGES