Skip to content

Instantly share code, notes, and snippets.

View neilstuartcraig's full-sized avatar

Neil Craig neilstuartcraig

View GitHub Profile
@neilstuartcraig
neilstuartcraig / keybase.md
Created September 18, 2014 10:39
Keybase proof

Keybase proof

I hereby claim:

  • I am neilstuartcraig on github.
  • I am neilcraig (https://keybase.io/neilcraig) on keybase.
  • I have a public key whose fingerprint is EE2E 497F 287E AC9F 07F7 D387 FD97 7DDA E85E 0A1C

To claim this, I am signing this object:

@neilstuartcraig
neilstuartcraig / etc-init.d-nginx
Last active August 29, 2015 14:16 — forked from sairam/etc-init.d-nginx
NGINX init script for my project - forked from https://gist.github.com/sairam/5892520
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemin
#
# chkconfig: - 85 15
# description: Nginx iwe/IMAP/proxy server
# processname: nginx
# config: /etc/nginx/current/nginx.conf
# pidfile: /var/run/nginx.pid
# user: gtmdaemon
@neilstuartcraig
neilstuartcraig / nginx vary header length patch
Created September 10, 2015 20:52
nginx vary header length patch
--- a/src/http/ngx_http_cache.h 2015-06-05 15:10:36.000000000 +0100
+++ b/src/http/ngx_http_cache.h 2015-06-05 15:16:21.000000000 +0100
@@ -25,7 +25,7 @@
#define NGX_HTTP_CACHE_KEY_LEN 16
#define NGX_HTTP_CACHE_ETAG_LEN 42
-#define NGX_HTTP_CACHE_VARY_LEN 42
+#define NGX_HTTP_CACHE_VARY_LEN 4096
#define NGX_HTTP_CACHE_VERSION 3
"use strict";
// Core deps
const path = require("path");
const fs = require("fs");
// Monolith PoC
let HARFile = path.join(__dirname, "/data/har2.js");
fs.readFile(HARFile, (err, data) =>
{
This file has been truncated, but you can view the full file.
{
"log": {
"version": "1.2",
"creator": {
"name": "WebInspector",
"version": "537.36"
},
"pages": [
{
"startedDateTime": "2016-05-27T11:43:56.762Z",
{
"blockedURI": {
"http://static.bbci.co.uk": {
"0": 20,
"200": 1
},
"inline": {
"0": 8,
"200": 5
},
@neilstuartcraig
neilstuartcraig / compile-node-alpine.txt
Created October 17, 2016 21:10
Compiling Node.JS on Alpine Linux
apk update
apk install curl python build-base gcc abuild binutils binutils-doc gcc-doc linux-headers
curl -L -O https://nodejs.org/dist/v4.6.0/node-v4.6.0.tar.gz
tar xzf node-v4.6.0.tar.gz
cd node-v4.6.0
./configure
make
make install
@neilstuartcraig
neilstuartcraig / node-https-post-example.js
Last active February 17, 2017 14:35
nodejs core https POST example - not working code!
// NOTE: This isn't working code, I rehashed it as an example from one of my projects
import https from "https";
const requestOptions =
{
// See https://nodejs.org/api/http.html#http_http_request_options_callback
};
const req = https.request(requestOptions, (res) =>
@neilstuartcraig
neilstuartcraig / nginx-boringssl-build-script-debian.sh
Last active April 4, 2024 23:39
This builds NGINX from source with BoringSSL for Debian (alike?) systems with systemd (e.g. Debian Jessie)
#!/bin/bash
LATESTNGINX="1.11.10"
BUILDROOT="/tmp/boring-nginx"
# Pre-req
sudo apt-get update
sudo apt-get upgrade -y
# Install deps
@neilstuartcraig
neilstuartcraig / LetsEncrypt-HPKP-Jul-2017
Last active July 19, 2017 20:18
HPKP header for Let's Encrypt active & backup certs listed at https://letsencrypt.org/certificates/ - generated by https://hpkpcalc.github.io/calculator.html
Public-Key-Pins: pin-sha256="YLh1dUR9y6Kja30RrAn7JKnbQG/uEtLMkBgFF2Fuihg="; pin-sha256="sRHdihwgkaib1P1gxX8HFszlD+7/gTfNvuAybgLPNis="; max-age=31536000