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
input {
exec {
command => "ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{print $1}'"
interval => "86400"
type => "ipv4"
}
file {
format => "plain"
message_format => "plain"
type => "yum_log"
@jalogisch
jalogisch / nxlog.conf
Last active December 16, 2015 01:09
nxlog ship gelf via UDP target can be graylog2 or logstash
<Extension gelf>
Module xm_gelf
</Extension>
<Input in>
# Use 'im_mseventlog' for Windows XP and 2003
Module im_msvistalog
Exec if ($EventID == 4202 or $EventID == 4208 or $EventID == 4302 or $EventID == 4304 or $EventID == 5004) drop();\
else{\
if ( $EventType == "INFO" ) $SyslogSeverityValue = 6;\
@jalogisch
jalogisch / logstash_syslog_to_gelf
Created April 11, 2013 07:31
This Logstash Configuration takes Syslog Messages, add some additional Fields and Information to them and send them via GELF to graylog2-radio which put them into rabbitmq transport Inspiration from: http://cookbook.logstash.net/recipes/syslog-pri/ (but little modified to match my needs) http://blog.torch.sh/post/43651465177/introducing-graylog2…
input {
tcp {
port => 514
type => syslog
}
udp {
port => 514
type => syslog
}
}
@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
@jalogisch
jalogisch / es.sh
Last active December 18, 2015 23:59
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
# NEW WAY / EASY WAY
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.1.deb
sudo dpkg -i elasticsearch-0.90.0.deb
{
"template": "logstash-*",
"settings" : {
"number_of_shards" : 2,
"number_of_replicas" : 1,
"index" : {
"query" : { "default_field" : "@message" },
"store" : { "compress" : { "stored" : true, "tv": true } }
}
},
#!/bin/bash
# per-user install
echo 'if [ -z "$(type rbenv 2> /dev/null | head -1 | grep function)" ]; then' >> ~/.bashrc
echo ' export RBENV_ROOT=/usr/local/rbenv' >> ~/.bashrc
echo ' export PATH=$RBENV_ROOT/bin:$PATH' >> ~/.bashrc
echo ' eval "$(rbenv init -)"' >> ~/.bashrc
echo 'fi' >> ~/.bashrc
@jalogisch
jalogisch / Netflix - Unitymedia | Customer Hell!
Last active May 15, 2016 09:45
I have since last Monday(2016-02-22) - first day i notice - problems getting Netflix Content into my home. - Lost in a Customer Hell between Netflix and Unitymedia
2016-02-22
During the Day (2016-01-22) i notice that Netflix is not working on my TV. I tried other Devices but always getting an Error pointing me to http://netflix.com/proxy.
I called netflix (Germany) and over 30 min the agent followed his script what need to be done (reboot the modem, change devices and use mobile data) to show me that netflix does not have a problem and i should call my ISP.
Short after that, i called my ISP. The Agent told me that this morning they got notified by the tech department that unitymedia tech is working with netflix tech on this issue.
If i use another connection - a VPN to my Server, mobile data - connection is possible. Netflix relax and say "look your ISP has an issue"
Detailed Information are written down as note to my Account.
@jalogisch
jalogisch / install_graphite_uwsgi_nginx.sh
Created April 8, 2016 18:06
install graphite with nginx and uwsgi on ubuntu 14.4 LTS
# install needed packages
apt-get install python-pip python-dev
apt-get install python-twisted python-cairo
apt-get install fontconfig python-tz
apt-get install python-django python-django-tagging
apt-get install nginx uwsgi-plugin-python uwsgi
# "little helper"
@jalogisch
jalogisch / log4j2.xml
Created May 19, 2016 11:04 — forked from joschi/log4j2.xml
Graylog REST API Access Logs
<?xml version="1.0" encoding="UTF-8"?>
<Configuration packages="org.graylog2.log4j" shutdownHook="disable">
<Appenders>
<RollingFile name="AccessLogs" fileName="/tmp/logs/access.log"
filePattern="/tmp/logs/access-%d{yyyy-MM-dd-HH-mm}-%i.log.gz">
<PatternLayout>
<Pattern>%d %-5p: %c - %m%n</Pattern>
</PatternLayout>
<Policies>
<TimeBasedTriggeringPolicy modulate="true"/>