View hexdump.java
static String hexDump(byte[] bytes) { | |
Formatter format = new Formatter(new StringBuilder()); | |
for (int j = 0; j < bytes.length; j++) { | |
if (j % 16 == 0) { | |
format.format((j > 0 ? "\n" : "") + "%08X ", j); | |
} | |
format.format("%02X ", bytes[j]); | |
} | |
return format.toString(); | |
} |
View sshd_config
# This is the sshd server system-wide configuration file. See | |
# sshd_config(5) for more information. | |
HostKey /etc/ssh/ssh_host_ed25519_key | |
HostKey /etc/ssh/ssh_host_rsa_key | |
ChallengeResponseAuthentication no | |
UsePAM yes | |
# Allow client to pass locale environment variables |
View parent-from-existing.py
#!/usr/bin/env python3 | |
import os | |
import argparse | |
parser = argparse.ArgumentParser(description='Generate a Maven parent pom for existing Maven projects in a folder.') | |
parser.add_argument('root', default='.', nargs='?', | |
help='root (parent) folder') | |
parser.add_argument('--group', default='localhost', | |
help='groupId for parent POM') |
View hls-distances.html
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<script src="http://js.api.here.com/v3/3.0/mapsjs-core.js" type="text/javascript" charset="utf-8"></script> | |
<script src="http://js.api.here.com/v3/3.0/mapsjs-service.js" type="text/javascript" charset="utf-8"></script> | |
</head> |
View manifest_growth.py
import os | |
from git import Repo | |
import datetime as dt | |
import xml.etree.ElementTree as ET | |
repo = Repo('/home/klaus/stats/manifests') | |
target_file = 'manifest.xml' | |
assert not repo.bare |
View gerrit-ssh.py
#!/usr/bin/env python | |
import paramiko | |
import sys | |
import os | |
client = paramiko.SSHClient() | |
client.load_system_host_keys() | |
client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) | |
config = paramiko.SSHConfig() |
View findhash.py
""" Finding commits by SHA-1 hash on Github. This is a simple | |
brute-force search for a specific usecase: you assume that the commit is | |
within all repos forked from a certain root repo within the past n days. | |
This may result in many calls to the GitHub API, which in turn may result | |
in GitHub's rate limiter kicking in and forcing you to take a break. You | |
have been warned. | |
Built with Python 3.4 and github3.py 0.9.4. | |
""" |
View curltest.sh
curl -XGET 'http://localhost:9200/' | |
#{ | |
# "status" : 200, | |
# "name" : "Spider-Man", | |
# "version" : { | |
# "number" : "1.3.2", | |
# "build_hash" : "dee175dbe2f254f3f26992f5d7591939aaefd12f", | |
# "build_timestamp" : "2014-08-13T14:29:30Z", | |
# "build_snapshot" : false, | |
# "lucene_version" : "4.9" |
View two-main-jars-pom.xml
<plugin> | |
<artifactId>maven-assembly-plugin</artifactId> | |
<executions> | |
<execution> | |
<id>make-assembly1</id> | |
<phase>package</phase> | |
<goals> | |
<goal>single</goal> | |
</goals> |
View JacksonStreamingBindingTest.java
package tv.xrm.test; | |
import com.fasterxml.jackson.core.type.TypeReference; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import java.util.*; | |
public class JacksonStreamingBindingTest { |
NewerOlder