Skip to content

Instantly share code, notes, and snippets.

View troyfontaine's full-sized avatar

Troy Fontaine troyfontaine

View GitHub Profile
@troyfontaine
troyfontaine / certfix.sh
Created January 5, 2020 06:14
Hackish Certbot HAProxy Script
#!/bin/bash
# This is intended to work with https://github.com/greenhost/certbot-haproxy
DOMAIN="my.supercool.domain" # Replace this with your actual domain that certbot will be using
# Force renewal of certificate
certbot renew --force-renewal
# Sleep for authorization to complete
@troyfontaine
troyfontaine / README.md
Last active December 31, 2019 17:24
CFSSL Links to hang onto
@troyfontaine
troyfontaine / remove_gh_package.sh
Created December 12, 2019 04:29
Bash script to Delete/Remove Private Github Packages
#!/bin/bash
# Really crappy script that works to delete private packages stored on Github Packages
# Intended to simplify deleting packages that are counting against your limit
# By Troy Fontaine (github.com/troyfontaine)
# First displays the private packages name then the version finally the ID needed to delete it
# Then prompts you if you want to delete the packages based on the ID
GITHUB_TOKEN=$SUPERSECRETTOKEN
REPO_OWNER=$YOURGITHUBUSERNAME
@troyfontaine
troyfontaine / Docker-Compose.yml
Created November 29, 2019 05:58
Pihole Docker Container with IPv6 Support
version: "3"
# More info at https://github.com/pi-hole/docker-pi-hole/ and https://docs.pi-hole.net/
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
ports:
- "53:53/tcp"
- "53:53/udp"
@troyfontaine
troyfontaine / macos_to_windows10_oss_developer.md
Last active April 8, 2022 03:40
Windows 10-based Linux Developer Setup (Coming from macOS)

How to Install OpenSSH on Windows 10 (any version) with Publickey Authentication working

This brief tutorial assumes you already have an SSH public key you want to use

  1. Install chocolatey via Powershell

    Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
    
  2. Close Powershell

  3. Open a new Powershell session

@troyfontaine
troyfontaine / README.md
Last active March 24, 2019 19:43
Ubuntu 18.04 Raspberry Pi Cloud Init Notes

Location of cloud-config

/Volumes/cloudimg-rootfs/var/lib/cloud/seed/nocloud-net/user-data

Networking Issues

Netplan seems to not play nicely with VLANs (or so it would appear), further testing required

Port in use issues if using WireGuard on UDP 53

systemd-resolve issues, solution

@troyfontaine
troyfontaine / README.md
Created December 12, 2018 06:31
Dell PowerConnect 3500 Series Tips

How To

Commands

Firmware Updating while Stacked

Copy from a tftp to a stack master

copy tftp://192.168.0.8/powerconnect_35xx-20066.ros image
@troyfontaine
troyfontaine / README.md
Created September 10, 2018 05:52
Raspbian Stretch VIM Fix

Fix for blasted visual editor mode

Create the following file: /etc/vim/vimrc.local

" This file loads the default vim options at the beginning and prevents
" that they are being loaded again later. All other options that will be set,
" are added, or overwrite the default settings. Add as many options as you
" whish at the end of this file.

" Load the defaults
@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 / create.sh
Last active April 8, 2022 03:25
Cloudkey SSL Cert with Third-party cert
#!/bin/bash
# Create fullchain
cat ~/cert/*.ca-bundle ~/cert/*.crt >> fullchain.cer
# Generate pkcs12 cert from acme output
openssl pkcs12 -export -in ~/cert/fullchain.cer -inkey \
~/cert/mydomain.key \
-out ~/cert/unifi.p12 -name unifi -password pass:aircontrolenterprise