Skip to content

Instantly share code, notes, and snippets.

@William-Hill
William-Hill / self_signed_cert.py
Created July 2, 2018 17:11
Create a self-signed cert using PyOpenSSL
def create_self_signed_cert(cert_dir):
"""
If datacard.crt and datacard.key don't exist in cert_dir, create a new
self-signed cert and keypair and write them into that directory.
Source: https://skippylovesmalorie.wordpress.com/2010/02/12/how-to-generate-a-self-signed-certificate-using-pyopenssl/
"""
CERT_FILE = "hostcert.pem"
KEY_FILE = "hostkey.pem"
@William-Hill
William-Hill / dump_pylint_settings.sh
Created July 26, 2018 16:20
Change pylint settings
pylint --generate-rcfile > .pylintrc
@William-Hill
William-Hill / Dockerfile
Last active August 5, 2018 04:56
Dockerfile for creating a CentOS6 image bootstrapped for ESGF
# Use an official CentOS image
FROM centos:6
# Set the working directory to /home/hill119
WORKDIR /home/hill119
USER root
# Copy the current directory contents into the container at /home/hill119
ADD . /home/hill119
@William-Hill
William-Hill / delete_branches.sh
Created October 14, 2018 16:46
Delete multiple branches in git
git branch -d `git branch --list '$1'`
@William-Hill
William-Hill / clone_no_ssl.sh
Created January 9, 2020 23:25
Disable SSL for single Git clone
git -c http.sslVerify=false clone https://example.com/path/to/git