Tips, Tricks, and Checklists | |
---|---|
RHEL / CentOS | Debian / Ubuntu |
CCDC Event | |
---|---|
Box Assignments (2019) | Fundamentals (2019) |
How To's | |
---|---|
Splunk (CentOS 6) | Bind9 (Ubuntu 12.04) |
PS1="┌─[\`if [ \$? = 0 ]; then echo \[\e[32m\]✔\[\e[0m\];else echo \[\e[31m\]✘\[\e[0m\];fi\`]───[\`if [ \u = root ]; then echo \[\e[31m\]\u\[\e[0m\]; else echo \[\e[33m\]\u\[\e[0m\]; fi\`\[\e[01;49;39m\]@\H\[\e[00m\]]───[\[\e[1;49;34m\]\W\[\e[0m\]]───[\[\e[1;49;39m\]\$(ls | wc -l) files, \$(ls -lah | grep -m 1 total | sed 's/total //')\[\e[0m\]]\n└───▶ "
Short and easy, but prone to failures
backupDir="$HOME""/ccdc_backups/$(basename -s.sh "$0")"
A bit more of a pain, but significantly less prone to failures
backupDir="$HOME""/ccdc_backups/$(echo $BASH_SOURCE | sed 's|.sh$||' | rev | cut -d\/ -f1 | rev)"