This file contains 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
file=$1 | |
for f in $(git fsck --lost-found | grep 'dangling commit' | awk '{print $3}'); do | |
git log --stat $f | grep $file &> /dev/null; | |
if [ $? -eq 0 ]; then | |
git log -1 $f; | |
fi; | |
done |
This file contains 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 | |
d=$1 | |
function first_commit_on_dir() { | |
d=$1 | |
echo $(git log --follow --oneline --pretty=format:'%H' --reverse -- "$d" | head -1) | |
} | |
function get_renames() { |
This file contains 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 | |
# | |
# Check all databases/tables in mysql for disabled keys. | |
# | |
MYSQL="mysql" | |
dbs=$(echo "show databases" | $MYSQL -N) | |
for db in $dbs; do |
This file contains 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 | |
MYSQL_ROOT_PASSWORD=$1 | |
if [ -z "$MYSQL_ROOT_PASSWORD" ]; then | |
echo 'Missing required $1 (password).' | |
exit 1 | |
fi | |
# check if mysql is running now. |
This file contains 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/sh | |
# | |
# Usage: mysql-backup.sh dbname <daily|hourly|weekly|monthly> <backup dir> <dump args> | |
# | |
if [ -z $1 ]; then | |
echo "Missing required dbname." | |
exit 1 | |
fi |