Skip to content

Instantly share code, notes, and snippets.

📢
Hack the planet! Hack the planet!

Markus Frosch lazyfrosch

📢
Hack the planet! Hack the planet!
View GitHub Profile
@lazyfrosch
lazyfrosch / README.md
Created May 30, 2020
Unifi Controller in Docker
View README.md
@lazyfrosch
lazyfrosch / check_logfiles.cfg
Last active Apr 21, 2020
check_logfiles for the slightly magical usage, when files are named with the current date, but we can't expect a static filename
View check_logfiles.cfg
## Config
$seekfilesdir = '/var/tmp';
my $logdir = '/var/log/app';
my $search_defaults = {
tag => 'prefix',
criticalpatterns => 'someerror',
options => 'sticky=3600,allyoucaneat',
};
@lazyfrosch
lazyfrosch / Dockerfile
Created Apr 14, 2020
Testing Icinga 2 deps on CentOS 8
View Dockerfile
# Just an example to test dependencies
FROM centos:8
RUN yum install -y mariadb mariadb-server
RUN yum install -y https://packages.icinga.com/epel/icinga-rpm-release-8-latest.noarch.rpm
RUN yum install -y icinga2 icinga2-ido-mysql
RUN ldd /usr/lib64/icinga2/libmysql_shim.so \
@lazyfrosch
lazyfrosch / nginx-site.conf
Last active Apr 3, 2020
Icinga2 proxy through Nginx
View nginx-site.conf
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html;
server_name icinga.example.com;
location ~ ^/icinga2 {
return 301 https://$server_name$request_uri;
@lazyfrosch
lazyfrosch / bluetooth-a2dp.png
Last active Apr 1, 2020
Toggle Bluetooth Profiles with Pulseaudio
View uniqueKeysOfList.php
<?php
$list = array(array("key1"=>"value","key4"=>"value"),array("key3"=>"value"),array("key2"=>"value"));
function uniqueKeysOfList($list) {
$keys = [];
foreach ($list as $obj) {
foreach ($obj as $k => $v) {
$keys[$k] = 1;
@lazyfrosch
lazyfrosch / ansible-replace.yml
Last active Feb 21, 2020
Ansible Icinga Plugin constants
View ansible-replace.yml
- name: Icinga 2 const
hosts:
- test
tasks:
- name: Determine PluginDir for default
set_fact:
icinga2_plugin_dir: /usr/lib/nagios/plugins
- name: Determine PluginDir for RedHat
@lazyfrosch
lazyfrosch / patch.diff
Created Feb 20, 2020
Icinga Director Hack to allow ServiceSet Import of templates (the service sets themselve)
View patch.diff
diff --git a/library/Director/Objects/ImportSource.php b/library/Director/Objects/ImportSource.php
index a58aa195..e9b115c5 100644
--- a/library/Director/Objects/ImportSource.php
+++ b/library/Director/Objects/ImportSource.php
@@ -119,7 +119,7 @@ class ImportSource extends DbObjectWithSettings implements ExportInterface
$this->loadedRowModifiers = $this->fetchRowModifiers();
}
$current = $this->loadedRowModifiers;
- if ($current !== null && count($current) !== count($modifiers)) {
+ if (empty($current) || count($current) !== count($modifiers)) {
@lazyfrosch
lazyfrosch / git-all
Last active Jan 17, 2020
One of my favorite git shortcut, run actions on a deeper git tree with multiple repositories
View git-all
#!/bin/bash
# git-all
#
# Copyright (c) 2019 Markus Frosch <markus@lazyfrosch.de>
#
# Licensed under GPL-2+
rc=0
color() {
@lazyfrosch
lazyfrosch / git-filter-secrets
Last active Jan 8, 2020
An example how to filter secrets from git commits
View git-filter-secrets
#!/bin/bash
set -e
case "$1" in
init)
git config filter.git-filter-secrets.smudge "git-filter-secrets smudge"
git config filter.git-filter-secrets.clean "git-filter-secrets clean"
git config filter.git-filter-secrets.required true
echo "Configuration updated"
You can’t perform that action at this time.