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 April 24, 2024 14:19
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 / README.md
Last active April 19, 2024 13:10
How to Update the Firmware of a Crucial Consumer SSD on Linux via the Terminal

How to Update the Firmware of a Crucial Consumer SSD on Ubuntu 22.04 via the Terminal

This has been tested on Ubuntu 22.04 with 3x Crucial MX500 1TB SSDs purchased in 2023

  1. Install the required packages
    sudo apt-get install -y smartmontools unzip curl
    
  2. Check your current firmware version and note it-you will want to be sure that you are actually updating the firmware version (replace sdX with your actual device's identifier-leaving off any partition numbers as you're checking the block device and not the data on it)
@troyfontaine
troyfontaine / readme.md
Last active April 8, 2024 06:10
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 / 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
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 / palworld-dedicated-server-setup.md
Last active February 14, 2024 01:49
Set up a Palworld Dedicated Server On Ubuntu 22.04

How to Set up a Palworld Dedicated Server On an Ubuntu 22.04 Host (VM or baremetal)

WORK IN PROGRESS

Because the documentation scattered around the internet is pretty inconsistent, I'm putting everything I've found that seems to work together here.

Overview

This took too much effort to get sorted out, so I'm documenting everything figured out so far here.

@troyfontaine
troyfontaine / README.md
Created April 3, 2022 05:06
Migrating Unifi Controller from Cloudkey Gen 1 to Docker Container

How to Migrate a Unifi Controller from Cloudkey Gen 1 to Docker Container

Background: In an effort to streamline my local network and reduce the number of dedicated devices, I began an effort to move off of my Unifi Cloudkey Gen 1 to a Docker Container. While the migration should be straight forward-it is definitely not!

Before we begin, ensure that your existing Cloudkey is still connected to the network and operational. This is crucial to migrate the existing settings and to leverage the Unifi migration tooling for a site to save on having to wipe your configuration and rebuild everything from scratch.

  1. Launch your container (it is up to you to follow the documentation for the specific maintainer's flavour to ensure you avoid data loss!) Once you can access the set up screen (on TCP:8443) for the containerized controller, you can proceed to Step 2
  2. On your existing controller, Navigate to Settings -> Backup and download a settings only backup. This is CRITICAL because trying to import
@troyfontaine
troyfontaine / falchion-nx-remap-left-alt-left-windows-keys.md
Last active December 31, 2023 06:54
How to Remap Left-Alt and Left-Windows keys on the ASUS ROG Falchion NX (Mac Style Key Layout)

How to Remap the Left-Alt and Left-Windows keys on the ASUS ROG Falchion NX (Mac Style Key Layout)

Because remapping can confuse the keyboard, we have to temporarily reprogram two keys outside of the left Windows and Left Alt keys that we're trying to work with in order to get the keys swapped like we want. It would be nice if the Armour Crate software would provide a way to specify a known key rather than having us type it-but c'est la vie!

  1. Open Armoury Crate
  2. On the left nav, click on the "Device" tab, then select your keyboard from the list
  3. Click on the ?/ key in the Armoury Crate Window, then on the right side of the Window, toggle the drop down from Default to Keyboard Function
  4. Now, click in the box that says "Click her then press the key."
  5. Hold down the right Alt key on your keyboard and press the left Alt key, you will now see that the ?/ key is set to Left Alt
  6. Click on the .> key in the Armoury Crate Window, then on the right side of the Window, toggle the drop down

How to add an image to a gist

  1. Create a gist if you haven't already.
  2. Clone your gist:
    # make sure to replace `<hash>` with your gist's hash
    git clone https://gist.github.com/<hash>.git # with https
    git clone git@gist.github.com:<hash>.git     # or with ssh
@troyfontaine
troyfontaine / README.md
Created July 1, 2018 02:15 — forked from RichardBronosky/README.md
Using cloud-init for cloudless provisioning of Raspberry Pi

Installing cloud-init on a fresh Raspbian Lite image

This is a work in Progress!

Purpose

This mainly demonstrates my goal of preparing a Raspberry Pi to be provisioned prior to its first boot. To do this I have chosen to use the same cloud-init that is the standard for provisioning servers at Amazon EC2, Microsoft Azure, OpenStack, etc.

I found this to be quite challenging because there is little information available for using cloud-init without a cloud. So, this project also servers as a demonstration for anyone on any version of Linux who may want to install from source, and/or use without a cloud. If you fall into that later group, you probably just want to read the code. It's bash so everything I do, you could also do at the command line. (Even the for loop.)