Skip to content

Instantly share code, notes, and snippets.

View tomdaley92's full-sized avatar
💾
Loading...

Tom Daley tomdaley92

💾
Loading...
View GitHub Profile

Increasing LVM Disk Space (Ubuntu)

Increase live Ubuntu server disk space (requires LVM) without any downtime.

All of the commands below need to be executed as root user.

  1. Create a new partition using unallocated space.

    First we'll need to determine exactly which disk was added or had its size increased.

@tomdaley92
tomdaley92 / fizzbuzz.py
Created August 5, 2022 22:14
FizzBuzz - Interview Question
'''
FizzBuzz Coding Challenge
Print integers 1 through N, with the following caveats:
- print "Fizz" if an integer is multiple of 3
- print "Buzz" if an integer is a multiple of 5
- print "FizzBuzz" if an integer is a multiple of both 3 and 5
'''
@tomdaley92
tomdaley92 / README.md
Last active June 14, 2022 20:58
Uploading TLS Certificate to Cisco SG 250 Series Switches

Uploading TLS Certificate to Cisco SG 250/350 Series Switches

I recently picked up a Cisco SG250-08HP and it would not accept a certificate that I issued for it, using my own Root CA. Even after bootstrapping trust with the CA it still would not work, and the error message was unclear. After a few hours of research and many failed attempts I finally found a replicable way to achieve this. So I hope this might help someone else that runs into this in the future.

TL;DR: RSA key pair must be in pkcs1 format for the Cisco switch to accept it.

To give some additional context, I generated my certificates with Pfsense 2.6.0 at the time of this writing using SHA256 and 2048 bit keys. OpenSSL version used in this guide: OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022)

@tomdaley92
tomdaley92 / README.md
Last active February 8, 2024 23:53
The Renter's Home Lab

The Renter's Home Lab

Motivation

      Shortly after starting my career in IT, my team started to embrace the DevOps mentality and it's been pretty hard to look back. As a developer in today's world, I feel lucky and empowered to have access to tools like Ansible & Terraform, so a big part of this is fueled by a desire to strengthen my DevOps skills. Personally, I have found that wearing many hats is key to becoming a more well-rounded programmer as well. And that means learning about all the pieces involved, not just the application layers. So the days of working in a black box are over for me!

      Over time, I also became much more educated on the issues of data privacy and how we blindly trust Tech Giants to not misuse our information. It worries me that often times we are not even aware there is any manipulation happening. I think that fear, combined w

@tomdaley92
tomdaley92 / .gitconfig
Last active December 19, 2022 19:38
Git & GPG Configuration
# ~/.gitconfig
[core]
excludesfile = /home/tom/.gitignore
[user]
name = Thomas Daley
email = $EMAIL
signingKey = 53590CD5B7BDC149
[commit]
gpgsign = true
@tomdaley92
tomdaley92 / Cartridge.cc
Last active September 27, 2024 10:35
Gameboy Cartridge Parser. Optimized by using a few O(1) lookup tables
#include "Cartridge.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Cartridge::Cartridge() {
rom_loaded = 0;
}
@tomdaley92
tomdaley92 / .Xmodmap
Last active September 5, 2021 01:59
Debian Caps-lock Re-purposing
keycode 66 = Mode_switch
keysym j = j J Left
keysym l = l L Right
keysym i = i I Up
keysym k = k K Down
keysym u = u U Home
keysym o = o O End
@tomdaley92
tomdaley92 / karabiner.json
Created August 17, 2021 22:04
Karabiner elements MacOS configuration (capslock + j,k,l,i,u,o => arrow keys and page up/down)
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": true
},
"profiles": [
{
"complex_modifications": {
"parameters": {
@tomdaley92
tomdaley92 / README.md
Last active October 15, 2024 19:12
Proxmox - Email Alerts Setup (gmail)

Proxmox - Email Alerts Setup (gmail)

  1. SSH into proxmox node and become root user. Run the following commands to download extra software dependencies we'll need.

    apt update
    apt install -y libsasl2-modules mailutils
  2. Enable 2FA for the gmail account that will be used by going to security settings

@tomdaley92
tomdaley92 / backup-github.sh
Last active February 25, 2024 03:01
Synology GitHub Backup Script
#!/bin/sh
[ -z "$GITHUB_TOKEN" ] && echo "error: GITHUB_TOKEN required but not set" && exit 1
[ "$#" -lt 2 ] && echo "usage: bash $0 USER|ORG PATH" && exit 1
GITHUB_USER=$1
BACKUP_DIR=$2/${GITHUB_USER}
GITHUB_API_BASE=https://api.github.com