Skip to content

Instantly share code, notes, and snippets.

View lifeofguenter's full-sized avatar
💭
I'm just a thin layer on top of AWS

Günter Grodotzki lifeofguenter

💭
I'm just a thin layer on top of AWS
View GitHub Profile
@lifeofguenter
lifeofguenter / browsertest.php
Created October 25, 2017 05:30
simply test two selenium servers
<?php
error_reporting(E_ALL);
ini_set('display_errors', true);
chdir(__DIR__);
if (!file_exists('vendor/autoload.php')) {
echo 'Please run:' . PHP_EOL;
echo 'composer require facebook/webdriver' . PHP_EOL;
@lifeofguenter
lifeofguenter / 01-nginx.conf
Last active November 7, 2017 13:52
Laravel on Nginx + PHP-FPM (replace APP_DOMAIN)
user www-data www-data;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
worker_processes auto;
worker_rlimit_nofile 100000;
pcre_jit on;
events {
use epoll;
@lifeofguenter
lifeofguenter / bash-completion-ssh.sh
Created November 10, 2017 09:48
~/.bash_completion.d/
# http://fahdshariff.blogspot.co.za/2011/04/writing-your-own-bash-completion.html
# https://unix.stackexchange.com/a/181603/111459
_ssh() {
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts=$(grep --no-messages '^Host' ~/.ssh/config ~/.ssh/config.d/* | grep -v '[?*]' | cut -d ' ' -f 2-)
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )

Keybase proof

I hereby claim:

  • I am lifeofguenter on github.
  • I am lifeofguenter (https://keybase.io/lifeofguenter) on keybase.
  • I have a public key ASCN7Zk0DWmLpu7GNeuYjrDdzR3wz-de3yQ_AO9f376EXgo

To claim this, I am signing this object:

tpl::render() {
local assign_re='@@([A-Za-z0-9_]+)@@'
while IFS='' read -r line || [[ -n "${line}" ]]; do
while [[ "${line}" =~ $assign_re ]]; do
line="${line/${BASH_REMATCH[0]}/${!BASH_REMATCH[1]}}"
done
echo "${line}"
done < "${1}"
}
@lifeofguenter
lifeofguenter / aws.sh
Created November 7, 2018 10:08
bash_profile functions
# will search either by instance-name or instance-id
# on instance-id it will return the first match, on instance-name it will return all matches
# will iterate through all your ~/.aws/credentials profiles
#
# Usage: aws-find-ec2 NAME-OR-INSTANCE-ID
# Example output:
# ~  aws-find-ec2 i-1234567abcdefghijk
# - checking company-master...
# - checking company-development...
# asg-platform / i-1234567abcdefghijk / 172.0.1.200
@lifeofguenter
lifeofguenter / Z
Last active November 11, 2018 21:14
NZBGet Transcoders
#!/bin/bash
##############################################################################
### NZBGET POST-PROCESSING SCRIPT ###
# Move files if all daisy-chained PP prior succeeded.
# Version: 0.1.0
#
#
# NOTE: For support visit the forum thread: http://nzbget.net/forum/viewtopic.php?f=8&t=1265
@lifeofguenter
lifeofguenter / lighttpd-libressl.patch
Last active December 8, 2018 11:24
Lighttpd 1.4.35 + LibreSSL 2.0.5 Patch
--- a/configure 2014-08-11 12:45:44.000000000 +0200
+++ b/configure 2014-08-11 12:52:00.000000000 +0200
@@ -14330,9 +14330,9 @@
if test "x$use_openssl" = "xyes"; then
- if test "x$use_kerberos" != "xyes"; then
- CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_KRB5"
- fi
+# if test "x$use_kerberos" != "xyes"; then
@lifeofguenter
lifeofguenter / jenkins-cleanup-nodes.sh
Created March 23, 2018 05:58
cleanup offline nodes (jenkins / ecs)
#!/usr/bin/env bash
throw_exception() {
echo "Ooops!"
echo 'Stack trace:' 1>&2
while caller $((n++)) 1>&2; do :; done;
exit 1
}
set -E
@lifeofguenter
lifeofguenter / firefox.desktop
Last active July 5, 2019 22:29
Desktop files
[Desktop Entry]
Name=Firefox
Comment=Web Browser
GenericName=Web Browser
X-GNOME-FullName=Firefox Web Browser
Exec=env MOZ_ACCELERATED=1 MOZ_WEBRENDER=1 /opt/firefox/firefox %u
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=/opt/firefox/browser/chrome/icons/default/default128.png