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
Originally from: http://erlang.org/pipermail/erlang-questions/2017-August/093170.html | |
For a safe and fast Erlang SSL server, there's a few | |
configuration values you might want by default: | |
[{ciphers, CipherList}, % see below | |
{honor_cipher_order, true}, % pick the server-defined order of ciphers | |
{secure_renegotiate, true}, % prevent renegotiation hijacks | |
{client_renegotiation, false}, % prevent clients DoSing w/ renegs | |
{versions, ['tlsv1.2', 'tlsv1.1']}, % add tlsv1 if you must |
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
-module(timetop). | |
-export([top/2]). | |
top(Duration, Count) -> | |
OldPrio = erlang:process_flag(priority, high), | |
Result = scheduled_time_top(Duration), | |
erlang:process_flag(priority, OldPrio), | |
lists:sublist(Result, Count). |
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 table_stats as ( | |
select psut.relname, | |
psut.n_live_tup, | |
1.0 * psut.idx_scan / greatest(1, psut.seq_scan + psut.idx_scan) as index_use_ratio | |
from pg_stat_user_tables psut | |
order by psut.n_live_tup desc | |
), | |
table_io as ( | |
select psiut.relname, | |
sum(psiut.heap_blks_read) as table_page_read, |
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
request = function() | |
category = uuid() | |
path = "/weber_api/send_message/v1/" | |
wrk.headers["Content-Type"] = "application/json; charset=utf-8" | |
wrk.headers["x-auth-id"] = "valid_AUTH_Session" | |
wrk.body = "{\"weber_message\":[{\"id\":\""..category.."\",\"dst_addr\":\"+___\",\"category\":\""..category.." \",\"message_template\":[{\"text\":\"Тестовое сообщение!\"}]}]}" | |
return wrk.format("POST", path) | |
end | |
random = math.random |
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
ffmpeg -i intro.mov -vf "boxblur=5:1" intro-blur.mov |
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
#!/bin/bash | |
# installing erlang on ubuntu's | |
VERSION="R15B01" | |
sudo apt-get install build-essential libncurses5-dev openssl libssl-dev | |
sudo mkdir -p /opt/erlang/ | |
curl -O https://raw.github.com/spawngrid/kerl/master/kerl && chmod a+x kerl | |
sudo mv kerl /opt/erlang/ |
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
-module(date_util). | |
-compile(export_all). | |
epoch() -> | |
now_to_seconds(now()) | |
. | |
epoch_hires() -> | |
now_to_seconds_hires(now()) | |
. |