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
| # создаем один tar.bz2 архив | |
| backupDirectory=<backups_directory> | |
| projectDirectory=<projects_directory> | |
| chatId=<telegram_chat_id> | |
| botToken=<telegram_bot_token> | |
| cd $backupDirectory | |
| tar -cvjf $backupDirectory/archive.full.tar.bz2 $projectDirectory | |
| split -b 40M archive.full.tar.bz2 "archiver.tar.bz.part" | |
| for i in `ls $backupDirectory | grep part` |
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 | |
| #EK | |
| telegram() { | |
| USERID="" | |
| KEY="" | |
| URL="https://api.telegram.org/bot${KEY}/sendMessage" | |
| TEXT="${1}" | |
| curl -s -d "chat_id=${USERID}&text=${TEXT}&disable_web_page_preview=true&parse_mode=markdown" $URL > /dev/null | |
| } |
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 | |
| # USER SETTINGS | |
| BACKUP_FOLDER="/srv/repositories" | |
| BACKUP_FILE_NAME=backup-`date +%Y%m%d`.tar.gz | |
| DROPBOX_FOLDER=/Backup | |
| TELEGRAM_USER_ID="" | |
| TELEGRAM_BOT_KEY="" | |
| HEALTH_CHECK_KEY="" |
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
| node: Platform built on V8 to build network applications | |
| git: Distributed revision control system | |
| wget: Internet file retriever | |
| yarn: JavaScript package manager | |
| python3: Interpreted, interactive, object-oriented programming language | |
| python: Interpreted, interactive, object-oriented programming language | |
| mysql: Open source relational database management system | |
| coreutils: GNU File, Shell, and Text utilities | |
| openssl: SSL/TLS cryptography library | |
| postgresql: Object-relational database system |
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
| -------------------------------------------------------------------------------------------------------------------- | |
| #setting system locale to en_US.utf8 | |
| localectl set-locale LC_CTYPE=en_US.utf8 | |
| localectl status | |
| ---------------------------------------------------------------------------------------------------- | |
| ip -o -4 addr list enp0s8 | awk '{print $4}' | cut -d/ -f1 # print IP with a given interface | |
| ip -o -6 addr list enp0s8 | awk '{print $4}' | cut -d/ -f1 | |
| ip route get 8.8.8.8 | sed -n '/src/{s/.*src *\([^ ]*\).*/\1/p;q}' # IP reaching the public internet, multiple IPs interfaces | |
| ifconfig | awk '/192.168.18.84/ {print $1}' RS="\n\n" # print interface with a given IP | |
| ---------------------------------------------------------------------------------------------------- |
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 | |
| ### | |
| # Backup Script | |
| ### | |
| # Toggle debug mode for CLI output - "YES" or "NO" | |
| DEBUG="YES" | |
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 | |
| ### | |
| # Backup Script | |
| ### | |
| # Toggle debug mode for CLI output - "YES" or "NO" | |
| DEBUG="YES" | |
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
| Random shell scripts |
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 | |
| # Install utilities: ipset and iprange | |
| apt install ipset iprange -y | |
| # Create new a set | |
| ipset create tor hash:net | |
| # Get a list of Tor exit-nodes | |
| curl -sSL "https://check.torproject.org/torbulkexitlist" > /tmp/exit_nodes.txt | |
| # Optimize and merge a list | |
| iprange --optimize --merge /tmp/exit_nodes.txt > /tmp/exit_nodes_optimized.txt | |
| # Add to the set |
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/sh | |
| wget -qO- https://check.torproject.org/torbulkexitlist | sort | sed "s/^/deny /g;" > /etc/nginx/conf.d/deny-tor.conf | |
| systemctl nginx reload |