Skip to content

Instantly share code, notes, and snippets.

@descilla
descilla / millionaer.vb
Created December 19, 2012 14:02
Ein kurzes Script, welches errechnet, wann man Millionär ist.
Sub millionaer()
Dim start As String
Dim percent As String
Dim output
Do
If IsNumeric(start) And IsNumeric(percent) Then
If (percent * 1) > "10" Then
percent = ""
Else
' start*percent^n = 1000000 (Kürzen(durch start teilen))
@descilla
descilla / Springerproblem.c
Last active August 29, 2015 14:12
Springerproblem
//
// main.c
// knightrider
//
// Created by Simon W. on 04.01.15.
// Copyright (c) 2015 Simon W. & Andy S. All rights reserved.
//
int springer( int zeile, int spalte, int num );
#include <stdio.h>
#include <time.h>
#!/usr/bin/python
# -*- coding: utf-8 -
#Imports:
import urllib, json, time
from pprint import pprint
from collections import OrderedDict
from geopy.geocoders import Nominatim
url = "https://freifunk-muensterland.de/map/data/nodes.json"
response = urllib.urlopen(url)
#response = open('nodes.json')
#
# OpenWrt Config file for collectd(1).
# Please read collectd.conf(5) for a list of options.
# http://collectd.org/
#
#Hostname "localhost"
#FQDNLookup true
BaseDir "/var/lib/collectd"
PIDFile "/var/run/collectd.pid"
#!/bin/sh
opkg update
opkg install collectd collectd-mod-interface collectd-mod-network collectd-mod-cpu collectd-mod-load collectd-mod-memory collectd-mod-ping collectd-mod-processes
cp -f collectd.conf /etc/collectd.conf
#!/usr/bin/python
import datetime
from pprint import pprint
def parse_leases(lease_file):
leases = {}
lease = {}
in_lease = False
for line in lease_file:
if line.lstrip().startswith('#'):
@descilla
descilla / dhcp.py
Last active November 16, 2015 20:33
#!/usr/bin/python
import datetime, collectd
def parse_leases(lease_file):
leases = {}
lease = {}
in_lease = False
for line in lease_file:
if line.lstrip().startswith('#'):
geo $switch {
default 0;
#Infopunkt-Hiltrup
2a03:2260:115:0:16cc:20ff:fe70:b69e 1;
#anaptis
2a03:2260:115:0:c66e:1fff:fe87:6a40 1;
#Freifunk-Rumphorst-01
2a03:2260:115:0:32b5:c2ff:feb0:74fa 1;
#00Q_Johann-Krane-Weg_8_X1
2a03:2260:115:0:eade:27ff:fe3c:181e 1;
geo $switch {
default 0;
#Schlossgarten-Cafe-03
2a03:2260:115:0:ea94:f6ff:fe6d:26fc 1;
#Heidhorn-Freifunk-Outdoor-1
2a03:2260:115:0:6a72:51ff:fe2e:e40d 1;
#Sportschuetzen-Hiltrup-Outdoor
2a03:2260:115:0:6a72:51ff:fe2c:e33c 1;
#Gazelle_03
2a03:2260:115:0:ea94:f6ff:fe29:da12 1;
geo $switch {
default 0;
#FanLin-HuoJian
2a03:2260:115:0:6a72:51ff:fe08:86fc 1;
#cafe-med-aussen
2a03:2260:115:0:6a72:51ff:fe20:ab80 1;
#kgbvax-m2-f-nnw
2a03:2260:115:0:6a72:51ff:fe24:e29e 1;
#00Q_Campus-Nienberge_X1
2a03:2260:115:0:c66e:1fff:febd:44e 1;