Skip to content

Instantly share code, notes, and snippets.

View jalogisch's full-sized avatar
🏠
Working from home

Jan Doberstein jalogisch

🏠
Working from home
View GitHub Profile
@jalogisch
jalogisch / ca.md
Created September 4, 2017 11:22 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@jalogisch
jalogisch / nginx_graylog.conf
Last active August 23, 2017 14:50
Graylog behind NGINX Proxy in a sub-directory
# Graylog in Subdirectorie
#
# server.conf settings:
# rest_listen_uri = http://192.168.10.11:9000/serveurgraylog/api/
# web_listen_uri = http://192.168.10.11:9000/serveurgraylog/
#
server {
listen 80 ;
server_name g1422.lan;
@jalogisch
jalogisch / dnsmasq_clean_message
Last active April 17, 2017 12:04
pi-hole / dnsmasq pipeline rules to use with graylog pipeline rules
rule "dnsmasq clean message"
when
has_field("programname") AND contains(to_string($message.programname), "dnsmasq")
then
let m = regex("^.+: (.+)$", to_string($message.message));
let clean_message = m["0"];
// Set a better message field without the prefix clutter.
set_field("message", clean_message);
end
@jalogisch
jalogisch / 0_reuse_code.js
Created February 7, 2017 09:42
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

Keybase proof

I hereby claim:

  • I am jalogisch on github.
  • I am jalogisch (https://keybase.io/jalogisch) on keybase.
  • I have a public key whose fingerprint is A19B F39B 7474 7846 4184 AAFC 70C7 FC35 A4E8 36F8

To claim this, I am signing this object:

@jalogisch
jalogisch / haproxy
Created September 9, 2016 15:32
tcp_syslog_haproxy configuration
listen syslog_tcp_514
bind *:514
mode tcp
timeout client 120s
timeout server 120s
default-server inter 2s downinter 5s rise 3 fall 2 maxconn 64 maxqueue 128 weight 100
server graylog1 192.168.55.201:51400 check
server graylog2 192.168.55.202:51400 check
server graylog3 192.168.55.203:51400 check
@jalogisch
jalogisch / ghost_pipeline_extract_messages
Created August 1, 2016 10:15
this is the pipeline rule to get the information of ghost blog log that is started/monitored by systemd into useful fields in graylog
rule "extract_ghost_blog_from_systemd_log"
when
has_field("programname") AND to_string($message.programname) == "Ghost"
then
let message_field = to_string($message.message);
let action = grok(pattern: "%{COMBINEDAPACHELOG}", value: message_field);
set_fields(action);
end
@jalogisch
jalogisch / jekyll-import.php
Created June 23, 2016 16:58 — forked from tylerhall/jekyll-import.php
Import a Jekyll posts directory into WordPress
<?PHP
require '/path/to/markdown-extra.php';
$db = mysql_connect('localhost', 'root', 'password') or die(mysql_error());
mysql_select_db('tylerio', $db) or die(mysql_error());
$files = scandir('posts');
array_shift($files); // .
array_shift($files); // ..
@jalogisch
jalogisch / rsyslog_to_graylog.conf
Created April 11, 2013 07:44
rsyslog.conf for Graylog2 Forward of ESX Syslog Messages and remove the Information Overflow
$template GRAYLOG2,"<%PRI%>1 %timegenerated:::date-rfc3339% %HOSTNAME% %syslogtag% - %APP-NAME%: %msg:::drop-last-lf%\n"
$ActionForwardDefaultTemplate GRAYLOG2
$PreserveFQDN on
*.err;*.crit;*.alert;*.emerg;cron.*;auth,authpriv.* @GRAYLOG_SERVER:PORT
server
{
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name graylog.example.org;
location /api/
{
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $host;