# change mirror to ubuntu.osuosl.org first
sudo apt-get update
sudo apt-get install build-essential libreadline-dev libssl-dev zlib1g-dev libxml2-dev libxslt-dev
require 'v8' | |
require 'open-uri' | |
require 'pp' | |
require 'ap' | |
require 'taka' | |
require 'ostruct' | |
# | |
# Monkey patch all elements to include a 'style' attribute | |
# |
build_package_patched() { | |
# These three patches are included when RVM builds REE | |
cd source | |
wget 'https://github.com/wayneeseguin/rvm/raw/master/patches/ree/1.8.7/tcmalloc.patch' | |
wget 'https://github.com/wayneeseguin/rvm/raw/master/patches/ree/1.8.7/stdout-rouge-fix.patch' | |
wget 'https://github.com/wayneeseguin/rvm/raw/master/patches/ree/1.8.7/no_sslv2.diff' | |
patch -p1 < tcmalloc.patch | |
patch -p1 < stdout-rouge-fix.patch | |
patch -p1 < no_sslv2.diff | |
cd .. |
require 'watir-webdriver' | |
capabilities = Selenium::WebDriver::Remote::Capabilities.phantomjs("phantomjs.page.settings.userAgent" => "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1468.0 Safari/537.36") | |
driver = Selenium::WebDriver.for :phantomjs, :desired_capabilities => capabilities | |
browser = ::Watir::Browser.new driver | |
# Quick test to make sure it's set | |
browser.goto 'http://www.useragentstring.com/' | |
browser.textarea(:id => "uas_textfeld").value |
As usual, use it at your own risk. I am not to be held responsible for your actions.
Supported devices: WNR1000v2 (tested by me), WNR1000v2-VC (provided by Comcast for free; tested by Douglas Fraser)
Notice: Upgrade WNR1000v2 to the latest factory firmware: 1.1.2.58. Otherwise, the power LED may not behave properly.
You need to place the device into failsafe mode. For booting into failsafe mode, you need to power up the device while holding the reset button with a pin. The power LED should have an amber colour. Hold the button until it is starting to flash green. It starts to flash green after it flashes the amber LED for six times. After that, the device is in failsafe mode, accepting a firmware via its TFTP server. The device should respond to pings at 192.168.1.1, although the responses may be malformed.
-- When fed to XPath selects all URLs from HTML document | |
-- from within HTML attributes designated to hold URL | |
-- One-line version | |
"//a/@href | //applet/@codebase | //area/@href | //base/@href | //blockquote/@cite | //body/@background | //del/@cite | //form/@action | //frame/@src | //frame/@longdesc | //head/@profile | //iframe/@longdesc | //iframe/@url | //img/@longdesc | //img/@usemap | //input/@src | //input/@usemap | //ins/@cite | //object/@classid | //object/@codebase | //object/@data | //object/@usemap | //q/@cite | //img/@src | //link/@href | //source/@src | //embed/@src | //script/@src | //audio/@src | //button/@formaction | //command/@icon | //html/@manifest | //input/@formaction | //video/@poster | //video/@src" | |
-- Multi-line version (readable) | |
"//a/@href | |
| //applet/@codebase | |
| //area/@href | |
| //base/@href |
// Examples for using socat (and filan) | |
//"$" means normal user, "#" requires privileges, "//" starts a comment | |
/////////////////////////////////////////////////////////////////////////////// | |
// similar to netcat | |
// connect to 10.1.1.1 on port 80 and relay to and from stdio |