This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <array> | |
| #include <tuple> | |
| #include <type_traits> | |
| #include <utility> | |
| namespace cdict { | |
| template<char... cs> | |
| using string = std::integer_sequence<char, cs...>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # extract all urls from a text file | |
| cat file.txt | egrep -o 'https?://[^ ]+' | sed -e 's/https/http/g' | sed -e 's/\W+$//g' | sort | uniq -c | sort -bnr | |
| # extraxt domains from URL's found in text files | |
| cat file.txt | egrep -o 'https?://[^ ]+' | sed -e 's/https/http/g' | sed -e 's/\W+$//g' | sed -e 's/http:\/\///g' | sed -e 's/\/.*$//g' | sort | uniq -c | sort -bnr | |
| # extract email addresses | |
| cat file.txt | grep -i -o '[A-Z0-9._%+-]\+@[A-Z0-9.-]\+\.[A-Z]\{2,4\}' | sort | uniq -c | sort -bnr | |
| # list all words in a text file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| TODAY=$(date +%Y%m%d) | |
| TARGETS=( '/etc' '/home' '/root' '/var/www' ) | |
| BACKUP_ROOT='/backups' | |
| BACKUP_DIR="${BACKUP_ROOT}/${TODAY}" | |
| echo "$(date +%D" "%r): Beginning backup" | |
| mkdir -p $BACKUP_DIR | |
| for i in ${TARGETS[@]}; do |
NewerOlder