Skip to content

Instantly share code, notes, and snippets.

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

Bill Smargiassi smarj

🏠
Working from home
  • GitHub Staff
  • New Jersey
View GitHub Profile
@smarj
smarj / example_errors.md
Created April 13, 2018 16:56 — forked from angrycub/example_errors.md
Examples of Riak Error Log Messages

eacces

Note: It is not eaccess

An example created when the ring folder is not owned by the user riak is running as:

2015-06-23 14:57:43.073 [error] <0.154.0>@riak_core_ring_manager:do_write_ringfile:236 Unable to write ring to "./data/ring/riak_core_ring.default.20150623185743" - {badmatch,{error,eacces}}

emfile

@smarj
smarj / check-debugs.sh
Created May 5, 2016 15:39 — forked from angrycub/check-debugs.sh.md
Forever WIP preprocessor for a cluster's worth of Riak Debugs. Catches some of the faves and biggies
#! /bin/bash
echo Creating Combined console.log
for I in *-riak-debug; do NODE=${I//-riak-debug/}; echo " Processing ${NODE}..."; for J in $I/logs/platform_log_dir/console.lo*; do sed -n -e '/^2015/!{H;d;};/^2015/{x;s/\n/ /g;p;};${x;s/\n/ /g;p;}' $J | awk '!/^$/{print $1"T"$2,"'${NODE}'",$0}' | sed 's/\([^ ]*\) \([^ ]*\) \([^ ]*\) \([^ ]*\) \(.*\)/\1 \2 \5/' >> temp.log ; done; done; sort temp.log > combined_console.log;rm temp.log;
echo Creating Combined error.log
for I in *-riak-debug; do NODE=${I//-riak-debug/}; echo " Processing ${NODE}..."; for J in $I/logs/platform_log_dir/error.lo*; do sed -n -e '/^2015/!{H;d;};/^2015/{x;s/\n/ /g;p;};${x;s/\n/ /g;p;}' $J | awk '!/^$/{print $1"T"$2,"'${NODE}'",$0}' | sed 's/\([^ ]*\) \([^ ]*\) \([^ ]*\) \([^ ]*\) \(.*\)/\1 \2 \5/' >> temp.log ; done; done; sort temp.log > combined_error.log;rm temp.log;
echo Checking for LevelDB Compaction Errors
find . -name "LOG" -exec grep -l 'Compaction error' {} \;
@smarj
smarj / makeAnyPdfExcel.rb
Last active December 14, 2015 05:29 — forked from sck/makeAnyPdfSearchable.rb
makeAnyPdfSearchable.rb and makeAnyPdfExcel.rb
#! /usr/bin/env ruby
require 'tmpdir'
def fixed?(fn) fn =~ /\.searchable\.pdf/; end
def searchable_fn(fn)
return fn if fixed?(fn)
"#{File.dirname(fn)}/#{File.basename(fn, File.extname(fn))}.searchable.pdf"
end
@smarj
smarj / isa-fields.rb
Created January 10, 2013 16:27
ISA W3C Logging Fields as a Ruby Hash
FLD = { "c-ip" => 0, "cs-username" => 1, "c-agent" => 2, "sc-authenticated" => 3, "date" => 4, "time" => 5, "s-svcname" => 6,
"s-computername" => 7, "cs-referred" => 8, "r-host" => 9, "r-ip" => 10,
"r-port" => 11, "time-taken" => 12, "sc-bytes" => 13, "cs-bytes" => 14,
"cs-protocol" => 15, "cs-transport" => 16, "s-operation" => 17,
"cs-uri" => 18, "cs-mime-type" => 19, "s-object-source" => 20,
"sc-status" => 21, "s-cache-info" => 22, "rule" => 23,
"FilterInfo" => 24, "cs-Network" => 25, "sc-Network" => 26,
"error-info" => 27, "action" => 28, "GmtLogTime" => 29,
"AuthenticationServer" => 30 }