sudo docker rmi
sudo docker rm
sudo docker ps -a
sudo docker exec -it CONTAINER_HASH /bin/sh
sudo docker logs CONTAINER_HASH
sudo docker run -d CONTAINER_NAME:VERSION
sudo docker build -t IMAGE_NAME:VERSION .
sudo docker compose up -d
sudo docker compose down
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
| # search some word in all log file in current directory | |
| ls | cut -d " " -f2 | xargs grep "WORD" | |
| # see live last log in current directory | |
| ls -ltrh | rev | cut -d' ' -f 1 | rev | tail -n1 | xargs tail -f |
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 binascii | |
| def ucs2_decode(hex_string: str) -> str: | |
| return binascii.unhexlify(hex_string).decode('utf-16-be') | |
| def ucs2_encode(text: str) -> str: | |
| encoded = text.encode('utf-16-be') | |
| hexlify = binascii.hexlify(encoded) | |
| return hexlify.decode().upper() |
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
| ls | cut -d " " -f2 | xargs grep "SOME WORD" |
If you are using proxychain for chaing proxy then need to get it http proxy for some reason(i.e set it on Telegram) you need to run some proxy server with this program. In this example I will use proxy.py. this is a http proxy server writed with pure python.
after config proxychains use following code.
pip install proxy.py
proxychains proxyby defualt run http proxy on host 127.0.0.1 and port 8899
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
| def arabic_to_persian(text: str) -> str: | |
| # arabic: persian | |
| characters = { | |
| 'ك': 'ک', | |
| 'دِ': 'د', | |
| 'بِ': 'ب', | |
| 'زِ': 'ز', | |
| 'ذِ': 'ذ', | |
| 'شِ': 'ش', | |
| 'سِ': 'س', |
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
| ssh -p 22 -N -L 3306:127.0.0.1:3306 [USER]@[SERVER-IP] | |
| # -p -> ssh port | |
| mysql -u [MYSQL-USER] -p -h 127.0.0.1 |
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 USER 'root'@'%' IDENTIFIED BY 'some_pass'; | |
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'; | |
| FLUSH PRIVILEGES; |
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 | |
| # Removes old revisions of snaps | |
| # CLOSE ALL SNAPS BEFORE RUNNING THIS | |
| set -eu | |
| LANG=en_US.UTF-8 snap list --all | awk '/disabled/{print $1, $3}' | | |
| while read snapname revision; do | |
| snap remove "$snapname" --revision="$revision" | |
| done |
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
| function full_fill_check(target_element) { | |
| let all_required_checked = true | |
| $(target_element).find('input:required').each((index, element) => { | |
| if (!$(element).val()) { | |
| $(element).attr('placeholder', '*اجباری') | |
| all_required_checked = false | |
| } | |
| }) | |
| if (!all_required_checked) { | |
| Swal.fire( |