Skip to content

Instantly share code, notes, and snippets.

@jiahuang
jiahuang / gist:21346a001f499d00411e
Created July 6, 2015 13:36
openwrt b/g/n settings
On the terminal:
```
uci set wireless.radio0.require_mode=g //把g换到b/n
uci commit
wifi
```

开关wifi: 改 /etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option channel '11'
        option hwmode '11g'
        option path '10180000.wmac'
 option htmode 'HT20'

Copy the packetspammer binary to /usr/bin on the Tessel, then run the following commands:

iw dev wlan0 interface add mon0 type monitor
ifconfig wlan0 down
ifconfig mon0 up
iw mon0 set channel 11
packetspammer -d0 mon0 > /dev/null
@jiahuang
jiahuang / devboards.md
Created May 20, 2015 22:49
list of small linux dev boards

#small linux dev boards

  • VoCore ($20)
  • CHIP ($9, probably won't ship until next year though)
/* global console */
/* global require */
var tessel = require('tessel');
var http = require('http');
var mainLoop = function() {
var options = {
hostname: '192.168.1.106',
port: 3000,
@jiahuang
jiahuang / cc3k_post_log
Created July 30, 2014 07:36
cc3k post log
← read HCI_EVNT_SOCKET <- socket #1 opened.
→ write HCI_CMND_SETSOCKOPT 24 bytes: <Buffer 01 00 00 00 ff ff 00 00 00 40 00 00 08 00 00 00 04 ...>
← read HCI_EVNT_SETSOCKOPT 4 bytes: <Buffer ff ff ff ff>
→ write HCI_CMND_CONNECT -> connecting socket #1... (8.8.8.8)
← read HCI_EVNT_CONNECT 4 bytes: <Buffer 00 00 00 00>
→ write DATA 46 'bytes:' <Buffer 01 00 00 00 0c 00 00 00 1d 00 00 00 00 00 00 00 df ...>
← read HCI_EVNT_SEND 8 bytes: <Buffer 01 00 00 00 1d 00 00 00>
→ write HCI_CMND_SELECT → r .1.. w .... e .1.. [non-blocking, timeout: 3750ms]
← read HCI_EVNT_SELECT ← r .1.. w .... e .... [status 1]
→ write HCI_CMND_RECVFROM 12 bytes: <Buffer 01 00 00 00 01 10 00 00 00 00 00 00>
@jiahuang
jiahuang / cc3k_trace
Created July 30, 2014 07:18
cc3k error trace
→ write HCI_CMND_SOCKET -> request to open socket...
← read HCI_EVNT_SOCKET <- socket #0 opened.
→ write HCI_CMND_SETSOCKOPT 22 bytes: <Buffer 00 00 00 00 ff ff 00 00 02 00 00 00 08 00 00 00 02 ...>
← read HCI_EVNT_SETSOCKOPT 4 bytes: <Buffer 2f 7b 08 00>
→ write HCI_CMND_SETSOCKOPT 24 bytes: <Buffer 00 00 00 00 ff ff 00 00 01 00 00 00 08 00 00 00 04 ...>
← read HCI_EVNT_SETSOCKOPT 4 bytes: <Buffer 00 00 00 00>
→ write HCI_CMND_SOCKET -> request to open socket...
← read HCI_EVNT_SOCKET <- socket #1 opened.
→ write HCI_CMND_SETSOCKOPT 24 bytes: <Buffer 01 00 00 00 ff ff 00 00 00 40 00 00 08 00 00 00 04 ...>
← read HCI_EVNT_SETSOCKOPT 4 bytes: <Buffer ff ff ff ff>
var board = require('tessel');
var net = board.net;

console.log('opening tcp socket');

console.log('connecting to', process.env.DEPLOY_IP);
var client = net.connect(3000, process.env.DEPLOY_IP, function () {
  console.log('writing');
 
@jiahuang
jiahuang / watchdog.c
Created November 30, 2012 05:55
ATTiny watchdog setting
uint8_t watchdog_count = 0;
ISR(WDT_vect) {
// This vector is for the watchdog timer
PORTA = PORTA | (1 << LED ); // The LED never goes on
++watchdog_count;
}
ISR(PCINT0_vect)
{
@jiahuang
jiahuang / .zshrc
Created August 28, 2012 06:31
zsh theme
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="AARON"
# Example aliases