Skip to content

Instantly share code, notes, and snippets.

jcarley / jsonmin
Created Dec 17, 2020
Minifies and escapes a json file. I use this for minifying json key files from GCP
View jsonmin
#!/usr/bin/env bash
usage() {
echo "./jsonmin <INFILE> <OUTFILE>"
echo " INFILE: File to be minified"
echo " OUTIFLE: File to save minified json as"
jcarley / postman-pre-request01.js
Last active Dec 5, 2020
Postman pre-request script to automatically get a bearer token from Auth0 and save it for reuse. Two approaches.
View postman-pre-request01.js
const echoPostRequest = {
url: 'https://<my url>',
method: 'POST',
header: 'Content-Type:application/json',
body: {
mode: 'application/json',
raw: JSON.stringify(
client_id:'<your client ID>',
client_secret:'<your client secret>',
jcarley / .rubocop.yml
Last active Dec 4, 2020
Boilerplate Rubocopy yaml file
View .rubocop.yml
# The behavior of RuboCop can be controlled via the .rubocop.yml
# configuration file. It makes it possible to enable/disable
# certain cops (checks) and to alter their behavior if they accept
# any parameters. The file can be placed either in your home
# directory or in some project directory.
# RuboCop will start looking for the configuration file in the directory
# where the inspected file is and continue its way up to the root directory.
# See
View .eslintrc01.js
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
parserOptions: {
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
extends: [
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
View gist:b9d2b74efde3afb0666236d9abe40a8b
service salt-minion stop
rm -f /etc/salt/pki/minion/
echo "master: salt" > /etc/salt/minion
service salt-minion start
View assume-role-policy.json
"Version": "2012-10-17",
"Statement": [
"Action": "sts:AssumeRole",
"Principal": {
"Service": ""
"Effect": "Allow",
"Sid": ""
jcarley /
Created Jan 19, 2018 — forked from bradrydzewski/
Generate trusted CA certificates for running Docker with HTTPS
# Generates client and server certificates used to enable HTTPS
# remote authentication to a Docker daemon.
# See
# To start the Docker Daemon:
# sudo docker -d \
jcarley /
Created Jan 17, 2018 — forked from hisnameisjimmy/
Unifi Controller one-shot install script for Ubuntu 16.04 with Lets Encrypt
# This script stands on the shoulders of giants.
# It is written and tested for Ubuntu 16.04 on Digital Ocean using a 1GB droplet.
# Anything less than 1GB of memory may cause issues with anything memory intensive
# like imports/exports.
# It does the following:
# 1) Opens the appropriate ports for Unifi, SSH, Web/SSL traffic via iptables
View Dockerfile
FROM ruby:2.4.2
ENV DEBIAN_FRONTEND noninteractive
ENV TERM xterm
ADD bashrc /root/.bashrc
RUN echo "deb jessie-pgdg main" >> /etc/apt/sources.list.d/pgdg.list && \
wget --quiet -O - | apt-key add -
RUN apt-get -qqy update && \
jcarley / .babelrc
Created Aug 10, 2017 — forked from fdietz/.babelrc
Phoenix Framework Webpack Integration (replacing Brunch)
View .babelrc
"presets": ["es2015", "react", "babel-preset-stage-0"]