Skip to content

Instantly share code, notes, and snippets.

View yetimdasturchi's full-sized avatar
👨‍💻
Fisting code

Manuchehr Usmonov yetimdasturchi

👨‍💻
Fisting code
View GitHub Profile
@yetimdasturchi
yetimdasturchi / openvpn_runner.sh
Created August 4, 2025 16:15
Run commands on remote servers
#!/bin/bash
VPN_SERVER="10.8.0.1"
STATUS_COMMAND="/root/openvpn_status.sh"
output=$(ssh -o BatchMode=yes -o ConnectTimeout=5 root@$VPN_SERVER "$STATUS_COMMAND")
if [[ $? -ne 0 ]]; then
echo "Failed to connect to $VPN_SERVER or run the command."
exit 1
@yetimdasturchi
yetimdasturchi / vlc-adb.sh
Created March 23, 2026 19:23
Stream any URL to VLC on Android TV over ADB
#!/bin/bash
DEVICE_IP="${ADB_DEVICE:-}"
VLC_ACTIVITY="org.videolan.vlc/org.videolan.vlc.StartActivity"
usage() {
echo "Usage: $(basename "$0") [OPTIONS] <url>"
echo ""
echo "Options:"
echo " -d, --device <ip:port> Target device (or set ADB_DEVICE env)"
@yetimdasturchi
yetimdasturchi / scan_effect.sh
Last active June 20, 2026 06:02
Create scanned looking PDFs with adjustable DPI/quality support
#!/usr/bin/env bash
set -Eeuo pipefail
SCRIPT_NAME="$(basename "$0")"
INPUT=""
OUTPUT="scanned_output.pdf"
DPI="130"
QUALITY="65"
INSTALL_DEPS="false"
@yetimdasturchi
yetimdasturchi / sunrise-sunset.php
Created August 19, 2026 15:22
Calculate sunrise and sunset times using geographic coordinates and date.
<?php
/**
* Check whether the given year is a leap year.
*/
function isLeapYear(int $year): bool
{
return $year % 400 === 0
|| ($year % 4 === 0 && $year % 100 !== 0);
}