Skip to content

Instantly share code, notes, and snippets.

@Azimkhan
Azimkhan / gist:549619bca0bdc12a1695f9d4a94935ee
Created November 14, 2018 07:04 — forked from miohtama/gist:5389146
Decoding emails in Python e.g. for GMail and imapclient lib
import email
def get_decoded_email_body(message_body):
""" Decode email body.
Detect character set if the header is not set.
We try to get text/plain, but if there is not one then fallback to text/html.
:param message_body: Raw 7-bit message body input e.g. from imaplib. Double encoded in quoted-printable and latin-1
@Azimkhan
Azimkhan / self-signed-certificate-with-custom-ca.md
Created January 31, 2018 06:50 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@Azimkhan
Azimkhan / install-comodo-ssl-cert-for-nginx.rst
Created June 7, 2017 06:44 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert