Skip to content

Instantly share code, notes, and snippets.

@simonsmiley
simonsmiley / letsencrypt.conf
Created December 9, 2016 10:49
nginx ssl stub
location ^~ /.well-known/acme-challenge {
alias /var/lib/letsencrypt/.well-known/acme-challenge;
default_type "text/plain";
try_files $uri =404;
}
server {
listen 0.0.0.0:80;
server_name koel.example.com
server_tokens off;
location '/.well-known/acme-challenge' {
default_type "text/plain";
root /srv/http/letsencrypt;
}
location / {
return 301 https://$server_name$request_uri;

Keybase proof

I hereby claim:

  • I am simonsmiley on github.
  • I am thelinuxguy (https://keybase.io/thelinuxguy) on keybase.
  • I have a public key ASAhjU6wI1ygHsRkr9anCETqxhewcUiDgG8QLgby1YiqBQo

To claim this, I am signing this object:

@simonsmiley
simonsmiley / files.py
Last active August 29, 2015 14:20
Programs for correcting students exercises Add new snippet
#!/bin/env python3
import os
import hashlib
def hashfile(afile, hasher, blocksize=65536):
buf = afile.read(blocksize)
while len(buf) > 0:
hasher.update(buf)
buf = afile.read(blocksize)
return hasher.digest()