Skip to content

Instantly share code, notes, and snippets.

# coding:utf-8
# Copyright 2011 litl, LLC. All Rights Reserved.
import httplib
import re
import urllib
import urlparse
from flask import Blueprint, request, Response, url_for
from werkzeug.datastructures import Headers
@rmamba
rmamba / TLDs
Last active March 27, 2023 06:26
{
"com": "whois.internic.net",
"net": "whois.internic.net",
"org": "whois.internic.net",
"edu": "whois.internic.net",
"uk.com": "whois.uk.com",
"eu.org": "whois.eu.org",
"ac": "whois.nic.ac",
"al": "whois.ripe.net",
"am": "whois.amnic.net",
@rmamba
rmamba / whois.py
Last active August 29, 2015 13:58
#!/usr/bin/python
import sys
import telnetlib
import socket
import os.path
import urllib2
import json
@rmamba
rmamba / btsyncd
Last active August 29, 2015 13:58
btsyncd start up script goes into /etc/init.d/btsyncd on RaspberryPi
#!/bin/sh
#sudo update-rc.d btsyncd defaults
BTSYNCPATH=/home/pi/BTSync
do_start () {
$BTSYNCPATH/btsync --config $BTSYNCPATH/btsync.conf
}
do_status () {
@rmamba
rmamba / btsync-install
Last active February 4, 2016 14:46
Install BTSync for ARM on RaspberryPi
#!/bin/bash
#On RaspberryPi run
#wget http://goo.gl/QaXLfr -O btsync-install
#sudo chmod +x btsync-install
#sudo btsync-install
cd /home/pi
mkdir BTSync
chown pi:pi BTSync
@rmamba
rmamba / restDB-install
Last active August 29, 2015 13:58
Install script for pyRestDB installation on RaspberryPI
#!/bin/bash
#On RaspberryPi run
#wget http://goo.gl/l9MalS -O restDB-install
#sudo chmod +x restDB-install
#sudo ./restDB-install
cd /home/pi
wget https://github.com/rmamba/pyRestDb/archive/v0.1.tar.gz -O pyRestDB.tar.gz
@rmamba
rmamba / timelapsed
Last active August 29, 2015 13:58
Timelapse daemon for RaspberryPI
#!/bin/sh
### BEGIN INIT INFO
# Provides: webcam
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Control raspistill
# Description: Control raspistill camera time lapse
# and save images to RAM disk.
#!/bin/sh
# Generic Daemon start/stop script
# This goes to /etc/init.d folder
# $: /etc/init.d/btsyncd
# Replace:
# {PROGRAM} with program name [btsync]
# {EXEPATH} with path to program [/home/pi]
# {PIDFILE} with PID file name [/var/run/btsync.pid]
@rmamba
rmamba / HTMLTags.py
Created May 23, 2014 10:50
Based on http://code.activestate.com/recipes/366000/ and modified to be included in py files
import cStringIO
class TAG:
"""Generic class for tags"""
def __init__(self, inner_HTML="", **attrs):
self.tag = self.__class__.__name__
self.inner_HTML = inner_HTML
self.attrs = attrs
self.children = []
self.brothers = []
@rmamba
rmamba / raspi-blacklist.conf
Created May 31, 2014 12:10
wget raspi-blacklist.conf and avoid editing the file
# blacklist spi and i2c by default (many users don't need them)
#needs to go into /etc/modprobe.d/raspi-blacklist.conf
#Don't blacklist spi and i2c drivers
#blacklist spi-bcm2708
#blacklist i2c-bcm2708