Skip to content

Instantly share code, notes, and snippets.

View pyropeter's full-sized avatar

PyroPeter pyropeter

View GitHub Profile
@pyropeter
pyropeter / README.md
Created March 1, 2020 09:36
stubby+unbound as local caching DNS resolver with DoT upstream
$ unbound-control-setup
$ systemctl enable stubby unbound
$ systemctl start stubby unbound

Unbound dumps statistics to syslog every six hours:

@pyropeter
pyropeter / wlan-info.py
Created May 13, 2019 12:52
Use wpa_cli to print hostnames of nearby cisco APs
from subprocess import run, CalledProcessError
from time import sleep
CMD = ["wpa_cli"]
def scan_results(_scan=True):
res = []
proc = run(CMD + ["scan_results"],
check=True, capture_output=True)
@pyropeter
pyropeter / todo-template.py
Last active October 13, 2018 14:10
My calendar
#!/usr/bin/python
from datetime import date, timedelta
from locale import setlocale, LC_ALL
setlocale(LC_ALL, '')
start = date.today() - timedelta(7)
d = start
@pyropeter
pyropeter / README
Created October 4, 2018 10:09
CLI YouTube channel viewer
This introduces a CLI command `yt` which calls `youtube-viewer`
to display a YouTube channel. The YouTube channel IDs are stored
in `~/.config/youtube/` in flat plain text files containing just
the ID. The file name is used as the argument to `yt`.
One way to find out the channel IDs is to paste a URL of a
YouTube video into the `youtube-viewer` prompt. It will
then list the channel ID in the videos metadata.
@pyropeter
pyropeter / vimrc
Created April 4, 2018 18:20
vim diff support for jadx jobf files
autocmd BufNewFile,BufRead *.jobf set diffexpr=DiffJobf()
function DiffJobf()
let expr = "s_[Cfmp]o?[0-9]{4}[a-zA-Z0-9]_FNORD_g"
let opt = ""
if &diffopt =~ "icase"
let opt = opt . "-i "
endif
if &diffopt =~ "iwhite"
let opt = opt . "-b "
endif
@pyropeter
pyropeter / README
Created August 28, 2017 07:34
Work around broken suspend-to-ram on Lenovo X230 with coreboot
* Write contents to `/etc/modprobe.d/broken-suspend.conf`.
Lorsque le balai du strobesfdsf touche la piste cuivrée (t1), l'entrée D du FF2 monte â "1".
When the strobesfdsf brush touches the coppered track (t1), the D input of FF2 rises to "1".
RC1 assure un flanc "propre" malgré les rebonds de contact.
RC1 ensures a "clean" edge despite the contact bounce.
Lors du premier flanc de ADC aprés RC1, une impulsion, formée par RC2, provoque un presetfdsfds et le moteur est arrêté. (t2)
At the first edge of ADC after RC1, a pulse, formed by RC2, causes a presetfdsfds and the motor is stopped. (T2)
-----BEGIN DH PARAMETERS-----
MIIBCAKCAQEA//////////+t+FRYortKmq/cViAnPTzx2LnFg84tNpWp4TZBFGQz
+8yTnc4kmz75fS/jY2MMddj2gbICrsRhetPfHtXV/WVhJDP1H18GbtCFY2VVPe0a
87VXE15/V8k1mE8McODmi3fipona8+/och3xWKE2rec1MKzKT0g6eXq8CrGCsyT7
YdEIqUuyyOP7uWrat2DX9GgdT0Kj3jlN9K5W7edjcrsZCwenyO4KbXCeAvzhzffi
7MA0BM0oNC9hkXL+nOmFg/+OTxIy7vKBg8P+OxtMb61zO7X8vC7CIAXFjvGDfRaD
ssbzSibBsu/6iGtCOGEoXJf//////////wIBAg==
-----END DH PARAMETERS-----
@pyropeter
pyropeter / i3-config
Created February 16, 2017 22:26
i3 screen setup stuff
bindsym XF86Display exec --no-startup-id ~/.i3/setup-screens
@pyropeter
pyropeter / dial.sh
Last active August 29, 2015 13:56
Script to dial any number using the AVM FritzBox 7360 "Wählhilfe"
#!/bin/bash
set -e
set -u
hostname="$1"
username="$2"
password="$3"
number="$4"