Skip to content

Instantly share code, notes, and snippets.

Simon Massey simbo1905

Block or report user

Report or block simbo1905

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@simbo1905
simbo1905 / helmfile.yaml
Last active Sep 3, 2019
cod-builder-demo
View helmfile.yaml
repositories:
- name: ocd-meta
url: https://ocd-scm.github.io/ocd-meta/charts
releases:
- name: {{ requiredEnv "ENV_PREFIX" }}-realworld
labels:
builder: realworld
chart: ocd-meta/ocd-builder
version: "1.0.0"
values:
@simbo1905
simbo1905 / initContainerWriteEmptyDir.sh
Created Sep 2, 2019
use an initContainer to write configuration into an empty ephemeral folder
View initContainerWriteEmptyDir.sh
#!/bin/bash
cat | oc create -f - <<EOF
apiVersion: v1
kind: Pod
metadata:
name: my-app
spec:
containers:
- name: realworld
image: docker.io/simonmassey/react-redux-realworld:v0.0.2
@simbo1905
simbo1905 / initContainerPvcWrite.sh
Created Sep 2, 2019
write out a config file to a PVCs wihin an initContainer
View initContainerPvcWrite.sh
#!/bin/bash
cat | oc create -f - <<EOF
---
apiVersion: "v1"
kind: "PersistentVolumeClaim"
metadata:
name: "config-data-claim"
spec:
accessModes:
- "ReadWriteMany"
@simbo1905
simbo1905 / GnuPG-2.2.md
Last active Aug 10, 2019 — forked from vt0r/GnuPG-2.2.md
Build/install instructions for GnuPG 2.2.x on Centos 7 and similar distros (formerly for 2.1.x)
View GnuPG-2.2.md

GnuPG 2.2.x Build Instructions

Below are my build instructions for GnuPG 2.2.9, released on July 12th, 2018. These instructions are built for a headless Centos 7 LTS server (specificaly the openshift/base-centos7 docker image).

You use the below install script to install GnuPG 2.2.x by running the following commands:

# if you are root in a docker image:
curl -OL "https://gist.githubusercontent.com/simbo1905/ba3e8af9a45435db6093aea35c6150e8/raw/83561e214e36f6556fd6b1ec0a384cf28cb2debf/install-gnupg22.sh" && bash ./install-gnupg22.sh
# else if you need to sudo to do the installs:
@simbo1905
simbo1905 / HowTo.md
Created Apr 27, 2019
debug git-secret using bashdb and visual studio code
View HowTo.md

How To

Install bashdb which you can do from source or get from a package manager. On MacOS you can brew install bashdb.

Install Visual Studio Code and the Bash Debug plugin from the marketplace. See this blog article yet I didn't have to do any upgrades of build from source things worked pretty much out of the box after installing bashdb via Homebrew.

Use the debug.sh script in this gist as the entrypoint to be able to step through code.

@simbo1905
simbo1905 / helmfile-macos.sh
Created Apr 22, 2019
installl helmfile on macOS
View helmfile-macos.sh
#!/bin/sh
# Helmfile on MacOS
brew install helm
helm plugin install https://github.com/databus23/helm-diff
helm plugin install https://github.com/futuresimple/helm-secrets
brew install helmfile
brew install gnu-getopt
@simbo1905
simbo1905 / ocd-pre-apply-hook
Created Apr 12, 2019
md5 hash secrets to detect when to bounce apps
View ocd-pre-apply-hook
#!/bin/bash
oc get secrets | md5sum > /tmp/secrets.md5
@simbo1905
simbo1905 / JPACryptoConverter.java
Last active Apr 11, 2019
JPA Converter which encrypts a column in the db
View JPACryptoConverter.java
import java.security.Key;
import java.util.Properties;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
import javax.persistence.AttributeConverter;
import javax.persistence.Converter;
import org.slf4j.Logger;
@simbo1905
simbo1905 / PwnedPaswordsMongoDB.md
Last active Feb 18, 2019
How To Load The HIBP Pwned Passwords Database Into MongoDB
View PwnedPaswordsMongoDB.md

How To Load The HIBP Pwned Passwords Database Into MongoDB

NIST recommends that when users are trying to set a password you should reject those that are commonly used or compromised:

When processing requests to establish and change memorized secrets, 
verifiers SHALL compare the prospective secrets against a list that 
contains values known to be commonly-used, expected, or compromised.

But how do you know what are the compromised passwords? Luckily Troy Hunter put a lot of effort into building the "Have I Been Pwned (HIBP)" database with the SHA1 hashes of 501,636,842 passwords that have been compromised on the internet. Sweet.

@simbo1905
simbo1905 / how-to-make-a-slack-bot.md
Last active Feb 11, 2019
how to make a botkit slack bot on OpenShift.com
View how-to-make-a-slack-bot.md

fork the botkit slack starter repo

open https://github.com/howdyai/botkit-starter-slack

create a node.js app from your fork on openshift.com

open openshift.com

register a bot on api.slack.com

You can’t perform that action at this time.