Skip to content

Instantly share code, notes, and snippets.

@guillermo
guillermo / my_app.sh
Created January 15, 2014 08:27
This is a unix wrapper around the erlang vm.
#!/bin/bash
# This is a unix wrapper around the erlang vm. It provides the following functionality:
#
# * Spawns in foreground
# * Handle SIGHUP and call RELOADFUNC
# * Handle SIGTERM SIGQUIT and SIGINT telling to the vm to quit
# * Dies if the vm dies (for example kernel killing because out of memory)
#
# Forks and improvements are welcome.
@dysinger
dysinger / easy-ubuntu-openvpn.sh
Created August 28, 2013 18:22
Create a VPN on EC2 in 30 seconds
#!/bin/sh
# linux firewall/forwarding
modprobe iptable_nat
echo 1 | tee /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 10.10.10.1/2 -o eth0 -j MASQUERADE
# install openvpn
apt-get update && apt-get install -y openvpn
cd /etc/openvpn/
INSTANCE=$(curl http://169.254.169.254/latest/meta-data/public-hostname)
openvpn --genkey --secret ${INSTANCE}.key
@bkw
bkw / preseed.cfg
Last active December 19, 2015 06:29
packer.io config files to go from pristine vanilla ubuntu 12.04 LTS to a docker.io and chef-enabled vagrant box The resulting image is still a bit large and doesn't yet follow all the vagrant conventions, but it's a start.
d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/modelcode string pc105
d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain
d-i netcfg/wireless_wep string
d-i mirror/country string Germany
d-i mirror/http/mirror select de.archive.ubuntu.com
@nodesocket
nodesocket / bootstrap.flatten.css
Last active April 1, 2021 23:37
Below are simple styles to "flatten" bootstrap. I didn't go through every control and widget that bootstrap offers, only what was required for https://commando.io, so your milage may vary.
/* Flatten das boostrap */
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;
@gnarf
gnarf / ..git-pr.md
Last active April 12, 2024 22:00
git pr - Global .gitconfig aliases for Pull Request Managment

Install

Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh

Usage

Easily checkout local copies of pull requests from remotes:

  • git pr 4 - creates local branch pr/4 from the github upstream(if it exists) or origin remote and checks it out
  • git pr 4 someremote - creates local branch pr/4 from someremote remote and checks it out
#!/bin/sh
# INSTALL
wget -O- http://hydra.nixos.org/build/4253979/download/1/nix-1.5.1-x86_64-linux.tar.bz2 \
| tar xj -C /
sudo -i nix-finish-install
# DEFAULT PROFILE
ln -sf /nix/var/nix/profiles/default/etc/profile.d/nix.sh \
/etc/profile.d/nix.sh
@Drewzar
Drewzar / gist:5257932
Last active December 15, 2015 12:09 — forked from dstrctrng/gist:5257727
#!/bin/bash
#This will create a lucid docker image
# must been done from an ubuntu12.04 server as non-root
echo Installind debootstrap
sudo aptitude install debootstrap
echo Create boostrap
sudo debootstrap --arch amd64 --include=language-pack-en,aptitude lucid lucid http://archive.ubuntu.com/ubuntu/
echo Create policy
@fnichol
fnichol / bootstrap
Created January 7, 2013 17:57
Basic Project script/bootstrap
#!/usr/bin/env bash
set -e
[ -n "$BOOTSTRAP_DEBUG" ] && set -x
banner() { printf -- "-----> $*\n"; }
log() { printf -- " $*\n"; }
warn() { printf -- ">>>>>> $*\n"; }
fail() { printf -- "\nERROR: $*\n" ; exit 1 ; }
if ! command -v direnv >/dev/null ; then
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@everpeace
everpeace / gitsshm
Created May 15, 2012 14:16
GIT_SSH manager for github.
#!/bin/bash
if [ -z $GITHUB_KEYS_DIR ]; then
GITHUB_KEYS_DIR="$HOME/github-keys"
fi
if [ -z $GITHUB_KEY_FILE_NAME ]; then
GITHUB_KEY_FILE_NAME="id_rsa"
fi