Skip to content

Instantly share code, notes, and snippets.

@jemiam
jemiam / puma
Created October 17, 2017 07:29
jungle init.d script for Amazon Linux
#! /bin/sh
### BEGIN INIT INFO
# Provides: puma
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Puma web server
# Description: A ruby web server built for concurrency http://puma.io
# initscript to be placed in /etc/init.d.
@jemiam
jemiam / mysql_check_repl.sh
Last active October 6, 2016 08:07
mysql replication check script
#!/bin/bash
# replication delay threshold
TH_SECONDS_BEHIND=60
set -euo pipefail
IFS=$'\n\t'
SERVER=$(hostname -f)
ERRORS=()
@jemiam
jemiam / .zshrc
Created October 12, 2014 05:50
peco-select-history
function peco-select-history() {
local tac
if which tac > /dev/null; then
tac="tac"
else
tac="tail -r"
fi
if [ -n "$LBUFFER" ]; then
BUFFER=$(history -n 1 | \
eval $tac | \
#!/usr/bin/env ruby
require "optparse"
def usage
puts "usage: #{File.basename(__FILE__)} SRC DST [ -e EXCLUDE ] [ --use-sudo ]"
end
src = ARGV.shift
unless src