Skip to content

Instantly share code, notes, and snippets.

Avatar

noestreich

  • Berlin
View GitHub Profile
@noestreich
noestreich / itunes_festival.py
Created Aug 4, 2011 — forked from jrave/itunes_festival.py
Quick and Dirty script to automate some stuff for the itunes festival streams
View itunes_festival.py
import urllib2
import re
url = ''
host='http://streaming.itunesfestival.com'
def get_token():
sub = url.find('?token=')
return url[sub:]
@noestreich
noestreich / DriveNow-Statusboard.php
Last active Dec 16, 2015
Snippet for Panic's iPad App "Statusboard" to show available Drive Now cars in Berlin within a predefined radius. i.e: How many free cars are within 300m from my home-address? Screenshot: http://i.imgur.com/zjvq1Ev.jpg
View DriveNow-Statusboard.php
<?php
##config for homelocation and radius (in meter)
$myhomelat = "52.49993";
$myhomelng = "13.39190";
$myradius = "300";
## get the drive now json
$driveURL = "https://www.drive-now.com/php/metropolis/json.vehicle_filter?cit=6099";
$process = curl_init($driveURL);
curl_setopt($process, CURLOPT_HEADER, false);
@noestreich
noestreich / bvg-table.php
Last active Dec 16, 2015
BVG Departure-Times in Panic's Statusboard - Screenshot: http://i.imgur.com/29kQwt8.jpg PHP-snippet for Panic's iPad App "Statusboard" to show realtime "Ist-Abfahrtzeiten" from Berlins public transportation BVG. This PHP outputs the table of departuring trains on a predefined station, 8 Minutes from now (to account for the walk to the station). …
View bvg-table.php
<?php
## set timezone
date_default_timezone_set('EUROPE/Berlin');
## set date and time + 8minutes walking distance to the train station
$zeit = date('H:i', strtotime("+8 minutes"));
$tag = date('d.m.y', strtotime("+8 minutes"));
## set trainstation ID (find ID here: http://mobil.bvg.de/Fahrinfo/bin/stboard.bin/dox?rt=0& ) and a transtation name or abbriviation as you like
$bahnhof ='9120001';
@noestreich
noestreich / RasplexMon.py
Created Sep 20, 2014
RasplexMon: Rasplex Cron to send iOS-Push-Notification control Sonos Speaker and Philips HUE - Forum-Link: http://tinyurl.com/rasplex-cron
View RasplexMon.py
#!/usr/bin/env python
import datetime
import time
import urllib2
import xml.etree.ElementTree as ET
from os.path import expanduser
import logging
import logging.handlers
import httplib
import urllib
View osx-for-hackers.sh
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
View osx-for-hackers.sh
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
View hue-dimmer-sonos-control.py
#!/usr/bin/env python
import urllib, json, datetime, time, os, soco
# HUE Bridge IP
url = 'http://192.168.1.48/api/newdeveloper'
response = urllib.urlopen(url)
data = json.loads(response.read())
button = data['sensors']['3']['state']['buttonevent']
klickzeit = data['sensors']['3']['state']['lastupdated']
klickzeitunix = time.mktime(datetime.datetime.strptime(klickzeit, "%Y-%m-%dT%H:%M:%S").timetuple())
timestamp = int(time.time())
@noestreich
noestreich / FritzboxVPN.mobileconfig.xml
Last active Mar 13, 2022
Eine Profildatei zum Regeln von VPN-on-Demand Verbindungen zwischen iPhone und FRITZ!Box. Siehe: http://www.iphone-ticker.de/?p=97462
View FritzboxVPN.mobileconfig.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>IPSec</key>
<dict>
<key>AuthenticationMethod</key>
@noestreich
noestreich / VPN_On_Demand.xml
Last active Apr 25, 2020
Der VPN-On-Demand Codeblock zur Integration in eine Profildatei. Siehe: http://www.iphone-ticker.de/?p=97462
View VPN_On_Demand.xml
<!-- VPN-On-Demand Codeblock -->
<key>OnDemandEnabled</key>
<integer>1</integer>
<key>OnDemandRules</key>
<array>
<!-- VPN beim Zugriff auf Heimnetz-Adressen aufbauen -->
<dict>
<key>Action</key>
<string>EvaluateConnection</string>
<key>ActionParameters</key>
View Sonos_Game_Controller.py
#!/usr/bin/python
#-*- coding: utf-8 -*-
import pygame, soco
from pygame.locals import *
### Sonos im Netzwerk finden
speakers = soco.discover()
### Sonos Status und Playlist-Infos
def is_playing(transport_info):