Skip to content

Instantly share code, notes, and snippets.

View pamolloy's full-sized avatar

Philip Molloy pamolloy

View GitHub Profile
@pamolloy
pamolloy / README.md
Last active April 6, 2024 05:49
Mesh network using VXLAN over Wireguard
@pamolloy
pamolloy / README.md
Last active January 23, 2019 20:55
Irssi notifications

I keep running into the following issue:

Jan 23 15:48:52 localhost irssi-notify.bash[23391]: ssh_askpass: exec(/usr/libexec/openssh/ssh-askpass): No such file or directory
Jan 23 15:48:52 localhost irssi-notify.bash[23391]: user@host: Permission denied (publickey).

After I installed openssh-askpass I get prompted for the password for my key every time ssh is called in the script.

@pamolloy
pamolloy / README.md
Last active January 23, 2024 07:28
Ubiquiti USG configuration for Wireguard

Download the latest ugw3 package from https://github.com/Lochnair/vyatta-wireguard/releases and install it on your USG using dpkg -i wireguard-ugw3-<version>.deb.

cd /config/auth
umask 077
mkdir wireguard
cd wireguard
wg genkey > wg_private.key
wg pubkey < wg_private.key > wg_public.key
@pamolloy
pamolloy / driver.c
Last active October 17, 2018 15:26
Disabling runtime power management does not disable autosuspend
#include <linux/module.h>
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/of_gpio.h>
#include <linux/pm_runtime.h>
#define MODULE_NAME "device"
#! /bin/sh
NAME=foo
DAEMON=/root/$NAME
case "$1" in
start)
printf "Starting $NAME: "
start-stop-daemon -S -q -b -x $DAEMON
[ $? = 0 ] && echo "OK" || echo "FAIL"
@pamolloy
pamolloy / remote-load-rrd-dump.xml
Last active November 14, 2016 15:14
Remote load RRD dump
This file has been truncated, but you can view the full file.
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rrd SYSTEM "http://oss.oetiker.ch/rrdtool/rrdtool.dtd">
<!-- Round Robin Database Dump -->
<rrd>
<version>0003</version>
<step>10</step> <!-- Seconds -->
<lastupdate>1469481585</lastupdate> <!-- 2016-07-25 17:19:45 EDT -->
<ds>
<name> shortterm </name>
@pamolloy
pamolloy / sts.bash
Created November 23, 2014 17:13
Bash commands executed by STS on my desktop while studying at GWU
boot
pwd
apt-get
apt
ifconfig
cd /proc
cd acpi
cd asus
cd embedded_controller/
cd scsi
, Option "V" ["variable"]
(ReqArg
(\arg opt -> do
let (key,val) = case break (`elem` ":=") arg of
(k,_:v) -> (k,v)
(k,_) -> (k,"true")
return opt{ optVariables = (key,val) : optVariables opt })
"KEY[:VALUE]")
""
@pamolloy
pamolloy / network
Created July 27, 2014 19:59
Router #1
config 'switch' 'eth0'
option 'enable' '1'
config 'switch_vlan' 'eth0_0'
option 'device' 'eth0'
option 'vlan' '0'
option 'ports' '1 2 3 5'
config 'switch_vlan' 'eth0_1'
option 'device' 'eth0'
@pamolloy
pamolloy / dhcp
Last active August 29, 2015 14:04
Router #2
config 'dnsmasq'
option 'domainneeded' '1'
option 'boguspriv' '1'
option 'filterwin2k' '0'
option 'localise_queries' '1'
option 'rebind_protection' '1'
option 'rebind_localhost' '1'
option 'local' '/lan/'
option 'domain' 'lan'
option 'expandhosts' '1'