Skip to content

Instantly share code, notes, and snippets.

View stalkermn's full-sized avatar

Valerii Vasylkov stalkermn

View GitHub Profile
@stalkermn
stalkermn / erlang-ssl-tls-config.txt
Created May 27, 2021 14:09 — forked from jj1bdx/erlang-ssl-tls-config.txt
Erlang SSL/TLS configuration (originally by Fréd Hébert)
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
@stalkermn
stalkermn / timetop.erl
Created September 27, 2019 09:39 — forked from stolen/timetop.erl
top processes by scheduled time
-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).
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,
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
ffmpeg -i intro.mov -vf "boxblur=5:1" intro-blur.mov
@stalkermn
stalkermn / install.sh
Created April 26, 2017 13:55 — forked from chaos-ad/install.sh
Installing erlang in ubuntu
#!/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/
-module(date_util).
-compile(export_all).
epoch() ->
now_to_seconds(now())
.
epoch_hires() ->
now_to_seconds_hires(now())
.