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 / convert-images-to-jxl.py
Last active December 9, 2025 20:34
a python script to convert images to JPEG-XL using cjxl
#!/usr/bin/env python3
import os
import shutil
import subprocess
import logging
from pathlib import Path
from dataclasses import dataclass
from time import sleep, perf_counter
from typing import List, Iterator, Optional
from dataclasses import dataclass
from pathlib import Path
from typing import Tuple
import cv2
import numpy as np
@dataclass
class FaceDetection:
@parsapoorsh
parsapoorsh / ollama-pull.sh
Last active December 9, 2025 05:15
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 November 26, 2025 15:45
ffmpeg video stabilization

ffmpeg video stabilization

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

for next commands, encoder settings MUST BE the same or better then 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