Skip to content

Instantly share code, notes, and snippets.

View devinrsmith's full-sized avatar

Devin Smith devinrsmith

  • Deephaven Data Labs
View GitHub Profile
@devinrsmith
devinrsmith / gist:f81ffd5f9baf117157aa
Created May 27, 2014 18:38
tahoeusnaothusntoaehusrcg'aeui rcsh
aoeu-naotehusanoehusaontehuosaenuhoae
uaoeusntaoebunsathu
au
abua,ehbua,u
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../paper-input/paper-input.html">
<link rel="import" href="../paper-slider/paper-slider.html">
<link rel="import" href="../paper-button/paper-button.html">
input {
tcp {
type => "syslog"
port => 514
}
}
filter {
if [type] == "syslog" {
grok {
@devinrsmith
devinrsmith / ncsa grok
Last active August 29, 2015 14:07
"Common" log format, NCSA, etc for grok.
(?:%{IP:clientip}|%{HOSTNAME:clienthost}) %{USER:ident} %{USER:auth} \[%{HTTPDATE:timestamp}\] "(?:%{WORD:verb} %{NOTSPACE:request}(?: HTTP/%{NUMBER:httpversion})?|%{DATA:rawrequest})" %{NUMBER:response} (?:%{NUMBER:bytes}|-) %{QS:referrer} %{QS:agent}
@devinrsmith
devinrsmith / FixedInput.java
Created November 14, 2014 17:20
FixedInput allows the same byte[] to be passed into Input.
import com.esotericsoftware.kryo.io.Input;
import java.io.InputStream;
/**
* Created by dsmith on 11/14/14.
*
* In reference to https://github.com/EsotericSoftware/kryo/issues/264
*/
public class FixedInput extends Input {
@devinrsmith
devinrsmith / gist:a55b55e2ac12d50c4559
Created January 15, 2015 16:44
weedfs multi part error
Log file created at: 2015/01/14 16:22:07
Running on machine: xxx
Binary: Built with gc go1.3.1 for linux/amd64
Log line format: [IWEF]mmdd hh:mm:ss threadid file:line] msg
I0114 16:22:07 00001 file_util.go:20] Folder /data Permission: -rwxr-xr-x
I0114 16:22:07 00001 volume.go:108] loading file /data/images_3.idx readonly false
I0114 16:22:08 00001 store.go:225] data file /data/images_3.dat, replicaPlacement=001 v=2 size=582434260 ttl=
I0114 16:22:08 00001 volume.go:108] loading file /data/images_6.idx readonly false
I0114 16:22:08 00001 store.go:225] data file /data/images_6.dat, replicaPlacement=001 v=2 size=568452399 ttl=
I0114 16:22:08 00001 store.go:232] Store started on dir: /data with 2 volumes max 16
@devinrsmith
devinrsmith / DoubleCheckedSupplier.java
Last active June 29, 2020 03:45
Double Checked Locking made easy with Java 8 Suppliers
import java.util.function.Supplier;
/**
* Created by dsmith on 2/16/15.
*
* https://en.wikipedia.org/wiki/Double-checked_locking
*
*/
public class DoubleCheckedSupplier<T> implements Supplier<T> {
public static <T> Supplier<T> of(Supplier<T> supplier) {
@devinrsmith
devinrsmith / GuavaConcatIssue.java
Last active August 29, 2015 14:17
Guava Concat Issue
import com.google.common.base.Suppliers;
import com.google.common.collect.AbstractIterator;
import com.google.common.collect.Iterators;
import java.util.*;
import java.util.function.Consumer;
import java.util.function.Supplier;
/**
* Created by dsmith on 3/19/15.
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URI;
/**
* Created by dsmith on 4/8/15.
*/
public class UrlTest {
public static void main(String[] args) throws IOException {
final HttpURLConnection urlConnection = (HttpURLConnection)
@devinrsmith
devinrsmith / SpliteratorTest.java
Created July 21, 2015 20:45
Testing spliterator visibility
import java.util.Spliterator;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
/**
* Created by dsmith on 7/21/15.
*/
public class SpliteratorTest {