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
van9ogh@VAN9OGH $ wpa_passphrase test "mypasswd" | |
network={ | |
ssid="test" | |
#psk="mypasswd" | |
psk=0e804f52de7e7565be873500fa038cef6a9e571f56d6757f419191f3b4fe65c6 | |
} |
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
default-lease-time 600; | |
max-lease-time 7200; | |
log-facility local7; | |
subnet 192.168.2.0 netmask 255.255.255.0 { | |
range 192.168.2.100 192.168.2.200; | |
option domain-name-servers 8.8.8.8, 8.8.4.4; | |
option routers 192.168.2.1; | |
default-lease-time 600; | |
max-lease-time 7200; | |
} |
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
sudo ifconfig wlan0 192.168.2.1 netmask 255.255.255.0 | |
sudo dhcp -q -cf /etc/dhcpd/dhcpd.conf wlan0 | |
sudo iptables -t nat -A POSTROUTING -o wlan2 -j MASQUERADE | |
sudo su | |
echo "1" /proc/sys/net/ipv4/ip_forward |
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
# acl控制是有优先级的, 由于我们学校内部有一个视频网站, 因此看校内网默认放行. | |
acl school_video dst 10.28.102.174 | |
http_access allow school_video | |
# 这里就是用来做阻塞的关键部分了, 看不明白不要紧, cp即可 | |
acl media rep_mime_type video/flv video/x-flv | |
acl media rep_mime_type -i ^video/ | |
acl media rep_mime_type -i ^video\/ | |
acl media rep_mime_type ^application/vnd.ms.wms-hdr.asfv1 |
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
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 8888 | |
iptables -t nat -A PREROUTING -i eth1 -p udp --dport 80 -j REDIRECT --to-port 8888 |
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 <avr/io.h> | |
#include <stdio.h> | |
#define F_CPU 8000000UL // 8MHZ | |
#include <util/delay.h> | |
#include <avr/interrupt.h> | |
#include "nRF24L01.h" | |
#define DDR_CSN DDB4 // PB4 | |
#define DDR_MOSI DDB5 // PB5 |
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
module YL69HumidityP { | |
provides interface Atm128AdcConfig; | |
uses interface MicaBusAdc as SoilHumidityAdc; | |
} | |
implementation | |
{ | |
async command uint8_t Atm128AdcConfig.getChannel() { | |
return call SoilHumidityAdc.getChannel(); | |
} |
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
module YL69HumidityControlP { | |
provides { | |
interface SplitControl; | |
} | |
uses { | |
interface Timer<TMilli> as Delay; | |
interface GeneralIO as Power; | |
} | |
} | |
implementation { |
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
configuration YL69HumidityC { | |
provides { | |
interface SplitControl; | |
interface Read<uint16_t>; | |
} | |
} | |
implementation { | |
components YL69HumidityControlP as Control; | |
components YL69HumidityP as Device; | |
components MicaBusC; |
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
#ifndef SMART_IRRIGATION_H | |
#define SMART_IRRIGATION_H | |
#define RESERVED_LEN 1 | |
// list of operation -> request_code | |
#define SET_SWITCH_STATUS_REQUEST 0x01// 设置传感器开关 | |
#define GET_SWITCH_STATUS_REQUEST 0x02// 获取开关状态 | |
#define GET_READING_REQUEST 0x03// 获取传感器采集的数据 | |
#define SET_READING_PERIOD_REQUEST 0x04// 设置采集的周期 |