Skip to content

Instantly share code, notes, and snippets.

@aswild
aswild / dieroll.py
Last active September 26, 2019 15:01
#!/usr/bin/env python3
import argparse
import inspect
from io import StringIO
from itertools import product
import random
import re
import sys
@aswild
aswild / pacman-upgrades-graph.py
Created May 30, 2019 00:51
Script to visualize the most-upgraded packages on a pacman based system
#!/usr/bin/env python3
"""
pacman-upgrades-graph.py: a script to visualize the most-upgraded packages on an pacman-based system.
"""
import argparse, os, re, shutil, subprocess, sys
parser = argparse.ArgumentParser()
parser.add_argument('-w', '--width', type=int, default=-1,
help='Max total width of graph. Defaults to terminal size, ' +
@aswild
aswild / vyatta_wireguard_build.sh
Last active February 14, 2020 23:06
Download and build the wireguard kernel module and tools for EdgeOS. see https://github.com/Lochnair/vyatta-wireguard
#!/bin/sh
cat <<_EOF
This script has moved!
Check out https://github.com/aswild/vyatta-wireguard-build
_EOF
@aswild
aswild / 0001-sipmsg-insert-line-breaks-between-paragraphs.patch
Created October 25, 2018 23:21
pidgin-sipe hack to fix pasted line breaks in received messages from Lync
From 087937f81634bd315444c38b7e0906280e8d2895 Mon Sep 17 00:00:00 2001
From: Allen Wild <allenwild93@gmail.com>
Date: Tue, 23 Oct 2018 17:01:57 -0400
Subject: [PATCH] sipmsg: insert line breaks between paragraphs
Pasting text into Lync causes the lines to be split with <p></p> tags,
but pidgin doesn't display this and puts everything on one ugly line.
This is really a pidgin bug but I can hack around it in sipe by sneaking
in <br/> after every </p> we see (unless it's at the end of the message
@aswild
aswild / unifi-cert-update.sh
Last active September 27, 2021 05:52
Add an existing Letsencrypt cert to a UniFi controller (no certbot dependency or auto update) https://github.com/aswild/meta-wild-common/blob/master/recipes-ubnt/unifi/unifi-cert-update/unifi-cert-update.sh
#!/bin/bash
# Copyright (c) 2018 Allen Wild
# SPDX-License-Identifier: MIT
#
# based on https://github.com/stevejenkins/unifi-linux-utils/blob/master/unifi_ssl_import.sh
# and https://source.sosdg.org/brielle/lets-encrypt-scripts
set -e
UNIFI_DIR=/usr/lib/unifi
@aswild
aswild / buildme-ncurss6.sh
Last active June 13, 2018 13:46
ncurses 6.1 local install script
#!/bin/bash -e
: ${PREFIX:=/usr/local/ncurses6}
default_configopts=(
--prefix=${PREFIX}
--with-abi-version=6
--enable-widec
--disable-shared
--enable-pc-files