Skip to content

Instantly share code, notes, and snippets.

View lazyfrosch's full-sized avatar
📢
Hack the planet! Hack the planet!

Markus Frosch lazyfrosch

📢
Hack the planet! Hack the planet!
View GitHub Profile
@lazyfrosch
lazyfrosch / gist:4001310
Created November 2, 2012 13:13
auto display
_auto.sh
#!/bin/bash
info=$(nv-control-dpy --probe-dpys)
if [[ "$info" == *"BenQ FP767-12"* ]]; then
~/.screenlayout/home.sh
elif [[ "$info" == *"Idek Iiyama PLE2208HDS"* ]]; then
~/.screenlayout/work.sh
else
#!/bin/env perl
#
# check_oldestfile_in_directory
#
# (c) 2013 NETWAYS GmbH
# Markus Frosch <markus.frosch@netways.de>
#
# license GPL2+
#
#!/bin/env perl
# Markus Frosch <markus.frosch@netways.de>
# NETWAYS GmbH
#
# 04.07.2012
#
# A check to compare multiple checks by a AND
# algorithm
@lazyfrosch
lazyfrosch / gist:5553017
Created May 10, 2013 07:50
Nginx Config I got from a user for Icinga*
server {
server_name myhost;
listen 80;
root /usr/share/icinga-web/pub;
if ($http_host != "myhost") {
rewrite ^ http://myhost$request_uri permanent;
}
location = /favicon.ico {
log_not_found off;
@lazyfrosch
lazyfrosch / gist:5964718
Last active December 19, 2015 13:49
From Debian-devel - it hurts
Dear Ladies and Gentlemen,
I'm a master-student of the "Hochschule Bonn-Rhein-Sieg" and I'm working at
a project with the DLR (Deutsches Zentrum für Luft- und Raumfahrt). In the
project I want to develop a datalogger-system with the Raspberry PI. The
Raspberry PI works with the software Raspbian and there is installed your
operating system Debian. My question is: Do I need a license for the
software to develop in a company?
With kind regards,
@lazyfrosch
lazyfrosch / idotool.pl
Created October 8, 2013 09:04
IDO tool to cleanup the database of Icinga IDOutils
#!/usr/bin/env perl
####################################################################
# Icinga IDO Cleanup Tool
#
# (c) 2012 NETWAYS GmbH
# by Markus Frosch <markus.frosch@netways.de>
#
# LICENSE:
#
# This work is made available to you under the terms of Version 2 of
@lazyfrosch
lazyfrosch / LogoExtender.js
Created October 12, 2013 22:18
example logo extender for Icinga Web: lib/js/LogoExtender.js make sure to load this file via the javascript.xml of a module the image is supplied via the pub directory inside a module - or better pub/images/
(function() {
var renderLogo = function(cb) {
var cmp = Ext.getCmp('north-frame');
if(!cmp) {
cb.defer(200,this,[cb]);
} else {
var image = String.format('{0}/modules/MyModule/resources/images/mylogo.png', AppKit.util.Config.get("path"));
// update main component - if necessary ("backport" from a 1.9 feature)
// only needed when on < 1.9.0
@lazyfrosch
lazyfrosch / gist:8443140
Last active January 3, 2016 09:29
Let your datacenter play the Imperial March from Star Wars
mco beep \
-l 350 -f 392 -D 100 --new -l 350 -f 392 -D 100 --new -l 350 -f 392 -D 100 --new -l 250 -f 311.1 -D 100 \
--new -l 25 -f 466.2 -D 100 --new -l 350 -f 392 -D 100 --new -l 250 -f 311.1 -D 100 --new -l 25 -f 466.2 \
-D 100 --new -l 700 -f 392 -D 100 --new -l 350 -f 587.32 -D 100 --new -l 350 -f 587.32 -D 100 --new -l 350 \
-f 587.32 -D 100 --new -l 250 -f 622.26 -D 100 --new -l 25 -f 466.2 -D 100 --new -l 350 -f 369.99 -D 100 \
--new -l 250 -f 311.1 -D 100 --new -l 25 -f 466.2 -D 100 --new -l 700 -f 392 -D 100 --new -l 350 -f 784 \
-D 100 --new -l 250 -f 392 -D 100 --new -l 25 -f 392 -D 100 --new -l 350 -f 784 -D 100 --new -l 250 \
-f 739.98 -D 100 --new -l 25 -f 698.46 -D 100 --new -l 25 -f 659.26 -D 100 --new -l 25 -f 622.26 -D 100 \
--new -l 50 -f 659.26 -D 400 --new -l 25 -f 415.3 -D 200 --new -l 350 -f 554.36 -D 100 --new -l 250 \
-f 523.25 -D 100 --new -l 25 -f 493.88 -D 100 --new -l 25 -f 466.16 -D 100 --new -l 25 -f 440 -D 100 \
markus@ubuntu1:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.4 LTS"
markus@ubuntu1:~$ sudo apt-get install icinga-web
Reading package lists... Done
Building dependency tree
Reading state information... Done
@lazyfrosch
lazyfrosch / mid.pl
Last active August 29, 2015 13:58
LConf Custom mid.pl to replace some macros in the service name
# (c) 2013 NETWAYS GmbH, Markus Frosch <markus.frosch@netways.de>
sub CustomMid {
my $CLIENTS = shift;
# process each host
foreach my $client (keys %{$CLIENTS}) {
# process each service
foreach my $service (keys %{$CLIENTS->{$client}->{'SERVICES'}}) {
###