Skip to content

Instantly share code, notes, and snippets.

View nZac's full-sized avatar

Nick Zaccardi nZac

View GitHub Profile
@nZac
nZac / openttd.cfg
Created February 18, 2024 02:14
OpenTTD Config
[version]
version_string = 13.4
version_number = 1D486D64
ini_version = 2
[network]
commands_per_frame = 2
max_commands_in_queue = 16
bytes_per_frame = 8
@nZac
nZac / r53-export-validation.py
Created November 14, 2023 04:25
Simple validation script for Route 53 record-set JSON outputs
"""Simple validation script for Route 53 record-set JSON outputs
Only validates some record types
aws route53 list-resource-record-sets --hosted-zone-id zone-id-old > old-dns.json
aws route53 list-resource-record-sets --hosted-zone-id zone-id-new > new-dns.json
"""
from __future__ import annotations
@nZac
nZac / tmux.conf
Last active December 18, 2020 14:49
.tmux.conf
# curl https://gist.githubusercontent.com/nZac/e200b656539b0aa311b579e25c258e36/raw > ~/.tmux.conf
# Prett Colors! Make sure iTerm2 is setup with "xterm-256color"
set -g default-terminal "screen-256color"
set -g terminal-overrides ""
set -g status-bg '#666666'
set -g status-fg '#aaaaaa'
set-option -g renumber-windows on
set -g update-environment "SSH_AUTH_SOCK"
@nZac
nZac / .vimrc
Last active February 16, 2021 16:24 — forked from simonista/.vimrc
A basic .vimrc file that will serve as a good template on which to build.
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" Plugin Settings
let g:clang_library_path='/usr/lib/x86_64-linux-gnu/libclang-6.0.so.1'
" Turn on syntax highlighting
@nZac
nZac / importdns.py
Created May 27, 2020 17:17
Convert R53 to TF
#!/usr/bin/env python3
import argparse
from typing import List, Optional
import dataclasses
import enum
INDENT = ' '
@nZac
nZac / example.py
Last active December 30, 2019 03:53
Simple Text Media Handler in Falcon
import falcon
import falcon.media
import falcon.testing
class TextHandler(falcon.media.BaseHandler):
def serialize(self, media, content_type):
return str(media).encode()
@nZac
nZac / api.py
Created May 19, 2019 22:23
Falcon SQLAlchemy Integration
import falcon
import sqlalchemy
from .middleware import SQLAlchemyMiddleware
from .db import session
def create_app(config: dict):
session.configure(bind=sqlalchemy.create_engine(config.get('DATABASE_URL', 'sqlite://')))
return falcon.API(middleware=[SQLAlchemyMiddleware(session)])
@nZac
nZac / commands.sql
Created November 12, 2018 22:35
Permissioned Template Based PG Database Creation
---------------------------
-- SERVER LEVEL COMMANDS --
---------------------------
-- Create a new template database (we could alter template1 as well).
CREATE DATABASE "template2";
-- This avoids possibly droping the template table
UPDATE pg_database SET datistemplate = true WHERE datname='template2';
@nZac
nZac / Commands
Created February 21, 2018 17:43
Basic NixOS Virtualbox Setup
# Original: https://nixos.wiki/wiki/NixOS_on_ZFS#How_to_install_NixOS_on_a_ZFS_root_filesystem
# Make sure to enable EFI support in VB. Settings -> System -> Enable EFI
# Add the zfs filesystem to the install environment:
nano /etc/nixos/configuration.nix
## ---8<-------------------------8<---
boot.supportedFilesystems = [ "zfs" ];
## ---8<-------------------------8<---
@nZac
nZac / error
Last active May 18, 2017 19:04
Uncaught TypeError: Cannot read property 'getAttribute' of undefined
at Notification.UIkit._getProps (http://localhost:5000/static/js/bundle.js:12413:25)
at Notification.UIkit._initProps (http://localhost:5000/static/js/bundle.js:12348:43)
at Notification.UIkit.$mount (http://localhost:5000/static/js/bundle.js:12574:14)
at Notification.created (http://localhost:5000/static/js/bundle.js:16966:18)
at http://localhost:5000/static/js/bundle.js:12131:66
at Array.forEach (native)
at Notification.UIkit._callHook (http://localhost:5000/static/js/bundle.js:12131:22)
at Notification.UIkit._init (http://localhost:5000/static/js/bundle.js:12275:14)
at new Notification (eval at createClass (http://localhost:5000/static/js/bundle.js:12089:16), <anonymous>:2:47)