Skip to content

Instantly share code, notes, and snippets.

View Chaz6's full-sized avatar

Chris Hills Chaz6

View GitHub Profile
@vidia
vidia / nginx-unificontroller.conf
Last active October 22, 2025 05:33
Example, working, NGINX config for proxying to Unifi Controller software and using letsencrypt. Includes websocket fix.
# I had a bit of trouble getting my unifi controller (hosted offsite) to use a proxy/letsencrypt. So here are the fruits of my labor.
# The unifi default port is 8443 running on localhost.
# License: CC0 (Public Domain)
server {
# SSL configuration
#
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
@zcaceres
zcaceres / Nested-Routers-Express.md
Last active August 14, 2025 13:53
Child Routers in Express

Nested Routers in Express.js

Express makes it easy to nest routes in your routers. But I always had trouble accessing the request object's .params when you had a long URI with multiple parameters and nested routes.

Let's say you're building routes for a website www.music.com. Music is organized into albums with multiple tracks. Users can click to see a track list. Then they can select a single track and see a sub-page about that specific track.

At our application level, we could first have a Router to handle any requests to our albums.

const express = require('express');
@peterforgacs
peterforgacs / Windows10AWSEC2.md
Last active October 27, 2025 08:09
Running Windows 10 on AWS EC2

Running Windows 10 on AWS EC2

Downloading the image

Download the windows image you want.

AWS vmimport supported versions: Microsoft Windows 10 (Professional, Enterprise, Education) (US English) (64-bit only)

So Home wont work.

@Vivelin
Vivelin / CourierNewPrime.user.css
Last active November 21, 2020 17:38
Courier -> Courier Prime
/* ==UserStyle==
@name Courier font replacement
@namespace vivelin.net
@version 1.0.2
@description Replace Courier and similar fonts with Courier Prime. Requires Courier Prime to be installed locally. Available from <https://quoteunquoteapps.com/courierprime/>.
@author Vivelin
@updateURL https://gist.githubusercontent.com/Vivelin/7b73bde9d62fb99741eab4e16de38eb6/raw/CourierNewPrime.user.css
@license unlicense
==/UserStyle== */
@Vivelin
Vivelin / ArialRoboto.user.css
Last active November 21, 2020 17:49
Arial -> Roboto
/* ==UserStyle==
@name Arial font replacement
@namespace vivelin.net
@version 1.0.4
@description Replace Arial, Helvetica and similar fonts with Roboto. Requires Roboto to be installed locally. Available from <https://github.com/google/roboto/releases>.
@author Vivelin
@updateURL https://gist.github.com/Vivelin/cd37bbcee8caa00bd8eb5383f07667d6/raw/ArialRoboto.user.css
@license unlicense
==/UserStyle== */
@ytti
ytti / jnh_exception_packet_trace.rb
Last active August 22, 2022 11:56
script to turn JunOS Trio exception capture into a PCAP
#!/usr/bin/env ruby
# script to generate PCAP from Trio exception trace. Potentially you may need to change POP_BYTES variable.
# Trio exception trace allows you to capture things like broken packets (checksum error), to see who is sending them
# clogin junos-trio-box | tee exception_trace
# start shell pfe network fpc0
# show jnh 0 exceptions terse
# debug jnh exceptions N discard ## get N from above command
# debug jnh exceptions-trace

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

#!/bin/bash
iatest=$(expr index "$-" i)
#######################################################
# SOURCED ALIAS'S AND SCRIPTS BY zachbrowne.me
#######################################################
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
@nathan-osman
nathan-osman / win32.go
Last active September 11, 2025 02:32
Simple Windows GUI application written in Go
package main
import (
"log"
"syscall"
"unsafe"
)
var (
kernel32 = syscall.NewLazyDLL("kernel32.dll")
@dpino
dpino / ns-ipv6-no-nat.sh
Created April 29, 2016 22:19
Create Network Namespace with IPv6 connectivity via Hurricane Electric tunnel (no NAT66 needed)
#!/usr/bin/env bash
set -x
if [[ $EUID -ne 0 ]]; then
echo "You must run this script as root."
exit 1
fi
# Fill up IPv6 addresses for the veth pair. Addresses must belong to the