Skip to content

Instantly share code, notes, and snippets.

@blackestwhite
blackestwhite / dockerfile
Created March 1, 2025 06:14
nuxt dockerfile
FROM node:23-alpine3.20 AS build
# update and install the latest dependencies for the alpine version
RUN apk update && apk upgrade
# Install pnpm
RUN corepack enable && corepack prepare pnpm@latest --activate
# set work dir as app
WORKDIR /app
@blackestwhite
blackestwhite / backup-minio.yml
Created January 14, 2025 18:08
a github action to save minio contents to a git repo
name: Backup All MinIO Buckets and Push to GitHub
on:
schedule:
- cron: '0 0 * * *' # Runs daily at midnight
workflow_dispatch: # Allows manual triggering
jobs:
backup:
runs-on: ubuntu-latest
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: