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
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()
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).
@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
@ichux
ichux / TODO.txt
Last active October 4, 2025 03:13
- Connect the RUTX12 to main router and connect other devices to the RUTX12
- Use the assigned hostname while connected to the RUTX12
- Test the RTMP and advertising
- Begin to pack every essentials
- Check the kitchen to be sure we didn't leave anything behind
- # on bitia
Settings:
- ensure one can turn on and off recording from the dashboard
> rsync -avP .ssh [email protected]:~
# 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",
#!/bin/bash
TARGET=/usr/local/bin/docker-compose
# Step 1: Create the file
sudo touch "$TARGET"
# Step 2: Make it executable
sudo chmod +x "$TARGET"