Skip to content

Instantly share code, notes, and snippets.

Avatar

Peter pteich

View GitHub Profile
@pteich
pteich / main.go
Last active Aug 5, 2020
Example for using go's sync.errgroup together with signal detection signal.Notify to stop all running goroutines
View main.go
package main
import (
"context"
"errors"
"fmt"
"os"
"os/signal"
"syscall"
"time"
View keybase.md

Keybase proof

I hereby claim:

  • I am pteich on github.
  • I am pteich (https://keybase.io/pteich) on keybase.
  • I have a public key ASCLynuk3IisbBsZktWF5fB9yF3mP1zgsv2aKsGNdR-Cvwo

To claim this, I am signing this object:

@pteich
pteich / Dockerfile
Created Jul 12, 2016
Tomcat Dockerfile Description
View Dockerfile
FROM tomcat:7-jre8-alpine
MAINTAINER Peter Teich <peter.teich@gmail.com>
# mit RUN werden beim Bauen des Image Shell-Befehle IM Container ausgeführt
# möglichst viele Befehle miteinmal ausführen, da nach jedem RUN ein neuer Layer im Container gespeichert wird
# Beispiel:
# RUN apt-get update && apt-get install -y build-essential curl && \
# apt-get clean && \
# rm -rf /var/lib/apt/lists/* && \
@pteich
pteich / request_wowzalisteners.go
Last active Nov 2, 2015
Request Wowza Stream Listeners
View request_wowzalisteners.go
package main
import (
"encoding/xml"
"fmt"
"io/ioutil"
"net/http"
"net/url"
httpDigestAuth "github.com/pteich/http-digest-auth-client"
@pteich
pteich / request_icecastlisteners.go
Last active Nov 21, 2018
Request Listeners Stats from Icecast
View request_icecastlisteners.go
package main
import (
"bytes"
"encoding/xml"
"fmt"
"io/ioutil"
"net/http"
"time"
)
@pteich
pteich / gist:8d43ed6dadfaa74b8b6e
Last active Aug 29, 2015
Fluentd Icecast input with request line split
View gist:8d43ed6dadfaa74b8b6e
Regex:
^(?<host>[^ ]*) (?<logname>[^ ]*) (?<user>[^ ]*) \[(?<time>[^\]]*)\] \"GET (?<request_uri>[^\?]+)\?(?<request_args>[^ ]*) (?<request_protocol>[^ ]*)\" (?<response>[^ ]*) (?<bytes>[^ ]*) \"(?<referrer>[^\"]*)\" \"(?<agent>[^\"]*)\" (?<duration>[^ ]*)
Time Format:
%d/%b/%Y:%H:%M:%S %z
fluent.conf
<source>
type tail
path /var/log/foo/bar.log
@pteich
pteich / .htaccess
Last active Aug 29, 2015
Apache Redirect non www to www subdomain (httpd.conf or .htaccess)
View .htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(?!www\.)(.+) [NC]
RewriteRule ^(.*) http://www.%1$1 [R=301,NE,L]
@pteich
pteich / bootstrap.sh
Created Oct 22, 2014
Bootstrap to setup up Vagrant Ubuntu Box with Apache, PHP, ElasticSearch, Beanstalkd and Beanstalk workers via Supervisord
View bootstrap.sh
#!/usr/bin/env bash
sudo apt-get install mc -y
wget -qO - http://packages.elasticsearch.org/GPG-KEY-elasticsearch | sudo apt-key add -
echo "deb http://packages.elasticsearch.org/elasticsearch/1.3/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch.list
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
sudo apt-get install elasticsearch -y
sudo apt-get install php5-curl -y
sudo /usr/share/elasticsearch/bin/plugin -install mobz/elasticsearch-head
You can’t perform that action at this time.