Skip to content

Instantly share code, notes, and snippets.


Troy Fontaine troyfontaine

View GitHub Profile
troyfontaine /
Last active Feb 27, 2021
Setting up Aliases for Python on Windows PowerShell

Getting Your Python (Development) On!

Python for Windows is really easy to install-but what if you had started in the world of MacOS/*nix OSes and miss that single command to call Python or Pip? What if you don't have access to modify your environment PATH?

Windows PowerShell has a feature called "Profiles" which allows you to configure your PowerShell in a similar fashion as you could with Bash, Zsh, etc.

Pretty cool huh?

Create a Profile

troyfontaine /
Created Aug 13, 2020
Fixed Close All RabbitMQ Connections

Fixed command to close connections to RabbitMQ

rabbitmqctl list_connections pid port state user vhost recv_cnt send_cnt send_pend name| grep -vP 'Listing|pid' | awk '{print "rabbitmqctl close_connection \"" $1 "\" \"manually closing idle connection\"" | "sh" }'
troyfontaine /
Last active May 11, 2020
Pipeline Script to install rbenv, rbenv gemset and ruby-build
# Bash script to check if rbenv is installed along with a few necessities and if they don't exist
# to install them
install_rbenv() {
echo "--- :construction: Installing Rbenv"
# Clone rbenv from Github
git clone "$HOME/.rbenv" > /dev/null 2>&1
troyfontaine / 1.
Last active Jul 9, 2021 — forked from igorkulman/CompareTools.plist
Visual Studio Code as a merge tool for Git Tower.
View 1.

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 /
Last active Nov 19, 2020
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
troyfontaine /
Last active Mar 7, 2020
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 /
Created Feb 23, 2020
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 /
Last active Aug 7, 2020
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 /
Created Jan 5, 2020
Hackish Certbot HAProxy Script
# This is intended to work with
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