Skip to content

Instantly share code, notes, and snippets.

View radzki's full-sized avatar
💻

Gabriel Radzki radzki

💻
View GitHub Profile
@radzki
radzki / intelbrasW51200GSRestarter.sh
Created November 12, 2025 05:39
Script to automate the restart action on Intelbras W5-1200GS
#!/bin/bash
# Router Control Script
# Encodes credentials and performs API calls to control the router
#
# Usage:
# ./router_control.sh
# ROUTER_IP=192.168.1.1 USERNAME=admin PASSWORD=mypass ./router_control.sh
#
# Requirements:
@radzki
radzki / proxmox_disable_gpu_passthrough.sh
Created September 16, 2025 00:18
A script to disable GPU passthrough on Proxmox Host
#!/bin/bash
function continueOrExit {
echo "Continue? (y/N)"
read continue
if [ "$continue" != "y" ] && [ "$continue" != "Y" ]; then
echo "Exiting..."
exit 1
fi
@radzki
radzki / proxmox_enable_gpu_passthrough.sh
Last active September 16, 2025 00:18
A script to enable GPU passthrough on Proxmox Host
#!/bin/bash
function getGPUDevices {
echo "===== getGPUDevices ====="
# Get GPU devices and extract PCI IDs
echo "Found GPUs:"
GPU_DEVICES=$(lspci -nn | grep -i vga | grep -E '(AMD|NVIDIA)')
echo "$GPU_DEVICES"
@radzki
radzki / espota.py
Created January 20, 2025 22:18
espota.py for CGNAT
#!/usr/bin/env python3
#
# Original espota.py by Ivan Grokhotkov:
# https://gist.github.com/igrr/d35ab8446922179dc58c
#
# Modified since 2015-09-18 from Pascal Gollor (https://github.com/pgollor)
# Modified since 2015-11-09 from Hristo Gochkov (https://github.com/me-no-dev)
# Modified since 2016-01-03 from Matthew O'Gorman (https://githumb.com/mogorman)
#
# This script will push an OTA update to the ESP
@radzki
radzki / notification.py
Created February 29, 2024 21:33
Codility's test
def solution(message, K):
if K < 3 or K > 500:
raise Exception("K out of range")
if len(message) == 0 or len(message) > 500:
raise Exception("Message too big.")
if len(message) <= K:
return message