Skip to content

Instantly share code, notes, and snippets.

View colinwilson's full-sized avatar
⚗️

Colin Wilson colinwilson

⚗️
View GitHub Profile
@colinwilson
colinwilson / lotuslabs-uk.vercel.app_2022-10-15_16-42-48.json
Created October 15, 2022 15:45
Chrome Lighthouse report for lotus labs docs site 2022-10-15
{
"requestedUrl": "https://lotuslabs-uk.vercel.app/docs/contributing/code-of-conduct/",
"finalUrl": "https://lotuslabs-uk.vercel.app/docs/contributing/code-of-conduct/",
"lighthouseVersion": "9.6.6",
"userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/102.0.5005.115 Safari/537.36",
"fetchTime": "2022-10-15T15:42:48.151Z",
"environment": {
"networkUserAgent": "Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4695.0 Mobile Safari/537.36 Chrome-Lighthouse",
"hostUserAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/102.0.5005.115 Safari/537.36",
"benchmarkIndex": 1527
@colinwilson
colinwilson / new_do_pricing_effective_2022.07.01.md
Last active May 17, 2022 16:19
New DigitalOcean Pricing - Prices effective starting July 1, 2022
@colinwilson
colinwilson / custom-prism-autoloader.js
Created February 10, 2022 05:08
Custom PrismJS Autoloader
(function () {
if (typeof Prism === 'undefined' || typeof document === 'undefined') {
return;
}
/* eslint-disable */
/**
* The dependencies map is built automatically with gulp.
@colinwilson
colinwilson / hb_h.265_1080p_vfast.sh
Created July 24, 2020 14:42
HandBrakeCLI Batch Conversion Script h.265,1080p,very fast preset
#!/bin/bash
# This script uses HandBrakeCLI to automatically convert a folder containing video files to H.265 (HEVC).
# You need to substitute SRC -- Source folder, DEST -- Destination folder,
# PRESET -- Preset name, & PRESET_FILE -- Preset file (json) for your own values
SRC="/root/video_in"
DEST="/root/video_out"
DEST_EXT=mkv
HANDBRAKE_CLI=HandBrakeCLI
@colinwilson
colinwilson / hbap_vfast.json
Last active July 24, 2020 14:41
HandBrake Preset [h.265,1080p,audio passthrough] --preset veryfast
{
"PresetList": [
{
"AudioCopyMask": [
"copy:aac",
"copy:ac3",
"copy:dtshd",
"copy:dts",
"copy:mp3",
"copy:truehd",
@colinwilson
colinwilson / main.tf
Created July 16, 2020 13:54
Create 3 private network connected servers on Hetzner Cloud via Terraform
provider "hcloud" {
token = var.hcloud_token
}
resource "hcloud_ssh_key" "default" {
name = var.ssh_public_key_name
public_key = var.ssh_public_key
}
resource "hcloud_network" "default" {
@colinwilson
colinwilson / all-in-one-postgres-dev.yaml
Last active June 24, 2020 03:12
Kong Ingress Controller Kubernetes Deployment [Postgres All-In-One DEV on Rancher 2.x] 1.3-alpine
apiVersion: v1
kind: Namespace
metadata:
name: kong
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: kongconsumers.configuration.konghq.com
spec:
@colinwilson
colinwilson / hb_install.sh
Last active February 17, 2020 04:44
HandBrake Install Script
#! /bin/bash
cd /root && mkdir video_in && mkdir video_out \
&& wget https://gist.githubusercontent.com/colinwilson/bdc29535d8825acdda2fbc2d3718d021/raw/2a14fa3f8be94424a650308a2b5f2dbd6bad8876/hbap.json \
&& wget https://gist.githubusercontent.com/colinwilson/3ba48ea637035d3f4ac8fdf5c25bc55a/raw/b9692629119246685bfeb3141b35e63a96a6ef6f/hbap720p.json \
&& wget https://gist.githubusercontent.com/colinwilson/8852b8fe09a52cca6828960621edd5d3/raw/90f4b89f8f6b35a1929a1fd7b187340cb1d5342a/hbap4k.json \
&& wget https://gist.githubusercontent.com/colinwilson/5ea73985e520f0c85e610c2f0e29ac39/raw/484cfa10216973d754bee2ab1e16ca18fb864dfa/hb_h.265_720p.sh \
&& wget https://gist.githubusercontent.com/colinwilson/db77c82536721f6ea70309b6d601f19e/raw/4bd1f86df6b144123f3885c9bb99fe0842ee7e4c/hb_h.265_1080p.sh \
&& wget https://gist.githubusercontent.com/colinwilson/4416611115d5f76bb9f6555dd2fe0730/raw/c343cde69b6a4e23e5bca304f865d36593e91b95/hb_h.265_2160p.sh \
&& chmod +x hb_h.265_720p.sh \
&& chmod +x hb_h.265_1080p.sh \
@colinwilson
colinwilson / all-in-one-postgres.yaml
Last active March 18, 2020 18:28
Kong Ingress Controller Kubernetes Deployment [Postgres All-In-One] 1.3-alpine
apiVersion: v1
kind: Namespace
metadata:
name: kong
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: kongconsumers.configuration.konghq.com
spec:
--
-- GEOIP IN POSTGRESQL
--
-- We use two approaches. First using PostgreSQL inet and cidr types and indexing (PostgreSQL 9.4 and later),
-- and then using ip4r (https://github.com/RhodiumToad/ip4r).
-- The performance of ip4r indexes is significantly better than PostgreSQL's own index.
-- An operation that took 42s using ip4r took 47 minutes using PostgreSQL's cidr index.
--