Skip to content

Instantly share code, notes, and snippets.

View breml's full-sized avatar

Lucas Bremgartner breml

View GitHub Profile
@breml
breml / script-template.sh
Last active January 8, 2021 21:49 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-d] [--no-color] [-f] -p param_value arg1 [arg2...]
@breml
breml / gnupg_scdaemon.md
Last active April 25, 2020 06:11 — forked from artizirk/gnupg_scdaemon.md
OpenPGP SSH access with Yubikey and GnuPG

OpenPGP SSH access with Yubikey and GnuPG

Yubikey, Smart Cards, OpenSC and GnuPG are pain in the ass to get working. Those snippets here sould help alleviate pain.

Yubikey Config under Ubuntu

To reset and disable not used modes on Yubikey you need the ykman program

You can install it using those commands

@breml
breml / finddirtygit.sh
Last active June 22, 2017 07:59 — forked from mrjabba/finddirtygit.sh
Find any dirty git projects as well as local only branches in the current working directory and recursively beneath this directory
#!/bin/bash
##############################################################################
# Find any dirty git projects in the current working directory
# and recursively beneath this directory
# copied with thanks to Matthew from
# https://github.com/matthewmccullough/scripts/blob/master/finddirtygit
#
# USAGE:
# finddirtygit
@breml
breml / Debug_logstash_plugins.md
Created November 30, 2015 14:05
Setup environment for debug logstash plugins

Debugging Logstash Plugins

Login shell, for rvm to work properly

/bin/bash --login

use JRuby

rvm use jruby

@breml
breml / graphite.py
Created April 28, 2014 10:50
Extended Graphite sink for statsite (https://github.com/armon/statsite) which allows to divide the counted value with the configured interval. This way the the saved values have the correct unit (e.g count/second) and is compatible with other statsd implementations (e.g. statsd by etsy or bucky). In the config-file of statsite add (where the las…
"""
Supports flushing metrics to graphite
"""
import sys
import socket
import logging
class GraphiteStore(object):
def __init__(self, host="localhost", port=2003, prefix="statsite", attempts=3, interval=10):