Skip to content

Instantly share code, notes, and snippets.


bradley bcicen

View GitHub Profile
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:


start new with session name:

tmux new -s myname
marktheunissen / pedantically_commented_playbook.yml
Last active Sep 29, 2022 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
View pedantically_commented_playbook.yml
This playbook has been removed as it is now very outdated.
randallmlough / translate.go
Last active Sep 5, 2022 — forked from hvoecking/translate.go
Golang reflection: traversing arbitrary structures – []map[string]interface{} support
View translate.go
// Traverses an arbitrary struct and translates all stings it encounters
// I haven't seen an example for reflection traversing an arbitrary struct, so
// I want to share this with you. If you encounter any bugs or want to see
// another example please comment.
// The MIT License (MIT)
// Copyright (c) 2014 Heye Vöcking
# This gist is compatible with Ansible 1.x .
# For Ansible 2.x , please check out:
# -
# -
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
sontek /
Last active Jul 20, 2022
Make your terminal snow
LINES=$(tput lines)
COLUMNS=$(tput cols)
declare -A snowflakes
declare -A lastflakes
dannguyen /
Last active Jun 13, 2022
A command-line function that runs a SQLite query and gets a Markdown-ready table; See console demo at
### sqlmd
# Bash function for outputting SQLite results in Markdown-friendly table
### Dependency:
# csvlook can be found here:
# $ sqlmd "SELECT name, age FROM people;" optional_db_name_argument.sqlite
drsnyder /
Last active Aug 11, 2021
Demonstrate the contention on /dev/urandom with N threads.
# Create a user land file for testing.
# dd if=/dev/urandom of=/tmp/urandom bs=1M count=10
# infile threads
# Examples:
# time python2.6 /tmp/urandom
# time python2.6 /dev/urandom
# R to generate a plot of the read time distribution at each level of concurrency
# rdt = read.csv("output.csv", header=F)
jordansissel /
Last active Feb 6, 2021
logstash message format

logstash json format

  "message"    => "hello world",
  "@version"   => "1",
  "@timestamp" => "2014-04-22T23:03:14.111Z",
  "type"       => "stdin",
  "host"       => "hello.local"
sivel / wp-mysql-test.php
Created Aug 5, 2009
Database connection test script for WordPress
View wp-mysql-test.php
* Database connection test script for WordPress
* Parses the wp-config.php file for DB connection information and tests
* a mysql connection to the DB server and selection of the database.
* Errors will be reported. Attempts will be made to repair table errors.
* Place this file in the same directory as wp-config.php

Displaying images in the terminal with tput and echo


Requires ImageMagick, easily available from your favorite package manager. Tested on Linux and OSX
convert image.png -resize 40 txt:-|sed -E 's/://;s/\( ? ?//;s/, ? ?/,/g;s/\)//;s/([0-9]+,[0-9]+,[0-9]+),[0-9]+/\1/g;s/255/254/g;/mage/d'|awk '{print $1,$2}'|sed -E 's/^0,[0-9]+ /print "echo;tput setaf "\;/;s/^[0-9]+,[0-9]+ /print "tput setaf ";/;s/(.+),(.+),(.+)/\1\/42.5*36+\2\/42.5*6+\3\/42.5+16/'|bc|sed 's/$/;echo -n "  ";/'|tr '\n' ' '|sed 's/^/tput rev;/;s/; /;/g;s/$/tput sgr0;echo/'|bash