Skip to content

Instantly share code, notes, and snippets.

View rmetzler's full-sized avatar
💭
Recruiters should mention the role and salary range if you spam me.

Richard Metzler rmetzler

💭
Recruiters should mention the role and salary range if you spam me.
View GitHub Profile
2019-04-30 20:35:04.933+0000 WARN [io.netty.channel.AbstractChannelHandlerContext] An exception 'java.lang.OutOfMemoryError: Java heap space' [enable DEBUG level for full stacktrace] was thrown by a user handler's exceptionCaught() method while handling the following exception:
2019-04-30 20:35:04.933+0000 WARN [io.netty.channel.AbstractChannelHandlerContext] An exception 'java.lang.OutOfMemoryError: Java heap space' [enable DEBUG level for full stacktrace] was thrown by a user handler's exceptionCaught() method while handling the following exception:
2019-04-30 20:35:04.935+0000 ERROR [o.n.b.r.DefaultBoltConnection] Unable to close pack output of bolt session 'bolt-181'.
java.lang.NullPointerException
at org.neo4j.bolt.v1.transport.ChunkedOutput.close(ChunkedOutput.java:231)
at org.neo4j.bolt.runtime.DefaultBoltConnection.close(DefaultBoltConnection.java:313)
at org.neo4j.bolt.runtime.DefaultBoltConnection.processNextBatch(DefaultBoltConnection.java:242)
at org.neo4j.bolt.runt
@rmetzler
rmetzler / fuzzy-azure-account-switch
Created April 24, 2019 11:12
use fzf to switch between azure accounts
function faz() {
az account set --subscription $(az account list -o table | fzf | cut -c '62-98')
az account show
}
@rmetzler
rmetzler / tcp_flags.txt
Created April 21, 2019 07:43 — forked from tuxfight3r/tcp_flags.txt
tcpdump - reading tcp flags
##TCP FLAGS##
Unskilled Attackers Pester Real Security Folks
==============================================
TCPDUMP FLAGS
Unskilled = URG = (Not Displayed in Flag Field, Displayed elsewhere)
Attackers = ACK = (Not Displayed in Flag Field, Displayed elsewhere)
Pester = PSH = [P] (Push Data)
Real = RST = [R] (Reset Connection)
Security = SYN = [S] (Start Connection)
@rmetzler
rmetzler / kubectl-top-node-pods.sh
Last active April 18, 2019 12:35
kubectl top node,pod
#!/bin/bash
join -a 1 -1 1 -2 2 \
<(kubectl top node | sed -e 's/NAME/NODE/') \
<( \
join -1 1 -2 1 \
-o 1.1,2.7,1.2,1.3 \
<(kubectl top pod) \
<(kubectl get pod -o wide) \
| sed -e 's/NAME/POD/' \
@rmetzler
rmetzler / wait_for_http_200_ok.sh
Last active January 26, 2019 08:25
waiting for http
function wait_for_http_200_ok(){
URL="$1"
timeout="$((SECONDS+60))"
while true; do
HTTP_CODE=$( curl --silent --write-out %{http_code} --output /dev/null ${URL} )
[[ "200" = "$HTTP_CODE" ]] && break
[[ "${SECONDS}" -ge "${timeout}" ]] && echo "timed out waiting for ${URL}" && exit 1
sleep 1
done
}
@rmetzler
rmetzler / ssh-docker-vm.sh
Created December 12, 2018 12:08 — forked from abdennour/ssh-docker-vm.sh
ssh-docker-for-mac
#!/bin/bash
screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty
@rmetzler
rmetzler / ssh-d4m
Created December 12, 2018 12:08
SSH into Docker for Mac xhyve VM
1. screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
2. when done use CTRL-A CTRL-\ and then y (for yes) to exit
Alternative method:
1. docker run -it --privileged --pid=host debian nsenter -t 1 -m -u -n -i sh
@rmetzler
rmetzler / poc.rb
Created December 9, 2018 15:09 — forked from zelivans/poc.rb
CVE-2018-1002105 exploit
#!/usr/bin/env ruby
require 'socket'
require 'openssl'
require 'json'
host = 'kubernetes'
metrics = '/apis/metrics.k8s.io/v1beta1'
sock = TCPSocket.new host, 443
@rmetzler
rmetzler / starttmux.sh
Created December 6, 2018 18:30 — forked from todgru/starttmux.sh
Start up tmux with custom windows, panes and applications running
#!/bin/sh
#
# Setup a work space called `work` with two windows
# first window has 3 panes.
# The first pane set at 65%, split horizontally, set to api root and running vim
# pane 2 is split at 25% and running redis-server
# pane 3 is set to api root and bash prompt.
# note: `api` aliased to `cd ~/path/to/work`
#
session="work"
@rmetzler
rmetzler / cors.nginxconf
Created November 29, 2018 08:33 — forked from pauloricardomg/cors.nginxconf
Nginx configuration for CORS-enabled HTTPS proxy with origin white-list defined by a simple regex
#
# Acts as a nginx HTTPS proxy server
# enabling CORS only to domains matched by regex
# /https?://.*\.mckinsey\.com(:[0-9]+)?)/
#
# Based on:
# * http://blog.themillhousegroup.com/2013/05/nginx-as-cors-enabled-https-proxy.html
# * http://enable-cors.org/server_nginx.html
#
server {