Skip to content

Instantly share code, notes, and snippets.

View motin's full-sized avatar

Motin motin

View GitHub Profile
{
"query":{
"match_all":{}
},
"filter":{
"range":{
"population":{
"gt":10000
}
}
First, an ordinary node is started (the master):
[2011-05-30 14:15:54,997][INFO ][node ] [Wild Child] {elasticsearch/0.16.1}[24022]: initializing ...
[2011-05-30 14:15:55,000][INFO ][plugins ] [Wild Child] loaded []
[2011-05-30 14:15:58,714][INFO ][node ] [Wild Child] {elasticsearch/0.16.1}[24022]: initialized
[2011-05-30 14:15:58,714][INFO ][node ] [Wild Child] {elasticsearch/0.16.1}[24022]: starting ...
[2011-05-30 14:15:58,814][INFO ][transport ] [Wild Child] bound_address {inet[/0:0:0:0:0:0:0:0:9301]}, publish_address {inet[/xxx.xxx.xxx.xxx:9301]}
[2011-05-30 14:16:01,856][INFO ][cluster.service ] [Wild Child] new_master [Wild Child][q7s-536IQqCKyPo0w9Z-ug][inet[/xxx.xxx.xxx.xxx:9301]], reason: zen-disco-join (elected_as_master)
[2011-05-30 14:16:01,907][INFO ][discovery ] [Wild Child] elasticsearch_tripl_dev/q7s-536IQqCKyPo0w9Z-ug
[2011-05-30 14:16:02,081][INFO ][gateway ]
# ElasticSearch and it's service wrapper
sudo su $USER
cd ~/db/
wget --no-check-certificate https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.16.1.tar.gz
tar -xvf elasticsearch-0.16.1.tar.gz
wget --no-check-certificate http://github.com/elasticsearch/elasticsearch-servicewrapper/tarball/master
tar -xvf master
rm master
mv *servicewrapper*/service elasticsearch-0.*/bin/
rm -rf *servicewrapper*
# ElasticSearch proxy - Part 1 - node.js
sudo apt-get install python-software-properties curl
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
sudo ln -s /usr/bin/nodejs /usr/bin/node
curl http://npmjs.org/install.sh | sudo sh
# ElasticSearch proxy - Part 2 - the proxy
sudo su $USER
@motin
motin / .gitignore
Created June 1, 2011 20:37 — forked from karmi/.gitignore
This fork adds more metadata and also shows the first seven tasks within each story. Original description: Script to generate PDF cards suitable for planning poker from Pivotal Tracker [http://www.pivotaltracker.com/] CSV export. Inspired by Bryan Helmkam
.DS_Store
*.csv
*.pdf
--- Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -648,13 +651,16 @@
$length = strlen($str);
for ( $i=0; $i < $length; $i++ ) {
$char = $str{$i};
if ( $char == '{' ) {
+ if ($nest == 0 && substr($str, $i, 18) != '{&quot;event&quot;') continue;
$nest++;
[2011-06-06 10:46:11,151][DEBUG][action.search.type ] [Shinchuko Lotus] [indexname][4], node[u7ADHz7ERlKnKKBq5OKLYQ], [P], s[STARTED]: Failed to execute [org.elasticsearch.action.search.SearchRequest@5725a42b]
org.elasticsearch.transport.RemoteTransportException: [Larry Bodine][inet[/99.99.99.99:9302]][search/phase/query]
Caused by: java.lang.NullPointerException
at org.elasticsearch.search.internal.ContextIndexSearcher.removeCollectors(ContextIndexSearcher.java:81)
at org.elasticsearch.search.facet.FacetPhase.execute(FacetPhase.java:72)
at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:220)
at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:222)
at org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryTransportHandler.messageReceived(SearchServiceTransportAction.java:447)
at org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryTransportHandler.messageReceived(SearchService
@motin
motin / gist:3973272
Created October 29, 2012 12:33
Node assert - [0,0,0] should be considered equal to [0,0,0]
describe('foo', function(){
describe('#bar()', function(){
it('[0,0,0] should be considered equal to [0,0,0]', function(){
assert.equal([0,0,0], [0,0,0]);
})
})
})
# Result: AssertionError: [0,0,0] == [0,0,0]
var done = function(err, image) {
console.log('before undefined foo-function');
foo();
console.log('after undefined foo-function');
}
function readImage(src, done) {
@motin
motin / gist:4036418
Created November 8, 2012 03:14
Post-build TideSDK install script attempt
# Install after build without using the installer
unzip build/osx/dist/sdk-1.3.0-beta.zip -d ~/Library/Application\ Support/Titanium/
# Uninstall
rm -r ~/Library/Application\ Support/Titanium/sdk/osx/1.3*
rm -r ~/Library/Application\ Support/Titanium/runtime/osx/1.3*
rm -r ~/Library/Application\ Support/Titanium/modules/osx/*/1.3*