Skip to content

Instantly share code, notes, and snippets.

@richmilne
richmilne / convert-letsencrypt-java-keystore.sh
Last active Oct 18, 2020
Convert your domain's Let's Encrypt certificate (along with their intermediate certs) into a keystore that can be used with Java apps - such as Atlassian's Confluence
View convert-letsencrypt-java-keystore.sh
#!/usr/bin/env bash
# A codificiation of the steps outlined at
# https://ordina-jworks.github.io/security/2019/08/14/Using-Lets-Encrypt-Certificates-In-Java.html
# that I found relevant in getting my LE certs to work with our Confluence install.
# That page, and other sources, suggest that you might also have to import ALL the LE intermediate
# certs into the default Confluence / Java keystore ($JRE_HOME/lib/security/cacerts)
NOTIFY=webmaster@example.com
DOMAIN=www.example.com
@richmilne
richmilne / import-letsencrypt-java.sh
Last active Dec 15, 2021 — forked from galan/import-letsencrypt-java.sh
Import Let's Encrypt certificates into Java's trusted keystore (cacerts)
View import-letsencrypt-java.sh
#!/bin/bash -e
# A codificiation of the steps outlined at
# https://ordina-jworks.github.io/security/2019/08/14/Using-Lets-Encrypt-Certificates-In-Java.html
CERT_EXT=der
# JAVA_HOME can be passed as argument if not set
if [[ -z ${JAVA_HOME+x} ]] || [[ ! -d ${JAVA_HOME} ]]; then
JAVA_HOME=${1}
fi
@richmilne
richmilne / bitbucket_approve_pull.py
Last active Jun 2, 2022
Approve pull requests on BitBucket Server.
View bitbucket_approve_pull.py
#! /usr/bin/env python3
"""Approve pull requests on BitBucket Server.
If you are trying to approve pull requests on BitBucket from external/3rd-
party tools (like Jenkins) there may be plugins available to do the job
automatically - if you're lucky. The `Bitbucket Approve Plugin`_ seems to be
one such plugin.
Unfortunately, it's only for the *CLOUD*-hosted version of Bitbucket. The
self-hosted version, Bitbucket Server (formerly known as Stash) uses a
@richmilne
richmilne / test_count_invers.py
Created Oct 17, 2015
Python test cases for first programming assignment in Coursera's "Algorithms: Design and Analysis, Part 1"
View test_count_invers.py
"""
Test cases for the 'counting inversions' programming assignment, the first
assignment of the Coursera course "Algorithms: Design and Analysis, Part I".
This module incorporates most of the tests found in the course forum, in
this thread:
https://class.coursera.org/algo-009/forum/thread?thread_id=2
To help check my work, I modified my merge_sort implementation to return