Skip to content

Instantly share code, notes, and snippets.

@deinspanjer
deinspanjer / gist:1148248
Created August 16, 2011 01:13
logs of trying to start ES localhost single node, no customization of config
den:elasticsearch-0.17.6 dre$ bin/elasticsearch -f
[2011-08-15 18:03:05,228][INFO ][node ] [Nathaniel Richards] {elasticsearch/0.17.6}[45834]: initializing ...
[2011-08-15 18:03:05,235][INFO ][plugins ] [Nathaniel Richards] loaded [], sites [head]
[2011-08-15 18:03:07,238][INFO ][node ] [Nathaniel Richards] {elasticsearch/0.17.6}[45834]: initialized
[2011-08-15 18:03:07,238][INFO ][node ] [Nathaniel Richards] {elasticsearch/0.17.6}[45834]: starting ...
[2011-08-15 18:03:07,334][INFO ][transport ] [Nathaniel Richards] bound_address {inet[/0.0.0.0:9300]}, publish_address {inet[/10.251.28.55:9300]}
[2011-08-15 18:03:37,388][WARN ][discovery ] [Nathaniel Richards] waited for 30s and no initial state was set by the discovery
[2011-08-15 18:03:37,389][INFO ][discovery ] [Nathaniel Richards] elasticsearch/pEX4pJxDQ2WjH4Luk0UTFQ
[2011-08-15 18:03:37,394][INFO ][http ] [Nathanie
{
"query" : {
"filtered" : {
"query" : { "match_all" : {} },
"filter" : {
"and" : [
{ "or" : [
{ "prefix" : { "name" : "hugo" } },
{ "prefix" : { "contact" : "hugo" } }
]},
@deinspanjer
deinspanjer / gist:3643387
Created September 5, 2012 19:47 — forked from xstevens/gist:3641802
Half-baked BitSet using byte[] rather than long[]
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
public class VerticaBinaryFormatBitSet {
private static final byte ZERO = (byte)0;
private byte[] bytes;
private boolean dirty = false;
private int numBits;
private int numBytes;
@deinspanjer
deinspanjer / BulkLoadTester.java
Created September 5, 2012 20:59
Quick and dirty tester for different Vertica bulk load methods
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
@deinspanjer
deinspanjer / gist:4772379
Created February 12, 2013 19:04
Little JS hack to pretty print FHR payloads. The biggest feature is converting date codes into yyyy-MM-dd along with age.
/* Usage:
1. open about:healthreport
2. open a Web Console panel in that page
3. Pop the console out and expand it
4. Copy this JS code to the clipboard
5. Paste it into the command prompt at the bottom of the console
*/
/* Credit: http://stackoverflow.com/a/7838061 */
function getAge(fromdate, todate){
@deinspanjer
deinspanjer / gist:8476437
Last active January 3, 2016 14:29
Terminal log of my attempts to merge lagunitas branch into my tajo branch and ensure everything is up to date both locally and in my origin github user repo.
### ** From my first terminal window which was dealing with my local copy of the lagunitas branch. **
[1001][me@xxx: ~]$ cd src/mondrian-lagunitas/
[1001][me@xxx: mondrian-lagunitas (lagunitas)]$ git status
On branch lagunitas
nothing to commit, working directory clean
[1004][me@xxx: mondrian-lagunitas (lagunitas)]$ git log
commit 24b9fc2c84031bce388b5aa4f63684229c96d625
@deinspanjer
deinspanjer / Test.java
Last active January 3, 2016 19:49
Example of a problem where I'm trying to have a class implement an interface but return a couple of extra methods, but I cannot use that class in places where an interface method expects the return type to be the base interface. Edit: Now with a solution.
import java.util.*;
public class Test {
public static interface Position {}
public static interface Axis {
public List<? extends Position> getPositions();
}
public static class GoodAxis implements Axis {
private List<Position> positions = new ArrayList<>();
@deinspanjer
deinspanjer / gist:8528424
Last active January 3, 2016 22:29
Postgres query that implements the "last non-null value"
steelwheels=# select a1_h0_l0
steelwheels-# , a1_h0_l1
steelwheels-# , a1_h0_l2
steelwheels-# , a0_h0_l0
steelwheels-# , a0_h0_l1
steelwheels-# , m0
steelwheels-# , first_value(m0)
steelwheels-# over (
steelwheels(# partition by p0
steelwheels(# order by a1_h0_l0
# in manifests/default.pp
define append_if_no_such_line($file, $line, $refreshonly = 'false') {
exec { "/bin/echo '$line' >> '$file'":
unless => "/bin/grep -Fxqe '$line' '$file'",
path => "/bin",
refreshonly => $refreshonly,
}
}
class { '::mysql::server':
override_options => { 'mysqld' => {
'query_cache_limit' => '128M',
'query_cache_size' => '256M',
'query_cache_type' => '1',
}, 'mysqld_safe' => {
# Set the MySQL timezone.
# @see http://stackoverflow.com/questions/947299/how-do-i-make-mysqls-now-and-curdate-functions-use-utc