Skip to content

Instantly share code, notes, and snippets.

@martinamps
martinamps / gist:6c710aaa9ebd3af3953f
Created November 21, 2015 16:15
Facebook: Monitoring at 250 gbit/s
Monitoring Challenges
Collect monitoring data
Snapshot of system, monitoring changes over time
Hard at scale
Analyze monitoring data
Hard to do fast/effiicienly.
enum Attribute: string {
UINT = 'sql_attr_uint';
BOOL = 'sql_attr_bool';
BIGINT = 'sql_attr_bigint';
TIMESTAMP = 'sql_attr_timestamp';
STR2ORDINAL = 'sql_attr_str2ordinal';
FLOAT = 'sql_attr_float';
MULTI = 'sql_attr_multi';
STRING = 'sql_attr_string';
STR2WORDCOUNT = 'sql_attr_str2wordcount';
@martinamps
martinamps / ko_sendpackets.cpp
Created January 16, 2015 19:49
old code sample of injecting packets into KO
DWORD KO_SEND_FUNC = 0x473430; //0x4736C0;
DWORD KO_SOCKET_BMA = 0xB6D790; //0xB6D770;
std::vector<char> hex2bytes(std::string hex) {
std::vector<char> out;
std::istringstream s;
int b;
for (int i = 0; i < hex.length(); i += 2) {
s.clear();
class Test {
use Overload;
public function __construct() {
self::add('test', function($a, $b, $c = false) {
echo '2-3 args: a => ', $a, ' b => ', $b, ' c => ', $c, PHP_EOL;
});
self::add('test', function() {
[30-Sep-2013 13:08:46.875542] DEBUG: pid 794, fpm_got_signal(), line 76: received SIGCHLD
[30-Sep-2013 13:08:46.875605] WARNING: pid 794, fpm_children_bury(), line 252: [pool www] child 10202 exited on signal 11 (SIGSEGV) after 116.726905 seconds from start
[30-Sep-2013 13:08:46.878376] NOTICE: pid 794, fpm_children_make(), line 421: [pool www] child 10243 started
[30-Sep-2013 13:08:46.878439] DEBUG: pid 794, fpm_event_loop(), line 419: event module triggered 1 events