Skip to content

Instantly share code, notes, and snippets.

Micah Hausler micahhausler

Block or report user

Report or block micahhausler

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
@micahhausler
micahhausler / Dockerfile
Created Feb 10, 2020
amazon-eks-pod-identity-webhook-issue-34
View Dockerfile
FROM php:alpine
RUN apk -U add composer && \
composer require aws/aws-sdk-php
ADD ./script.php /opt/code/script.php
CMD php /opt/code/script.php
@micahhausler
micahhausler / main.go
Last active Aug 22, 2019
CloudConfig loop vs global map benchmark
View main.go
package main
import (
"fmt"
"github.com/aws/aws-sdk-go/aws/endpoints"
"gopkg.in/gcfg.v1"
)
type CloudConfig struct {
@micahhausler
micahhausler / jq-filter.sh
Last active Oct 3, 2019
GitHub collaborator finder
View jq-filter.sh
# Go to https://developer.github.com/v4/explorer/ and enter the graphql query with the query veriable:
# {"queryString": "your-githubuser-name"}
cat results.json |
jq '.data.user.repositories.edges[] | { Count: .node.collaborators.totalCount, Repo: .node.name} | select(.Count > 2)'
@micahhausler
micahhausler / create.sh
Last active Apr 12, 2019
kops - kubernetes 1.9
View create.sh
#!/usr/bin/env bash
export CLUSTER_NAME=${CLUSTER_NAME:-example.cluster.k8s.local}
export KUBERNETES_VERSION=${KUBERNETES_VERSION:-https://storage.googleapis.com/kubernetes-release/release/v1.9.0/}
export AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION:-us-west-2}
# Get all available AZs
export AWS_AVAILABILITY_ZONES="$(aws ec2 describe-availability-zones --query 'AvailabilityZones[].ZoneName' --output text | awk -v OFS="," '$1=$1')"
# Create a unique s3 bucket name, or use an existing S3_BUCKET environment variable
View cc.yaml
coreos:
units:
- name: etcd3-peers.service
command: start
content: |
[Unit]
Description=Write a file with the etcd peers that we should bootstrap to\n",
Requires=docker.socket
After=docker.socket
@micahhausler
micahhausler / decode.py
Created Apr 5, 2017
Morse Code Decrypter
View decode.py
# See https://itunes.apple.com/us/app/medium/id828256236?mt=8, version 2.48
morse = {
".-": "A", "-...": "B", "-.-.": "C", "-..": "D", ".": "E", "..-.": "F", "--.": "G", "....": "H",
"..": "I", ".---": "J", "-.-": "K", ".-..": "L", "--": "M", "-.": "N", "---": "O", ".--.": "P",
"--.-": "Q", ".-.": "R", "...": "S", "-": "T", "..-": "U", "...-": "V", ".--": "W", "-..-": "X",
"-.--": "Y", "--..": "Z", "-----": "0", ".----": "1", "..---": "2", "...--": "3", "....-": "4",
".....": "5", "-....": "6", "--...": "7", "---..": "8", "----.": "9", "/": " ", ".-.-.-": ".",
".----.": "'", "--..--": ","}
text = (
'- .... .. ... / ..- .--. -.. .- - . / -- .- .. -. .-.. -.-- / -.-. --- -. - .- .. -. ... /'
@micahhausler
micahhausler / audit.log
Last active Feb 23, 2017
Kube-DNS SELinux
View audit.log
Feb 23 19:23:04 ip-172-31-11-231.us-west-2.compute.internal audit[32554]: AVC avc: denied { open } for pid=32554 comm="dashboard" path="/public/en/index.html" dev="overlay" ino=48298053 scontext=system_u:system_r:svirt_lxc_net_t:s0:c370,c736 tcontext=system_u:object_r:unlabeled_t:s0 tclass=file permissive=1
Feb 23 19:24:56 ip-172-31-11-231.us-west-2.compute.internal audit[10853]: AVC avc: denied { execute } for pid=10853 comm="exechealthz" name="sh" dev="xvdb" ino=2490773 scontext=system_u:system_r:svirt_lxc_net_t:s0:c399,c912 tcontext=system_u:object_r:unlabeled_t:s0 tclass=file permissive=1
Feb 23 19:24:56 ip-172-31-11-231.us-west-2.compute.internal audit[10853]: AVC avc: denied { read open } for pid=10853 comm="exechealthz" path="/bin/sh" dev="overlay" ino=138907031 scontext=system_u:system_r:svirt_lxc_net_t:s0:c399,c912 tcontext=system_u:object_r:unlabeled_t:s0 tclass=file permissive=1
Feb 23 19:24:56 ip-172-31-11-231.us-west-2.compute.internal audit[10853]: AVC avc: denied { execute_no_trans }
View bashrc
NORMAL="\[\033[00m\]"
BLUE="\[\033[01;34m\]"
RED="\[\e[1;31m\]"
YELLOW="\[\e[1;33m\]"
GREEN="\[\e[1;32m\]"
PS1_WORKDIR="\w"
PS1_HOSTNAME="\h"
PS1_USER="\u"
__kube_ps1()
@micahhausler
micahhausler / kube-dns.yaml
Last active Aug 24, 2016
Prometheus Error scraping skydns
View kube-dns.yaml
apiVersion: v1
kind: Service
metadata:
name: kube-dns
namespace: kube-system
labels:
k8s-app: kube-dns
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "KubeDNS"
annotations:
@micahhausler
micahhausler / stdout
Created May 19, 2016
sbt assembly error
View stdout
[error] Class java.time.Duration not found - continuing with a stub.
[error] Class java.time.Duration not found - continuing with a stub.
[error] missing or invalid dependency detected while loading class file 'DefaultWrites.class'.
[error] Could not access type Instant in value java.time,
[error] because it (or its dependencies) are missing. Check your build definition for
[error] missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.)
[error] A full rebuild may help if 'DefaultWrites.class' was compiled against an incompatible version of java.time.
[error] missing or invalid dependency detected while loading class file 'DefaultWrites.class'.
[error] Could not access type LocalDate in value java.time,
[error] because it (or its dependencies) are missing. Check your build definition for
You can’t perform that action at this time.