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
# maximum capability of system | |
user@ubuntu:~$ cat /proc/sys/fs/file-max | |
708444 | |
# available limit | |
user@ubuntu:~$ ulimit -n | |
1024 | |
# To increase the available limit to say 200000 | |
user@ubuntu:~$ sudo vim /etc/sysctl.conf |
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
version: '3.9' | |
services: | |
clickhouse-server1: | |
image: yandex/clickhouse-server | |
ports: | |
- "8123:8123" | |
volumes: | |
- ./config.xml:/etc/clickhouse-server/config.xml | |
ulimits: |
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
public static void Main() | |
{ | |
var esClient = new ElasticClient(new Uri("http://localhost:9200")); | |
var response = esClient | |
.Search<object>(s => s | |
.Index("sample_index") | |
.AllTypes() | |
.Scroll("1m")); |
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
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Running; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace MemoryTestSandbox | |
{ |
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
2021.06.24 08:39:52.882235 [ 49925 ] {} <Debug> MergeTreeSequentialSource: Reading 2 marks from part 202106_330750_330750_0, total 54 rows starting from the beginning of the part | |
2021.06.24 08:39:52.893411 [ 49925 ] {} <Debug> analytics.events_local (8fcee572-2b74-42f2-8fce-e5722b74c2f2) (MergerMutator): Merge sorted 2913 rows, containing 46 columns (46 merged, 0 gathered) in 0.012852513 sec., 226648.28271327174 rows/sec., 94.10 MiB/sec. | |
2021.06.24 08:39:52.914845 [ 49925 ] {} <Trace> analytics.events_local (8fcee572-2b74-42f2-8fce-e5722b74c2f2): Renaming temporary part tmp_merge_202106_330565_330750_17 to 202106_330565_330750_17. | |
2021.06.24 08:39:52.914934 [ 49925 ] {} <Trace> analytics.events_local (8fcee572-2b74-42f2-8fce-e5722b74c2f2) (MergerMutator): Merged 5 parts: from 202106_330565_330743_16 to 202106_330750_330750_0 | |
2021.06.24 08:39:52.918118 [ 49925 ] {} <Debug> MemoryTracker: Peak memory usage: 12.40 MiB. | |
2021.06.24 08:39:53.272905 [ 49929 ] {} <Trace> system.metric_log (22746af7-8e26-4b0f-a274-6af |
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
//Name | |
=IFNA(QUERY('Jira sync'!A:O, "select O where B = '"& parent & "' AND A = 'Epic' LIMIT 1",0), "") | |
//Project | |
=IFNA(QUERY('Jira sync'!A:C, "select C where B = '"& parent & "' AND A = 'Epic' LIMIT 1",0), 0) | |
//Risk | |
=IFNA(QUERY('Jira sync'!A:M, "select M where B = '"& parent & "' AND A = 'Epic' LIMIT 1",0), 0) | |
//Risk Reasoning |
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 zeroconf import ServiceBrowser, ServiceListener, Zeroconf, ZeroconfServiceTypes | |
class MyListener(ServiceListener): | |
def update_service(self, zc: Zeroconf, type_: str, name: str) -> None: | |
info = zc.get_service_info(type_, name) | |
print("Updated: \t", format_info(info)) | |
def remove_service(self, zc: Zeroconf, type_: str, name: str) -> None: |
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
# BEGIN: 8f7d6h3j4k5l | |
import unittest | |
import requests | |
import jwt | |
import time | |
class TestAPI(unittest.TestCase): | |
token = None | |
api_basepath = "https://api-test.xl-byg.dk" |
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
WITH p AS ( | |
WITH q AS ( | |
WITH y AS ( | |
WITH x as ( | |
SELECT | |
sm.entity_id, | |
s.state, | |
s.last_updated_ts, | |
COALESCE(LAG(s.state) OVER (partition by sm.entity_id ORDER BY last_updated_ts ASC), s.state) as last_state | |
FROM states s |
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
{ | |
init: function(elevators, floors) { | |
// helper function to check if a floor is already queued | |
function isFloorQueued(elevator, floorNum) { | |
return elevator.destinationQueue.indexOf(floorNum) > -1; | |
} | |
function isFloorQueuedForAnyElevator(floorNum) { | |
for (let e = 0; e < elevators.length; e++) { |
OlderNewer