Skip to content

Instantly share code, notes, and snippets.

View JParkinson1991's full-sized avatar

Josh Parkinson JParkinson1991

  • Rural Insurance
  • England
View GitHub Profile

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
@JParkinson1991
JParkinson1991 / README-Template.md
Created May 31, 2023 08:18 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@JParkinson1991
JParkinson1991 / x509certs.sh
Created April 25, 2023 13:23
Generation X509 Self Signed Certificates
# Generates X509 self signed keys pairs
#
# Structure:
# openssl req -x509 -newkey rsa:4096 -keyout "<pkey_name>" -out "<cert_name>" -sha256 -days <days> -subj '/CN=<domain>'
#
# Parmaeters:
# pkey_name: The name of the generated private key file
# cert_name: The name of the generated public key file
# days: The number of days the cert if valid for
# domain: The domain the cert is being generated on
@JParkinson1991
JParkinson1991 / bash_script_source.sh
Last active January 2, 2021 14:52
Get bash script source directory (follow symlinks etc)
#!/bin/bash
# Taken from answer: https://stackoverflow.com/questions/59895/how-to-get-the-source-directory-of-a-bash-script-from-within-the-script-itself/246128#246128
# Option 1: One Liner
#
# "It will work as long as the last component of the path used to find the script is not a symlink (directory links are OK)"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# Option 2: Bulletproof
#
@JParkinson1991
JParkinson1991 / envsubst-recursive.sh
Last active September 17, 2020 13:17
envsubst-recursive.sh
#!/usr/bin/env bash
# Usage envsubst-recursive.sh [source root]
# Options:
# -a|--append - Set string to append to processed source file names
# -f|--filter - Set the filename filter (only process files matching this filter)
# -o|--output - Set the output directory for substituted file
# -q|--quiet - Enable quiet mode, no script output
# -v|--variables - Set the variable names to replace only. IMPORTANT: Single quote this argument
# Script variable defaults
@JParkinson1991
JParkinson1991 / get_json_value.sh
Last active June 17, 2020 09:10
Bash Functions: GET JSON Values
#!/usr/bin/env bash
# Extracts a json value from a json containing string
#
# Usage:
# get_json_value <key> [occurrence]
#
# Examples:
# echo $string | get_json_value theKey 1
# cat file.json | get_json_value theKey
@JParkinson1991
JParkinson1991 / .gitignore
Created April 23, 2020 10:53
Base File: .gitignore
# ==============================================================================
# Project Ignores
#
# - Place project specific ignore statements in this section.
# ==============================================================================
# ==============================================================================
# Dreamweaver Ignores
#
# - Notes
@JParkinson1991
JParkinson1991 / .editorconfig
Created April 23, 2020 10:52
Base File: .editorconfig
# This is the top-most .editorconfig file; do not search in parent directories.
root = true
# Default configuration
[*]
end_of_line = LF
indent_style = space
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
@JParkinson1991
JParkinson1991 / npm_link.md
Last active April 21, 2020 08:54
Local Package Development via NPM Link
#!/usr/bin/env bash
# For current version see:
# https://github.com/JParkinson1991/bin/blob/master/google-chrome
# Wraps cli usage of google chrome on MacOS
#
# Requirments: Google Chrome
#
# Run in default mode, open/visible browser, environment defined address/port