Skip to content

Instantly share code, notes, and snippets.

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

Tom Daley tomdaley92

💾
Loading...
View GitHub Profile
@tomdaley92
tomdaley92 / Cartridge.cc
Last active October 3, 2021 21:09
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 / .zshrc
Last active November 28, 2021 02:12
Zsh Configuration (oh-my-zshell)
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/tom/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
@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 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 / ast.py
Last active June 27, 2022 05:49
Abstract Syntax Trees and the Shunting Yard Algorithm
#!/usr/bin/env python3
'''
Abstract Syntax Trees
01/04/2018
You may override the constants OPERATORS and PRECEDENCE
to define your own grammar. The is_operand() function is
intended to be redefined as well and is used to determine
if a given token within an expression string is a valid
@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 / .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 / plex_fast_large.json
Created April 3, 2021 23:46
handbrake presets
{
"PresetList": [
{
"AlignAVStart": false,
"AudioCopyMask": [
"copy:aac",
"copy:ac3",
"copy:dtshd",
"copy:dts",
"copy:mp3",
@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 / 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