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
[program:fs]
environment=DISPLAY=:0
directory=/home/ichux/devcode/passon
numprocs=1
user=ichux
stopwaitsecs=50
command=bash -c "sleep 5 && python3 fullscreen.py"
redirect_stderr=false
[program:myapp]
numprocs=5
numprocs_start=01
command=/usr/bin/python3 ./app_server.py 89%(process_num)02d
process_name=%(program_name)s_%(process_num)02d
priority=999
autostart=true
autorestart=unexpected
startsecs=5
startretries=3
import json
import os
from django.core.wsgi import get_wsgi_application
from webob import Request
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")
application = get_wsgi_application()
@ichux
ichux / mkv_mp3.sh
Created January 9, 2024 12:17
extract mp3 from mkv
ffmpeg -i vokoscreenNG-2024-01-09_12-33-41.mkv -vn -acodec copy fidesic.mp3
@ichux
ichux / portkiller.sh
Last active January 5, 2024 09:35
kill what's running a port
# kill what's running on port 2108
# ubuntu: apt install -y lsof
# alpine: apk add lsof
lsof -i :2108 -sTCP:LISTEN -t | xargs -t kill
# fix issues with " ERROR: Repository not found."
git config --global --unset credential.helper
sudo git config --system --unset credential.helper
eval "$(ssh-agent -s)" && ssh-add ~/.ssh/dellXPS
# location: /home/ichux/.ssh/id_ed25519_sikilabs
ssh-keygen -t ed25519 -C "chukwudi@id_ed25519_slabs.com"
# add to the right place in git
cat /home/ichux/.ssh/id_ed25519_slabs.pub
sudo EDITOR=nano visudo
# ensure you run sudo commands without password
your-user-name-here ALL=(ALL:ALL) NOPASSWD:ALL
# increase sudo timeout to 30 minutes
Defaults:your-user-name-here timestamp_timeout=30
@ichux
ichux / ssh-pi4.txt
Created December 27, 2023 14:26
ssh to pi
1. cd ~/.ssh
2. ssh-keygen -b 4096
3. type pi4
4. cat ~/.ssh/pi4.pub | ssh -o IdentitiesOnly=yes ubuntu@192.168.8.169 \
"mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys && chmod -R go= ~/.ssh && cat >> ~/.ssh/authorized_keys"
5. nano ~/.ssh/config
Host pi4
User ubuntu
@ichux
ichux / cloudflared.sh
Last active December 27, 2023 11:14
cloudflared on Pi4
# PI
wget -O \
cloudflared https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-arm64 && \
sudo mv cloudflared /usr/local/bin && sudo chmod +x /usr/local/bin/cloudflared && cloudflared -v
# Normal PC
wget -O \
cloudflared https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 && \
sudo mv cloudflared /usr/local/bin && sudo chmod +x /usr/local/bin/cloudflared && cloudflared -v
@ichux
ichux / compress.py
Created December 19, 2023 13:58
compress
import hashlib
from base64 import b64encode
with open("./ai.png", "rb") as img:
data = img.read()
print(b64encode(data).decode("utf-8"))
print(hashlib.sha1(data).hexdigest())