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
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}"
}

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:

@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}) )
@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 / 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 / katest.php
Created July 22, 2016 14:54
keep-alive benchmark tool in php ($ php katest.php -m 100 http://localhost/)
<?php
// debug
error_reporting(E_ALL);
ini_set('display_errors', true);
ini_set('html_errors', false);
function clrf($num = 1)
{
return str_repeat("\r\n", $num);
#!/bin/bash
##############################################################################
# $Id: checkinstall,v 1.6.3.1 2010/02/10 14:42:32 izto Exp $
# ########################
#
#
# CheckInstall v1.6.3
#
# Installs a compiled program from the program's source directory using
# "make install" or any other command supplied on checkinstall's command
@lifeofguenter
lifeofguenter / lighttpd-1.4.37-mod_ssi-no-etag.patch
Created September 20, 2015 12:20
[PATCH] Lighttpd 1.4.37 mod_ssi: remove ETag and Last-Modified Headers from response/output.
--- a/src/mod_ssi.c 2015-05-14 11:34:41.000000000 +0200
+++ b/src/mod_ssi.c 2015-09-20 14:15:16.927322005 +0200
@@ -36,7 +36,6 @@
# include <sys/filio.h>
#endif
-#include "etag.h"
#include "version.h"
/* The newest modified time of included files for include statement */
@lifeofguenter
lifeofguenter / Bee.php
Created November 22, 2014 14:30
sample hunspell/enchant usage
<?php
namespace Weheartwebsites\Spelling;
use Exception;
class Bee
{
protected $broker;
<?php
error_reporting(E_ALL);
ini_set('display_errors', true);
define('SSH_HOST', '');
define('SSH_PORT', 666);
define('SSH_USER', '');
define('SSH_PASS', '');
define('REMOTE_PATH', '/var/www/');