Skip to content

Instantly share code, notes, and snippets.

James Hale jmhale

Block or report user

Report or block jmhale

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
@jmhale
jmhale / get-container-ports.sh
Created May 3, 2019
Gets listening ports inside of a Docker container
View get-container-ports.sh
CONTAINER_PID=$(sudo docker inspect -f '{{.State.Pid}}' container_name; sudo nsenter -t $CONTAINER_PID -n netstat -ln | grep LISTEN
@jmhale
jmhale / install-doh.sh
Created Apr 25, 2019
Installs cloudflared and configures it to use Quad9's DNS-over-HTTPS (DoH)
View install-doh.sh
wget https://bin.equinox.io/c/VdrWdbjqyF/cloudflared-stable-linux-arm.tgz
tar -xvzf cloudflared-stable-linux-arm.tgz
sudo cp ./cloudflared /usr/local/bin
sudo chmod +x /usr/local/bin/cloudflared
useradd -s /usr/sbin/nologin -r -M cloudflared
cat
cat <<EOF > /etc/default/cloudflared
# Commandline args for cloudflared
View keybase.md

Keybase proof

I hereby claim:

  • I am jmhale on github.
  • I am jhale (https://keybase.io/jhale) on keybase.
  • I have a public key ASDHkIOQMIqIh7OYC9V4HqwpPaF2RZylhtjLlxoBfro4TAo

To claim this, I am signing this object:

View gist:5a27833565e5185a4838b2227765b690
aws ec2 describe-instances | jq -r '[.Reservations[].Instances[].ImageId] | unique[]'
View defcon-vpn.tf
## Temporary VPN for DEF CON
variable "dns_zone" {}
variable "dns_zone_id" {}
variable "ssh_key_id" {}
data "aws_iam_policy_document" "access-defcon-artifacts-policy-doc" {
statement {
actions = [
"s3:GetObject",
View defcon-vpc.tf
## Temporary VPC for DEF CON
variable "defcon_cidr_vpc" { default = "10.170.0.0/16" }
variable "defcon_cidr_private_east_1a" { default = "10.170.1.0/24"}
variable "defcon_cidr_private_east_1b" { default = "10.170.2.0/24"}
variable "defcon_cidr_private_east_1c" { default = "10.170.3.0/24"}
variable "defcon_cidr_public_east_1a" { default = "10.170.11.0/24"}
variable "defcon_cidr_public_east_1b" { default = "10.170.12.0/24"}
variable "defcon_cidr_public_east_1c" { default = "10.170.13.0/24"}
@jmhale
jmhale / aws-reinvent2017-security-talks.md
Last active Dec 6, 2017
Links to the AWS re:Invent 2017 Security (SID) sessions. Blatantly stolen from: https://gist.github.com/stevenringo/108922d042c4647f2e195a98e668108a, where you can find the full list of talks.
@jmhale
jmhale / okta-session-token.py
Created Nov 16, 2017
Handles MFA auth to Okta and outputs session_token
View okta-session-token.py
""" Handles auth to Okta and return session_token """
#pylint: disable=C0325
import os
from ConfigParser import RawConfigParser
from getpass import getpass
import requests
class OktaAuth(object):
""" Handles auth to Okta and returns SAML assertion """
def __init__(self, okta_profile, verbose):
You can’t perform that action at this time.