HAVE MOVED THE FILES TO a repo...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib, json | |
class SABnzbd(object): | |
""" | |
Usage: | |
>>> from sabnzbd import SABnzbd | |
>>> s = SABnzbd('sakar.local', 8080, '4488f2881b90d7753bef8fb9e1bc56b3') | |
>>> s.pause() # Pauses the downloads | |
>>> s.shutdown() # Shut's down SABnzbd+ | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# LICENSE: public domain | |
def calculate_initial_compass_bearing(pointA, pointB): | |
""" | |
Calculates the bearing between two points. | |
The formulae used is the following: | |
θ = atan2(sin(Δlong).cos(lat2), | |
cos(lat1).sin(lat2) − sin(lat1).cos(lat2).cos(Δlong)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
from wand.image import Image | |
with Image(filename='inputimagefile.tiff') as img: | |
print img.format | |
with img.convert('jpeg') as converted: | |
converted.save(filename='outputimage.jpg') | |
converted.resize(72,72) | |
converted.save(filename='outputimage_thumbnail.jpg') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -- coding: utf-8 -- | |
from win32api import * | |
from win32gui import * | |
import win32con | |
import sys, os | |
import struct | |
import time | |
class WindowsBalloonTip: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import RPi.GPIO as gpio | |
from time import sleep | |
import re | |
import sys | |
gpio.setmode(gpio.BCM) | |
red = 23 | |
yel = 24 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
#Kwh per weekday | |
import time | |
import logging | |
import calendar | |
from datetime import datetime | |
import redis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location ~ /\.git { | |
deny all; | |
} | |
# or, all . directories/files in general (including .htaccess, etc) | |
location ~ /\. { | |
deny all; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# September 2013 | |
# by Matthew Bordignon, @bordignon on Twitter | |
# | |
# Simple Python script (v2.7x) that subscribes to a MQTT broker topic and inserts the topic into a mysql database | |
# This is designed for the http://mqttitude.org/ project backend | |
# | |
import MySQLdb | |
import mosquitto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$conn = mysql_connect("thebeast.localdomain", "root", "") or die(mysql_error()); | |
mysql_select_db("mqtt") or die(mysql_error()); | |
?> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"/> | |
<title>Google Maps</title> | |
<style type="text/css"> |
OlderNewer