Skip to content

Instantly share code, notes, and snippets.

View jmbwell's full-sized avatar

John Burwell jmbwell

  • Houston, Texas
View GitHub Profile
@jmbwell
jmbwell / Notes.md
Created November 3, 2022 17:11
VyOS: fix "No connection to RPKI cache server"

In VyOS, FRR doesn't seem to want to connect to an RPKI cache server after booting. To restore the connection:

  1. Connect to the vyos firewall
  2. Run vtysh
  3. At the vtysh prompt:
  • rpki stop
  • rpki start
  • clear bgp
  • exit
@jmbwell
jmbwell / dreamhost_dns.py
Last active June 14, 2023 07:36
A quick Ansible module for updating DreamHost DNS records.
#!/usr/bin/python
# Copyright: (c) 2022, John Burwell <jmbwell@atatdotdot.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = r'''
---
# Monit on pfSense 2.5 x64
# Install the package from the FreeBSD repository
pkg add http://pkg.freebsd.org/FreeBSD:12:amd64/latest/All/monit-5.29.0_1.txz
# Rename the rc.d script to .sh and fix permissions so pfSense will start it automatically
mv /usr/local/etc/rc.d/monit /usr/local/etc/rc.d/monit.sh
chmod 0755 /usr/local/etc/rc.d/monit.sh
# Add monit_enable=YES to a local rc.conf
@jmbwell
jmbwell / .zshrc
Created December 2, 2021 20:24
zsh autocompletion for activating python virtualenvs
# zsh example for python virtualenv activation shortcuts with autocomplete
#
# - Assumes your virtualenvs are stored in the directory ~/virtualenvs
#
# To use, type activate, then press tab to get a list of available virtualenvs
# Example: act<tab> ans<tab> to do "activate ~/virtualenvs/ansible"
# 1. Activate enhanced completion in zsh
autoload -Uz compinit && compinit
@jmbwell
jmbwell / LinkImmutableID.ps1
Created September 15, 2021 16:08
Script to link local AD users to Azure AD users if they were not matched correctly by Azure Connect
<#
Description
-----------
This script can help you merge duplicate Azure AD users or match a local
AD user to an Azure AD user by copying the Azure AD Immutable ID to the
local user record.
This can be useful if Azure AD Connect has not correctly matched a local
user with an existing cloud user, leaving you with duplicate users.
@jmbwell
jmbwell / crashplan-date-last-backup.sh
Created June 17, 2020 14:16
Scrape the date and time of the last "Completed" backup from CrashPlan's history log, for use as a Jamf extension attribute. Works on a local system, no need to query the server's API.
#/bin/sh
# Grep the CrashPlan history.log.0 file for "Completed" and get the date and time
# Note: check the path of the log file for your environment
result=$(grep Completed /Library/Logs/CrashPlan/history.log.0 | tail -1 | awk '{ print $2 " " $3 }')
# Reformat CrashPlan's ad-hoc date format into a standard format
reformatted=$(date -j -f "%m/%d/%y %H:%M%p" "${result}" "+%Y-%m-%d %H:%M:%S")
# Output the result for Jamf
@jmbwell
jmbwell / infinitive.service
Created January 11, 2019 03:34
systemd unit for starting infinitive on raspberry pi
[Unit]
Description=Infinitive
After=multi-user.target
[Service]
Type=Idle
ExecStart=/home/pi/go/src/github.com/jmbwell/infinitive/infinitive -httpport=8080 -serial=/dev/ttyUSB0
StandardOutput=null
Restart=always
RestartSec=10
@jmbwell
jmbwell / homebridge.service
Last active January 11, 2019 03:34
systemd unit for starting homebridge on raspberry pi
[Unit]
Description=Homebridge
After=multi-user.target
[Service]
Type=Idle
ExecStart=/usr/bin/homebridge -U /root/.homebridge -D
Restart=always
RestartSec=10