Skip to content

Instantly share code, notes, and snippets.

View neilstuartcraig's full-sized avatar

Neil Craig neilstuartcraig

View GitHub Profile
@neilstuartcraig
neilstuartcraig / tdp-push-config-draft-1
Created July 20, 2017 12:53
TDP push config draft 1
# H2 push
# Needed on all pages:
push / {
/assets/css/reset.css?v=1
/assets/images/twitter.svg
/assets/images/github.svg
/assets/css/generics.css?v=1
/assets/css/main-header.css?v=1
/assets/css/main-footer.css?v=1
}
@neilstuartcraig
neilstuartcraig / caddy-debian-9-sysd-service-file
Created July 20, 2017 21:27
A basic Caddy / Debian 9 (Stretch) System D service file
[Unit]
Description=Caddy HTTP/2 web server
Documentation=https://caddyserver.com/docs
After=network-online.target
Wants=network-online.target
[Service]
Restart=on-failure
StartLimitInterval=0
StartLimitBurst=0
@neilstuartcraig
neilstuartcraig / gcs-fuse-mount-as-user
Last active September 5, 2017 20:01 — forked from anonymous/gcs-fuse-mount-as-user
FSTab mount GCS bucket as specific user (www-data)
<GCS BUCKET NAME (NO gs:// prefix)> <MOUNT POINT> gcsfuse ro,uid=33,gid=33,noatime,async,_netdev,noexec,user,implicit_dirs,allow_other 0 0
Example:
GCS Bucket name: a-test-bkt
Mount point: /mnt/atb
a-test-bucket /mnt/atb gcsfuse ro,uid=33,gid=33,noatime,async,_netdev,noexec,user,implicit_dirs,allow_other 0 0
NOTES:
implicit_dirs is the --implicit-dirs option which is required to allow the FS to show dirs - see https://github.com/googlecloudplatform/gcsfuse/blob/master/docs/semantics.md#implicit-directories
@neilstuartcraig
neilstuartcraig / medium-hwsbwptti-stats.md
Last active October 12, 2017 13:30
Medium article: How we deliver BBC Web Pages to the Internet - stats for "Our audience" section
Metric Num requests/month Peak requests/sec
Num web pages 40,000,000,000 50,000
Num web page assets 400,000,000,000 600,000
Country         h1 time   h2 time   % reduction  
Argentina     4.78   3.57   34.0%        
New Zealand   5.19   4.05   28.2%        
Japan 4.70 3.73 26.2%
China (Beijing) 5.40 4.64 16.5%
South Africa 4.19 3.80 10.2%
United Kingdom 0.94 0.92 2.7%
Latest versions on Pixel 2, Monday 4th December 2017
------------------------------------------------------------------------
Chrome Canary (65):
User Agent: Mozilla/5.0 (Linux; Android 8.0.0; Pixel 2 Build/OPD1.170816.025) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3284.0 Mobile Safari/537.36
Client ciphersuites: 0x4a4a:0x1301:0x1302:0x1303:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA:AES256-SHA:0x000a
Client Curves: 0x8a8a:X25519:prime256v1:secp384r1
Chrome Dev (64):
User Agent: Mozilla/5.0 (Linux; Android 8.0.0; Pixel 2 Build/OPD1.170816.025) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3281.0 Mobile Safari/537.36
@neilstuartcraig
neilstuartcraig / gist:d4fd833c51f2a54c2f9e36ab5b25f9cf
Created April 17, 2018 18:58
Email address format - template to request corrections as per RFC 2822
Hello
I’d be grateful if you could forward this email to your technical folk for their consideration please:
I just used your website contact form and I noticed that the email address validation doesn’t allow “+" in the “locally interpreted string” (the part of the email address before the “@"). A “+" (along with a number of other characters) is a valid character in this part of the address (as per the relevant standard, RFC 2822: https://tools.ietf.org/html/rfc2822#section-3.2.4). If you’re unfamiliar with the email address format/spec, this blog post does a good job of explaining it: https://haacked.com/archive/2007/08/21/i-knew-how-to-validate-an-email-address-until-i.aspx/.
Like many others, I use a specific “+ alias” for each account I sign up for, this allows me to filter any resulting spam and more importantly, means that it is more difficult for malicious people and unwanted advertisers to link two or more leaked sets of account details of mine together (see https://fieldguide.gizmodo.com/how-to-us
@neilstuartcraig
neilstuartcraig / tls1-blog-global.md
Last active November 20, 2018 12:37
TLS usage on www.bbc.co.uk and www.bbc.com, 10-13 Nov 2018
TLS Version Number of requests Percentage
TLSv1.2 2,002,516,373 97.96%
TLSv1.1 4,529,764 0.22%
TLSv1.0 37,160,210 1.82%
@neilstuartcraig
neilstuartcraig / tls-1-blog-per-country.md
Created November 20, 2018 12:40
How TLS usage varies by geography on www.bbc.co.uk and www.bbc.com
Country Number of requests Percentage of TLS 1.0 usage
Bosnia and Herzegovina 35,031 100.00%
China 2,261,506 86.93%
Montenegro 28,712 48.74%
Croatia 113,948 43.75%
Uganda 150,225 34.48%
Honduras 97,644 29.55%
Ethiopia 180,473 26.04%
Democratic Republic of the Congo 12,775 25.67%
@neilstuartcraig
neilstuartcraig / tls1-blog-gb-us.md
Created November 20, 2018 12:41
TLS usage for GB and USA on www.bbc.co.uk and www.bbc.com
Country Number of requests Percentage of TLS 1.0 usage
Great Britain 23,778,043 1.43%
USA 2,373,620 1.47%