Skip to content

Instantly share code, notes, and snippets.

View gaurishhs's full-sized avatar
🌴
Life is short. Time is fast. Enjoy every moment

Gaurish Sethia gaurishhs

🌴
Life is short. Time is fast. Enjoy every moment
View GitHub Profile
@gaurishhs
gaurishhs / sh
Created February 27, 2024 09:54
Backup 2 PostgreSQL services zip and upload via rclone deleting older files
#1/bin/bash
timestamp=$(date +"%H-%M-%S_%d-%m-%Y")
docker exec postgres pg_dump -U gaurish kanboard > ~/dumps/kanboard_dump-$timestamp.sql
docker exec davical-postgres pg_dumpall -U gaurish > ~/dumps/davical_dump-$timestamp.sql
cd dumps
zip -6 -r backup_$timestamp.zip kanboard_dump-$timestamp.sql davical_dump-$timestamp.sql
@gaurishhs
gaurishhs / bench.sh
Last active February 18, 2023 07:26
Go vs Bun Benchmark
echo "\n\n# Benchmarking Golang"
go build main.go
./main &
PID=$!
sleep 2
bombardier --fasthttp -c 100 -n 10000 http://127.0.0.1:8000/
ps -o pid,ppid,pcpu,pmem,command -p $PID
# Thread count
echo "Threads: $(ps -M $PID | grep -v USER | wc -l)"
kill $PID