Skip to content

Instantly share code, notes, and snippets.

View patrakov's full-sized avatar

Alexander Patrakov patrakov

View GitHub Profile
@patrakov
patrakov / README
Last active October 22, 2023 12:33
Automatically reinstall OpenWRT packages after firmware upgrades
The script helps you restore all installed OpenWRT packages after upgrading the main firmware image via sysupgrade. It works
ONLY if the default firmware image provided by the OpenWRT project is sufficient to get connected to the Internet, but you
want some extra packages for additional functionality. In other words, it WILL NOT WORK if connecting to the Internet
requires installing extra packages (e.g., a kernel module for your LTE modem).
The script has been tested for upgrading from OpenWRT 18.06.1 to 18.06.2 and to a development snapshot, as well as between
development snapshots. On LEDE 17.01.x, "flock" is not a part of the default image, so has to be installed manually.
Initial setup:
@patrakov
patrakov / route53.py
Last active June 16, 2022 04:56 — forked from nh2/route53.py
route53 hook for dehydrated - python2 / python3 + boto2 version. Tested on Ubuntu 16.04
#!/usr/bin/env python
# How to use:
#
# Ubuntu 16.04: apt install -y python-boto OR apt install -y python3-boto
#
# Specify the default profile on aws/boto profile files or use the optional AWS_PROFILE env var:
# AWS_PROFILE=example ./dehydrated -c -d example.com -t dns-01 -k /etc/dehydrated/hooks/route53.py
#
# Manually specify hosted zone:
@patrakov
patrakov / wavgrep.py
Created March 12, 2015 20:13
Find the piece most similar to one wav file (needle) in another (haystack)
#!/usr/bin/python2
import sys
import numpy
from scipy.io import wavfile
from scipy.signal import fftconvolve
def usage():
print >> sys.stderr, "Usage: wavgrep.py --like|--similar|--this needle.wav haystack.wav"