Skip to content

Instantly share code, notes, and snippets.

View gkhays's full-sized avatar

Garve Hays gkhays

View GitHub Profile
@gkhays
gkhays / TestTimeStampUtils.java
Last active June 2, 2021 12:06 — forked from kristopherjohnson/TimestampUtils.java
Methods for generating ISO 8601 timestamps in Java/Android
package net.kristopherjohnson.util.test;
import static org.junit.Assert.*;
import java.util.Date;
import net.kristopherjohnson.util.TimestampUtils;
import org.junit.Before;
import org.junit.Test;
@gkhays
gkhays / Maven-Artifacts.md
Last active May 2, 2017 19:39
Maven configuration to create an uber JAR

Maven Artifacts

Record the steps to create an uber jar and to add information to a jar manifest. Below, I add a time stamp and "codification" information.

Manifest-Version: 1.0
Implementation-Title: Maven Custom JAR Manifest
Implementation-Version: 1.0.0-SNAPSHOT
Archiver-Version: Plexus Archiver
Built-By: gkh
@gkhays
gkhays / CollectionUtils.java
Last active April 3, 2016 16:29 — forked from milingo/CollectionUtils.java
Java Collections
// Init
new String[]{"a", "b"}
List<String> list = new ArrayList<String>(
Arrays.asList("String A", "String B", "String C")
);
Map<String, Owner> owners = new HashMap<String, Owner>() {{
put("no-money", createOwnerWithoutMoney());
@gkhays
gkhays / svn-history.md
Last active October 8, 2015 19:49
SVN Activity Metrics: See and count the number of revisions given a date range.

Subversion Log

The first place I looked for svn log syntax was the manual; see Examining History. E.g.

$ svn log
------------------------------------------------------------------------
r3 | sally | 2008-05-15 23:09:28 -0500 (Thu, 15 May 2008) | 1 line

Added include lines and corrected # of cheese slices.
@gkhays
gkhays / audit-jars.sh
Created October 8, 2015 18:32
List all the JAR files being used in a project or installation.
#!bin/bash
# Find all the JARs starting here and print them out.
find . -name *.jar -print > audit.txt
# Strip out the path and sort.
find . -name *.jar -exec basename {} \; | sort -u > audit-nopath.txt
#! /bin/sh
#
# network Bring up/down networking
#
# chkconfig: 345 20 80
# description: Starts and stops minecraft-server-nogui.sh
#
case "$1" in
start)
@gkhays
gkhays / ec2.md
Last active March 4, 2016 20:10
DNS Settings for EC2

My instance ended up with no DNS resolution

nslookup facebook.com
dig +trace facebook.com

didn't work :(

So updated resolv.conf to the following:

@gkhays
gkhays / osx-10.11-setup.md
Created October 27, 2015 20:03 — forked from kevinelliott/osx-10.11-setup.md
Mac OS X 10.11 El Capitan Setup

Mac OS X 10.11 El Capitan

Custom recipe to get OS X 10.11 El Capitan running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.10 Yosemite setup recipe (as found on this gist https://gist.github.com/kevinelliott/0726211d17020a6abc1f). Note that I expect this to change significantly as I install El Capitan several times.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

class Hello {
int test() {
String s = null;
return s == null ? 0 : s.length();
}
}