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
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"
ffmpeg -protocol_whitelist \
"file,http,https,tcp,tls" \
-i ~/Downloads/master.m3u8 \
-c copy master.mp4
#!/usr/bin/env python
"""
Simple script to create a Django superuser.
Run this from the project root directory.
"""
import os
import sys
import django
sqlite3 ~/terminaLogs.db <<EOF
CREATE TABLE IF NOT EXISTS logs (
id INTEGER PRIMARY KEY AUTOINCREMENT,
timestamp TEXT NOT NULL,
message TEXT NOT NULL
);
EOF
echo .schema | sqlite3 ~/terminaLogs.db
# cinema, advertising
sudo apt install -y mpv smplayer
mpv http://example.com/stream-url
smplayer http://example.com/stream-url
# cinema
July 20, 2025, 14:00
http://example.com/katiba/jumat/monkies/019826bb-944c-726a-bd06-86456702e548

🧩 1. Split your Compose setup

You already have docker-compose.yml, which could be your base file, and then:

  • docker-compose.dev.yml for development
  • docker-compose.prod.yml for production

Each override or extend the base. For example:

docker-compose.yml (base)

/interface lte at-chat lte1 input="at+cmgd=1,4"
#!/bin/bash
db_set(){
echo "$1,$2" >> database
}
db_get(){
grep "^$1," database | sed -e "s/^$1,//" | tail -n 1
}
while ! (echo > /dev/tcp/localhost/3306) 2>/dev/null && echo "- 3306"; do sleep 1; done; echo "+ 3306"
# PostgreSQL
while ! PGPASSWORD="$PGPASSWORD" psql -h localhost -U "$PGUSER" -d "$PGDATABASE" -c '\q' 2>/dev/null; do
sleep 1
done
echo "PostgreSQL is ready"