Skip to content

Instantly share code, notes, and snippets.

View colinmcintosh's full-sized avatar

Colin McIntosh colinmcintosh

View GitHub Profile
colinmcintosh / smile.bash
Created February 15, 2024 00:06
bash smile prompt
## Prompt
# Colors used for the prompt
# Regular text color
# Bold text color
# Background color
colinmcintosh / ha_issue_67344_workaround.yaml
Created February 28, 2022 02:12
Workaround for Home Assistant Issue #67344
# Two separate automation configs, one for on and one for off.
# Indicator On
alias: Automation - Garage Door Open Indicator On
description: ''
- platform: device
device_id: 860cdcae1ac3a1f0b3d9aa2e4d409eea
domain: cover
entity_id: cover.garage_door
## First Terminal
[cmcintosh@Apogee ~/.../] :) make run
rm -f gnmi-gateway
rm -f cover.out
go build -o gnmi-gateway -ldflags "-X"v0.8.0-8-gcc25dbc-cc25dbc" -X" .
./gnmi-gateway -version
gnmi-gateway version v0.8.0-8-gcc25dbc-cc25dbc (Built 2020-11-22T01:14:39Z)
./gnmi-gateway -EnableGNMIServer -ServerTLSCert=server.crt -ServerTLSKey=server.key -TargetLoaders=json -TargetJSONFile=targets.json
{"level":"info","time":"2020-11-21T17:14:45-08:00","message":"Starting GNMI Gateway."}
{"level":"info","time":"2020-11-21T17:14:45-08:00","message":"Clustering is NOT enabled. No locking or cluster coordination will happen."}
colinmcintosh / ubuntu_nginx_acmesh_cloudflare
Last active March 4, 2024 15:29
Configure Ubuntu 18.04 for NGINX with LetsEncrypt including auto-renewal using and Cloudflare API Tokens
sudo apt update
sudo apt upgrade -y
sudo apt install nginx
sudo mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak
# Create a folder to store your certs
mkdir -p /etc/nginx/ssl
# Edit NGINX config for your site
# If you need a TLS secured NGINX config look at
colinmcintosh / octopi_certbot_haproxy_cloudflare
Created May 10, 2020 02:15
Configure Octopi with HA Proxy for LetsEncrypt including Auto-renewal using Cloudflare DNS
# Pre-reqs
sudo apt update
sudo apt upgrade -y
sudo apt install software-properties-common certbot python-certbot-nginx python-pip
sudo pip install -U pip
sudo pip install setuptools wheel
sudo pip install certbot-dns-cloudflare
# Setup your Cloudflare API credentials
sudo mkdir ~/.secrets
colinmcintosh / yang_type.go
Last active February 14, 2020 06:28
This is an example of how to use to determine the modeled type of an OpenConfig path
// Copyright 2020 Netflix Inc
// Author: Colin McIntosh (
// Copyright 2015 Google Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
colinmcintosh / kenwood_thd72_ax25_ubuntu.bash
Last active April 10, 2021 17:11
Run AX25 on Ubuntu 18.04 via a Kenwood TH-D72 handheld transceiver
sudo apt update
sudo apt install ax25-tools ax25-apps
sudo vim /etc/ax25/axports
# Add the following line (replace MYCALL with your callsign):
# thd72a MYCALL 9600 255 7 TH-D72A (MYCALL)
# Install the latest release of Pat from here: E.g.
sudo dpkg -i pat_0.6.1_linux_amd64.deb
sudo /usr/share/pat/ax25/install-systemd-ax25-unit.bash
colinmcintosh / freenas_jail_certbot_cloudflare
Created April 25, 2019 03:01
Configure a FreeBSD Jail for NGINX with LetsEncrypt including Auto-renewal using Cloudflare DNS
pkg install nginx
pkg update
pkg install vim py27-certbot py27-certbot-dns-cloudflare
mkdir ~/.secrets
vim ~/.secrets/cloudflare.ini
# Cloudflare API credentials used by Certbot
dns_cloudflare_email =
colinmcintosh / ubuntu_nginx_certbot_cloudflare
Last active May 1, 2019 03:48
Configure Ubuntu 18.04 for NGINX with LetsEncrypt including Auto-renewal using Cloudflare DNS
adduser colin
usermod -aG sudo colin
sudo visudo
mkdir /home/colin/.ssh
cp ~/.ssh/authorized_keys /home/colin/.ssh/
chown -R colin:colin /home/colin/.ssh
worker_processes auto;
worker_rlimit_nofile 65535;
events {
multi_accept on;
worker_connections 65535;
http {
charset utf-8;