Skip to content

Instantly share code, notes, and snippets.

View z0mbix's full-sized avatar

David Wooldridge z0mbix

View GitHub Profile
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 14, 2025 16:18
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@waylan
waylan / foo.sh
Created November 15, 2012 18:39
Simple bash subcommands. Each subcommand is implemented as a function. For example, `sub_funcname` is called for `funcname` subcommand.
#!/bin/sh
ProgName=$(basename $0)
sub_help(){
echo "Usage: $ProgName <subcommand> [options]\n"
echo "Subcommands:"
echo " bar Do bar"
echo " baz Run baz"
echo ""
@cbmd
cbmd / default.conf
Created December 9, 2012 21:13
nginx config - dynamic virtual hosts
server {
index index.php;
set $basepath "/var/www";
set $domain $host;
# check one name domain for simple application
if ($domain ~ "^(.[^.]*)\.dev$") {
set $domain $1;
set $rootpath "${domain}";
@tomdz
tomdz / gist:5339163
Last active January 22, 2016 12:03
Vagrant test setup for haproxy with ssl client certificates

Setup vagrant vm

vagrant box add precise64 http://files.vagrantup.com/precise64.box
vagrant init precise64
sed -i 's/# config.vm.network :hostonly/config.vm.network :hostonly/' Vagrantfile
vagrant up
vagrant ssh

Install base software and apache (to have something to proxy)

@benr
benr / gist:5505198
Created May 2, 2013 20:34
SmartOS Vagrant Box, first preview. Lacks VBox Extensions for disk sharing. (smartos-20130419T073558Z)
vagrant box add smartos http://cuddletech.com/tmp/smartos-latest.box
mkdir smartos && cd smartos
vagrant init smartos
vagrant up
vagrant ssh
@kevinburke
kevinburke / .vimrc
Created May 7, 2013 00:48
reload open chrome window.
function! ReloadChrome()
execute 'silent !osascript -e "tell application \"Google Chrome\" to tell the active tab of its first window" ' .
\'-e "execute javascript \"window.location.reload();\" " ' .
\'-e "end tell" >/dev/null'
execute 'silent !clear'
endfunction
nnoremap <leader>o :call ReloadChrome()<CR><CR>k
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "make an instance, based on region, subnet, and security group. Uses AMI Mapping for Instance Store backed Amazon Linux 64bit in the region specified",
"Parameters" : {
"InstanceType" : {
"Description" : "Type of Instance to use, defaults to m1.medium",
"Type" : "String",
@johnl
johnl / screenshot.sh
Created June 11, 2013 11:17
high speed screenshot and upload utility
#!/bin/bash
#
# Copyright 2013 John Leach <[email protected]>
#
# Distributed under terms of the MIT license
#
# Takes a screeshot using scrot and uploads it via scp and sticks the
# url on the clipboard as quickly as possible.
#
# For speed, it cheats and puts the url on the clipboard *before*
@tsabat
tsabat / snapshot.py
Last active May 3, 2016 17:19
A python script to snapshot the volume attached to an instance.
#! /usr/bin/python
from boto import ec2;
import boto.utils
import argparse
def parsed_args():
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--instance_id",
help="the instance id you want to snapshot. default: current instance id",
@kevinburke
kevinburke / haproxy.config
Created October 10, 2013 17:34
twilio haproxy config
# Twilio HTTP HAProxy Configuration
# Version: 0.1
global
daemon
log 127.0.0.1 local0 info
maxconn 60000
spread-checks 3