Skip to content

Instantly share code, notes, and snippets.

pip install --upgrade --force-reinstall "git+https://github.com/ytdl-org/youtube-dl.git"
@blackestwhite
blackestwhite / forward.sh
Created December 5, 2022 13:46
port forwarding using ip tables
#!/bin/bash
read -p "Enter your proxy server's IP: " PROXY_IP
read -p "Enter your destination server's IP: " DEST_IP
sysctl net.ipv4.ip_forward=1
iptables -t nat -A PREROUTING -p tcp --dport 22 -j DNAT --to-destination $PROXY_IP
iptables -t nat -A PREROUTING -j DNAT --to-destination $DEST_IP
iptables -t nat -A POSTROUTING -j MASQUERADE
iptables-save
@blackestwhite
blackestwhite / EnFa_conversion.js
Last active October 25, 2022 11:42
English to Persian, Persian to English digit conversion, JavaScript RegEx
const ToPersian = str => str.replace(/\d/g, idx => '۰۱۲۳۴۵۶۷۸۹'[idx])
const ToEnglish = str => str.replace(/[۰-۹]/g, d => '۰۱۲۳۴۵۶۷۸۹'.indexOf(d))
@blackestwhite
blackestwhite / abi.json
Created June 19, 2022 04:43
Golang code snippet to listen/log BUSD events on Binance Smart Chain
[{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"constant":true,"inputs":[],"name":"_decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"payable":false,"stateMu

Keybase proof

I hereby claim:

  • I am blackestwhite on github.
  • I am blackestwhite (https://keybase.io/blackestwhite) on keybase.
  • I have a public key ASB2jQIEFv55bU6Dn76GzGndtkNQRwyquOu3O3zcNsdW4go

To claim this, I am signing this object: