Skip to content

Instantly share code, notes, and snippets.

View adfinlay's full-sized avatar

Andrew Finlay adfinlay

View GitHub Profile
@adfinlay
adfinlay / .screenrc
Created October 9, 2013 16:31
Current screen settings
autodetach on
term screen-256color
hardstatus on
hardstatus alwayslastline
hardstatus string '%{= kK}%{w}%H %{K}%= %{= kw}%?%-Lw%?%{B}(%{W}%n*%f %t%?(%u)%?%{B})%{w}%?%+Lw%?%?%= %{K}%{B} %{w}%c%{K}'
startup_message off
termcapinfo xterm* ti@:te@
defscrollback 100000
altscreen on
nonblock on
@adfinlay
adfinlay / .bashrc_git
Created October 9, 2013 16:35
Git specific bashrc settings
alias gl="git l"
alias gg="git grep -n"
alias gd="git d"
alias gs="git s"
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
@adfinlay
adfinlay / my.cnf
Created May 11, 2014 09:42
Settings for mysql that will help ensure Unicode top to bottom.
[mysqld]
default-character-set=utf8
default-collation=utf8_general_ci
character-set-server=utf8
collation-server=utf8_general_ci
init-connect='SET NAMES utf8'
[client]
default-character-set=utf8
@adfinlay
adfinlay / Preferences.sublime-settings
Created May 11, 2014 09:44
Sublime Text 2 user preferences
{
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"default_line_ending": "unix",
"draw_white_space": "selection",
"ensure_newline_at_eof_on_save": true,
"fallback_encoding": "UTF-8",
"font_size": 9,
"ignored_packages":
[
"Vintage",
@adfinlay
adfinlay / git_sensitive
Created May 11, 2014 09:46
Github - remove sensitive information
git filter-branch --index-filter 'git rm --cached --ignore-unmatch path/to/sensitive_file' HEAD
@adfinlay
adfinlay / mysql_useful_queries
Created May 11, 2014 09:47
MySQL Useful queries
SELECT CONCAT(table_schema, '.', table_name),
CONCAT(CAST(ROUND(table_rows / 1000000, 2) AS CHAR), 'M') rows,
CONCAT(CAST(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2) AS CHAR), 'G') DATA,
CONCAT(CAST(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2) AS CHAR), 'G') idx,
CONCAT(CAST(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2) AS CHAR), 'G') total_size,
ROUND(index_length / data_length, 2) idxfrac
FROM information_schema.TABLES
ORDER BY data_length + index_length DESC
LIMIT 10;
@adfinlay
adfinlay / json_pretty
Created May 11, 2014 09:48
Prettifies JSON on the UNIX command line
{json} | python -mjson.tool
@adfinlay
adfinlay / find_replace
Created May 11, 2014 09:49
Find / replace en masse
find . -type f -name '*.html.twig' | xargs perl -pi -e 's/find/replace/g'
@adfinlay
adfinlay / putty_color.reg
Last active October 26, 2015 15:27
PuTTY Color Settings
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\Session%20Name%20Here]
"Colour0"="131,148,150"
"Colour1"="147,161,161"
"Colour2"="0,43,54"
"Colour3"="7,54,66"
"Colour4"="0,43,54"
"Colour5"="238,232,213"
"Colour6"="7,54,66"
@adfinlay
adfinlay / gist:3cb5388b85b2acae2340
Created September 25, 2014 15:21
Generate varnish HTTP Basic Auth string
echo -n "username:password" | base64