Skip to content

Instantly share code, notes, and snippets.

View hourback's full-sized avatar

Ali Jonathan Nabavi hourback

View GitHub Profile
@hourback
hourback / Exception.rb
Last active November 13, 2015 21:07 — forked from stuart-warren/Exception.rb
Windows Event log via nxlog (json) -> logstash 1.2 config
Exception in filterworker {"exception"=>#<NoMethodError: undefined method `[]=' for nil:NilClass>, "backtrace"=>["file:/opt/logstash/logstash.jar!/logstash/event.rb:135:in `[]='", "org/jruby/RubyProc.java:255:in `call'", "(eval):9:in `exec'", "org/jruby/RubyProc.java:255:in `call'", "file:/opt/logstash/logstash.jar!/logstash/util/fieldreference.rb:44:in `exec'", "file:/opt/logstash/logstash.jar!/logstash/event.rb:134:in `[]='", "file:/opt/logstash/logstash.jar!/logstash/filters/mutate.rb:234:in `rename'", "org/jruby/RubyHash.java:1332:in `each'", "file:/opt/logstash/logstash.jar!/logstash/filters/mutate.rb:232:in `rename'", "file:/opt/logstash/logstash.jar!/logstash/filters/mutate.rb:205:in `filter'", "(eval):127:in `initialize'", "org/jruby/RubyProc.java:255:in `call'", "file:/opt/logstash/logstash.jar!/logstash/pipeline.rb:243:in `filter'", "file:/opt/logstash/logstash.jar!/logstash/pipeline.rb:191:in `filterworker'", "file:/opt/logstash/logstash.jar!/logstash/pipeline.rb:134:in `start_filters'"], :level=>:
@hourback
hourback / remove-ambari-and-hadoop.sh
Last active April 9, 2020 16:14
I'm using this to clean up between installations of Ambari and HDP.
#!/bin/bash
ambari-server stop
ambari-server reset
ambari-agent stop
service mysqld stop
service postgresql stop
python /usr/lib/python2.6/site-packages/ambari_agent/HostCleanup.py
@hourback
hourback / Input
Last active August 29, 2015 14:19
Lua decoder for Heka, for reading in WebSphere SystemOut.log files with unrecognized time stamp format
[4/23/15 4:49:49:371 CDT] 00003a01 CoordinatorCo E HMGR0140E: An event indicating that the core group membership is inconsistent was received. Recovery failed. The exception is com.ibm.ws.hamanager.runtime.config.ServerIndexNodeException: serverindex for node janmsdlxwas04 does not contain server celig1_janmsdlxwas04_cnataraj
at com.ibm.ws.hamanager.runtime.config.CoreGroupProcesses$ServerIndexParser.getServerIndexForServer(CoreGroupProcesses.java:376)
at com.ibm.ws.hamanager.runtime.config.CoreGroupProcesses.<init>(CoreGroupProcesses.java:135)
at com.ibm.ws.hamanager.runtime.config.CoreGroupConfig.<init>(CoreGroupConfig.java:113)
at com.ibm.ws.hamanager.runtime.config.StateBlobBuilder.buildBlob(StateBlobBuilder.java:104)
at com.ibm.ws.hamanager.runtime.CoordinatorComponentImpl$InconsistentDefinedSetHandler.run(CoordinatorComponentImpl.java:1127)
at java.lang.Thread.run(Thread.java:738)
.
[4/23/15 4:50:30:005 CDT] 0000002e DiscoveryRcv I DCSV1031I: DCS Stac
@hourback
hourback / hekad.conf
Created April 7, 2015 17:37
My Upstart script for starting/stopping hekad on CentOS 6.6
description "Heka daemon"
author "Ali Nabavi"
start on runlevel [235]
stop on runlevel [06]
console output
exec /opt/heka/bin/hekad --config=/usr/local/etc/hekad.toml | logger
[hekad]
maxprocs = 2
[secure]
type = "LogstreamerInput"
log_directory = "/var/log"
file_match = 'secure'
decoder = "RsyslogDecoder"
[messages]
@hourback
hourback / nxlog
Last active August 29, 2015 14:18
A SysV init script for nxlog on RHEL 5 box (/etc/init.d/nxlog)
#! /bin/bash
#
# nxlog Start/Stop the nxlog log handler
#
# chkconfig: 2345 90 60
# description: nxlog is an open-source, cross-platform log handler.
# processname: nxlog
# config: /usr/local/etc/nxlog/nxlog.conf
# pidfile: /var/run/nxlog.pid
#!/bin/bash
# Author: Erik Kristensen
# Email: erik@erikkristensen.com
# License: MIT
# Nagios Usage: check_nrpe!check_docker_container!_container_id_
# Usage: ./check_docker_container.sh _container_id_
#
# The script checks if a container is running.
# OK - running
@hourback
hourback / setup.sh
Last active August 29, 2015 14:09
Setting up dev and deployment environment for fanotification
sudo docker run -v /fanotification-webapp-dev -v /fanotification-webapp-deployment -v /fanotification-server-dev -v /fanotification-server-deployment --name my-data busybox true
@hourback
hourback / add_routes.bat
Last active August 29, 2015 14:07
Static routes for routing certain requests through friendlier interfaces. The first file is the Windows batch file I originally used, and the second it the Go program I wrote to do the lookup dynamically.
REM archive.ubuntu.com
route add 91.189.92.201 mask 255.255.255.255 172.16.1.1
route add 91.189.92.200 mask 255.255.255.255 172.16.1.1
route add 91.189.91.15 mask 255.255.255.255 172.16.1.1
route add 91.189.91.14 mask 255.255.255.255 172.16.1.1
route add 91.189.91.13 mask 255.255.255.255 172.16.1.1
route add 91.189.88.153 mask 255.255.255.255 172.16.1.1
route add 91.189.88.149 mask 255.255.255.255 172.16.1.1
REM pastebin.com
route add 190.93.241.15 mask 255.255.255.255 172.16.1.1
2014/10/02 22:13:27 Entering PostNotification....
2014/10/02 22:13:27 &{0xc210047240 {<nil>}}
2014/10/02 22:13:27 decoder is: &{0x976c20 [] {[] 0 {<nil> false [] <nil> false 0 <nil> 0} {<nil> false [] <nil> false 0 <nil> 0} <nil
> false} {<nil> false [] <nil> false 0 <nil> 0} <nil>}
2014/10/02 22:13:27 http: panic serving 192.168.59.3:24847: EOF
goroutine 3 [running]:
net/http.func·009()
/usr/lib/go/src/pkg/net/http/server.go:1093 +0xae
runtime.panic(0x651de0, 0xc21000a030)
/usr/lib/go/src/pkg/runtime/panic.c:248 +0x106