Skip to content

Instantly share code, notes, and snippets.


Ryan D ryan0x44

View GitHub Profile
ryan0x44 /
Created Jul 9, 2018
Node/NPM/Yarn via Docker Run

To start a bash prompt with only Docker installed on your host OS, run the following command:

docker run --rm -v $PWD:/src -w /src -u node -it node /bin/bash

Here's what each parameter does:

  • --rm removes the container once you exit
  • -v $PWD:/src will mount your current host working directory into /src inside the container
#!/bin/bash -e
# Using the "hello-world" image as an example
# `CMD ["/hello"]`
docker pull hello-world
docker inspect -f "{{.Config.Cmd}}" hello-world | cut -f2 -d "[" | cut -f1 -d "]"
# produces: `/hello`
ryan0x44 /
Created Feb 27, 2018
Preview Markdown in Chrome
TMP_FILE=$(mktemp); pandoc $MD_FILE > $TMP_FILE; open -a "Google Chrome" $TMP_FILE && rm $TMP_FILE
ryan0x44 /
Created Feb 24, 2018
Find out how many times your password has been pwned
# set pw to the password you want to lookup (of course, be careful with writing this to your shell history or unencrypted disk!)
# this will output the number of times it has been pwned
s=$(echo -n $pw | openssl sha1 | tr '[a-z]' '[A-Z]'); curl -s "${s:0:5}" | grep "${s:5}" | cut -d ":" -f 2
ryan0x44 /
Created Nov 28, 2017
Send events to Sentry from bash
#!/bin/bash -e
# sentry_event params: [event_id] [culprit] [message] [optional:extra]
sentry_event() {
# Get current unix timestamp
TIMESTAMP=`date +%s`
# Parse DSN
TEMP=`echo $SENTRY_DSN | cut -d '/' -f3`
ryan0x44 /
Last active Feb 12, 2020
Java Checkstyle Cyclomatic Complexity Example
public class Example1 {
public static void main(String[] args) {
int a = 0;
if (a >= 0) {
System.out.println(">= 0");
if (a != 0) {
System.out.println("!= 0");
} else {
System.out.println("< 0");

Keybase proof

I hereby claim:

  • I am ryan0x44 on github.
  • I am ryan0x44 ( on keybase.
  • I have a public key ASCsZYdRwGWRK1gYhgSx3v1G8iOsgDazCUh6pM8ePLDifwo

To claim this, I am signing this object:

ryan0x44 /
Created Nov 19, 2015
Blue-Green AWS Auto Scaling Deployments with Terraform

A quick note on how I'm currently handling Blue/Green or A/B deployments with Terraform and AWS EC2 Auto Scaling.

In my particular use case, I want to be able to inspect an AMI deployment manually before disabling the previous deployment.

Hopefully someone finds this useful, and if you have and feedback please leave a comment or email me.


I build my AMI's using Packer and Ansible.

You can’t perform that action at this time.