Skip to content

Instantly share code, notes, and snippets.

View ichux's full-sized avatar
🏠
Working from home

Chukwudi Nwachukwu ichux

🏠
Working from home
View GitHub Profile
sudo echo $USER' ALL=(ALL) NOPASSWD: ALL' | sudo tee /etc/sudoers.d/$USER && sudo chmod 0440 /etc/sudoers.d/$USER
#!/bin/bash
ffmpeg \
-protocol_whitelist "file,http,https,tcp,tls" \
-user_agent "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:146.0) Gecko/20100101 Firefox/146.0" \
-referer "https://www.dw.com" \
-i "https://hlsvod.dw.com/i/dwtv_video/flv/she/she260108_ttn_,AVC_480x270,AVC_512x288,AVC_640x360,AVC_960x540,AVC_1280x720,AVC_1920x1080,.mp4.csmil/master.m3u8" \
-c copy \
aiprivacy.mp4
@ichux
ichux / twrap.py
Created January 9, 2026 14:39
text wrap
import textwrap
def format_string(data, chunk_size=73, indent=4, return_output=False):
"""
Format a string into chunks of specified size using textwrap, with optional indentation.
Args:
data: Input string to be formatted.
chunk_size: Size of each chunk (default: 73).
indent: Number of spaces for indentation (default: 4).
return_output: If True, return the formatted string instead of printing (default: False).
python3 << 'EOF'
import ast
import sys
file_path = "~/test_clinical_study.py"
with open(file_path, 'r') as f:
tree = ast.parse(f.read(), filename=file_path)
imported = set()
@ichux
ichux / binorbin.py
Last active November 2, 2025 17:24
import msgpack
class Event:
@staticmethod
def pack(payload):
return msgpack.packb(payload, use_bin_type=True)
@staticmethod
def unpack(blob):
return msgpack.unpackb(blob, raw=False, strict_map_key=False)
https://discord.com/api/download/stable?platform=linux&format=deb
> docker save \
python:3.12.11-slim-bookworm \
zeromq:latest \
fanout/pushpin:1.40.1 \
redis:8.2.1-alpine3.22 \
mariadb:12.1.1-rc \
-o all_images.tar
> rsync -avP .ssh iam@bit.wise:~
# the above copies the .ssh folder from PC A and dumps the folder to the ~/.ssh on the PC B
@ichux
ichux / nodejs
Created September 30, 2025 16:27
mkdir -p ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=$HOME/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
import time
from datetime import datetime, timedelta, timezone
import redis
class RedisTimeTracker:
def __init__(self):
self.RD = redis.Redis(
host="127.0.0.1",