Skip to content

Instantly share code, notes, and snippets.

View pamolloy's full-sized avatar
🦺

Philip Molloy pamolloy

🦺
View GitHub Profile
@pamolloy
pamolloy / 0001-env-Exit-tools-when-invalid-CRC-found.patch
Last active August 27, 2019 22:12
U-Boot patch to exit userspace tools when an invalid CRC is found
From 6482180e602c4853e43d5c5a40b3349b63aba276 Mon Sep 17 00:00:00 2001
From: Philip Molloy <philip-molloy@idexx.com>
Date: Tue, 2 Apr 2019 17:02:48 -0400
Subject: [PATCH 1/1] env: Exit tools when invalid CRC found
fw_setenv and fw_printenv currently print a warning and use a default
environment compiled into the binary when an invalid CRC is found. This
modifies the default behavior to print an error and exit. This is
especially important when calling the tools from a script since the
script depends on the exit code of the tool to know something went
@pamolloy
pamolloy / install-aerc.bash
Last active June 22, 2024 04:19
Install the aerc e-mail client on Fedora and connect to ProtonMail
#!/usr/bin/env bash
sudo dnf install -y glibc-static
git clone https://git.sr.ht/~sircmpwn/scdoc
cd scdoc
make PREFIX=~/.local/ install
cd ..
sudo dnf install -y golang notmuch-devel
go get golang.org/dl/go1.12.8
@pamolloy
pamolloy / README.md
Last active February 26, 2019 15:28
Enabling EEPROM support in U-Boot

Selecting CONFIG_SYS_I2C_ZYNQ and CONFIG_ZYNQ_I2C0 builds successfully (see Xilinx documentation). But those are old config options and should be replaced with CONFIG_I2C_CADENCE.

Selecting CONFIG_ENV_IS_IN_EEPROM causes the following assertion to fail:

cmd/eeprom.c:58:2: error: #error CONFIG_SYS_I2C_EEPROM_ADDR_LEN must be 1 or 2
 #error CONFIG_SYS_I2C_EEPROM_ADDR_LEN must be 1 or 2
  ^~~~~

...
@pamolloy
pamolloy / README.md
Last active June 8, 2025 19:57
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 October 16, 2024 20:40
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