Skip to content

Instantly share code, notes, and snippets.

View troyfontaine's full-sized avatar

Troy Fontaine troyfontaine

View GitHub Profile
@troyfontaine
troyfontaine / 1. Windows.md
Last active November 24, 2023 13:19 — forked from igorkulman/CompareTools.plist
Visual Studio Code as a merge tool for Git Tower.

Enable Visual Studio Code for Merge/Diff on Windows

From PowerShell or CMD:

cd C:\Program Files (x86)\fournova\Tower\CompareTools
code .

Edit VisualStudioCode.json and replace line 10 which is:

@troyfontaine
troyfontaine / README.md
Last active November 6, 2023 14:42
Unifi Controller v5 Hot Spot Portal Customization

Customizing the Unifi Controller v5.6+ Hot Spot Portal

Overview

This document provides some basic guidance on how to customize the Unifi Controller v5.6+ Hot Spot Portal feature. Existing documentation seems to be scarce in this technician's opinion.

This readme is the culmination of some exploration in customizing the portal for business use. Please note, all examples use the installed location of the Unifi v5 Controller software on the Unifi CloudKey.

Unifi Controller v5.10+

Some issues have been encountered after upgrading the Unifi Controller to newer releases specifically with the Hot Spot Portal customizations on Unifi Controller versions greater than 5.10 relating to the use of these instructions. You may not have a choice but to upgrade your included default template to the latest version and re-modify your portal files.

@troyfontaine
troyfontaine / README.md
Last active October 15, 2023 09:58
Ubiquiti USG config.gateway.json Syntax

Ubiquiti USG Advanced Configuration

Overview

Integrated DNS Overview

When using a USG with Ubiquiti's Unifi Controller software (version 5.6 and earlier), the functionality of integrating the hostnames of clients (when they request a DHCP lease) into local DNS does not appear to work as you would find with Consumer grade routers. To work around this limitation, we can add static host mappings to a configuration file that will be provisioned to the USG when either a configuration change is made or we force provisioning to the USG itself.

Non-GUI Supported Dynamic DNS Providers

I've added in the necessary syntax for adding Cloudflare DDNS to the USG for VPN/Services setup courtesy of this post by britannic on the Ubiquiti Forums.

Configuration File

@troyfontaine
troyfontaine / asus-falchion-nx-key-combinations.md
Last active September 4, 2023 18:22
ASUS Falchion NX Key Combinations

ASUS Falchion NX Key Combinations

Function Keys

Hot Key Function
FN + DEL Scroll Lock
FN + CTRL Menu
FN + P Print screen
FN + PgDn End
@troyfontaine
troyfontaine / serverspec_rspec_cheatsheet.md
Last active September 3, 2023 15:42 — forked from mearns/serverspec_rspec_cheatsheet.html
A cheat sheet for server spec and rspec

Serverspec and RSpec Cheat Sheet

Setup

Initialize a serverspec directory with boilerplate

serverspec-init
@troyfontaine
troyfontaine / 1-raspberry_pi_with_led_powerbutton_and_rtc.md
Last active July 17, 2023 21:59
Raspberry Pi with LED Power Button and RTC

How to Set up a Raspberry Pi with LED Power Button and RTC

After a lot of trial and error, I've figured out how to set up a Raspberry Pi (in my case, I tested with a 2B and 3B+, this may not work on a Pi 4B). This involves using the i2c0 bus (which normally isn't recommended), but this is what I was able to get working as re-mapping would communicate with the RTC via i2c, but the overlay for the RTC wouldn't adjust its configuration when told to use i2c3 or higher.

Required hardware

  1. Power button (this should be a momentary switch type)
  2. Power LED (for me, this was actually built into the power button)
  3. 330K Ohm resistor (this is connected between the LED and the 3.3v header
  4. A Real Time Clock (RTC) Module (preferably, one with built-in pull up resistors)
  5. Jumper wires
@troyfontaine
troyfontaine / beg_redirect.map
Last active March 23, 2023 10:19
HAProxy Redirecting based on an HTTP Query or a Map with a fallback redirect based on host header
# This file contains only partial paths to match on
# This file should reside in the same directory as the haproxy.cfg simply due to the way it is configured in the sample snippet-but they can go anywhere in the /etc/haproxy directory
/my-partial- https://subdomain3.mydomain.com/my-new-full-path
@troyfontaine
troyfontaine / README.md
Last active December 22, 2022 16:04
USG ddclient Upgrade Script

How to use this script?

Why, that's simple! Copy this script to your USG, run chmod +x on it and then, as a user with sudo permission, execute it.

Shamelessly borrowed from Brittanic on the Ubiquiti Unifi forums

How to use it?

Simply run the following command (note, if you are at all security concious-don't run it and instead review the script, then copy it to your USG to execute).

curl https://gist.githubusercontent.com/troyfontaine/7e6f93e32621177fc9a94e823adc52b5/raw/fix_ddns.sh | sudo bash
@troyfontaine
troyfontaine / howtosurvive.md
Last active December 14, 2022 22:43
PFSense Router with VLANs and TFTP Server

Ephemeral Ports are your bane

TFTP is said to "only use UDP 69" but this is completely and totally inaccurate.

TFTP starts communications on UDP 69, then moves the conversation to ephemeral ports between the two systems-and depending on the systems involved, they can change during the boot process.

Note, this doesn't seem to work across VLANs....

So, where do you start?

Step 1) You need UDP 67, 69, 4011, 1024:5000 from your PXE booting machine to the PXE Server. This is because the PXE bootloader appears to use that range specifically.

@troyfontaine
troyfontaine / realmd_ubuntu1404.md
Last active October 17, 2022 00:05
Steps to join an Ubuntu 14.04 Server to Active Directory using realmd

Steps to join an Ubuntu 14.04 Server to Active Directory using realmd

Step 1: Perform updates

apt-get update

Step 2: Install realmd

apt-get install -y realmd