Skip to content

Instantly share code, notes, and snippets.

View troyfontaine's full-sized avatar

Troy Fontaine troyfontaine

View GitHub Profile
@troyfontaine
troyfontaine / 1-setup.md
Last active June 17, 2024 20:05
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@troyfontaine
troyfontaine / howtosurvive.md
Last active December 14, 2022 22:43
PFSense Router with VLANs and TFTP Server

Ephemeral Ports are your bane

TFTP is said to "only use UDP 69" but this is completely and totally inaccurate.

TFTP starts communications on UDP 69, then moves the conversation to ephemeral ports between the two systems-and depending on the systems involved, they can change during the boot process.

Note, this doesn't seem to work across VLANs....

So, where do you start?

Step 1) You need UDP 67, 69, 4011, 1024:5000 from your PXE booting machine to the PXE Server. This is because the PXE bootloader appears to use that range specifically.

@troyfontaine
troyfontaine / readme.md
Last active February 17, 2024 02:21
Logging SFTP interactions on a Chrooted User in Ubuntu 14.04

How to setup SFTP Logging on Ubuntu 14.04 for a Chrooted User

Prerequisites: Using internal-sftp for sftp; rsyslog for logging

Step 1. Set up your chrooted directories

sudo mkdir /sftp/myshare
sudo mkdir /sftp/myothershare

Step 2. Create your groups for your chrooted users

@troyfontaine
troyfontaine / readme.md
Last active April 27, 2017 16:56
[WIP] Ansible Cheatsheet

List of OS Families used by ansible_os_family

"Container Linux by CoreOS" = Container Linux "Debian" = Debian, Raspbian, Ubuntu

Get facts about a host

ansible myserver -m setup | less
@troyfontaine
troyfontaine / readme.md
Last active June 12, 2024 12:55
Resize root partition (or how to remove the default /home partition) on CentOS 7 online

Resize root partition (or how to remove the default /home partition) on CentOS 7 online

This process requires that you are able to ssh OR log in locally using the root user account and that no services be running as users out of /home on the target machine.

The examples are from a default installation with no customization-you NEED to know what you're working with for volumes/partitions to not horribly break things.

By default, CentOS 7 uses XFS for the file system and Logical Volume Manager (LVM), creating 3 partitions: /,/home and swap.

NOTE: If you want to be sure that nothing is writing to /home you can either modify the host to boot into single-user mode OR try to use the systemctl isolate runlevel1.target command to switch (not tested! should work).

@troyfontaine
troyfontaine / install_steps.md
Last active October 16, 2016 16:19
Install Ruby on Hypriot OS

Steps to install

  1. Install pre-requisite packages

    sudo apt update
    sudo apt install -y gcc make ruby-build
    
  2. Install rbenv

# !/bin/bash
# Script to use Fleetctl to stop and start containers using a rolling restart
# By Troy Fontaine with rolling restart script from http://engineering.rainchasers.com/coreos/fleet/2015/03/03/rolling-unit-restart.html
# Grab list of containers and assign to array
container_list=($(fleetctl list-units -fields=unit -no-legend | cut -f2 ))
# Prepare variable for later use
container=""
@troyfontaine
troyfontaine / readme.md
Created July 12, 2016 18:01
MySQL RDS Cheat Sheet

MySQL RDS Cheat Sheet

1. Install the Command Line Client

On Ubuntu

sudo apt-get install mysql-client

2. Use the command-line client to connect

The below command will connect to the rds server specified after -h and open a MySQL client connection that you can run commands against.

@troyfontaine
troyfontaine / consul_0.6.3.sh
Last active February 5, 2016 05:34
Packaging Consul into a deb file
#!/bin/bash
# Install pre-requisites
apt-get install software-properties-common
# Add PPAs
apt-add-repository ppa:brightbox/ruby-ng -y
apt-add-repository ppa:ansible/ansible -y
# Run update
@troyfontaine
troyfontaine / troubleshoot_haproxy.md
Created January 25, 2016 16:14
Troubleshooting HAProxy

Troubleshooting HAProxy

Step 1: Verify that HAProxy is running

On ubuntu, run the following command:

sudo service haproxy status

You should see output like below if it is running:

haproxy is running.