Skip to content

Instantly share code, notes, and snippets.

View enko's full-sized avatar
🐉
🧙

Tim enko

🐉
🧙
View GitHub Profile
@enko
enko / prosody_zabbix.py
Created March 15, 2015 10:01
Push prosody infos to zabbix
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2010 Christoph Heer ([email protected])
# Copyright (c) 2015 Tim Schumacher ([email protected])
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the \"Software\"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
@enko
enko / conv_mac2ll.py
Last active August 29, 2015 14:16
a playbook to configure a host only by its mac address
#!/usr/local/bin/python
def mac2ll(mac):
mac = mac.split(":")
mac.insert(3,'fe')
mac.insert(3,'ff')
mac[0] = str(int(mac[0]) ^ 6)
return "fe80::%s:%s:%s:%s" % ("".join(mac[0:2]),"".join(mac[2:4]),"".join(mac[4:6]),"".join(mac[6:8]))
@enko
enko / conv_mac2ll.py
Last active August 29, 2015 14:16
Convert MAC to IPv6 linklocal
#!/usr/local/bin/python
def mac2ll(mac):
mac = mac.split(":")
mac.insert(3,'fe')
mac.insert(3,'ff')
mac[0] = str(int(mac[0]) ^ 6)
return "fe80::%s:%s:%s:%s" % ("".join(mac[0:2]),"".join(mac[2:4]),"".join(mac[4:6]),"".join(mac[6:8]))
#!/bin/bash
i="0"
while [ $i -lt 60 ]
do
curl -k https://r.datenknoten.me
echo -e ""
sleep 60
i=$[$i+1]
done
@enko
enko / index.js
Created December 2, 2014 19:39
Retrieve the currently connected users
var xmpp = require('node-xmpp');
var util = require('util');
var sys = require('sys');
var ZabbixSender = require('zabbix-sender');
var config = require('./config').config;
var start = process.hrtime();
<?php
function calculateRatio(DateTime $now, DateTime $startdate, DateTime $enddate, $duration_type) {
$months = 0;
switch($duration_type) {
case OrderItemAttribute::DURATION_QUARTER:
$months = 3;
break;
case OrderItemAttribute::DURATION_HALFYEAR:
$months = 6;
break;

Keybase proof

I hereby claim:

  • I am enko on github.
  • I am 0xaffe (https://keybase.io/0xaffe) on keybase.
  • I have a public key whose fingerprint is 9055 4415 45C7 4387 9E80 1E90 0774 0725 A83D CDBB To claim this, I am signing this object:
@enko
enko / gist:6648828
Created September 21, 2013 09:15 — forked from anonymous/gist:6648750
<?php
require_once 'vendor/autoload.php';
use Guzzle\Http\Client;
$client = new Client('http://192.168.0.5:5280');
@enko
enko / .gitignore
Last active December 19, 2015 04:59
Holt die verbundenen MAC-Adressen und versucht die Hersteller rauszufinden.
node_modules
@enko
enko / index.js
Created June 1, 2013 20:11
A Zabbix-check for prosody.
var xmpp = require('node-xmpp');
var util = require('util');
var sys = require('sys');
var ZabbixSender = require('zabbix-sender');
var config = {
server : "192.168.0.5",
real_server : "boese-ban.de",
user : "[email protected]/check",