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 | |
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 |
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 |
#!pip install rauth | |
from rauth import OAuth2Service | |
import json | |
# init work | |
NATION_SLUG = 'somenation' | |
SITE_SLUG = 'somesite' | |
OAUTH_ID = 'someid' | |
OAUTH_SECRET = 'somesecret' |
# github-create | |
# this function will create a new GitHub repo using credentials, including 2FA codes, supplied by the user. | |
# you can copy this entire file into your `~/.bashrc` or similar, or you can copy everything between the outermost | |
# curly braces into its own script and save that somewhere on your PATH. | |
# to use it, simply run `github-create` from within a local git repo. | |
github-create() { | |
HELP="""Creates a GitHub repo, sets it as the remote 'origin' for the local git repo, pushes. |