Skip to content

Instantly share code, notes, and snippets.

View hardillb's full-sized avatar
🚴‍♂️
Suitably Employed

Ben Hardill hardillb

🚴‍♂️
Suitably Employed
View GitHub Profile
  1. Generate the file:
$ awk 'BEGIN { for(c=0;c<10000000;c++) printf "<p>LOL</p>" }' > 100M.html
$ (for I in `seq 1 100`; do cat 100M.html; done) | pv | gzip -9 > 10G.boomgz
  1. Check it is indeed good:
@kekru
kekru / 01nginx-tls-sni.md
Last active May 6, 2024 14:59
nginx TLS SNI routing, based on subdomain pattern

Nginx TLS SNI routing, based on subdomain pattern

Nginx can be configured to route to a backend, based on the server's domain name, which is included in the SSL/TLS handshake (Server Name Indication, SNI).
This works for http upstream servers, but also for other protocols, that can be secured with TLS.

prerequisites

  • at least nginx 1.15.9 to use variables in ssl_certificate and ssl_certificate_key.
  • check nginx -V for the following:
    ...
    TLS SNI support enabled
@inntran
inntran / vzw-lte-ipv6-prefix-translation.md
Last active September 9, 2022 00:58
To configure IPv6 NPTv6 on Linux to allow more hosts behind Verizon Wireless LTE IPv6 single /64 prefix

Problem

Verizon Wireless assigns you ONE IPv4 address and ONE /64 IPv6 prefix for their cellular service, and VZW would reset your datalink once they received 1 packet with an illegal source address.

We have NAT for IP but for IPv6 we would like to avoid address translation to get some kind of end-to-end communication.

Solution

NPTv6, defined in RFC6296, would help us to do stateless prefix translation for IPv6.

@andysc
andysc / IPspeak.pl
Last active June 6, 2020 18:11
Speak the IP address of your linux machine. Perfect for Raspberry PIs or other headless servers with audio output. Just plug in a speaker or earphones and wait to be told the IP address to ssh to!
#!/usr/bin/perl
# IPspeak
# Andy S-C
# 18-May-13
# 15-Oct-16 - made more "human" ... ten dot nought dot one nine three dot seventeen
# this is the order we check the interfaces
@interfaces = ("eth0", "wlan0");