A scratch pad of things that are hard to remember
:w !sudo tee %
- Exit on first error
- Throw error if referencing an undefined variable
set -e
set -u
SCRIPTPATH=$( cd "$(dirname "$0")" ; pwd -P )
sudo !!
screen -X eval "chdir $PWD"
sudo apt-get clean
sudo apt-get autoclean
sudo apt-get autoremove
perl -0777 -i -pe 's|^(.*)\n={3,}$|# $1|gm' `find . -name '*.md'`
g
- match globally, i.e. replace ALL occurrencesm
- treat string as multi-line. Then ^ $ work line-by-line instead of whole doci
- case insensitives
- make dot match a newlinex
- ignore whitespace and allow comments after # on each line
iconv -f utf-8 -t ascii//translit
(use with pipes)
drush vset theme_default seven
s find . -type d -exec chmod 755 {} \; && s find . -type f -exec chmod 644 {} \;