Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am jbonney on github.
  • I am jbonney (https://keybase.io/jbonney) on keybase.
  • I have a public key ASBgDeWYjOtPoyZhuSwq-zuANFYogofsPCrYtKgGj_XwRQo

To claim this, I am signing this object:

@jbonney
jbonney / crontab
Last active August 29, 2015 14:22
Script to check the internet connection of a kiosk and reload the active page in case the connection drops and then comes back online. Sources: -http://alexba.in/blog/2015/01/14/automatically-reconnecting-wifi-on-a-raspberrypi/ - http://raspberrypi.stackexchange.com/questions/6981/auto-refresh-for-midori - http://www.lynsayshepherd.com/blog/2014…
*/2 * * * * DISPLAY=:0 sh /usr/local/bin/wifi_reloader.sh
user=...
pass=...
host=localhost # or remote if necessary
database=...
mysqldump -u${user} -p${pass} -h ${host} --add-drop-table --no-data ${database} | grep ^DROP | mysql -u${user} -p${pass} -h ${host} ${database}
# Get info about current kernel
uname -a
# List installed kernels
dpkg-query -l | awk '/linux-image-*/ {print $2}'
# Remove old kernel and dependencies (DO NOT DELETE KERNEL FROM uname -a)
sudo apt-get --purge remove <Kernel>
sudo apt-get autoremove
# Update grub (usually not necessary)
sudo update-grub
#Encryption
openssl enc -in important_backups.tar.gz -aes-256-cbc -e > important_backups_encrypted.tar.gz
# Decryption
openssl enc -in important_backups_encrypted.tar.gz -aes-256-cbc -d > important_backups_decrypted.tar.gz
CREATE USER 'dbbackup'@'localhost' IDENTIFIED BY '***';
GRANT SELECT ,
RELOAD ,
FILE ,
SUPER ,
LOCK TABLES ,
SHOW VIEW ON * . * TO 'dbbackup'@'localhost' IDENTIFIED BY '***' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
@jbonney
jbonney / .bash_profile
Created February 4, 2014 13:43
Run ssh-agent when you login, and kill it when you logout. Add code to ~/.bash_profile. Taken from http://blog.xk72.com/post/75565726956/ssh-agent
eval `/usr/bin/ssh-agent -s`
trap "kill $SSH_AGENT_PID" 0
@jbonney
jbonney / link.txt
Created January 31, 2014 22:42
Ruby Styleguide from GitHub
wget -qO- http://ipecho.net/plain ; echo
curl ipecho.net/plain ; echo
@jbonney
jbonney / link.txt
Created December 13, 2013 09:51
HTML5+JSON interactive table plugin. Dynatable is a funner, semantic, interactive table plugin using jQuery, HTML5, and JSON. And it's not just for tables.