reqadd X-Forwarded-Proto:\ https
http-request set-header Host dsomehost.cloudfront.net
server my_cf_pt dsomehost.cloudfront.net:443 ssl sni req.hdr(Host)
Few quick notes: the port can be anything you like, the connection must be made via
tcp won’t work due to the SNI requirement.
The important part here is feeding the SNI to cloudfront ala sni req.hdr(Host)
An extra thing you may wish to do, depends on your resolver setup. IP ranges are pretty broad and non-static for cloudfront so you can set the resolver to use
resolver myresolvername at the end of the server line and setup your resolver…
originally posted at https://chrismckee.co.uk/c-logo-for-stuff-and-stickers/
Back in early 2013 I was pasting stickers all over my Acer, as if it was some sort of third-rate thermal insulation, and I thought to myself, wouldn’t it be nice if I could have a C# one.
Annoyingly all the C# ones were god awful. But Jeremy Kratz had made a nice C++ one while at MSFT and had kindly made it clear he wasn’t bothered about the licence something confirmed recently.
Anyhoo I liked it and decided to try and replicate it in Illustrator then sort for print in PhotoShop, whacked in…
When copying to the local file system I always use the following rsync options:
rsync -aWhv --no-compress --progress /source/ /destinationfolder/
--no-compress as it's on the same machine
--progress speaks for itself
-a preserves ownership & permissions using archive flag
-W copying whole files only
# and optional ones for watching
-h human-readable transfer rate and file sizes
-v keeps it verbose so we can see whats happening
Things are rarely simple or obvious when working across languages; especially when one is .net.
Rather than waste time here’s the code, in its long form.
With a key
and a message or data value of
some random junk
with both solutions we should receive
public string HmacSHA256(string key, string data)
ASCIIEncoding encoder = new ASCIIEncoding();
Byte code = encoder.GetBytes(key);
using (HMACSHA256 hmac = new HMACSHA256(code))
Byte hmBytes = hmac.ComputeHash(encoder.GetBytes(data));
hash = ToHexString(hmBytes);
public static string ToHexString(byte array)
StringBuilder hex = new StringBuilder(array.Length * 2);
foreach (byte b in array)
Which will generate the same value for the same given inputs as:
hmac.new(key.encode('utf-8'), data.encode('utf-8'), hashlib.sha256).hexdigest()