Skip to content

Instantly share code, notes, and snippets.

View troyfontaine's full-sized avatar

Troy Fontaine troyfontaine

View GitHub Profile
@troyfontaine
troyfontaine / README.md
Created February 6, 2018 06:39
High Sierra SSH Issue with Cisco iOS (ssh_dispatch_run_fatal Invalid key length)

Overview

You must connect to your Cisco device from another machine using an earlier version of OpenSSH as the reason for this error is:

  1. The new version of OpenSSH does not support RSA Host Keys less than 1024 bits in length
  2. The switch by default has an RSA Host Key of less than 1024 bits

The solution is as follows:

Step 1. Connect from another device

You can actually get away with (for now) using Bitvise SSH on Windows and enabling the disabled Algorithms, etc. to allow you to connect to the Cisco device.

@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 / 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 / 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 / myserver.xml
Created January 25, 2016 02:23
KVM Virtual Machine Template XML
<domain type='kvm'>
<name>MyServer</name>
<memory unit='KiB'>4194304</memory>
<currentMemory unit='KiB'>4194304</currentMemory>
<vcpu placement='static'>4</vcpu>
<os>
<type arch='x86_64' machine='pc-i440fx-wily'>hvm</type>
<boot dev='hd'/>
</os>
<features>
@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 / 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 / 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