Instantly share code, notes, and snippets.

View install-docker-on-ubuntu.sh
#!/bin/bash
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
cat > /etc/apt/sources.list.d/docker.list <<EOM
deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable
EOM
apt-get -qqy update
apt-get -qqy install docker-ce docker-compose
View reservations.rb
#!/usr/bin/ruby
# reports used -vs- reserved instances in ec2
#
# needs `{apt-get,brew} install awscli` with an `AWS_PROFILE` configured
require 'json'
def reserved_instances
JSON(`aws --profile=#{AWS_PROFILE} ec2 describe-reserved-instances`)["ReservedInstances"]
end
View ssh-tools Makefile
all: authorized_keys config
authorized_keys: authorized_keys.d/*
cat $^ > $@
config: config.d/*
cat $^ > $@
clean:
rm -f authorized_keys
View gist:16101be699e58b2ef67b
### Keybase proof
I hereby claim:
* I am mmm on github.
* I am m_3 (https://keybase.io/m_3) on keybase.
* I have a public key whose fingerprint is 0D9E DC5F 633B 05D4 7633 42C3 76D4 635F B2A3 4D75
To claim this, I am signing this object:
View sonicwall-cli
######### CREATE A SERVICE #################
configure
service
add “SMTPS_587_TCP”
ip-type 6
port-begin 587
port-end 587
end
finished
View gist:10220349
## Options to set on the command line
d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
d-i console-setup/layoutcode string us
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain
d-i netcfg/choose_interface select auto
d-i netcfg/wireless_wep string
View tmux-cssh
#!/bin/sh
usage() {
echo "Usage: $0 user1@host1 user2@host2 host3 host{4..6} host7 host8 [...]"
}
[ $# -lt 1 ] && usage && exit 1
create_ssh_pane() {
local session=$1
local host=$2
View filters.xml.erb
<?xml version='1.0' encoding='UTF-8'?>
<feed xmlns='http://www.w3.org/2005/Atom' xmlns:apps='http://schemas.google.com/apps/2006'>
<title>Mail Filters</title>
<% MAILING_LISTS = [
{
:name => "canonical-com",
:pattern => :list,
:base_name => "lists.canonical.com",
:lists => [
View gist:5878432
#!/bin/bash
# hadoop
juju deploy hadoop hadoop-master
juju deploy hadoop hadoop-slave -n12
juju add-relation hadoop-master:namenode hadoop-slave:datanode
juju add-relation hadoop-master:jobtracker hadoop-slave:tasktracker
# instrument hadoop-slave
juju deploy ganglia-node
View gist:3879853
# Our .tmux.conf file
# Setting the prefix from C-b to C-a
# START:prefix
set -g prefix C-a
set -g prefix2 C-b
# END:prefix
# Free the original Ctrl-b prefix keybinding
# START:unbind
unbind C-b