Skip to content

Instantly share code, notes, and snippets.

View michaelgreenhill's full-sized avatar
🎶
I must be a printer, cos I be jammin

Michael Greenhill michaelgreenhill

🎶
I must be a printer, cos I be jammin
  • Melbourne, Australia
View GitHub Profile
@michaelgreenhill
michaelgreenhill / fix_lancache.sh
Created June 19, 2020 07:25
Stop qnap from taking over port 80
#!/bin/bash
# This script replaces the config directive to run Qthttpd on port 80 with port 81
# It then starts the Lancache container
# The entire block is wrapped in an if statement to check if it's already running...
if [[ $(docker container ls | grep lancache01$ | wc -l) == 0 ]]; then
/bin/sed -i -re 's#(\s+)("/usr/local/sbin/Qthttpd -p) (80) (.*)#\1\2 81 \4#' /etc/init.d/Qthttpd.sh
/etc/init.d/Qthttpd.sh restart
docker container start selby-lancache01
@michaelgreenhill
michaelgreenhill / settings.json
Last active May 22, 2020 07:34
Windows Terminal config
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"alwaysShowTabs": true,
"copyOnSelect": false,
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"initialCols": 180,
"initialRows": 45,
"keybindings": [{
"command": "closePane",
"keys": [
@michaelgreenhill
michaelgreenhill / export-secret.sh
Created February 17, 2020 06:06
Export an AWS secret to a .env file
#!/bin/bash
AWS_SECRET_ID="my-super-secret-secret"
AWS_REGION="ap-southeast-2"
ENVFILE="/srv/app/.env"
# Ensure your EC2 instance has the most recent version of the AWS CLI
apt-get install -y python3-pip jq
pip3 install awscli --upgrade
@michaelgreenhill
michaelgreenhill / iam-secrets-readonly.json
Created February 17, 2020 05:59
AWS Secrets Manager IAM role
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"secretsmanager:GetResourcePolicy",
"secretsmanager:GetSecretValue",
"secretsmanager:DescribeSecret",
"secretsmanager:ListSecretVersionIds"
@michaelgreenhill
michaelgreenhill / 01-pihole.conf
Last active September 26, 2020 17:47
Dockerised Pi-hole goodness
# Pi-hole: A black hole for Internet advertisements
# (c) 2017 Pi-hole, LLC (https://pi-hole.net)
# Network-wide ad blocking via your own hardware.
#
# Dnsmasq config for Pi-hole's FTLDNS
#
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.
###############################################################################
@michaelgreenhill
michaelgreenhill / docker-compose.yml
Last active January 9, 2020 07:52
Traefik v2 example configuration
version: "3.3"
services:
traefik:
image: "traefik:latest"
container_name: "selby-traefik01"
restart: always
environment:
- TZ=Australia/Melbourne
command: