Skip to content

Instantly share code, notes, and snippets.

Richard Metzler rmetzler

Block or report user

Report or block rmetzler

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
@rmetzler
rmetzler / vault_logrotate
Created Jul 3, 2019 — forked from soloradish/vault_logrotate
logrotate setting file for HashiCorp's Vault audit file
View vault_logrotate
# Change the path below to your own audit log path.
/var/log/vault/audit.log {
rotate 30
daily
# Do not execute rotate if the log file is empty.
notifempty
missingok
compress
# Set compress on next rotate cycl to prevent entry loss when performing compression.
delaycompress
@rmetzler
rmetzler / systemdunit.py
Created Jun 14, 2019 — forked from esamattis/systemdunit.py
Install Systemd units using Ansible
View systemdunit.py
"""
Install Systemd units using Ansible
Handles unit restarting and systemd daemon reloading when the unit changes.
Also stops the unit correctly when uninstalled
In your playbook put this file to library/systemdunit.py and make sure the
server has python-sh package installed
@rmetzler
rmetzler / test.py
Created Jun 5, 2019 — forked from dmsimard/test.py
ara with ansible-runner
View test.py
#!/usr/bin/env python3
# Proof of concept ara with ansible-runner
# Requires https://github.com/ansible/ansible-runner/issues/219#issuecomment-496191227
import ansible_runner
import os
from ara.setup import callback_plugins
PLAYBOOK = """
- name: Test for ansible-runner
View neo4j.debug.log
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 Apr 24, 2019
use fzf to switch between azure accounts
View fuzzy-azure-account-switch
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 Apr 21, 2019 — forked from tuxfight3r/tcp_flags.txt
tcpdump - reading tcp flags
View tcp_flags.txt
##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 Apr 18, 2019
kubectl top node,pod
View kubectl-top-node-pods.sh
#!/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/' \
View wait_for_http_200_ok.sh
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
}
View ssh-docker-vm.sh
#!/bin/bash
screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty
@rmetzler
rmetzler / ssh-d4m
Created Dec 12, 2018
SSH into Docker for Mac xhyve VM
View ssh-d4m
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
You can’t perform that action at this time.