Skip to content

Instantly share code, notes, and snippets.

View pyropeter's full-sized avatar

PyroPeter pyropeter

View GitHub Profile
@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`.
@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 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 / 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 / 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 / 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: