Skip to content

Instantly share code, notes, and snippets.

@ssm
ssm / check-cloudbleed-pass
Last active February 24, 2017 11:12
Check the content of your "pass" password manager against the published list of sites using cloudflare
#!/bin/bash
# Stig Sandbeck Mathisen <ssm@fnord.no>
# Checks the content of "pass" against the list of sites using cloudflare.
# Expect false positives, and possibly false negatives.
# TODO: remove the left part of each hostname from pass, to check domains.
---
# Ansible playbook to download CVE checking script from redhat.com,
# and testing all RedHat OS Family hosts.
#
# Stig Sandbeck Mathisen <ssm@fnord.no>
#
- hosts: localhost
connection: local
tasks:
@ssm
ssm / gist:9bd2e210b230d264bb9e0591398afe22
Created September 19, 2016 06:44
Logstash parsing dpkg.log
else if [fields][log_format] == "dpkg" {
grok {
match => { "message" => "%{TIMESTAMP_ISO8601:timestamp} %{GREEDYDATA:message}" }
overwrite => [ "message" ]
}
date {
match => [ "timestamp", "YYYY-MM-dd HH:mm:ss" ]
remove_field => [ "timestamp" ]
}
grok {
sub no_php_here {
if (req.url ~ "\.php(\?|$)") {
std.log("denied: request for .php");
return(synth(418, "I'm a teapot!"));
}
}
@ssm
ssm / test.vcl
Created February 22, 2016 14:11
sub redirect_to_https {
if (std.port(local.ip) == 80) {
set req.http.x-redir = "https://" + req.http.host + req.url;
return(synth(850, "Moved permanently"));
}
}
sub vcl_synth {
if (resp.status == 850) {
set resp.http.Location = req.http.x-redir;
@ssm
ssm / Puppetfile
Created December 23, 2015 13:37
Puppet configuration for SMTP smarthost with postfix
mod 'postfix',
:git => 'https://github.com/camptocamp/puppet-postfix.git',
:ref => '1.2.14'
Description:
libmunin-master-perl - perl modules for munin master
libmunin-node-perl - perl module Munin::Node
libmunin-perl - common perl modules for munin
libmunin-plugin-http-perl - perl bindings for HTTP munin plugins
libmunin-plugin-perl - perl bindings for munin plugins
libmunin-plugin-pgsql-perl - perl bindings for Postgresql munin plugins
libmunin-plugin-snmp-perl - perl bindings for SNMP munin plugins
munin - network-wide graphing framework (grapher/gatherer)
munin-async - network-wide graphing framework (async master/client)
@ssm
ssm / zone.rb
Last active December 20, 2015 14:49
zone fact
Facter.add(:zone) do
setcode do
something=Facter.value('hostname')
if not something.nil? and something =~ /(.)$/
$1
end
end
end
@ssm
ssm / gist:5797171
Created June 17, 2013 14:13
munin team bio
My first commit to the munin project was in 2007.
I mostly care about the Munin Guide (https://munin.readthedocs.org), and the plugin documentation. From time to time, I dig into the perl code of Munin, but not very often.
I am also the sysadmin for the Munin project servers. I take care of our Trac instance, and did the migration of the project from subversion to git in 2012.
@ssm
ssm / gist:5791574
Created June 16, 2013 09:56
systemd trigger issue? Needs investigating.
Script started, file is /home/ssm/.local/share/apt-dater/history/daoloth.fnord.no:0/1371376476-8770/typescript
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
dbus libdbus-1-3
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/571 kB of archives.
After this operation, 4096 B of additional disk space will be used.