Skip to content

Instantly share code, notes, and snippets.

@tanpinsiang
tanpinsiang / gist:4728212
Created February 7, 2013 03:38
几点要注意,祝你成功
有几点在ubuntu要注意:
1:
在chrome里打 /etc/network/interfaces
应该看到:
auto lo
iface lo inet loopback
2:
在ubuntu connect wifi哪里 有一个Edit Connections
在wired tab
@tanpinsiang
tanpinsiang / gist:5013240
Created February 22, 2013 13:00
flow meter code
#include <SoftwareSerial.h>
#define rxpin 2
#define txpin 3
//add the soft serial library
//set the RX pin to pin 2
//set the TX pin to pin 3
SoftwareSerial myserial(rxpin, txpin);
//enable the soft serial port
String inputstring = "";
String sensorstring = "";
@tanpinsiang
tanpinsiang / gist:5039088
Created February 26, 2013 15:05
reverse ssh and connect 3g
cd /usr/bin
sudo ./sakis3g connect APN="uninet" APN_USER="APN_USER" APN_PASS="APN_PASS" --console; python startup_mailer.py
ssh -f -N -T -R22222:localhost:22 amazon
ssh -p 22222 pi@localhost
var express = require('express');
var oauth = require('oauth');
var app = express.createServer();
var key = "[api-key]";
var secret = "[api-secret]";
var request = new oauth.OAuth(null, null, key, secret, '1.0', null, 'HMAC-SHA1');
app.get('/api-request', function(req, res){
request.get(
"http://127.0.0.1:8000/api/1.0/data.json",
// OAuth supports 3 legged and 2 legged (aka XAuth) authentication.
// This app demonstrates how to use 2 legged authentication with CartoDB
var sys = require('sys')
, querystring = require('querystring')
, OAuth = require('oauth').OAuth
, EventEmitter = require('events').EventEmitter;
function CartoDBClient(user, password, consumer_key, consumer_secret) {
/* Flatten das boostrap */
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;
import numpy as np
from math import pi, log
import pylab
from scipy import fft, ifft
from scipy.optimize import curve_fit
i = 10000
x = np.linspace(0, 3.5 * pi, i)
y = (0.3*np.sin(x) + np.sin(1.3 * x) + 0.9 * np.sin(4.2 * x) + 0.06 *
np.random.randn(i))
@tanpinsiang
tanpinsiang / wpa_supplicant.conf
Created September 11, 2013 07:36
wpa_supplicant smobilenet
ctrl_interface=/var/run/wpa_supplicant
network={
ssid="sMobileNet"
proto=WPA
key_mgmt=WPA-EAP
pairwise=TKIP
group=TKIP
eap=PEAP
identity="itsc username"