Skip to content

Instantly share code, notes, and snippets.

View wincus's full-sized avatar
🏠
Working from home

Juan Moyano wincus

🏠
Working from home
View GitHub Profile
@wincus
wincus / gist:502795154b1804b6fa1c
Created April 21, 2015 21:22
Export mysql users from master db
#export users in sql format
mysql -B -N -u${USER} -p${PASS} -h${HOST} -e "SELECT DISTINCT CONCAT('SHOW GRANTS FOR ''', user, '''@''', host, ''';') AS query FROM mysql.user" | \
mysql -u${USER} -p${PASS} -h${HOST} | \
sed 's/\(GRANT .*\)/\1;/;s/^\(Grants for .*\)/## \1 ##/;/##/{x;p;x;}' | \
gzip -c > ${HOST}/user-grants.sql.gz
@wincus
wincus / gist:e9596e828fc513ded86c
Created April 17, 2015 13:04
Byobu KeyBindings
###############################################################################
# byobu's tmux f-key keybindings
#
# Copyright (C) 2011-2014 Dustin Kirkland <kirkland@byobu.co>
#
# Authors: Dustin Kirkland <kirkland@byobu.co>
#
# 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, version 3 of the License.