Skip to content

Instantly share code, notes, and snippets.

View stalkermn's full-sized avatar

Valerii Vasylkov stalkermn

View GitHub Profile
@stolen
stolen / timetop.erl
Created January 18, 2018 16:08
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).
@jj1bdx
jj1bdx / erlang-ssl-tls-config.txt
Last active July 13, 2021 07:16 — forked from ferd/gist:af9abf6b3600d2d7f08dba58fdfb514a
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
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,