This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: reload-db /path/to/sqldump dbname | |
function reload-db { | |
for f in "$1"/*.sql; do | |
printf "%-${COLUMNS}s" "$f">&2; | |
cat "$f"; | |
done \ | |
| pv -s `du -sb "$1" | awk '{print $1}'` \ | |
| mysql -uroot "$2"; | |
if [ $? != 0 ]; then echo 'ERRORS!!!!!!!!!!!!!'; return $?; fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function error_message { | |
echo -e >&2 \ | |
"---------------------------------------------------------------------------------------------------------" \ | |
"\n$1" \ | |
"\n---------------------------------------------------------------------------------------------------------" | |
} | |
function undo_merge { | |
error_message "Undoing your merge. Please fix the problem and try again." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### ABOUT | |
### Runs rsync, retrying on errors up to a maximum number of tries. | |
### Simply edit the rsync line in the script to whatever parameters you need. | |
# Trap interrupts and exit instead of continuing the loop | |
trap "echo Exited!; exit;" SIGINT SIGTERM | |
MAX_RETRIES=50 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### Copyright 2009 Ian Young | |
### Available under the terms of the MIT license | |
### ABOUT | |
### Prevents you from svn switching to a mismatched directory in a different branch. | |
### See http://blog.iangreenleaf.com/2009/11/avoiding-disaster-when-using-svn-switch.html | |
### USAGE |
NewerOlder