Skip to content

Instantly share code, notes, and snippets.

View ntbrock's full-sized avatar

Taylor Brockman ntbrock

  • Brain Power Software
  • Charleston, SC
View GitHub Profile
# cat geoFail2Ban.sh
#!/bin/sh
export TMP_F2B='/tmp/fail2ban.cut'
cat /var/log/fail2ban.log|grep Ban|cut -f 7 -d ' ' > $TMP_F2B
while read p; do
echo -n $p
geoiplookup $p
@ntbrock
ntbrock / sketch_MemoryAutoReset.ino
Last active August 29, 2015 14:23
Arduino UNO Sketch - Memory Auto Reset low limit SRM malloc debugging
/**
* Say hello to Sainsmart UNO China clone. Cheap on Ebay, free USB A-B charger cord.
* 30 of them arrived in a box this week!
*
*
* Sketch also works well as a memory leak reset detector example, resets on < 250 free.
*
* @github ntbrock
* @gist: Arduino UNO Sketch - Memory Auto Reset low limit SRM malloc debugging
* @repo: https://github.com/ntbrock/bobino
import scala.util.parsing.combinator._
class HeaderPsvRegexParser extends HeaderCharacterRegexParser("|") {}
class HeaderCsvRegexParser extends HeaderCharacterRegexParser(",") {}
class HeaderCharacterRegexParser(delimiterCharacter:String) extends RegexParsers
{
// 2012-Jul-20 - The parser was removing splaces.
// 2015-Jul-07 - This override is required so that internal spaces remain.
override protected val whiteSpace = """[\t]""".r
import scala.util.parsing.combinator._
class HeaderPsvRegexParser extends HeaderCharacterRegexParser("|") {}
class HeaderCsvRegexParser extends HeaderCharacterRegexParser(",") {}
class HeaderCharacterRegexParser(delimiterCharacter:String) extends RegexParsers
{
// 2012-Jul-20 - The parser was removing splaces.
// 2015-Jul-07 - This override is required so that internal spaces remain.
override protected val whiteSpace = """[\t]""".r
Sweet OpenWrt Router: https://wiki.openwrt.org/toh/wd/n750?s[]=wd&s[]=n750
WD N750 Dual Band - $50 Amazon
The Cisco SPA504G's are great, WBPN's work well @ Vagabond. 192.168.1.254 is the default login, mine are Carbonated!!!
The PolyComs boot very slowly.
The Polycom phones transmit special default authentication information with the firmware version I am using.
The password is always sent as blank, secret tip.
@ntbrock
ntbrock / index.scala.html
Last active December 19, 2015 04:09
2013Jun30 app/views/index.scala.html
@(message: String)
<!-- Pre-requisite: Browser requests main page: /index via GET ( This page loads in DOM ) -->
@main("Example AJAX Partial Search Form") {
<!-- Step 2 : Page defines a submit button plus empty div#searchResults landing zone</li> -->
<div id="searchForm">
Form
@ntbrock
ntbrock / gist:6049260
Created July 21, 2013 17:37
PartialView Controller Example. Play Framework 2.1.x Scala. Usage in conf/routes: GET /:controller/_:partial controllers.PartialView.render(controller:String, partial: String) Define this view file: app/views/DemoSix/_helloPartialWorld.scala.html Usage in Browser URL bar: http://localhost:9000/DemoSix/_helloPartialWorld Easy method to use partia…
package controllers
import java.lang.reflect.Method
import play.api._
import play.api.mvc._
import play.api.libs.{ Comet }
import play.api.libs.iteratee._
import play.api.libs.concurrent._
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ntbrock
ntbrock / 2018Jan30 Kplex and Apple OSX
Created January 31, 2018 03:18
2018Jan30 Kplex and Apple OSX
2018Jan30 Kplex and MacOS
I'm writing to share a great kplex experience from tonight!
My raspberry pi zero w with 2ndary USB wifi adapter using custom compiled hostapd wasn't coming online as expected (shocker). The marine box I had cut for it was tool small to accept a mini HDMI cable. Plus, my fancy OLED rc.local boot status wasn't indicating anything out of the norm, so I decided debugging was best done back on the Vagabond bench and the toys got put away.
That being said, the goal of the evening was set to demonstrate the GX2200 Standard Horizon w/ GPS and AIS receivers transmitting information visible on the owner's iPhone running iNavX at the helm.
In response to my failure, I cloned my ntbrock/kplex fork on OSX high sierra 10.13, make'd, and had a linked kplex binary within 45 seconds.
@ntbrock
ntbrock / Normalized Pseudo Random with Duplicates.csv
Created February 11, 2018 12:22
2018Feb Normalized Pseudo Random with Duplicates.csv
We can't make this file beautiful and searchable because it's too large.
normal_pseudo_random_duplicates, great for test cases and data noise
-0.764574114
0.408083376
-0.24238223
-0.86169594
-0.6173314
0.898663911
-1.308830494
1.16620806
-0.684488581