This is a hands-on way to pull down a set of MySQL dumps from Amazon S3 and restore your database with it
Sister Document - Backup MySQL to Amazon S3 - read that first
# Set our variables
export mysqlpass="ROOTPASSWORD"
This is a hands-on way to pull down a set of MySQL dumps from Amazon S3 and restore your database with it
Sister Document - Backup MySQL to Amazon S3 - read that first
# Set our variables
export mysqlpass="ROOTPASSWORD"
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
this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc
This gist assumes:
| /** | |
| * DUMP | |
| * | |
| * Dumps a variable in a readable form to the console, this is a recursive function | |
| * so be careful of nested references that may cause it to overflow... (untested for that) | |
| * | |
| * @v ANYTHING [Any variable] | |
| * @name STRING [The name of the variable, optional, used internally when looping objects and arrays] | |
| * @spacing STRING [The prefix spacing, used internally when looping objects and arrays] | |
| */ |
| #!/bin/bash | |
| # Source | |
| # https://gist.github.com/oodavid/54cadfb92ff49618797d | |
| # Adapted from | |
| # https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-14-04 | |
| # Make sure this is added to the crontab, ie: | |
| # sudo crontab -e | |
| # 30 2 * * 1 /home/ubuntu/khan-draw/ssl-letsencrypt-auto-renew.sh >> /var/log/ssl-letsencrypt-auto-renew.log | |
| # Config |
Assign this little shell script to a keyboard shortcut Xfce to open a shell -prompt, then have that file / directory opened by it's native program.
Pretty simple, excellent user-experience!
Thanks to Xfce forum member "ToC" who helped me solve a problem with the script
| #!/bin/bash | |
| # This script is no good for servers with multiple-users, I simply | |
| # designed it to quickly push my git tinkerings to my EC2 test server. | |
| # | |
| # Use at your own risk! | |
| # | |
| # cd to a local directory under git control and execute this script, it will: | |
| # create repos on your server | |
| # modify your local remotes to push to the server |
| /// 0 - Example `Streams` | |
| Stream<MyUserModel> userStream => FirebaseAuth | |
| .instance | |
| .onAuthStateChanged | |
| .map((user) => MyUserModel.fromFirebase(user)); | |
| String documentPath = 'my/document'; | |
| Stream<MyDocumentModel> documentStream = Firestore.instance | |
| .document(documentPath) | |
| .snapshots() |
Make sure you have this git alias
git config --global alias.clone-branches '! git branch -a | sed -n "/\/HEAD /d; /\/master$/d; /remotes/p;" | xargs -L1 git checkout -t'
Clone the remote, pull all branches, change the remote, filter your directory, push
git clone git@github.com:user/existing-repo.git new-repo
cd new-repo
git clone-branches
git remote rm origin
| extension SortBy on List { | |
| sortBy(List<String> keys) { | |
| this.sort((a, b) { | |
| for(int k=0; k<keys.length; k++) { | |
| String key = keys[k]; | |
| int comparison = Comparable.compare((a[key]??""), (b[key]??"")); | |
| if(comparison != 0){ | |
| return comparison; | |
| } | |
| } |