Skip to content

Instantly share code, notes, and snippets.

@plembo
plembo / addremstatichostmappinger4.md
Last active May 10, 2024 01:23
Adding and removing static host mappings on EdgeRouter

Adding and removing static host mappings on EdgeRouter

Tested on a Ubiquiti EdgeRouter 4 with dnsmasq enabled for DHCP (and DNS) serving.

These operations can also be carried out in the EdgeRouter web gui with the "DNS host names" Wizard (click the "Wizards" tab and then select "DNS host names" to access).

To see all currently statically mapped hosts:

$ cat /etc/hosts
@gasman
gasman / encode.py
Created October 25, 2020 12:23
Encoding a file as a Youtube video - https://www.youtube.com/watch?v=hyqLv2_zBdA
# Encode inputfile.tar.gz as a series of video frames
# Frames are written to frames/frameNNNN.png
from PIL import Image
with open('inputfile.tar.gz', 'rb') as f:
data = f.read()
WIDTH = 120
HEIGHT = 90
CHUNK_SIZE = int((WIDTH * HEIGHT) / 8)
curl https://archive.md/dXdvQ/c58b55674ef876f8b78d02c30a685561b6376981.png --output 01.png && \
curl https://archive.md/dXdvQ/4591a5caa74058c0ae18d71b5cc40ea41a6ea496.png --output 02.png; \
convert -depth 8 01.png rgb:ytdl01.part; \
convert -depth 8 02.png rgb:ytdl02.part; \
cat ytdl01.part ytdl02.part > youtube-dl2020.09.20.tar.gz; \
rm ytdl01.part ytdl02.part; \
clear; \
print 'sha256 checksum: \n'; \
sha256sum youtube-dl2020.09.20.tar.gz
@PieterScheffers
PieterScheffers / transip_stack_clear_trash.sh
Last active August 28, 2020 23:03
TransIP Stack - Clear Trash
#!/bin/sh
STACK_URL=myuser.stackstorage.com
STACK_USER=myuser
STACK_PASSWORD=nooneknowsthis
curl \
--silent \
-X POST \
-H "Content-Type: application/json" \