-
Initialize a new git repository at
/etc/
cd /etc/ sudo git init
-
Setup
.gitignore
cat << EOF | sudo tee .gitignore
import RPi.GPIO as G | |
from time import sleep | |
import sys | |
if (len(sys.argv) < 1): exit | |
pin = int(sys.argv[-1]) | |
MODE = "BCM" |
-----BEGIN PGP PUBLIC KEY BLOCK----- | |
Version: SKS 1.1.4 | |
Comment: Hostname: pgp.mit.edu | |
mQENBFLOhGwBCADLreJzn4F8bKodTjg/QY4AyvQQWxnM0h56xsUmqTZqvRCp9kgtrcR5Bnvp | |
kMMRoIx9rOM7Hnp/LrxogZ8ZHbp+r3eQt3tp8p7ZwymQCT8cZoreTQplDp4eqZmnPh4BMk3a | |
+gqvgPv5SShwQjNGtf8r31MWe+xTCx6Db1XYpHav0pSs06Gmf/Kh/WVMtTvh841R0OU9mWhk | |
OxnOYWDErPSzUolA9u4A20B3LVpowjoA5Oaq3kIzC+mgL7muXhiEA4hzL9WXqcDHPXyRS3ut | |
Djmz1oqXFIZFgwhUUDW6g1hyuVuulNZRMkFtqASi13x+qMF8PwbU6KvoVCXG9++yQF13ABEB | |
AAG0K0hlaW5yaWNoIEhhcnRtYW5uIDxoYXJ0bWFubkB1bmkta29ibGVuei5kZT6JAT4EEwEC |
# ------- | |
# ------- banzhaf - version 1.1 | |
# ------- | |
# ------- A simple self-contained function to compute the Banzhaf Power Index given: | |
# ------- * a list of integer weights for all voters in the system, sorted in ascending order | |
# ------- * the quota for the voting system | |
# ------- | |
# ------- This is a slight modification (mainly vectorization) of the code by | |
# ------- Ruben R. Puentedura (http://www.hippasus.com/resources/socialsoftware/index.html) | |
# ------- which was published under CC-License in 2004 |
""" | |
Computes a summary of (unique) bank transactions from CSV files | |
USAGE: | |
python account-summary.py account_statment1.csv account_statement2.csv ... | |
OUTPUT: | |
CSV printed to stdout with the following colums |
#!/usr/bin/python | |
import sys | |
import BaseHTTPServer | |
import urllib2 | |
from dateutil import parser, tz as dutz | |
from datetime import datetime, tzinfo | |
import ipdb | |
BREAK=ipdb.set_trace |
import org.zeromq.ZMQ; | |
import org.zeromq.ZMQException; | |
public class TermOnSend { | |
public static void main(String[] args) { | |
final ZMQ.Context ctx = ZMQ.context(1); | |
Thread threadB = new Thread(new Runnable() { | |
@Override | |
public void run() { |
# postgres.conf | |
# | |
# A simple upstart script for the postgresql server as installed from source | |
# http://www.postgresql.org/docs/9.3/interactive/installation.html | |
# | |
# Place this file in /etc/init/ | |
# | |
# Usage: | |
# $ sudo service postgres start|stop|status | |
# |
import psycopg2, psycopg2.extras | |
DSN = { | |
'dbname': "xxx", | |
'user': "xxx", | |
'password': "xxx"} | |
def main(): | |
con = psycopg2.connect(connection_factory=psycopg2.extras.NamedTupleConnection, **DSN) | |
cur = con.cursor() |
DROP VIEW IF EXISTS ft_trips; | |
DROP VIEW IF EXISTS ft_stats; | |
-- Create view with basic gps statistics: | |
-- a) trip_id | |
-- b) Sample Count | |
-- c) Maximal Distance to Helsinki Train Station | |
CREATE VIEW ft_stats(trip_id, count, dist) AS | |
SELECT trip_id, count(lonlat), Max(st_distance(lonlat, St_geometryfromtext('POINT(24.6006695 60.1893798)',4326))) | |
FROM sensor_gps |