This file contains hidden or 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
有几点在ubuntu要注意: | |
1: | |
在chrome里打 /etc/network/interfaces | |
应该看到: | |
auto lo | |
iface lo inet loopback | |
2: | |
在ubuntu connect wifi哪里 有一个Edit Connections | |
在wired tab |
This file contains hidden or 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
#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 = ""; |
This file contains hidden or 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
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 |
This file contains hidden or 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
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", |
This file contains hidden or 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
// 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) { |
- node.js
- Installation paths: use one of these techniques to install node and npm without having to sudo.
- Node.js HOWTO: Install Node+NPM as user (not root) under Unix OSes
- Felix's Node.js Guide
- Creating a REST API using Node.js, Express, and MongoDB
- Node Cellar Sample Application with Backbone.js, Twitter Bootstrap, Node.js, Express, and MongoDB
- JavaScript Event Loop
- Node.js for PHP programmers
This file contains hidden or 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
/* 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; |
This file contains hidden or 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 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)) |
This file contains hidden or 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
ctrl_interface=/var/run/wpa_supplicant | |
network={ | |
ssid="sMobileNet" | |
proto=WPA | |
key_mgmt=WPA-EAP | |
pairwise=TKIP | |
group=TKIP | |
eap=PEAP | |
identity="itsc username" |