Skip to content

Instantly share code, notes, and snippets.

@csarcom
csarcom / a.py
Created September 6, 2019 18:04
class AnimalDoc(Document):
_id = Text()
class Index:
name = 'animal'
# Object type definition
"hits" : [
{
"_index" : "animal",
"_type" : "animal",
"_id" : "6d7a9391-9e7f-47e9-ad46-4d6fe85bba7d",
"_score" : 1.0,
"_source" : {
"scope" : {
"farm_id" : "7c60dea5-1d80-4997-87e5-a78a262229fd",
"holding_id" : "af13a51c-a1c6-4596-afd8-a15fbe54fe40"
from pycallgraph import PyCallGraph
from pycallgraph.output import GraphvizOutput
from pycallgraph import Config
with PyCallGraph(output=GraphvizOutput(), config=Config(max_depth=5)):
pass
upstream batata{
server 127.0.0.1:8000;
}
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
server {
listen 80;
server_name 159.203.86.164;
@csarcom
csarcom / komby.py
Created September 11, 2015 17:54
komby enforce bind
def _create_exchange(self):
return kombu.Exchange(self._amqp_exchange_name, type='direct',
durable=True, auto_delete=False)
def _create_queue(self, exchange):
return kombu.Queue(self._queue_name, auto_delete=False)
def _enforce_bind(self):
with kombu.Connection(host) as connection:
lista = [1,2,3,3,4]
defmodule Misc do
def dup([]) do
{:done, nil}
end
def dup(list) do
_dup(list, [])
end
def _dup([], result) do
presto:store> select * from metrics_rollup60 where name = 'bytes_sent.miss.2747t.hd' limit 10;
name | time | count | sum
--------------------------+-------------------------+--------+------------
bytes_sent.miss.2747t.hd | 2014-10-29 18:45:00.000 | 9893 | 112072036
bytes_sent.miss.2747t.hd | 2014-10-29 18:46:00.000 | 166883 | 1637354586
bytes_sent.miss.2747t.hd | 2014-10-29 18:47:00.000 | 223586 | 2271573231
bytes_sent.miss.2747t.hd | 2014-10-29 18:48:00.000 | 232457 | 2432849911
bytes_sent.miss.2747t.hd | 2014-10-29 18:49:00.000 | 234066 | 2453397952
bytes_sent.miss.2747t.hd | 2014-10-29 18:50:00.000 | 240202 | 2371110880
bytes_sent.miss.2747t.hd | 2014-10-29 18:51:00.000 | 231517 | 2360339360
presto:store> select * from metrics_rollup60 where name = 'upstream_cache_status.miss.2747t.hd' limit 10;
name | time | count | sum
-------------------------------------+-------------------------+--------+--------
upstream_cache_status.miss.2747t.hd | 2014-10-29 18:45:00.000 | 9893 | 9893
upstream_cache_status.miss.2747t.hd | 2014-10-29 18:46:00.000 | 166883 | 166883
upstream_cache_status.miss.2747t.hd | 2014-10-29 18:47:00.000 | 223586 | 223586
upstream_cache_status.miss.2747t.hd | 2014-10-29 18:48:00.000 | 232457 | 232457
upstream_cache_status.miss.2747t.hd | 2014-10-29 18:49:00.000 | 234066 | 234066
upstream_cache_status.miss.2747t.hd | 2014-10-29 18:50:00.000 | 240202 | 240202
upstream_cache_status.miss.2747t.hd | 2014-10-29 18:51:00.000 | 231517 | 231517
[ERROR] Found a problem with the direct dependency com.google.guava:guava of the current project
Expected version is 16.0.1
Resolved version is 16.0.1
Version 18.0 was expected by artifact: io.airlift:testing
[DEBUG] Ended DependencyVersionsCheckMojo mojo run!
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] presto-root ........................................ SUCCESS [05:04 min]
[INFO] presto-spi ......................................... FAILURE [ 47.515 s]
2014-10-29T13:03:01.174+0000 INFO main Bootstrap PROPERTY DEFAULT RUNTIME DESCRIPTION
2014-10-29T13:03:01.175+0000 INFO main Bootstrap cassandra.allow-drop-table false false Allow hive connector to drop table
2014-10-29T13:03:01.175+0000 INFO main Bootstrap cassandra.client.connect-timeout 5000.00ms 5000.00ms
2014-10-29T13:03:01.175+0000 INFO main Bootstrap cassandra.client.read-timeout 12000.00ms 12000.00ms
2014-10-29T13:03:01.175+0000 INFO main Bootstrap cassandra.client.so-linger null null
2014-10-29T13:03:01.176+0000 INFO main Bootstrap cassandra.consistency-level