Skip to content

Instantly share code, notes, and snippets.

View mattwillsher's full-sized avatar
😀

Matt Willsher mattwillsher

😀
View GitHub Profile
@mattwillsher
mattwillsher / hashinstall.sh
Last active August 4, 2019 17:21
Script to install any of the Hashicorp tools to a given path, including GPG verification of download integrity. Write on Ubuntu, test on desktop and cloud image
#!/bin/bash
# A simple script to install Hashicorp tools with GPG key verification
set -euo pipefail
# Set DEST_PATH if not already set
HASHI_DEST_PATH="${HASHI_DEST_PATH:-/usr/local/bin}"
# Clean up downloaded files
HASHI_CLEAN="${HASHI_CLEAN:-true}"
@mattwillsher
mattwillsher / localhost-cert.sh
Last active August 31, 2025 16:42
Generate CA cert/key and server cert/key for localhost use.
#!/usr/bin/env bash
set -e
OUTPUT_DIR=${OUTPUT_DIR:-"out"}
SUBDOMAIN=${1:-"my"}
CA_CERT="certs/ca.cert.pem"
CA_KEY="private/ca.key.pem"
LOCALHOST_CERT="certs/$SUBDOMAIN.localhost.cert.pem"
LOCALHOST_KEY="private/$SUBDOMAIN.localhost.key.pem"