Skip to content

Instantly share code, notes, and snippets.

View parsapoorsh's full-sized avatar
🍊
Hey there! I am using GitHub

Parsa Poorshikhian parsapoorsh

🍊
Hey there! I am using GitHub
View GitHub Profile
@parsapoorsh
parsapoorsh / ollama-pull.sh
Last active May 30, 2025 12:24
a script to download ollama models using WGET with hash verification
#!/bin/bash
die(){
echo "$1"
exit 1
}
# Function to verify SHA256 hash of a downloaded file.
verify_hash(){
local expected="$1"
@parsapoorsh
parsapoorsh / ffmpeg_video_stabilization.md
Last active October 10, 2024 14:40
ffmpeg video stabilization

ffmpeg video stabilization

for finding encoder info use: $ ffprobe -i original.mp4

for next commands, encoder settings MUST BE the same as the original video to don't lose significant quality and color during re-encoding


shake detection and stabilization:

@parsapoorsh
parsapoorsh / ufw-cloudflare.sh
Last active May 25, 2024 03:11
a bash script to create ufw rules for Cloudflare on port 80 and 433
#!/bin/bash
if [ "$1" == "insert" ]; then
for cfip in `curl -sw '\n' https://www.cloudflare.com/ips-v{4,6}`;
do
ufw allow proto tcp from $cfip to any port 80,443 comment 'Cloudflare';
done
echo $0 'Inserted'
elif [ "$1" == "delete" ]; then
while ufw status numbered | grep -q 'Cloudflare';
@parsapoorsh
parsapoorsh / mdb2sql.sh
Last active June 1, 2022 12:32 — forked from turicas/mdb2sql.sh
Convert a MDB (Access) file to SQL
#!/bin/bash
# Convert a MDB file (Access) to SQL
# Needs mdbtools[http://mdbtools.sourceforge.net/]
# run 'aptitude install mdbtools' on Debian/Ubuntu
# Created by Álvaro Justen <https://github.com/turicas>
# License: GPLv2
mdb=$1
sql=$2