Skip to content

Instantly share code, notes, and snippets.

View troyfontaine's full-sized avatar

Troy Fontaine troyfontaine

View GitHub Profile
@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 March 7, 2020 18:32
Intel Graphics 5th Gen Windows 10 Driver Disabled Fix

Intel Graphics 5th Gen Windows 10 Driver Disabled Fix

Windows 10 will disable the Intel(R) HD Graphics 5500 or similar GPU drivers if Hypervisor Code Integrity (HVCI) is enabled. HVCI appears to be enabled as part of Hyper-V. This affects laptops from all vendors as far as I can tell.

To disable HVCI,the registry entries outlined by Microsoft do not appear to work.

Microsoft does however provide a PowerShell script which does work.

  1. Download the script from the link above
  2. Extract the script
@troyfontaine
troyfontaine / README.md
Created February 23, 2020 23:44
How to stop Windows 10 Continuous Prompts to Associate a Viewer for PDF files

How to stop Windows 10 Continuous Prompts to associate a Viewer for PDF Files

If Windows 10 keeps prompting you to associate an application to view PDF files when you double click to open them, try deleting the following registry keys and rebooting. This worked for me.

  1. Open regedit as an administrator
  2. Navigate to Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf and delete the .pdf key
  3. Navigate to Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\FileAssociations\ProgIds and delete the REG_DWORD called _.pdf
  4. Reboot

This reset the default to Microsoft Edge and then allowed me to change the default to Adobe Reader.

@troyfontaine
troyfontaine / README.md
Last active August 7, 2020 12:56
Yubikey for AWS-Vault

How to Set up Yubikey for AWS-Vault

Tired of using a password for aws-vault? Want to use that lovely touch pad on your Yubikey? Here is how! (Shamelessly borrowed from this comment by Frederico Araujo). Note, this is not the same as configuring your terminal to use a Yubikey setup to be used as TOTP for AWS-instead of an app!

NOTE: These steps are for use on macOS and should be similar for Linux

  1. Remove existing credential from AWS Vault Run only if you already have it setup before:

aws-vault remove myprofile

@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