Skip to content

Instantly share code, notes, and snippets.

View chrisxaustin's full-sized avatar

Chris Austin chrisxaustin

  • Somerville, MA, US
View GitHub Profile
@chrisxaustin
chrisxaustin / log inbound syslog sources
Last active May 10, 2017 17:07
log inbound syslog sources
sudo tcpdump -ntlp port 514 2>/dev/null| perl -ne 'next unless /^IP (.*).[0-9]* >/; print $1,$/ if !$d{$1}++'
@chrisxaustin
chrisxaustin / jgrep
Created April 28, 2016 22:06
grep within all .java files within this directory and all child directories
#!/bin/sh
# Usage: jgrep foo
# Searches all java files under the current directory
grep -i "$*" `find . -name '*.java'`
@chrisxaustin
chrisxaustin / findjar
Created April 28, 2016 22:04
Bash script for searching jars under a set of directories
#!/bin/bash
# Usage: findjar <class name or pattern> <directories>
# Example: findjar StringUtils .
class=$1
shift
for f in `find $* -type f -name "*.jar"`; do
match=$(jar tf $f 2>/dev/null| grep $class);