Skip to content

Instantly share code, notes, and snippets.

View hourback's full-sized avatar

Ali Jonathan Nabavi hourback

View GitHub Profile
anab@osidev-ws23:/storage/opt/android-sdk-linux/platform-tools$ cat recovery.log
Starting TWRP 2.3.1.0 on Tue Nov 6 16:33:13 2012
I:Internal path defined: '/sdcard'
I:External path defined: '/sdcard2'
Starting the UI...Pixel format: 720x1280 @ 32bpp
Pixel format: BGR_565
framebuffer: fd 3 (720 x 1280)
=> Linking mtab
=> Processing recovery.fstab
I:Processing '/boot'
@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 / 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 / gist:3136792
Created July 18, 2012 15:14
Failing tests
anab@osidev-ws23:~/Dropbox/projects/tnt_testing/ringojs$ ringo test.js
================================================================================
+ Running test AssertionError instanceof Error ... PASSED (17 ms)
+ Running test ok false ... PASSED (3 ms)
+ Running test ok(true) ... PASSED (0 ms)
+ Running test ok("test") ... PASSED (0 ms)
+ Running test equal true false ... PASSED (2 ms)
+ Running test equal null null ... PASSED (0 ms)
+ Running test equal undefined undefined ... PASSED (0 ms)
+ Running test equal null undefined ... PASSED (0 ms)
@hourback
hourback / tnt.js
Created July 17, 2012 19:24
RingoJS & Selenium
importPackage(org.openqa.selenium.firefox.FirefoxDriver);
var driver = new FirefoxDriver();
driver.get("http://www.google.com");
@hourback
hourback / solr_index.js
Created July 9, 2012 19:46
Handling XML output from Solr
var http = require('http-get');
var parser = require('libxml-to-js');
var util = require('util');
var options = {url: 'http://localhost:8080/solr/core1/dataimportdevelopment?command=status'};
var obj = (function(){
var mycallback = function (error, result) {
var xml = "";
@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