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
| gsettings set org.gnome.desktop.background picture-options 'none' | |
| gsettings set org.gnome.desktop.background primary-color '#000000' |
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
| NEWNAME="" | |
| FULLNAME="" | |
| usermod -l $NEWNAME -d /home/$NEWNAME -m ubuntu | |
| groupmod -n $NEWNAME ubuntu | |
| chfn -f $FULLNAME $NEWNAME |
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
| # create public azure storage account <account> with container 'git-test' | |
| az storage account create -n <account> -g <resource-group> -l <region> --sku Standard_LRS | |
| az storage container create --account-name <account> -n git-test --public-access blob | |
| # create a | |
| mkdir git-test && cd git-test | |
| git init | |
| echo "Hello World!" > test.txt | |
| git add test.txt && git commit -m 'initial commit' |
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
| # watch the progress of a redis list go down | |
| REDIS_HOST=<redis-hostname> REDIS_LIST=<redis-listname> TOTAL=<optional> python -c $'import os; import redis; from tqdm import tqdm; from time import sleep; r = redis.Redis(host=os.getenv("REDIS_HOST")); plen = r.llen(os.getenv("REDIS_LIST")); total = int(os.getenv("TOTAL", 0)); progress = tqdm(total=(total or plen), initial=(total-plen if total else 0));\nwhile plen > 0: clen = r.llen(os.getenv("REDIS_LIST")); progress.update(plen-clen); plen = clen; sleep(1);\nprogress.close()' |
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
| find <dir> -type f | xargs -L 1 -I {} basename {} | xargs -L 1 -I {} printf "{}\nCg==" | base64 -d |
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
| find <dir> -type f | xargs -L 1 -I {} basename {} | xargs -L 1 -I {} printf "{}\nCg==\n" | base64 -d |
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
| # block all connections | |
| sudo iptables -A INPUT -p tcp --dport 3306 -j DROP | |
| # kill all connections | |
| docker exec -it <container-name> mysql -sN -e "select concat('kill ',id,';') from information_schema.processlist;" > kill.txt | |
| docker exec -i <container-name> mysql < kill.txt | |
| # make schema changes | |
| ALTER TABLE ... | |
| # allow connections again | |
| sudo iptables -D INPUT -p tcp --dport 3306 -j DROP |
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
| echo $(az storage blob list --account-name <account-name> --container-name <container-name> --query "[*].[properties.contentLength]" --output tsv --num-results '*' | paste --serial --delimiters=+ | bc | xargs printf "%'d") bytes |
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
| import sys | |
| import os | |
| import struct | |
| import time | |
| from python import Panda | |
| from enum import IntEnum | |
| from Queue import Queue, Empty | |
| import threading |
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
| curl https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python - |