- golang
- python3
- git
cat <<EOF > rules.yml | |
--- | |
groups: | |
- name: main | |
rules: | |
EOF | |
curl -s -g 'http://localhost:9090/api/v1/series?' --data-urlencode 'match[]={job="grafana"}' \ |
from prometheus_client import Counter, start_http_server | |
from threading import Thread | |
import requests as re | |
import time | |
JOB_NAME = 'test' | |
INSTANCE = 'localhost' | |
def scrape_and_send(local_url: str, vm_url: str, scrape_interval: int): |
create table test(a Int64, b Int64, c Int64, d String) | |
engine=MergeTree partition by tuple() order by (a,b,c); | |
insert into test select 1, 0, number, toString(number) from numbers(1000000); | |
insert into test select 2, 2, number, toString(number) from numbers(100); | |
insert into test select 3, 3, number, toString(number) from numbers(1000000); | |
select count() from test where a=2 and c=1; | |
1 rows in set. Elapsed: 0.002 sec. |
You have to do 2 things in order to allow your container to access your host's postgresql database
- Make your postgresql listen to an external ip address
- Let this client ip (your docker container) access your postgresql database with a given user
Obs: By "Host" here I mean "the server where docker is running on".
Find your postgresql.conf (in case you don't know where it is)
$ sudo find / -type f -name postgresql.conf
Last updated March 13, 2024
This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.
Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.
For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.
input { stdin { } } | |
filter { | |
grok { | |
match => ["message", "%{HAPROXYHTTP}"] | |
remove_field => ["message"] | |
} | |
mutate { | |
convert => { "actconn" => "integer" | |
"backend_queue" => "integer" | |
"beconn" => "integer" |
:) SELECT toMonday(EventDate) AS k, count(), uniq(UserID) FROM hits_layer WHERE CounterID = 29761725 AND EventDate >= '2016-05-01' GROUP BY k ORDER BY k | |
SELECT | |
toMonday(EventDate) AS k, | |
count(), | |
uniq(UserID) | |
FROM hits_layer | |
WHERE (CounterID = 29761725) AND (EventDate >= '2016-05-01') | |
GROUP BY k | |
ORDER BY k ASC |
--- | |
- hosts: all | |
gather_facts: no | |
vars: | |
string: "string" | |
list: | |
- item1 | |
- item2 | |
dict: | |
key1: value1 |