Skip to content

Instantly share code, notes, and snippets.

@rodja
rodja / chat_app.py
Created May 8, 2023 03:36
Coding a Multi-User Chat App With NiceGUI
from uuid import uuid4
from nicegui import ui
messages = []
@ui.refreshable
def chat_messages(own_id):
for user_id, avatar, text in messages:
ui.chat_message(avatar=avatar, text=text, sent=user_id==own_id)
#!/bin/bash
[[ $EUID -ne 0 ]] && echo "This script must be run as root." && exit 1
wget -P /tmp https://archive.raspberrypi.org/debian/pool/main/o/omxplayer/omxplayer_20190723+gitf543a0d-1+bullseye_armhf.deb
dpkg -i /tmp/omxplayer_20190723+gitf543a0d-1+bullseye_armhf.deb
apt install -y --fix-broken
cd /usr/lib/arm-linux-gnueabihf
ln -s libmmal_core.so.0 libmmal_core.so
@christiansacks
christiansacks / utf82cp437.py
Last active March 25, 2022 01:09 — forked from inky/convert_nfo.py
Convert a file from UTF-8 to CP437.
#!/usr/bin/env python3
import codecs, sys
try:
infile, outfile = sys.argv[1], sys.argv[2]
except IndexError:
sys.stderr.write('usage: %s input_file output_file\n' % sys.argv[0])
sys.exit(1)
nfo = codecs.open(infile, encoding='utf-8').read()
codecs.open(outfile, 'w', encoding='cp437', errors='replace').write(nfo)
@cornfeedhobo
cornfeedhobo / README.md
Last active July 26, 2023 12:15
Framework Laptop Customizations

Framework Laptop Customizations

This documents the changes made while installing OpenSUSE LEAP 15.3 on the Framework Laptop (1st edition).


Guided install

During the guided install, there are some minor changes that will make things smoother later.

@andrewfraley
andrewfraley / pbs_on_rpi.md
Last active April 20, 2024 08:20
Backup a Raspberry Pi to Proxmox Backup Server using the Proxmox Backup Client

Backup a Raspberry Pi to Proxmox Backup Server using the Proxmox Backup Client

This works on a Pi 4, and should work on a Pi 3, but to work on a Pi Zero you would have to figure out how to compile your own client. More info in this thread on the Proxmox forums.

Determine if your Pi is 32bit or 64bit

Run the following command. If you get arm64, it's 64bit, otherwise you'll see armv7l which is 32bit.

uname -m
@alexandergknoll
alexandergknoll / upower
Created November 1, 2021 19:29
upower output for Framework laptop
native-path: BAT1
vendor: NVT
model: Framewo
serial: [REMOVED]
power supply: yes
updated: Mon 01 Nov 2021 03:25:34 PM EDT (23 seconds ago)
has history: yes
has statistics: yes
battery
present: yes
@umbernhard
umbernhard / arch-secure-install.md
Last active February 29, 2024 16:23
Building a Secure Arch Linux Device

Building a Secure Arch Linux Device

Locking down a linux machine is getting easier by the day. Recent advancements in systemd-boot have enabled a host of features to help users ensure that their machines have not been tampered with. This guide provides a walkthrough of how to turn on many of these features during installation, as well as reasoning for why certain features help improve security.

The steps laid out below draw on a wide variety of existing resources, and in places I'll point to them rather than attempt to regurgitate full explanations of the various security components. The most significant one, which I highly encourage everyone to read, is Rod Smith's site about secure boot, which is the most comprehensive and cogent explanation of UEFI, boot managers and boot loaders, and secure boot. Another incredibly useful resources is Safeboot, which encapsulates many of the setup steps below in a Debian application.

@fnky
fnky / ANSI.md
Last active May 20, 2024 20:43
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27

Installing Cool-Retro-Term on Windows10

First of all, this document is just a recompilation of different resources that already existed on the web previously that I personally tested some ones did work and other not. I liked the idea to make a full guide from start to end so all of you could also enjoy playing with cool-retro-term on windows 10. Personally I installed it on a windows 10 pro version. Fingers crossed!

result

@JUNNETWORKS
JUNNETWORKS / libinput-gestures.conf
Created May 5, 2018 21:42
Cinnamon touchpad gestures like windows10 for libinput-gestures
# show all windows in workspace
gesture swipe up 3 xdotool key alt+control+Down
# show Desktop
gesture swipe down 3 xdotool key super+d
# move current workspace for left
gesture swipe left 4 xdotool key alt+control+Right
# move current workspace for right