Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block kwbr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
SQLadmin /
Last active Nov 5, 2019
Automate xtrabackup for FULL/Incremental and restore
# This is my production backup script.
set -e
set -u
usage() {
echo "usage: $(basename $0) [option]"
echo "option=full: Perform Full Backup"
BradGunnerSGT / main-prod inventory
Last active Aug 29, 2015
Ansible instance-environment example:
View main-prod inventory
In order to minimize slip-ups, we have a different inventory file for
each instance-environment pair, and each inventory uses a different
group name as well. Then there are group-vars files for each
instance-environment pair that set a variable so the proper playbooks
get run.
For example, here is how we have the project laid out:
lelandbatey /
Last active Nov 12, 2019
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!


This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"


XVilka /
Last active Nov 19, 2019
True Colour (16 million colours) support in various terminal applications and terminals

Terminal Colors

There exists common confusion about terminal colors. This is what we have right now:

  • Plain ASCII
  • ANSI escape codes: 16 color codes with bold/italic and background
  • 256 color palette: 216 colors + 16 ANSI + 24 gray (colors are 24-bit)
  • 24-bit true color: "888" colors (aka 16 milion)
mllg / Tmpwatch
Last active Nov 6, 2017
Utility vim function to clean up vim's undo files (or others).
View Tmpwatch
function Tmpwatch(path, days)
let l:path = expand(a:path)
if isdirectory(l:path)
for file in split(globpath(l:path, "*"), "\n")
if localtime() > getftime(file) + 86400 * a:days && delete(file) != 0
echo "Tmpwatch(): Error deleting '" . file . "'"
echo "Tmpwatch(): Directory '" . l:path . "' not found"
You can’t perform that action at this time.