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
SELECT t.TABLE_NAME, `AUTO_INCREMENT` | |
FROM information_schema.TABLES AS t | |
JOIN information_schema.COLUMNS AS c ON ( | |
c.COLUMN_NAME = 'id' AND | |
c.TABLE_SCHEMA = t.TABLE_SCHEMA AND | |
c.TABLE_NAME = t.TABLE_NAME AND | |
c.`DATA_TYPE` = 'int' | |
) | |
WHERE AUTO_INCREMENT > 1717986918; |
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
#!/usr/bin/env bash | |
set -e | |
# Get the java version, quit if it's not found | |
JAVA_VERSION=`java -version 2>&1 | head -n 1 | cut -d\" -f 2 | cut -c1-3` | |
if [ -z "$JAVA_VERSION" ]; then | |
echo "Unable to determine Java version, exiting" | |
exit | |
fi |
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
# List all access keys for every IAM user | |
aws iam list-users | jq '.Users[].UserName' | sed "s/\"//g" | xargs -I {} aws iam list-access-keys --user={} | |
# Enable Metrics Collection on ASGs that don't have it | |
aws autoscaling describe-auto-scaling-groups | jq '.AutoScalingGroups[] | select(.EnabledMetrics==[]).AutoScalingGroupName' | xargs -I {} aws autoscaling enable-metrics-collection --auto-scaling-group-name {} --granularity "1Minute" |
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
# | |
# Pretty, colourful AWS | |
# | |
function paws() { | |
/usr/local/bin/aws "$@" | python -m json.tool | pygmentize -l javascript | |
} |
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
# | |
# Git branches in terminal path | |
# | |
function parse_git_branch { | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || return | |
echo " ("${ref#refs/heads/}")" | |
} | |
YELLOW="\[\033[0;33m\]" | |
PS1="[${debian_chroot:+($debian_chroot)}\u@\h \w$YELLOW\$(parse_git_branch)\[\e[0m\]]\$ " |
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
Blatantly stolen from stack overflow, copy the below command into a terminal and run it | |
remote=origin ; for brname in `git branch -r | grep $remote | grep -v master | grep -v HEAD | awk '{gsub(/[^\/]+\//,"",$1); print $1}'`; do git branch --set-upstream $brname $remote/$brname ; done |