From: http://stackoverflow.com/questions/16186392/multiple-option-arguments-using-getopts-bash
#!/bin/bash
while getopts "m:" opt; do
case $opt in
m) multi+=("$OPTARG");;
#...
esac
done
| %s/.*"name":"\([-a-z0-9A-Z.]*\)".*/\1/g | |
| Convert {"host":{"name":"host.domain.com","id":348,"hostgroup_id":null,"operatingsystem_id":5}}, to list of hostnames. |
| grep openvpn::client dev.pp | sed -e "s/\s*openvpn::client\s*{ '\([a-zA-Z]*\)':/\"\1\",/g" | |
| takes | |
| openvpn::client { 'serged': | |
| openvpn::client { 'danielc': | |
| openvpn::client { 'nigelg': | |
| and converts it to | |
| "serged", | |
| "danielc", | |
| "nigelg", |
From: http://stackoverflow.com/questions/16186392/multiple-option-arguments-using-getopts-bash
#!/bin/bash
while getopts "m:" opt; do
case $opt in
m) multi+=("$OPTARG");;
#...
esac
done
| #!/bin/bash | |
| ZONEID='' # Hosted Zone ID e.g. BJBK35SKMM9OE | |
| RECORDSET='' # The CNAME you want to update e.g. hello.example.com | |
| TTL=300 # The Time-To-Live of this recordset | |
| TYPE='A' # Change to AAAA if using an IPv6 address | |
| COMMENT="Auto updating @ `date`" | |
| IP=`curl -ss https://icanhazip.com/` # Get the external IP address | |
| LOGPATH='/var/log' |
| #!/bin/bash | |
| cp $1 /var/lib/docker/aufs/mnt/`docker inspect -f '{{.Id}}' $2`/ |
| #!/bin/bash | |
| if ! which wget > /dev/null; then | |
| yum install -y wget | |
| fi | |
| export DOCKER_VERSION=1.3.0 | |
| pushd /tmp | |
| if [ ! -f /usr/bin/docker ]; then |
| KEYBINDINGS | |
| byobu keybindings can be user defined in /usr/share/byobu/keybindings/ (or within .screenrc if byobu-export was used). The common key bindings | |
| are: | |
| F2 - Create a new window | |
| F3 - Move to previous window | |
| F4 - Move to next window |
To free pagecache, dentries and inodes:
| Stop/restart watching for changes in a file: | |
| git update-index --assume-unchanged <file> | |
| git update-index --no-assume-unchanged <file> |
| 13:41 <alisdair> 6000 keystrokes per hour | |
| 13:41 <alisdair> that seems high | |
| 13:43 <cheeseprocedure> 100 words per minute is 6000 words per hour, yes? 6000 keystrokes should be pretty easy | |
| 13:43 <cheeseprocedure> it does seem like a bizarre metric though | |
| 13:43 <cheeseprocedure> oh, data entry | |
| 13:44 <cheeseprocedure> so probably more like punching digits into a numpad mindlessly? | |
| 14:42 <Lefty> I could probaby type 6000 keystrokes per hour using only my buttcheeks | |
| 14:42 <Lefty> in fact I'm going to apply just to attempt that | |
| 14:42 <cheeseprocedure> i look forward to your after-action report | |
| 14:42 <cheeseprocedure> also, i hope they have spare keyboards |