Skip to content

Instantly share code, notes, and snippets.

View cmackenzie1's full-sized avatar
🏠
Working from home

Cole Mackenzie cmackenzie1

🏠
Working from home
View GitHub Profile

Settings for locking down a server with UFW

# delete all existing rules
sudo ufw reset

# enable ufw
sudo ufw enable

# defult deny everything incoming
@cmackenzie1
cmackenzie1 / biome.json
Created October 1, 2024 23:01
My biome.json
{
"$schema": "https://biomejs.dev/schemas/1.9.2/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": false,
"ignore": [
@cmackenzie1
cmackenzie1 / cargo-clean.sh
Created September 3, 2024 04:01
Run cargo clean on multiple directories.
#!/bin/bash
# Exit immediately if a command exits with a non-zero status
set -e
# Function to display error messages and exit
error_exit() {
echo "Error: $1" >&2
exit 1
}
@cmackenzie1
cmackenzie1 / git.md
Created February 6, 2024 19:28
My favorite git commands

Copy last commit message to clipboard

git log -1 --pretty=%B | pbcopy # Can also specify -2 for last two messages. 

Is it master or main?

git branch -l master main
@cmackenzie1
cmackenzie1 / deltalake_schemas.yaml
Created June 15, 2023 16:24
Define Delta Lake table schemas in YAML.
# A top-level `type: struct` is a `Schema`
# These can be serialized into a deltalake::Schema struct using serde_yaml in rust
# let schema: deltalake::Schema = serde_yaml::from_str(r#"<your yaml>");
---
# A struct with primitive fields
type: struct
fields:
- name: String
type: string
nullable: true
@cmackenzie1
cmackenzie1 / cloudflare_logpush.tf
Last active May 11, 2022 17:55
Cloudflare + Terraform example for configuring Logpush Jobs to R2. https://developers.cloudflare.com/logs/get-started/enable-destinations/r2/
# https://developers.cloudflare.com/logs/get-started/enable-destinations/r2/
data "cloudflare_api_token_permission_groups" "all" {
resource "cloudflare_api_token" "logpush_r2_token" {
name = "logpush_r2_token"
policy {
permission_groups = [
data.cloudflare_api_token_permission_groups.all.permissions["Workers R2 Storage Write"],
@cmackenzie1
cmackenzie1 / Lightroom Manifesto.md
Last active March 23, 2023 04:12
My cheatsheet / quick guide to using Adobe Lightroom.

Lighroom Manifesto ✊

🚩 Flags:

Assign flags right after an import to filter out the obviously bad shots and ones you'd like to keep. Use your first instinct and leave undecided ones as unflagged.

  • Pick (P): In focus, eyes open, good positioning
  • Reject (X): Out of focus, blurry motion, eyes closed
  • Unflag (U):
@cmackenzie1
cmackenzie1 / build.gradle.kts
Last active March 4, 2021 04:27
Gradle dependency for Expedia GraphQL
implementation("com.expediagroup:graphql-kotlin-spring-server:3.7.0")
@cmackenzie1
cmackenzie1 / docker-compose.yml
Last active October 12, 2024 08:33
Docker Compose for DynamoDB Local and Admin UI
version: '3.7'
services:
dynamodb-local:
image: amazon/dynamodb-local:latest
container_name: dynamodb-local
ports:
- "8000:8000"
dynamodb-admin:
image: aaronshaf/dynamodb-admin
print("Hello, World!)