Skip to content

Instantly share code, notes, and snippets.

View cedricdekimpe's full-sized avatar

Cédric Dekimpe cedricdekimpe

View GitHub Profile
@cedricdekimpe
cedricdekimpe / chroot-to-pi.sh
Created April 7, 2022 10:03 — forked from htruong/chroot-to-pi.sh
Chroot to pi sd card
#!/bin/bash
# This script allows you to chroot ("work on")
# the raspbian sd card as if it's the raspberry pi
# on your Ubuntu desktop/laptop
# just much faster and more convenient
# credits: https://gist.github.com/jkullick/9b02c2061fbdf4a6c4e8a78f1312a689
# make sure you have issued

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

#!/bin/bash
bucket="BUCKETNAME"
expireweeks=3
databases=`mysql -e "SHOW DATABASES;" | tr -d "| " | grep -v "\(Database\|information_schema\|mysql\)"`
datestamp=`date +"%m-%d-%y"`
timestamp=`date +"%H%M%S"`
for db in $databases; do
@cedricdekimpe
cedricdekimpe / gallery_images_controller.rb
Created August 20, 2011 12:27 — forked from splendeo/gallery_images_controller.rb
libpaperclip_processorsrotator.rb:6 : rotate_command to array to avoid "Can't convert String into Array" error