Skip to content

Instantly share code, notes, and snippets.

View mmm's full-sized avatar

Mark Mims mmm

View GitHub Profile
@mmm
mmm / reservations.rb
Last active December 28, 2016 11:23
checked used -vs- reserved instances in ec2
#!/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
@mmm
mmm / tmux-cssh
Last active November 8, 2017 21:59 — forked from otterley/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
#!/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
#!/bin/bash
#
# Screencast Capture for Linux
#
# This script uses `ffmpeg` to capture an hd1080 screencast.
# The output is # organized by `scene->shot->take` and saves files into
#
# $(cwd)/
# -> ${scene_name}/
# -> shot-${shot_number}/
#!/bin/bash
#
# Multi-monitor Screencast Capture for Linux
#
# This script uses `ffmpeg` to simultaneously capture
# inputs:
# - hd1080 monitor with "Slides" fullscreen
# - hd1080 monitor "Demo" screen (usually terminal and/or browser)
# - hd1080 webcam (h264)
# - audio (aac)
slides = $(wildcard *-*.md)
default: $(slides:.md=.docx)
pdfs: $(slides:.md=.pdf)
#run_pandoc := docker run --rm -t \
#-v `pwd`:/source \
#-v `python -c
all: authorized_keys config
authorized_keys: authorized_keys.d/*
cat $^ > $@
config: config.d/*
cat $^ > $@
clean:
rm -f authorized_keys
@mmm
mmm / tmux.conf
Last active July 19, 2019 20:16
tmux config
# 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
@mmm
mmm / ubuntu-preseed
Last active July 19, 2019 20:19
kyle's preseed
## 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
@mmm
mmm / filters.xml.erb
Last active February 10, 2022 11:29
Quick and dirty Gmail filters. Work ported from procmail a couple of months ago... Write out an xml file `erb filters.xml.erb > filters.xml` and import this into gmail Settings->Filters tab ("import filters" down at the bottom of the page).
<?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 => [