This file contains 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
import com.zaxxer.hikari.HikariDataSource; | |
import org.apache.hadoop.hbase.thrift.generated.BatchMutation; | |
import java.sql.Connection; | |
import java.sql.PreparedStatement; | |
import java.sql.SQLException; | |
import java.sql.Statement; | |
import java.util.ArrayList; | |
public class Test |
This file contains 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
FROM ubuntu:trusty | |
ENV HOME /root | |
ENV LC_ALL C.UTF-8 | |
ENV LANG en_US.UTF-8 | |
ENV LANGUAGE en_US.UTF-8 | |
RUN add-apt-repository ppa:ondrej/php && \ | |
apt-get update |
This file contains 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
$connection = new AMQPConnection([ | |
'host' => 'queue', | |
'port' => 5672, | |
'login' => 'guest', | |
'password' => 'guest' | |
]); | |
$connection->connect(); | |
$channel = new AMQPChannel($connection); |
This file contains 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 bash | |
docker run -tid -p 9200:9200 elasticsearch:1.7.3 | |
sleep 5 | |
ES_URI="http://192.168.99.100:9200" | |
curl -XDELETE ${ES_URI}/test |
This file contains 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
logstash_1 | {:timestamp=>"2016-03-29T19:24:36.994000+0000", :message=>"Connecting to RabbitMQ. Settings: {:vhost=>\"/\", :host=>\"rabbit\", :port=>5672, :user=>\"guest\", :automatic_recovery=>true, :pass=>\"guest\", :timeout=>0, :heartbeat=>0}", :level=>:debug, :file=>"logstash/plugin_mixins/rabbitmq_connection.rb", :line=>"138", :method=>"connect"} | |
rabbit | | |
rabbit | =INFO REPORT==== 29-Mar-2016::19:24:37 === | |
rabbit | accepting AMQP connection <0.402.0> (172.17.0.3:57646 -> 172.17.0.2:5672) | |
logstash_1 | {:timestamp=>"2016-03-29T19:24:37.089000+0000", :message=>"Connected to RabbitMQ at rabbit", :level=>:info, :file=>"logstash/plugin_mixins/rabbitmq_connection.rb", :line=>"145", :method=>"connect"} | |
logstash_1 | {:timestamp=>"2016-03-29T19:24:37.129000+0000", :message=>"Declaring exchange 'amq.fanout' with type fanout", :level=>:info, :file=>"logstash/inputs/rabbitmq.rb", :line=>"196", :method=>"bind_exchange!"} | |
logstash_1 | {:timestamp=>"2016-03-29T19:24:37.130000+0000", :message=>"Declaring an ex |
This file contains 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
# Apache Drill SQL query: | |
SELECT DISTINCT t1.name || t2.name, t1.name, t2.name,t2.type FROM dfs.tmp.`output1.json` t1 JOIN dfs.tmp.`output2.json` t2 ON t1.id = t2.id WHERE t1.name <> t2.name; | |
# Results | |
+-----------------------------+--------------------+--------------------+-------------------+ | |
| EXPR$0 | name | name0 | type | | |
+-----------------------------+--------------------+--------------------+-------------------+ | |
| OtherUnknown | Other | Unknown | unknown | |
This file contains 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
class MyContainerPass implements CompilerPassInterface | |
{ | |
/** | |
* @see Symfony\Component\DependencyInjection\Compiler.CompilerPassInterface::process() | |
*/ | |
public function process(ContainerBuilder $container) | |
{ | |
foreach($container->getServiceIds() as $id) | |
{ | |
// Filter services by ID starting by "report." |
This file contains 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
{ | |
"date" : "12:15:30 10/10/2026", | |
"program" : "api", | |
"hash" : "4OF4OFJ34OFJ34OFJ3LJ", | |
"file" : "./toto.php", | |
"line" : 56, | |
"version" : "v2" | |
} |
This file contains 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
{ | |
"size": 0, | |
"query": { | |
"query_string": { | |
"query": "name:error" | |
} | |
}, | |
"aggs": { | |
"dup": { | |
"terms": { |
This file contains 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
<?php | |
/** | |
* A simple Php script to remove duplicates content from elasticsearch (> 2.0) | |
* Usage: | |
* php remove_dup.php HOST INDEX(/TYPE) QUERY_STRING FIELD REFRESH_TIMEOUT | |
* | |
* This script uses terms aggregation > top_hits to retrieve duplicates then bulk delete document by id. | |
* | |
* <!> Very long because we have to wait refresh_interval seconds before new search <!> |