Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Hello? Is this thing on?

Dolf Schimmel Freeaqingme

💭
Hello? Is this thing on?
View GitHub Profile
View gist:afe68e7bbff6bdd17f8c062c0dd24e21
# File managed by Puppet
coordinator:
listenAddress:
type: "config"
value: "0.0.0.0:7201"
local:
namespaces:
- namespace: default
View gist:c491d5d743f5a9dda3b7565e2e054745
conn, err := grpc.Dial(
s.rpcSocketPath,
grpc.WithInsecure(),
grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) {
return net.DialTimeout("unix", addr, timeout)
}))
if err != nil {
log.Fatalf("did not connect: %v", err)
}
defer conn.Close()
@Freeaqingme
Freeaqingme / build-cockroachdb-debian-package.sh
Last active Oct 16, 2019
Cockroachdb debian .deb package
View build-cockroachdb-debian-package.sh
#!/bin/bash
set -ex
release=v1.0
build_iter=1.0
version=$(echo "${release}-${build_iter}" | sed 's/^v//g')
rm -rf bin/ pkg/ pkg_root/
@Freeaqingme
Freeaqingme / libmodsecurity.go
Last active Apr 22, 2017
modsecurity v3 linked to Go
View libmodsecurity.go
package main
/*
#cgo CPPFLAGS: -I/usr/local/modsecurity/include
#cgo LDFLAGS: /usr/local/modsecurity/lib/libmodsecurity.so
#include "modsecurity/modsecurity.h"
#include "modsecurity/transaction.h"
#include "modsecurity/rules.h"
@Freeaqingme
Freeaqingme / gist:8529d09df118278aea09
Created May 18, 2015
Observium PDU2-MIB/Raritan (D)PX2 - Outlets, Inlets and State sensors
View gist:8529d09df118278aea09
From 914fcc081a1586bad49abe5200fe32ad8e1f7468 Mon Sep 17 00:00:00 2001
From: "Dolf Schimmel (Freeaqingme)" <dolf@dolfschimmel.nl>
Date: Sun, 17 May 2015 02:47:19 +0200
Subject: [PATCH] PDU2-MIB/Raritan (D)PX2 - Outlets, Inlets and State sensors
for Over Current Protectors
---
includes/definitions/os.inc.php | 1 +
includes/definitions/sensors.inc.php | 4 +
includes/discovery/sensors/pdu2-mib.inc.php | 111 +
@Freeaqingme
Freeaqingme / gist:e70aed309066abecadcd
Last active Aug 29, 2015
Icinga2 perfdata to influxdb
View gist:e70aed309066abecadcd
#!/usr/bin/env php5
<?php
// select value from /.*/
// delete from /.*/
const PERFDATA_DIR = '/var/spool/icinga2/perfdata/';
$dir = new DirectoryIterator(PERFDATA_DIR);
justKeepOnGoing:
foreach ($dir as $fileinfo) {
@Freeaqingme
Freeaqingme / gist:d369293ed80d148c0145
Created Sep 16, 2014
Check_disk NRPE script that more or less works on Solaris
View gist:d369293ed80d148c0145
#!/usr/bin/bash
#
# Version 0.0.2 - Jan/2009
# Changes: df -P (to avoid it from breaking long lines)
#
# by Thiago Varela - thiago@iplenix.com
# Ripped from: http://exchange.nagios.org/directory/Plugins/Operating-Systems/Linux/check_disk--2D-%25-used-space/details
function help {
echo -e "\n\tThis plugin shows the % of used space of a mounted partition, using the 'df' utility\n\n\t$0:\n\t\t-c <integer>\tIf the % of used space is above <integer>, returns CRITICAL state\n\t\t-w <integer>\tIf the % of used space is below CRITICAL and above <integer>, returns WARNING state\n\t\t-d <device>\tThe partition or mountpoint to be checked. eg. "/dev/sda1", "/home", "/""
View gist:9713429
==Non-optional Coding Guidelines (TBD)==
* Newly added or modified methods are no longer than 20 lines.
* Any new methods are non-static. Unless everybody agrees this really poses an exception.
* A method has 10 params max. If it gets more, it needs refactoring.
* No params are provided via arrays to a method (behavior should be the same no matter if an array has 1 or 1M elements).
* A method does one thing, and one thing only.
* The 'else' statement is not used.
* We don't duplicate code, any code.
* Any method interacts with a maximum of 7 other objects.
* All objects are instantiated using the DI container.
View redis_
#!/usr/bin/perl -w
#
## Copyright (C) 2011 Colin Mollenhour <http://colin.mollenhour.com/>
##
## This program is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License
## as published by the Free Software Foundation; version 2 dated June,
## 1991.
##
View gist:8324817
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: /etc/puppet/modules/modulename/templates/authorized_keys.erb:10: syntax error, unexpected $end, expecting keyword_end
; _erbout.force_encoding(__ENCODING__)
^
cat /etc/puppet/modules/modulename/templates/authorized_keys.erb
# File managed by Puppet
#
<% @ssh_keys.each do |key| -%>
<% if scope.lookupvar('transipuser::bool_enable_two_factor_auth') == true -%>