This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
#!/bin/bash | |
_opts () { | |
perl -ne ' | |
print if s/^.IP .\\fB\\-/-/ and s/\\(f(P|I|B|R)|)|".*//g; | |
print if s/^.IX Item .\-/-/ and s/"//g; | |
print if s/^.It Fl /-/;' | |
} | |
_man_generic() { |
# | |
# Bash completion for fabric | |
# | |
function _fab_complete() { | |
local cur | |
if [[ -f "fabfile.py" || -f "f |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
#!/bin/bash | |
# atlassian-heap-dump.sh - dump a heap using GDB for a crashed application | |
# Accepts a single argument: the PID of the JVM | |
# Author: James Gray (jgray@atlassian.com) | |
# Copyright Atlassian P/L | |
# License: MIT | |
# Are we root? | |
if [ $UID -ne 0 ]; then |
#!/bin/bash | |
set -e | |
export AWS_REGION="eu-west-1" | |
export COMMIT_ID=$1 | |
# Docker Hub account with read-only access to the repository | |
export DOCKER_HUB_USERNAME="[FILL ME IN]" | |
export DOCKER_HUB_PASSWORD="[FILL ME IN]" |
Vagrant.configure("2") do |config| | |
config.vm.box = "debian/stretch64" | |
config.vm.provision "ansible" do |ansible| | |
ansible.compatibility_mode = "2.0" | |
ansible.playbook = "play.yml" | |
end | |
end |
#!/bin/bash | |
# This is my production backup script. | |
# https://sqlgossip.com | |
set -e | |
set -u | |
usage() { | |
echo "usage: $(basename $0) [option]" | |
echo "option=full: Perform Full Backup" |
#!/usr/bin/perl | |
use strict; | |
use warnings FATAL => 'all'; | |
use DBI; | |
use English qw(-no_match_vars); | |
use Getopt::Long; | |
use List::Util qw(max); |
#!/usr/bin/env bash | |
if [ -z "$1" ]; then | |
echo "Usage: $0 <iterations>" | |
exit 1 | |
fi | |
# Display product ID, category, title, price, num orders | |
# ordered by top products limit 10 | |
function top_products(){ |
#!/usr/bin/env awk -f | |
# Based on the idea from https://blogs.oracle.com/taylor22/entry/using_r_to_analyze_g1gc, the | |
# script is updated to use the format of the gc logs as received with the parameters: | |
# -XX:+UseThreadPriorities | |
# -XX:ThreadPriorityPolicy=42 | |
# -Xms1995M -Xmx1995M | |
# -Xss256k -XX:StringTableSize=1000003 | |
# -XX:SurvivorRatio=8 | |
# -XX:MaxTenuringThreshold=1 |