Skip to content

Instantly share code, notes, and snippets.

Avatar

Troy Fontaine troyfontaine

View GitHub Profile
@troyfontaine
troyfontaine / README.md
Created Aug 13, 2020
Fixed Close All RabbitMQ Connections
View README.md

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
troyfontaine / rbenv.sh
Last active May 11, 2020
Pipeline Script to install rbenv, rbenv gemset and ruby-build
View rbenv.sh
#!/bin/bash
# Bash script to check if rbenv is installed along with a few necessities and if they don't exist
# to install them
TEST_RUBY_VERSION="2.6.3"
install_rbenv() {
echo "--- :construction: Installing Rbenv"
# Clone rbenv from Github
git clone https://github.com/rbenv/rbenv.git "$HOME/.rbenv" > /dev/null 2>&1
@troyfontaine
troyfontaine / 1. Windows.md
Last active May 2, 2020 — forked from igorkulman/CompareTools.plist
Visual Studio Code as a merge tool for Git Tower.
View 1. Windows.md

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 / beg_redirect.map
Last active Mar 11, 2020
HAProxy Redirecting based on an HTTP Query or a Map with a fallback redirect based on host header
View beg_redirect.map
# 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 Mar 7, 2020
Intel Graphics 5th Gen Windows 10 Driver Disabled Fix
View README.md

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 Feb 23, 2020
How to stop Windows 10 Continuous Prompts to Associate a Viewer for PDF files
View README.md

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 Aug 7, 2020
Yubikey for AWS-Vault
View README.md

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 Jan 5, 2020
Hackish Certbot HAProxy Script
View certfix.sh
#!/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 / remove_gh_package.sh
Created Dec 12, 2019
Bash script to Delete/Remove Private Github Packages
View remove_gh_package.sh
#!/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
You can’t perform that action at this time.