Skip to content

Instantly share code, notes, and snippets.

View lukebakken's full-sized avatar

Luke Bakken lukebakken

View GitHub Profile
@lehoff
lehoff / pb_decode.erl
Created October 5, 2016 03:21
Potentially more efficient PB decoding
-module(pb_decode).
-compile(export_all).
%% existing code
d_msg_rpberrorresp(Bin, TrUserData) ->
dfp_read_field_def_rpberrorresp(Bin, 0, 0,
id(undefined, TrUserData),
id(undefined, TrUserData), TrUserData).
@lukebakken
lukebakken / .gitignore
Last active October 10, 2017 15:13
Erlang RSS Memory
*.beam
*.csv
@ferd
ferd / refc_leak.erl
Created July 18, 2013 12:32
Find Erlang processes that may be leaking refc binaries
f(MostLeaky).
MostLeaky = fun(N) ->
lists:sublist(
lists:usort(
fun({K1,V1},{K2,V2}) -> {V1,K1} =< {V2,K2} end,
[try
{_,Pre} = erlang:process_info(Pid, binary),
erlang:garbage_collect(Pid),
{_,Post} = erlang:process_info(Pid, binary),
{Pid, length(Post)-length(Pre)}
@bsparrow435
bsparrow435 / get_put_code.md
Last active March 29, 2021 10:33
Get/Put path walk through
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
@jdavid82
jdavid82 / .vimrc
Last active July 27, 2023 20:35
vim settings for full stack C# development in Windows 10
"Allow project specific .vimrc execution
set exrc
"no backup files
set nobackup
"only in case you don't want a backup file while editing
set nowritebackup
"no swap files
@hrchu
hrchu / 99-network-tuning.conf
Last active December 11, 2023 23:05 — forked from kgriffs/sysctl.conf
Linux Web Server Kernel Tuning
# Configuration file for runtime kernel parameters.
# See sysctl.conf(5) for more information.
# See also http://www.nateware.com/linux-network-tuning-for-2013.html for
# an explanation about some of these parameters, and instructions for
# a few other tweaks outside this file.
# See evil packets in your logs.
net.ipv4.conf.all.log_martians = 1
@djaiss
djaiss / gist:85a0ada83e6bca68e41e
Last active January 1, 2024 22:44
Block Twitter/Facebook in your /etc/hosts
# Block Facebook IPv4
127.0.0.1 www.facebook.com
127.0.0.1 facebook.com
127.0.0.1 login.facebook.com
127.0.0.1 www.login.facebook.com
127.0.0.1 fbcdn.net
127.0.0.1 www.fbcdn.net
127.0.0.1 fbcdn.com
127.0.0.1 www.fbcdn.com
127.0.0.1 static.ak.fbcdn.net