Skip to content

Instantly share code, notes, and snippets.

Ali Nabavi hourback

Block or report user

Report or block hourback

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hourback
hourback / Exception.rb
Last active Nov 13, 2015 — forked from stuart-warren/Exception.rb
Windows Event log via nxlog (json) -> logstash 1.2 config
View Exception.rb
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 Nov 19, 2018
I'm using this to clean up between installations of Ambari and HDP.
View remove-ambari-and-hadoop.sh
#!/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 Aug 29, 2015
Lua decoder for Heka, for reading in WebSphere SystemOut.log files with unrecognized time stamp format
View Input
[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 Apr 7, 2015
My Upstart script for starting/stopping hekad on CentOS 6.6
View hekad.conf
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
View hekad.toml
[hekad]
maxprocs = 2
[secure]
type = "LogstreamerInput"
log_directory = "/var/log"
file_match = 'secure'
decoder = "RsyslogDecoder"
[messages]
@hourback
hourback / nxlog
Last active Aug 29, 2015
A SysV init script for nxlog on RHEL 5 box (/etc/init.d/nxlog)
View 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
View check_docker_container.sh
#!/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 Aug 29, 2015
Setting up dev and deployment environment for fanotification
View setup.sh
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 Aug 29, 2015
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.
View add_routes.bat
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
View gist:471469e58498bc89738a
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
You can’t perform that action at this time.