This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
/usr/local/mysql/bin/mysql -u root test <<EOT | |
drop table test; | |
create table test ( | |
id integer, | |
b boolean | |
); | |
insert into test values (1, FALSE); | |
insert into test values (2, TRUE); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
/usr/local/mysql/bin/mysql -u root test <<EOT | |
drop table test; | |
create table test ( | |
id integer, | |
d text | |
); | |
insert into test values (1, '2015-04-03 00:45:00'); | |
EOT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
/usr/local/mysql/bin/mysql -u root test <<EOT | |
drop table test; | |
create table test ( | |
id integer, | |
t timestamp, | |
message text | |
); | |
insert into test values (1, now(), 'Hello, this is message 1'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# MySQL 5.1+ with http://dev.mysql.com/doc/refman/5.1/en/string-functions.html#function_load-file | |
# ES 1.4.4+ | |
# plugins required: jdbc, mapper attachment | |
# test.pdf is a PDF that can be parsed by Tika | |
/usr/local/mysql/bin/mysql -u root test <<EOT | |
drop table test; | |
create table test ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# first, set | |
# | |
# http.compression: true | |
# | |
# in config/elasticsearch.yml | |
curl -XDELETE 'localhost:9200/test' | |
rm -f content.json content.json.gz | |
echo '{"content":"Hello World"}' > content.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[2015-03-20 15:46:35,378][INFO ][node ] [Daisy Johnson] version[1.4.4], pid[15796], build[c88f77f/2015-02-19T13:05:36Z] | |
[2015-03-20 15:46:35,379][INFO ][node ] [Daisy Johnson] initializing ... | |
[2015-03-20 15:46:35,388][INFO ][plugins ] [Daisy Johnson] loaded [jdbc-1.4.0.10-87c9ce0], sites [] | |
[2015-03-20 15:46:37,028][INFO ][node ] [Daisy Johnson] initialized | |
[2015-03-20 15:46:37,029][INFO ][node ] [Daisy Johnson] starting ... | |
[2015-03-20 15:46:37,080][INFO ][transport ] [Daisy Johnson] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/10.1.1.57:9300]} | |
[2015-03-20 15:46:37,092][INFO ][discovery ] [Daisy Johnson] elasticsearch/QLgs41BVTNqHR69nC3hC0w | |
[2015-03-20 15:46:40,860][INFO ][cluster.service ] [Daisy Johnson] new_master [Daisy Johnson][QLgs41BVTNqHR69nC3hC0w][Jorg-Prantes-MacBook-Pro.local][inet[/10.1.1.57:9300]], reason: zen-disco-join (elected_as_maste |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
cralws triples from dewey.info and writes them to RDF N3 file | |
""" | |
import rdflib | |
def crawl(uri,file): | |
g = rdflib.ConjunctiveGraph() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XDELETE 'localhost:9200/test' | |
curl -XPUT 'localhost:9200/test' -d ' | |
{ | |
"mappings" : { | |
"docs" : { | |
"properties" : { | |
"content" : { | |
"type" : "string", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XDELETE 'localhost:9200/test' | |
curl -XPUT 'localhost:9200/test' -d ' | |
{ | |
"settings" : { | |
"analysis": { | |
"char_filter" : { | |
"full_text_mapping" : { | |
"type": "mapping", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def file = new File('names.txt') | |
file.eachLine { line -> | |
if (line.length() > 16) { | |
line = line.substring(16) | |
line.tokenize('$').each { word -> | |
word = word.substring(1) | |
print word | |
def latin = false | |
def greek = false | |
word.replaceAll("\\p{C}","").replaceAll("\\p{Space}","").replaceAll("\\p{Punct}","").toCharArray().each { c -> |