Skip to content

Instantly share code, notes, and snippets.

@ssm
ssm / testmail.sh
Created May 15, 2011 11:08
Shell function to test local system mail configuration
# Shell function to test mail delivery.
# Requirements: Linux, and "sendmail" somewhere in PATH
# Run "testmail <recipient>". This will return a single string, for
# which you can find in the mail log.
testmail () {
if [ -n "$1" ]; then
uuid=$(cat /proc/sys/kernel/random/uuid);
<VirtualHost *:80>
ServerName munin.example.org
ServerAlias munin
ServerAdmin info@example.org
DocumentRoot /srv/www/munin.example.org
ErrorLog /var/log/apache2/munin.example.org-error.log
CustomLog /var/log/apache2/munin.example.org-access.log combined
diff --git a/plugins/node.d/snmp__swap.in b/plugins/node.d/snmp__swap.in
index 06c355f..de1d476 100644
--- a/plugins/node.d/snmp__swap.in
+++ b/plugins/node.d/snmp__swap.in
@@ -52,8 +52,12 @@ my $swapsize = 0;
my $swapused = 0;
foreach my $swap (keys %$swap_d) {
- $swapsize += $session->get_single($hrStorageSize . $swap);
- $swapused += $session->get_single($hrStorageUsed . $swap);
define command {
command_name check_mod_gearman
command_line $USER1$/check_gearman -H localhost -W 300 -C 400
}
define command {
command_name check_mod_gearman_worker_connection
command_line $USER1$/check_gearman -H localhost -q worker_$ARG1$ -s check
}
---
Configuration summary for gearmand version 0.37
* Installation prefix: /usr
* System type: pc-linux-gnu
* Host CPU: x86_64
* C Compiler: gcc
* C Flags: -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Werror -Wall -Wextra -std=c99 -Wbad-function-cast -Wmissing-prototypes -Wnested-externs -Woverride-init
* C++ Compiler: g++
* C++ Flags: -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Werror -Wall -Wextra -Wpragmas -D_FORTIFY_SOURCE=2 -Waddress -Warray-bounds -Wchar-subscripts -Wcomment -Wctor-dtor-privacy -Wfloat-equal -Wformat=2 -Wlong-long -Wmaybe-uninitialized -Wmissing-field-initializers -Wmissing-noreturn -Wnon-virtual-dtor -Wnormalized=id -Woverloaded-virtual -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-compare -Wstack-protector -Wstrict-overflow=1 -Wswitch-enum -Wundef -Wunused-result -Wunused-variable
@ssm
ssm / build.log
Created October 13, 2012 12:34
Build log for cpm 0.27 on Debian GNU/kFreeBSD
$ cat last_operation.log
I: using fakeroot in build.
I: Current time: Sat Oct 13 12:25:55 UTC 2012
I: pbuilder-time-stamp: 1350131155
I: Building the build Environment
I: extracting base tarball [/home/ssm/pbuilder/unstable-base.tgz]
I: creating local configuration
I: copying local configuration
W: --override-config is not set; not updating apt.conf Read the manpage for details.
I: mounting /dev filesystemx
@ssm
ssm / make-snapshot-dsc
Created October 27, 2012 13:51
Building a debian source package (snapshot version)
#!/bin/sh
# 2012 Stig Sandbeck Mathisen <ssm@debian.org>
set -e
set -u
test "$(git status --porcelain | wc -l)" = "0" || {
echo "Aborting: Uncommitted changes in tree"
exit 1
@ssm
ssm / foo
Created October 27, 2012 14:04
gitpkg pristine tar
[gitpkg]
pre-export-hook = /usr/share/gitpkg/hooks/pristine-tar-pre-export-hook
# munin-node
description "munin instance of rrdcached"
author "Stig Sandbeck Mathisen <ssm@debian.org>"
start on filesystem
stop on runlevel [!2345]
# respawn
umask 022
@ssm
ssm / gist:5708217
Created June 4, 2013 18:20
aggregate plugin showing stacked
[aggregates;firewall]
update no
contacts no
bandwidth.graph_title Aggregate Bandwidth
bandwitdh.graph_category network
bandwidth.graph_order \
ipv6_up=example.com;firewall.example.com:if_ppp1.up \
ipv4_up=example.com;firewall.example.com:if_ppp0.up \