I hereby claim:
- I am starkers on github.
- I am starkers (https://keybase.io/starkers) on keybase.
- I have a public key ASBV3p_1ysgoIbzTE1O_F6S6Z7k365WlK9d_fdby9v1k4Qo
To claim this, I am signing this object:
| #!/usr/bin/env bash | |
| ## This rar's a file up with a password and emails it | |
| ## not as good as using openssl to encrypt but I'm not about to explain openssl pipes to my users | |
| # rar does the job :/ | |
| FILE=/var/log/some_logfile.log | |
| PASS="your super top secret password" |
I hereby claim:
To claim this, I am signing this object:
| #!/usr/bin/env bash | |
| set -o nounset # Treat unset variables as an error | |
| # | |
| # you can call this script as such if needed: | |
| # ./grants --user="mymysqlusername" --pass="password" --host="somehost" | |
| # | |
| # I much prefer .my.cnf or similar |
| #!/usr/bin/env bash | |
| # This script allows me to run a crontab at a random point in the next hour. | |
| # WHY? | |
| # Using something like a little delay can also stop ALL the servers hammering a proxy at once for example. | |
| # ...or if something breaks I don't take the entire cluster down at once | |
| # Do the task at some random point within the next X minutes: | |
| X=60 |
| #!/usr/bin/env bash | |
| #who gets alerted | |
| DEST=your@email.com | |
| #from address | |
| FROM="noreply@server.example.org" | |
| #directory to monitor | |
| DIR=/www |
| #!/usr/bin/env bash | |
| if [ "X$1" == X ]; then | |
| echo "prepares a new container does the following:" | |
| echo "- installs ssh keys from $KEYS" | |
| echo "- sets random root passwords" | |
| echo "- deletes the 'ubuntu' user" | |
| echo | |
| echo "usage: 'lxc-prep <container_name>'" | |
| echo |
| #!/usr/bin/env bash | |
| # I use this on servers hosting multiple containers. | |
| # It lets me reasonably easily manage ports without typing too much | |
| # Works on openvz and lxc... nothing really magical | |
| # Beware the spoof detection ranges.. if you expect legit traffic from one of these networks the modify it | |
| # There are a few bugs but generally this works well.. YMMV -david | |
| #public IP on my host (eth0) | |
| IP1=178.62.XX.XX |
| #!/usr/bin/env bash | |
| PATH=$PATH:/usr/bin/ | |
| # how to long to keep backups for (in days) | |
| KEEP=150 | |
| # Where to keep them | |
| BACKUP_PATH="/root/mysql_backups/sql" | |
| host="localhost" |
| #!/usr/bin/env bash | |
| convert_to_lower (){ | |
| IN="$1" | |
| tr '[:upper:]' '[:lower:]' <<< "$IN" | |
| } | |
| clipboard_output(){ | |
| #graps clipboard and prints to stdout |
| #!/usr/bin/env bash | |
| # DESC: simple monitoring of directory growth.. does a du and informs you the diff on a loop | |
| # defaults to 300 second loop | |
| # USAGE: this_script.sh "/some/directory/to/watch" is the directory to watch | |
| # sample output: | |
| #Fri May 13 13:12:06 BST 2016: thing grew by 132 | |
| #Fri May 13 13:17:07 BST 2016: thing grew by 83 | |
| #Fri May 13 13:37:07 BST 2016: thing shunk by 1575 | |
| #Fri May 13 13:42:07 BST 2016: thing grew by 596 |