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 vpn server | |
sudo iptables -t nat -A POSTROUTING -s 192.168.100.0/24 -d 192.168.0.0/24 -j MASQUERADE | |
# mac os x client | |
sudo route add 192.168.0.0/24 192.168.100.1 | |
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
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384 | |
options=3<RXCSUM,TXCSUM> | |
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 | |
inet 127.0.0.1 netmask 0xff000000 | |
inet6 ::1 prefixlen 128 | |
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280 | |
stf0: flags=0<> mtu 1280 | |
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 | |
options=2b<RXCSUM,TXCSUM,VLAN_HWTAGGING,TSO4> | |
ether 10:9a:dd:46:41:8d |
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
worker.list=loadbalancer | |
worker.loadbalancer.type=lb | |
worker.loadbalancer.balanced_workers=contpub1 | |
worker.loadbalancer.sticky_session=1 | |
worker.loadbalancer.error_escalation_time=0 | |
worker.loadbalancer.max_reply_timeouts=10 | |
worker.contpub1.reference=worker.template | |
worker.contpub1.host=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
# default: off | |
# description: svnserve is the server part of Subversion. | |
# server_args = -i -r /var/lib/svn/repositories | |
service svn | |
{ | |
disable = no | |
port = 3690 | |
socket_type = stream | |
protocol = tcp | |
wait = no |
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
@Grapes([ | |
@Grab('org.seleniumhq.selenium.client-drivers:selenium-java-client-driver:1.0.2'), | |
@Grab('org.seleniumhq.selenium:selenium-server:2.25.0'), | |
@GrabConfig(systemClassLoader=false, initContextClassLoader=true) | |
]) | |
import com.thoughtworks.selenium.* | |
import org.openqa.selenium.server.* | |
seleniumServer = new SeleniumServer() |
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
@Grab('org.jsoup:jsoup:1.7.1') | |
def doc = org.jsoup.Jsoup.connect("https://news.google.com/nwshp?hl=zh-TW&tab=wn").get() | |
doc.select("#s_POPULAR .titletext").each { | |
node-> | |
println "title=${node.text()}" | |
} |
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
n02.jpg 0.052 | |
s10.jpg 0.037 | |
n05.jpg 0.099 | |
b02.jpg 0.110 | |
b04.jpg 0.085 | |
n04.jpg 0.088 | |
n10.jpg 0.064 | |
s04.jpg 0.028 | |
n03.jpg 0.064 | |
b03.jpg 0.066 |
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
@Grab('net.sourceforge.nekohtml:nekohtml:1.9.16') | |
def parser = new org.cyberneko.html.parsers.SAXParser() | |
def page = new XmlParser(parser).parse('https://news.google.com/nwshp?hl=zh-TW&tab=wn') | |
page.depthFirst().DIV.grep{ it.'@class'=='title' }.each { | |
println it.A.SPAN.text() | |
} |
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
<!-- | |
Solve the PayPal error: | |
paypal Data does not match input character set or default encoding. | |
--> | |
<input type="hidden" name="charset" value="UTF-8"> |
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
#define TRIGPIN 10 | |
#define ECHOPIN 13 | |
#define LED1 8 | |
#define LED2 9 | |
long ping() { | |
digitalWrite(TRIGPIN, LOW); | |
delayMicroseconds(2); | |
digitalWrite(TRIGPIN, HIGH); | |
delayMicroseconds(10); |