Skip to content

Instantly share code, notes, and snippets.

@a-a
a-a / token.py
Created May 12, 2024 14:20
freeotp+ freeotp plus json token reader with QR output
#! /usr/bin/env python3
# usage: ensure freeotp-backup.json exists in working dir, run this
# if all goes well, it will spit out qr codes. you can enrol these to another authentictor app.
# good luck and try not to break your phone again ;)
#
# known limitations: HOTP is UNTESTED. the counter handling might be wrong. i didn't have any working HOTP to test against
import sys, json, qrcode, base64, platform
def qr_term_str(str):
@a-a
a-a / alpine-incus.md
Last active February 6, 2024 22:06 — forked from seia-soto/howto.md
How to compile lxc/incus on AlpineLinux

How to build lxc/incus on AlpineLinux (musl)

The document was written to build Incus v0.5.1. You may need a different how-to if you want to build higher versions of Incus.

  • Incus v0.5.1 (via Git)
  • AlpineLinux 3.18 x86_64
  • Canonical LXD-UI (Via Git)

This how-to document will help you to build Incus for AlpineLinux. Original references are:

@a-a
a-a / 10-wayland.conf
Last active November 29, 2023 16:56
pure wayland sddm on debian bookworm (raspberry pi 5, but probably similar for x86 and friends)
[General]
DisplayServer=wayland
[Wayland]
# Path of the directory containing session files
SessionDir=/usr/share/wayland-sessions
# Path of script to execute when starting the desktop session
SessionCommand=/usr/share/sddm/scripts/wayland-session
@a-a
a-a / lib_systemd_system_pocsag-udp-relay.service
Created July 25, 2023 21:14
rpitx pocsag - simple and dirty udp forwarder
[Unit]
Description=POCSAG UDP Relay
After=network-online.target
Wants=network-online.target systemd-networkd-wait-online.service
[Service]
Type=simple
ExecStart=/usr/bin/python3 /usr/local/bin/pocsag-udp-relay.py
StandardInput=tty-force
Restart=on-failure
@a-a
a-a / fuckedifimraisingajtaccaseforthis.txt
Last active November 2, 2021 11:36
Force Juniper SRX110 to accept VDSL PIC firmware from later (published) jfirmware releases
# Force Juniper SRX110H2 to accept VDSL PIC firmware from Juniper jfirmware 17 release (For SRX300 series?)
# it might work, it might not. do this at your own risk etc. i think it rolls back. haven't tried lol.
# Testing using latest 17.4 release specifically from https://support.juniper.net/support/downloads/?p=junos-srx#sw.
# At time of writing, "latest" was jfirmware-srxsme-17.4R3.16-signed.tgz - copy your shit to a fat32 usb
# Make usb mountpoint (if you haven't already)
root@% mkdir /var/tmp/usb
# Mount the USB
root@% mount_msdosfs /dev/da0s1 /var/tmp/usb
@a-a
a-a / lilygo-t5-weather.ino
Created November 21, 2020 00:21
lilygo-t5-weather.ino
#include <gfxfont.h>
#include <Adafruit_SPITFT_Macros.h>
#include <Adafruit_SPITFT.h>
#include <Adafruit_GFX.h>
#include <Adafruit_GrayOLED.h>
/* ESP Weather Display using an EPD 2.7" Display, obtains data from Open Weather Map, decodes it and then displays it.
####################################################################################################################################
@a-a
a-a / tryfreq.sh
Created May 17, 2020 15:14
Script to send POCSAG messages on multiple known frequencies to known RIC where transmission paramaters are unknown.
#! /bin/bash
#
# Script to send POCSAG messages on multiple known frequencies to specified RIC
# This could be useful where the RIC is known, the frequency is unknown but
# suspected to be a former UK commercial paging network, but all other
# paramaters such as baud raud or inversion are unknown.
#
# You should be using this in an RF test chamber to avoid voilating the law.
# But if you're playing with pagers, you presumably already known this :)
@a-a
a-a / dhcp-leases-to-dns.rsc
Last active August 31, 2020 13:23 — forked from SmartFinn/dhcp-leases-to-dns.rsc
MikroTik (RouterOS) script for automatically setting DNS records for clients when they obtain a DHCP lease
# MikroTik (RouterOS) script for automatically setting DNS records
# for clients when they obtain a DHCP lease.
#
# author SmartFinn <https://gist.github.com/SmartFinn>
# based on https://github.com/karrots/ROS-DDNS
# modified 20200412 a-a to allow multiple IPs per host
# modified 20200417 a-a, add functionality to strip anything after hostname, add variables to control optional features.
# Set to "true" if adding multiple IP addresses to the same hostname is acceptable, ie for clients with wireless and a wire.
:local allowRoundRobin "true";
@a-a
a-a / geniadconfig.sh
Last active August 31, 2018 16:49
Script to configure Cisco IAD2432-24FXS to switch 24 telephone ports locally.
#! /bin/bash
# Script to generate skeleton config for Cisco IAD2432-24FXS allowing it to switch 24 telephone ports locally. Extensions numbered 201-224. Apply this on top of a base (fresh from reset state) config to get phones to talk to each other.
for i in `seq 1 24`;
do
echo "voice-port 2/$(echo $(($i-1)))" #port 2/0
echo "ren 3"
echo "cptone gb"
echo "station-id number $(echo $(($i+200)))" #station-id 201
@a-a
a-a / sad2.c
Created August 1, 2018 10:24
:(
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <time.h>
#include <stdlib.h>
#include <windows.h>
#define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
const char* RESET = "\x1B[0m";