Skip to content

Instantly share code, notes, and snippets.

View mfournier's full-sized avatar

Marc Fournier mfournier

View GitHub Profile
@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 / 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));
root@vagrant-openldap:/etc/openldap# ls -lZd /var/lib/ldap
ls: cannot access /var/lib/ldap: No such file or directory
root@vagrant-openldap:/etc/openldap# semanage fcontext -l | grep slapd_db_t
/etc/openldap/slapd\.d(/.*)? all files system_u:object_r:slapd_db_t:s0
/var/lib/ldap all files system_u:object_r:slapd_db_t:s0
/var/lib/ldap(/.*)? all files system_u:object_r:slapd_db_t:s0
root@vagrant-openldap:/etc/openldap# mkdir /var/lib/ldap
root@vagrant-openldap:/etc/openldap# mkdir /var/lib/ldap/a
root@vagrant-openldap:/etc/openldap# ls -laZ /var/lib/ldap
drwxr-xr-x. root root unconfined_u:object_r:var_lib_t:s0 .
@mfournier
mfournier / logstash.conf
Created September 16, 2013 10:07
elasticsearch.yml
### MANAGED BY PUPPET ###
---
bootstrap:
mlockall: true
cluster:
name: logstash
index:
number_of_replicas: 0
number_of_shards: 25
node:
@mfournier
mfournier / on Debian 7
Created September 21, 2013 15:24
packages required to build collectd 5.4 from a git clone
package { ['flex', 'libgcrypt11-dev', 'valgrind', 'strace']: }
package { ['autotools-dev', 'libltdl-dev', 'iproute-dev', 'iptables-dev', 'javahelper', 'libcurl4-gnutls-dev', 'libdbi0-dev', 'libesmtp-dev', 'libganglia1-dev', 'libglib2.0-dev', 'libhal-dev', 'liblvm2-dev',
'libmemcached-dev', 'libmnl-dev', 'libmodbus-dev', 'libmysqlclient-dev', 'libnotify-dev', 'libopenipmi-dev', 'liboping-dev', 'libpcap-dev', 'libperl-dev', 'libpq-dev', 'libprotobuf-c0-dev', 'librabbitmq-dev', 'li
brrd-dev', 'libsensors4-dev', 'libsnmp-dev', 'perl', 'libtokyocabinet-dev', 'libtokyotyrant-dev', 'libupsclient1-dev', 'libvarnish-dev', 'libvirt-dev', 'libxml2-dev', 'libyajl-dev', 'linux-libc-dev', 'openjdk-6-j
dk', 'protobuf-c-compiler', 'python-dev' ]: }
[collectd_policy]
pattern = ^collectd\.
retentions = 10s:1d,30s:7d,1m:21d,15m:5y
[main]
ssldir=/var/lib/puppet/ssl
environments=stable,staging,foo,bar,baz
[agent]
environment=staging
pluginsync=true
report=true
[master]
handling server_type: ws toolbar.js:237
Switching to workspace null toolbar.js:211
Switching to workspace
Object {name: "Riemann", view: Object, id: "c1ea133fe44f643a8881432e74b0b91408908094"}
toolbar.js:211
will open url: ws://riemann:5556/index?subscribe=true&query=state%20%3D%20%22critical%22%20or%20state%20%3D%20%22warning%22%20or%20state%20%3D%20%22expired%22 subs.js:82
Socket opened state = "critical" or state = "warning" or state = "expired" subs.js:92
45982
Uncaught TypeError: Cannot convert undefined or null to object grid.js:358
Grid.remove grid.js:358
--- lib/riemann/dash/public/views/grid.js
+++ lib/riemann/dash/public/views/grid.js
@@ -354,7 +354,7 @@
Grid.prototype.remove = function(e) {
var row_key = this.row_fn(e);
var col_key = this.col_fn(e);
- if (this.events[row_key][col_key]) {
+ if (this.events[row_key] && this.events[row_key][col_key]) {
delete this.events[row_key][col_key];
}
@mfournier
mfournier / interfaces
Created December 17, 2013 15:16
ucarp config
auto br0
iface br0 inet static
bridge_ports vlan192
bridge_stp off
ucarp-vid 4
ucarp-vip 11.22.33.44
ucarp-upscript /etc/network/vip-up.sh
ucarp-downscript /etc/network/vip-down.sh
ucarp-password mysecretpassword
address 192.168.192.6