Skip to content

Instantly share code, notes, and snippets.

View lpgauth's full-sized avatar
😄
busy building cool stuff

Louis-Philippe Gauthier lpgauth

😄
busy building cool stuff
View GitHub Profile
~ $ nc -v 127.0.0.1 8080
found 0 associations
found 1 connections:
1: flags=82<CONNECTED,PREFERRED>
outif lo0
src 127.0.0.1 port 51112
dst 127.0.0.1 port 8080
rank info not available
TCP aux info available
@lpgauth
lpgauth / erlang-17.3.ebuild
Created September 17, 2014 13:42
Erlang 17.3 ebuild
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="4"
inherit git-2
DESCRIPTION="Erlang programming language, runtime environment, and large collection of libraries"
HOMEPAGE="http://www.erlang.org/"
@lpgauth
lpgauth / gist:011eb10dd0cce07d19ee
Last active August 29, 2015 14:09
tcpdump until beam.smp segfaults
tcpdump = fork do
exec "tcpdump -n -C 100 -W 5 -i eno1 -w beam"
end
Process.detach(tcpdump)
f = File.open("/var/log/messages", "r")
f.seek(0, IO::SEEK_END)
while true
select([f])
erl -sbt tnnps
Erlang/OTP 17 [DEVELOPMENT] [erts-6.2.1] [source-e61f384] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Eshell V6.2.1 (abort with ^G)
1> erlang:system_info(scheduler_bind_type).
unbound
@lpgauth
lpgauth / remote-shell.sh
Last active August 29, 2015 14:14
Bash script to open remote erlang shell on firewalled box
#!/bin/bash
if [ $# -ne 3 ]; then
echo "Usage: $0 hostname name cookie";
exit 1;
fi
HOST="$1"
NAME="$2"
COOKIE="$3"
@lpgauth
lpgauth / gist:e85efa59b96726af235d
Created February 23, 2015 16:54
otp17-hipe-mfait-rwlock.patch
(rtb-gateway@***.bloomdigital.com)85> lcnt:start(), lcnt:rt_opt({copy_save, true}), lcnt:clear(), timer:sleep(250), lcnt:collect(), lcnt:conflicts().
lock id #tries #collisions collisions [%] time [us] duration [%]
----- --- ------- ------------ --------------- ---------- -------------
pollset 1 24256 6071 25.0289 170652 65.8227
drv_ev_state 16 30178 1486 4.9241 117592 45.3568
run_queue 28 308489 10163 3.2944 109278 42.1500
timeofday 1 24499 3263 13.3189 32380 12.4894
timer_wheel 1 16898 862 5.1012 12341 4.7601
proc_status 11621 127163 146 0.1148 4896 1.8885
proc_main 11621 122045 3719 3.0472 4422 1.7056
beam/erl_lock_count.c:155:lcnt_thread_data_alloc(): Internal error: Lock counter failed to allocate memory!
Code Coverage:
marina : 100
marina_app : 100
marina_backlog : 100
marina_body : 84%
marina_buffer : 80%
marina_cache : 100
marina_frame : 93%
marina_queue : 60%
marina_request : 94%
Erlang/OTP 17 [erts-6.3] [source-575abc1] [64-bit] [smp:32:32] [async-threads:10] [hipe] [kernel-poll:false] [lock-counting]
Eshell V6.3 (abort with ^G)
1> lcnt:start(), lcnt:rt_opt({copy_save, true}), lcnt:clear(), timer:sleep(1000), lcnt:collect(), lcnt:conflicts(), lcnt:clear(), lcnt:stop().
lock id #tries #collisions collisions [%] time [us] duration [%]
----- --- ------- ------------ --------------- ---------- -------------
pollset 1 56872 15399 27.0766 429155 42.1222
drv_ev_state 16 139194 4855 3.4879 345582 33.9194
timeofday 1 55357 6164 11.1350 116585 11.4430
timer_wheel 1 42773 1767 4.1311 91477 8.9786
cat /proc/interrupts
echo 2 > /proc/irq/130/smp_affinity
echo 4 > /proc/irq/131/smp_affinity
echo 8 > /proc/irq/132/smp_affinity
echo 16 > /proc/irq/133/smp_affinity
echo 32 > /proc/irq/134/smp_affinity