Workers
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
docker volume rm $(docker volume ls -qf dangling=true)
docker volume ls -qf dangling=true | xargs -r docker volume rm
The general idea is to ask a group (let's call it target group) via bot and get answer. The group might be:
- Support Team
- IT Department of your company
- etc.
TODO: text formatting is lost on resending. Use entities instead of text field
TODO: set debug level via Environment variables
Done according to https://github.com/Neilpang/acme.sh/wiki/dns-manual-mode
Warning: DNS manual mode can not renew automatically. For renewal you need to repeat steps below each time. Certificate needs to be renewed within 90 days.
Install client
This file contains 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
# https://help.ubuntu.com/community/BackupYourSystem/TAR | |
# Archive | |
tar -cvpzf backup.tar.gz --one-file-system / | |
# Restore | |
sudo tar -xvpzf /path/to/backup.tar.gz -C /media/whatever --numeric-owner |
This file contains 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
sudo apt install lolcat cowsay | |
while true; do export PINGHOST=8.8.8.8 && RESULT=$(ping -q -n -c 4 $PINGHOST | awk '/packet loss/ {if ($6 != "0%") print $6, "packet loss"}') && echo "Done:" && if [[ -z $RESULT ]]; then cowsay "No package lost!" | lolcat --seed=45; else cowsay $RESULT | lolcat --seed=17; fi; date; echo -n "sleeping... "; sleep 5; echo -n "pinging... "; done | |
This file contains 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
# based on https://serverfault.com/a/196847 | |
# It will keep only latest 12 files | |
ls -1t /path/to/dir/* | tail -n +13 | xargs rm > /dev/null 2>&1 |
This file contains 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
# install dependencies | |
sudo pip install polib | |
sudo pip install google-cloud-translate==2.0.0 | |
# https://docs.transifex.com/client/installing-the-client | |
sudo pip install transifex-client | |
# prepare and export your google cloud credentials | |
# See https://cloud.google.com/translate/docs/basic/setup-basic | |
# and https://cloud.google.com/docs/authentication/getting-started |
This file contains 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
######################################### | |
unmapAll # Use Emacs-style bindings only. | |
######################################### | |
# Modifier Keys w/ Emacs Terminology: | |
# `<c-*>` = ⌃ Control Key; i.e. `C-*`. | |
# `<a-*>` = ⌥ Meta Key (Alt/Option); i.e. `M-*`. |