Skip to content

Instantly share code, notes, and snippets.

@GluTbl
GluTbl / usb_power_up.sh
Last active May 22, 2022 05:24
[Power Up usb for Ubuntu] #shell
echo "Usb power status:"
echo ""
sudo cat /sys/bus/usb/devices/*/power/level
echo ""
echo ""
while true; do
read -p "Do you wish to change usb power status? " yn
case $yn in
[Yy]* ) make install; break;;
@GluTbl
GluTbl / menu_selector.py
Created July 6, 2024 03:25
[Qprompt Menu] using menu selection in qprompt #python
import json
from typing import List, Dict, Any
from qprompt import Menu
class QpromptMenu:
def __init__(self, header: str, data: List[Dict[str, Any]], key_to_show):
self._data = data
@GluTbl
GluTbl / Dockerfile
Last active May 20, 2025 08:51
[AAXtoMP3 Dockerfile] #docker
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND=noninteractive
# Install core dependencies
RUN apt-get update && apt-get install -y \
curl \
bash \
grep \
@GluTbl
GluTbl / recursive_sha256sum.sh
Last active October 10, 2025 12:08
[Recursive file's sha256sum] #bash #shell
# do sha256asum for each file
# find . -type f ! -name "*.sha256sum" -exec bash -c 'for f; do echo "Processing: $f"; (cd "$(dirname "$f")" && sha256sum "$(basename "$f")" > "$(basename "$f").sha256sum"); done' _ {} +
# find . -type f ! -name "*.sha256sum" -exec sh -c 'for f; do echo "Processing: $f"; (cd "$(dirname "$f")" && sha256sum "$(basename "$f")" > "$(basename "$f").sha256sum"); done' _ {} +
# if you want to skip existing
#find . -type f ! -name "*.sha256sum" -exec sh -c 'for f; do if [ -f "$f.sha256sum" ]; then echo "Skipping (already exists): $f.sha256sum"; else echo "Processing: $f"; (cd "$(dirname "$f")" && sha256sum "$(basename "$f")" > "$(basename "$f").sha256sum"); fi; done' _ {} +
# check each file sha256sum is match
# find . -type f -name "*.sha256sum" -exec sh -c 'cd "$(dirname "{}")" && sha256sum -c "$(basename "{}")"' \;
@GluTbl
GluTbl / flush_dns.bat
Created May 27, 2025 15:58
[FLush dns] #bat
@echo off
cls
echo ========================================
echo DNS Flush Utility - Windows
echo ========================================
echo.
set /p userinput=Do you want to flush the DNS cache now? (y/n):
if /i "%userinput%"=="y" (
echo.
@GluTbl
GluTbl / QuickShare.bat
Created June 2, 2025 14:11
[Quick file host] #python
@echo off
cd /d %~dp0
echo Hosting current folder on LAN at port 8000...
python -m http.server 8000
pause
@GluTbl
GluTbl / overlay_partition_format.sh
Created October 6, 2025 06:08
[Formating partion by label] #bash
#!/bin/bash
LABEL="OVERLAY_ROOT"
FSTYPE="ext4"
# Find all devices with the label
DEVICES=($(blkid | grep "LABEL=\"$LABEL\"" | cut -d: -f1))
COUNT=${#DEVICES[@]}
@GluTbl
GluTbl / exact_match_search.ps1
Last active October 10, 2025 04:00
[Search files in WIndows] #powershell
function Find-Exact-FileWithProgress {
param (
[string] $BasePath,
[string] $FileName
)
$files = Get-ChildItem -Path $BasePath -Recurse -File -ErrorAction SilentlyContinue
$total = $files.Count
$counter = 0