Skip to content

Instantly share code, notes, and snippets.

View mfournier's full-sized avatar

Marc Fournier mfournier

View GitHub Profile
@mfournier
mfournier / diff
Created July 26, 2013 11:57
Connection refused issue
--- src/statsd-tg.c
+++ src/statsd-tg.c
@@ -202,7 +202,10 @@ static int send_random_event (int sock, unsigned short seed[static 3]) /* {{{ */
return (-1);
assert (buffer[buffer_size] == 0);
+ fprintf (stderr, "errno is: %i, strerror is: %s\n", errno, strerror(errno));
status = send (sock, buffer, (size_t) buffer_size, /* flags = */ 0);
+
+ fprintf (stderr, "send status is: %i, strerror is: %s\n", status, strerror(errno));
@mfournier
mfournier / backtrace on coredump
Last active December 19, 2015 22:39
testing collectd libmnl patch to netlink plugin (3b44cc54), built with --enable-debug --disable-all-plugins --enable-netlink --enable-cpu --enable-logfile --enable-csv segfaults except if built with CFLAGS="-g -O0"
$ gdb collectd/sbin/collectd collectd/var/lib/collectd/core
GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
@mfournier
mfournier / gist:6021422
Created July 17, 2013 15:07
collectd core dump, built with --enable-debug --with-java=/usr/lib/jvm/
gdb /opt/collectd/sbin/collectd /opt/collectd/var/lib/collectd/core
GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
@mfournier
mfournier / gist:5886960
Created June 28, 2013 18:38
problematic carbon config, 1 host, with 4 CPUs, 4GB memory, shitty disks (vmware virtual host), and about 70000 wsp files with 1 new point every 10 sec (collectd default settings)
[cache]
STORAGE_DIR = /srv/carbon
LOCAL_DATA_DIR = /srv/carbon/whisper
WHITELISTS_DIR = /srv/carbon/lists
CONF_DIR = /opt/carbon-venv/conf/
LOG_DIR = /var/log/carbon/
PID_DIR = /var/run/
USER = carbon
MAX_CACHE_SIZE = inf
MAX_UPDATES_PER_SECOND = 10
@mfournier
mfournier / gist:5883828
Created June 28, 2013 10:35
example collectd processes plugin
<Plugin "processes">
ProcessMatch "carbon-cache" "python.+carbon-cache"
ProcessMatch "carbon-aggregator" "python.+carbon-aggregator"
</Plugin>
LoadPlugin "curl_json"
<Plugin "curl_json">
<URL "http://localhost:8080/metrics/mbean/com.puppetlabs.puppetdb.query.population%3Atype%3Ddefault%2Cname%3Dnum-nodes">
Instance "population-num-nodes"
Header "Accept: application/json"
<Key "Value">
Type "absolute"
</Key>
</URL>
root 4852 0.0 2.4 195636 12260 ? Ss 14:27 0:00 /usr/sbin/httpd
root 4857 0.0 0.6 72496 3388 ? SNl 14:27 0:00 \_ /opt/lumberjack/bin/lumberjack --host localhost --port 6782 --ssl-ca-path /etc/logstash/server.crt -
root 4858 0.0 0.7 72496 3980 ? SNl 14:27 0:00 \_ /opt/lumberjack/bin/lumberjack --host localhost --port 6782 --ssl-ca-path /etc/logstash/server.crt -
apache 4884 0.0 2.4 350144 12072 ? Sl 14:27 0:00 \_ /usr/sbin/httpd
apache 4885 0.0 2.4 350144 12188 ? Sl 14:27 0:00 \_ /usr/sbin/httpd
apache 4887 0.0 2.4 350144 12072 ? Sl 14:27 0:00 \_ /usr/sbin/httpd
apache 4888 0.0 2.4 350144 12072 ? Sl 14:27 0:00 \_ /usr/sbin/httpd
apache 4890 0.0 2.4 350144 12072 ? Sl 14:27 0:00 \_ /usr/sbin/httpd
apache 4891 0.0 2.4 350144 12072 ? Sl 14:27 0:00 \_ /usr/sbin/httpd
apache 4895 0.0 2.4 350144 12072 ? Sl 14:27 0:00 \_ /usr/sbin/httpd
$ git log --oneline -1
cca836f - get cracking on the registrar
$ make
Makefile:21: warning: overriding commands for target `clean'
Makefile.ext:15: warning: ignoring old commands for target `clean'
go get -d github.com/alecthomas/gozmq
PKG_CONFIG_PATH=$PWD/build/lib/pkgconfig \
go install -tags zmq_3_x github.com/alecthomas/gozmq
PKG_CONFIG_PATH=$PWD/build/lib/pkgconfig \
go install -ldflags '-r $ORIGIN/../lib' lumberjack
2013-04-30T16:33:35.576+0200 SSL_connect error vv
140087971010080:error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed:s3_clnt.c:1166:
2013-04-30T16:33:35.576+0200 SSL_connect error ^^
2013-04-30T16:33:35.576+0200 ssl handshake failed
2013-04-30T16:33:35.576+0200 Disconnect requested
2013-04-30T16:33:35.576+0200 Connection attempt to localhost:6782 failed: Success
@mfournier
mfournier / gist:5355786
Created April 10, 2013 15:44
collectd/src/*.pb-c.[c,h], diff between protobuf-c 0.12 and 0.15
diff -ru /tmp/pb-c-0.12/pinba.pb-c.c /tmp/pb-c-0.15/pinba.pb-c.c
--- /tmp/pb-c-0.12/pinba.pb-c.c 2013-04-10 17:41:05.434000580 +0200
+++ /tmp/pb-c-0.15/pinba.pb-c.c 2013-04-10 17:42:07.270012460 +0200
@@ -1,5 +1,10 @@
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
+/* Do not generate deprecated warnings for self */
+#ifndef PROTOBUF_C_NO_DEPRECATED
+#define PROTOBUF_C_NO_DEPRECATED
+#endif