Skip to content

Instantly share code, notes, and snippets.

View sergeyignatov's full-sized avatar

Sergey Ignatov sergeyignatov

View GitHub Profile
@sergeyignatov
sergeyignatov / nginx config
Last active March 14, 2023 16:47
zabbix oauth
server {
listen 80;
return 301 https://zabbix.domain.com$request_uri;
}
server {
listen 443 ssl;
server_name zabbix zabbix.domain.com;
access_log /var/log/nginx/zabbix.log;
error_log /var/log/nginx/zabbix.error;
@alexey-milovidov
alexey-milovidov / rounding_time.txt
Created June 20, 2016 21:00
Example of rounding time to 5-second interval in ClickHouse.
:) SELECT toDateTime(intDiv(toUInt32(EventTime), 5) * 5) AS k, count(), uniq(UserID) FROM hits_layer WHERE CounterID = 29761725 AND EventDate = today() AND EventTime >= now() - 600 GROUP BY k ORDER BY k
SELECT
toDateTime(intDiv(toUInt32(EventTime), 5) * 5) AS k,
count(),
uniq(UserID)
FROM hits_layer
WHERE (CounterID = 29761725) AND (EventDate = today()) AND (EventTime >= (now() - 600))
GROUP BY k
ORDER BY k ASC
@smoser
smoser / README.md
Last active December 22, 2019 09:15
MAAS and curtin debug

Debugging curtin from within MAAS

Deploying a node with MAAS cli

You can deploy a node with the maas cli which is often preferable to clicking a button on a web UI.

$ SYSTEM_ID=node-787b19d8-d25c-11e4-9f9e-00163eca91de
$ NAME="random-nodename"
$ MAASNAME="maaslocal"

$ maas $MAASNAME machine allocate "name=$NAME"