Skip to content

Instantly share code, notes, and snippets.

@iamkominn
iamkominn / adhoc-web-servers.md
Last active November 24, 2025 23:48
Quick and lightweight ways to run an ad-hoc web server directly from the Linux command line to serve static files or directories

1. Python’s Built-in HTTP Server

Python 3:

# Serve current directory on port 8000
python3 -m http.server 8000

# Bind to a specific interface (e.g., localhost only)
python3 -m http.server 8000 --bind 127.0.0.1

# Serve a specific directory
@trevor403
trevor403 / webcam.sh
Created July 29, 2020 16:25
Virtual webcam for wayland screensharing
sudo modprobe v4l2loopback video_nr=4 card_label="virtual webcam" exclusive_caps=1
sudo ffmpeg -use_wallclock_as_timestamps 1 -fflags nobuffer -framerate 60 -device /dev/dri/card0 -f kmsgrab -format bgr0 -i - -vsync drop -init_hw_device vaapi=v:/dev/dri/renderD128 -filter_hw_device v -vf 'hwmap,hwdownload,format=yuv420p' -c:v rawvideo -f v4l2 /dev/video4
@c4mx
c4mx / wpa2_psk_auth.py
Last active October 30, 2025 01:33
Calculate PMK, PTK, MIC and MIC verification in WPA2-PSK authentication
#!/usr/bin/env python
# __author__ = 'c4mx'
from pbkdf2 import PBKDF2
from binascii import a2b_hex
import hmac, hashlib, binascii
# passphrase: WPA wifi password
def calc_pmk(passphrase, ssid):
return PBKDF2(passphrase, ssid, 4096).read(32)
@zopieux
zopieux / README.md
Last active February 25, 2026 22:01
QNAP TS-453 Pro: LCD, LEDs, fan & buttons

QNAP TS-453 Pro: LCD, LEDs, fan & buttons

QNAP NAS model TS-453 Pro has limited documentation on how to control its various peripherals, namely:

  • the front LCD display, a 2 row, 16 column blue & white LCD display, and its two menu buttons ("ENTER", "SELECT")
  • the front LEDs "STATUS" (red & green) & "USB" (blue)
  • the 4 "disk error" LEDs (red)
  • the front "USB COPY" button
  • the main rear fan
@apearson
apearson / node-red
Last active February 28, 2024 09:50
Node-RED FreeBSD RC Script
#!/bin/sh
#
# PROVIDE: nodered
# REQUIRE: LOGIN
# KEYWORD: shutdown
# Author: Andrew Pearson (apearson.io)
# Version: 1.0.2
# Description: