Skip to content

Instantly share code, notes, and snippets.

@kwbr
kwbr / make-load.sh
Created Jan 27, 2019 — forked from xaprb/make-load.sh
A little shell script for hammering the dvdstore database on Postgres
View make-load.sh
#!/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(){
View producer_consumer.pl
#!/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);
@kwbr
kwbr / xtrabackup_full_increment_restore.sh
Created Jan 9, 2019 — forked from SQLadmin/xtrabackup_full_increment_restore.sh
Automate xtrabackup for FULL/Incremental and restore
View xtrabackup_full_increment_restore.sh
#!/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"
@kwbr
kwbr / Vagrantfile
Created Jun 22, 2018
Example: apt_repository rewrites sources.list #41647
View Vagrantfile
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
View deploy.sh
#!/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]"
View gist:5232698
#!/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
@kwbr
kwbr / about.md
Created Mar 26, 2012 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
View about.md
@kwbr
kwbr / gist:2207176
Created Mar 26, 2012 — forked from exhuma/gist:2136677
Bash completion for fabric
View gist:2207176
#
# Bash completion for fabric
#
function _fab_complete() {
local cur
if [[ -f "fabfile.py" || -f "f
View generic_completion.sh
#!/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() {
You can’t perform that action at this time.