To free pagecache, dentries and inodes:
- free && sync && echo 3 > /proc/sys/vm/drop_caches && free
Stop/restart watching for changes in a file: | |
git update-index --assume-unchanged <file> | |
git update-index --no-assume-unchanged <file> |
To free pagecache, dentries and inodes:
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 |
#!/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 |
#!/bin/bash | |
cp $1 /var/lib/docker/aufs/mnt/`docker inspect -f '{{.Id}}' $2`/ |
#!/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' |
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
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", |
%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. |