Skip to content

Instantly share code, notes, and snippets.

View troyfontaine's full-sized avatar

Troy Fontaine troyfontaine

View GitHub Profile
@troyfontaine
troyfontaine / install.sh
Created February 10, 2022 03:59
Install Docker Compose V2 on 64-bit Raspberry Pi OS
#!/usr/bin/env bash
# Download the binary
sudo curl -SL https://github.com/docker/compose/releases/download/v2.2.3/docker-compose-linux-aarch64 \
-o /usr/local/lib/docker/cli-plugins/
# Set the binary to be executable
chmod +x /usr/local/lib/docker/cli-plugins/docker-compose
@troyfontaine
troyfontaine / install.sh
Last active February 8, 2022 18:20
Install Hashicorp Vault on Raspberry Pi 4 with 64-bit Raspberry Pi OS
#!/usr/bin/env bash
# Install Dependencies
sudo apt-get update && sudo apt-get install software-properties-common wget -y
# Add the gpg key
wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg
# Add the repository and set where the key is to validate the packages
echo 'deb [arch=arm64 signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main' | sudo tee /etc/apt/sources.list.d/hashicorp.list
@troyfontaine
troyfontaine / PythonAndPowerShell.md
Last active March 4, 2024 14:20
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
troyfontaine / README.md
Created August 13, 2020 12:50
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
troyfontaine / rbenv.sh
Last active May 11, 2020 17:22
Pipeline Script to install rbenv, rbenv gemset and ruby-build
#!/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 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 / 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