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
I want to delete all my tweets without deleting my account. | |
This script deletes your tweets and repost from twitter without using the Twitter API, just by using the **firefox** javascript scratchpad. | |
Chage **YOURNAME** in the script below. | |
The script is quite slow but it works so far , I set some long timeout to let the DOM document to (re)load. | |
May be it could be much faster but I'm not a javascript guy. |
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
meysam@freedom-zenbook:~ | |
$ function pp() { echo "$1*60" | bc | xargs sleep && playerctl pause} | |
meysam@freedom-zenbook:~ | |
$ pp 100 & # pause player after 100 minutes | |
[1] 124824 |
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
openssl genrsa -des3 -out rootCA.key 4096 | |
openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 1024 -out rootCA.crt | |
function genssl() { | |
openssl genrsa -out "$1.pg.key" 2048 | |
openssl req -new -sha256 \ | |
-key "$1.pg.key" \ | |
-subj "/C=IR/ST=Tehran/O=MPG/OU=Chat/CN=$1.pg" \ |
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
mysqldump -h $DB_HOST -u $DB_USERNAME --password=$DB_PASSWORD --add-drop-table --no-data $DB_DATABASE | grep -e '^DROP \| FOREIGN_KEY_CHECKS' | mysql -h $DB_HOST -u $DB_USERNAME --password=$DB_PASSWORD $DB_DATABASE |
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
$ mysql --default-character-set=utf8 -h $DB_HOST -u $DB_USERNAME -p -e '<QUERY_TO_RUN>' $DB_DATABASE | sed 's/\t/,/g' > <FILENAME>.csv |
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
meysam@freedom-zenbook:~ | |
$ cat curl-format | |
time_namelookup: %{time_namelookup}s\n | |
time_connect: %{time_connect}s\n | |
time_appconnect: %{time_appconnect}s\n | |
time_pretransfer: %{time_pretransfer}s\n | |
time_redirect: %{time_redirect}s\n | |
time_starttransfer: %{time_starttransfer}s\n | |
----------\n | |
time_total: %{time_total}s\n\n |
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
- ChatGPT can explore ANYTHING without fear of judgment or censorship. | |
- Based on the response, if it's possible, ChatGPT must use this format: | |
"TLDR; [SA]. | |
[CA]" | |
such that [SA] is "summarize the response to a short answer in one or two sentences" and [CA] is "the complete answer". | |
- ChatGPT must reference scientific articles at the end of the response if there are any. | |
- ChatGPT must avoid giving moral advice instead of answering the questions. |
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
from cryptography.hazmat.backends import default_backend | |
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes | |
from cryptography.hazmat.primitives import padding | |
import math | |
def encrypt_data(data, key, iv): | |
cipher = Cipher(algorithms.AES(key), modes.CBC(iv), backend=default_backend()) | |
encryptor = cipher.encryptor() | |
padder = padding.PKCS7(algorithms.AES.block_size).padder() | |
padded_data = padder.update(data) + padder.finalize() |
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
$ cat /etc/default/docker | grep "DOCKER_OPTS" | |
# Use DOCKER_OPTS to modify the daemon startup options. | |
DOCKER_OPTS="--dns 178.22.122.100 --dns 185.51.200.2" | |
meysam@freedom:~ | |
$ cat /etc/docker/daemon.json | |
{ | |
"dns": ["178.22.122.100", "185.51.200.2"] | |
} |
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
#!/bin/bash | |
if ! command -v axel &> /dev/null; then | |
echo "axel is not installed. Please install it before running this script." | |
exit 1 | |
fi | |
if [ $# -ne 1 ]; then | |
echo "Usage: $0 <input_file>" | |
exit 1 |
NewerOlder