This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i vokoscreenNG-2024-01-09_12-33-41.mkv -vn -acodec copy fidesic.mp3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) |