2012-04-14

My Dell Inspiron530

Just got a free Dell Inspiron530, with nice specification. I plan to use it us my working desktop. So, start to install xubuntu on it. As I have already have a live-usb, the usb will be used as the installation source. But I get a problem. We the system try to boot from my USB drive, it complain "boot error". This is really strange as I use to use my USB driver to install another two computer. After googling on the internet, I figure out the problem is from Dell's awful BIOS. The BIOS require USB drive to be exactly formated as it wanted, otherwise it will treat the USB drive as USB-zip0. The only software that I find be able to formate my USB drive to follow Dell's requirement is HP USB storage format tool.
After format my USB drive by using HP USB tool, this computer successfully recognized USB drive as USB-HDD and it did but into xubuntu installation interface. But I got another problem. The installation program cannot read the partition. The reason is, this old computer's hard disk used to be used to build a raid. So, there is old raid information on it. After remove the raid information by using 
"dmraid -E -r /dev/sda".
 xubuntu installation program successfully recognized all my existed partition.

南游记(四)-- 悉尼Day3

27日 悉尼 大晴天 hunter valley
27日早上一大早在酒店等车,另外等33同学。昨天头痛的她不知道今天能不能继续陪游。在酒店打个电话发现还生龙活虎,ok那今天的旅行是没有问题了。七点一刻老同学准时出现,估计是由于今天天气特别好的原因,老同学还稍做打扮。坐车,市区挨个酒店接完之后,八点整我们准时出发去猎人谷,开始品酒之旅。这时,看看车上的散拼客,老同学说我们报了一个老人团。一个半小时后,在中途的小镇停靠休息。看到很多人在一件小房子里面吃东西,我们就去品尝了一下,心想鬼老的团还真是不错,提供这么多东西。吃了一会儿后,一个工作人指出他们是当地了解土著人的团和我们不是一个团,汗呐,这下变成骗吃骗喝的了。老同学解释之后,工作人员高兴的说那边还有很多,想吃啥随便拿。澳洲村里人太好客了。半个小时后,我们到了今天的第一站,McWillian 酒厂,这里是1940年左右开始建成的葡萄园,一开始生产餐桌酒,不过销量不好,慢慢的转型做澳洲稍高端了,葡萄园主要有两种葡萄,白酒的和红酒的,红酒的主要是希拉。这里大部分是极其采摘,说是采摘,其实就是一通乱摇,把各种各样的葡萄都摇下来酿酒,不过偌大的葡萄园,两个人加机器就够了。人工的就费事很多,要大早晨,一点一点的找合适的采摘,所以叫精选葡萄酒。另外澳洲的葡萄酒都是加发酵粉催化出来的,3个星期左右就出栏了。按照解说人员的解释,酿酒就是控制好发酵,温度,氧化。不然很有可能酿出来的是醋。听了酿酒的常识,品尝了各种美酒。加上一顿牛排餐。开始觉得有点晕晕的感觉。餐后,司机把我们拉到另外一家酒厂,lindmans,看当地人的反应,似乎这家更加有名。继续平常各种美酒,冒泡的希拉,感觉像是香槟,还有各种甜酒。最终我们醉醺醺的准备前往最后一站。无一例外,仍然是吃吃喝喝。结束后,返回悉尼市,直奔想了很久的回转寿司店,一进店,发现这里的寿司种类异常的多,完全不是北欧可以比的。等地一个寿司进嘴,彻底震撼了。那口感实在是一绝,非常有yam yam 感。而鳗鱼寿司最终变成了我的最爱。由于吃吃喝喝了一天,实在是没有办法品尝更多。只能尽量找从来没有吃过的品尝。



 悉尼的城市一角
 路边的小亭子

 搭乘的巴士车
 途中小镇的警察局,在这里大家简单的歇歇脚。
Hunter Valley
 中午的时候,我们达到了McWillam 酒庄,在这里酒庄的工作人员简单的介绍了酒庄的历史,酿酒的工序流程。

McWillam 酒窖

中午在酒庄就餐
在吃喝一顿之后,我们前往第二个酒庄:lindemans




傍晚返回悉尼,路过有名的The Star (都城)
在悉尼的第三天,也是本次悉尼游的最后一天,晚餐就在市中心的回转寿司店。在这里吃到了我目前为止品尝过的最美味的寿司。还有本吃货的最爱,鳗鱼寿司。回转寿司店根据盘子的颜色不同,有不同的价钱。基本上是从2澳元到6澳元不等。吃完之后,自己的面前会有厚厚的一叠盘子。





2012-04-03

WR1043ND to OpenWRT

Complie personal build

First, I downloaded OpenWRT from official website and flushed it, it works pretty good. But there is a very important problem. OpenWRT does not support channel 12 and 13. These two channels are not allowed to be used in US. But, I am living in EU, it is no sense to waste two channels if there are more then 10 neighbors' wireless networks around you. As OpenWRT has an agreement with Atheros, they cannot provide pre-build bin file which support channel 12 and 13. So, I have to build my own one to let OpenWRT respect user's setting. On ubuntu/debian system install:
  bash$ sudo apt-get install subversion build-essential libncurses5-dev zlib1g-dev gawk flex quilt git-core
Create a folder to hold source files for compile:
  bash$ mkdir ~/OpenWRT
  bash$ cd OpenWRT
  bash$ svn co svn://svn.openwrt.org/openwrt/trunk/
  bash$ cd trunk
The respository can be found at https://dev.openwrt.org/wiki/GetSource. Option packages can be enabled in feeds.conf.default file which located at the root folder of the repository. Next, in order to update feeds after changing the sources, we need to run:
  bash$ scripts/feeds update -a
  bash$ scripts/feeds install -a

Then "scrips/feeds search xxx" can be used to search package and "scripts/feeds install xxx" can be used to install packages. The dependency will automatically be resolved by feed script.

To build rom for my router. I need to specify the setting:
  bash$ menuconfig
    Target System: Atheros AR71xx/AR7240/AR913X
    Target Profile: TP-LINK TL-WR1043ND v1
    Check the setting in Kernel modules-->Wireless Drivers-->kmod-ath-->configuration
  $make -j 3

First Login

After compile, file with name "openwrt-ar71xx-tl-wr1043nd-v1-squashfs-factory.bin" can be found in output folder. This is the file that need to flash on a factory router. Another one with name "openwrt-ar71xx-tl-wr1043nd-v1-squashfs-sysupgrade.bin" can be used to update router which already installed OpenWRT. The default status of a freshly instelled router is:
  • The internal interface lan and the wireless interface/interfaces wlan0 / wlan1 are bridged together to br-lan
  • wifi is disabled
  • the IP address of the internal interface/bridge of the OpenWrt-device is 192.168.1.1/24
  • dnsmasq is running; it allocates IP addresses in the range of 192.168.1.100 to .250 on the internal interface to connected hosts
  • dropbear does not accept connections
  • telnet daemon is running on standard port (23)
The first thing we need to do is to telnet to it and change the password. run command:
telnet 192.168.1.1
to connect to the router and:
root@openwrt:~$ passwd
Changing password for root
New password:
Retype password:
Password for root changed by root
root@openwrt:~$
after you set a password the telnet daemon will be disabled, type exit into the prompt.
without reboot, SSH is now available; so is HTTPS if the WebUI (LuCI) is installed with it's TLS-modules.
login again with ssh root@192.168.1.1

Install luci

Luci is a very easy to use GUI for OpenWRT. It can be installed from repository (other method). OpenWRT repository management system is similar to debian's dpkg, instead, it named opkg. As apt-get, the first thing to do is to retrieve the current list of available packages in the repository:
  opkg update
For a full LuCi installation without HTTPS suport:
  opkg install luci

Start LuCi(uHTTPd) server

Enable automatic start at boot and manually start the LuCi server with commands:
  
  /etc/init.d/uhttpd enable
  /etc/init.d/uhttpd start
After this, it is able to connect the router with web browser at http://192.168.1.1
uHTTPd can be configured, but it is not required.

Install required modules for WiFi

    opkg update
    opkg install kmod-ath9k wpad-mini
Wifi will be ready after reboot.

Install USB/HDD

To enable mass storage capability:

  root@OpenWrt:~# opkg install kmod-usb-storage
After that we can enable file system that we want to use. For example, we want to enable ext4 support:
  root@OpenWrt:~# opkg install kmod-fs-ext4
Now we can use blkid to list all avaiable disk. In my case, I got:
  root@OpenWrt:~# blkid
  /dev/sda1: UUID="0737-3F5F"
Ref:
  • http://knowhow.bart.prokop.name/install/openwrt/wr1043nd
  • http://blog.philippklaus.de/2011/04/openwrt-on-a-tp-link-tl-wr1043nd-gigabit-router

Setup DNS and DHCP

ref: http://wiki.openwrt.org/doc/uci/dhcp

Setup DDNS with ddns-scripts

Web interface can be used. But, in order to save more space, I decide to go to scripts. Check: http://wiki.openwrt.org/doc/howto/ddns.client

Install ddns-scripts package

  root@OpenWrt:~# opkg install ddns-scripts
The configuration is stored in /etc/config/ddns. At least one section has to be enabled to active ddns Enable the setting:
  root@OpenWrt:~# ACTION=ifup INTERFACE=wan /sbin/hotplug-call iface

WOL

I use my android phone to send wol message to my nas server. The name of the application is "Wol Wake On Lan Wan". I have already set up WOL function on my NAS. Here, we going to focus on Wol configuration on openwrt. 1. Add forwarding setting in firewall (/etc/config/firewall):
  config 'redirect'
    option '_name' 'wol' #name of this redirect 
    option 'src' 'wan' # message from internet
    option 'proto' 'udp' # wol package is udp
    option 'src_dport' '9' # wol port is set to 9
    option 'dest_ip' '192.168.0.2' # IP of NAS server
    option 'dest_port' '9'
    option 'target' 'DNAT' # I am using dynamic NAT
    option 'dest' 'lan' # of cause, my NAS is in my LAN
2. The next step is to add a binding between IP address and MAC address. Following ip command should be used to ask OpenWRT to remember ARP setting unless manual change or reboot. In order to keep this setting after rebooting. We need to add it to /etc/rc.local. So it will be invoked each time the router rebooted.
 
  ip neigh add 192.168.0.2 lladdr 1c:6f:65:b7:fe:b1 nud permanent dev br-lan
This command bind ip address 192.168.0.2 to MAC address 1c:6f:65:b7:fe:b1 and this is a permanent mapping to interface br-lan. If ip command is not installed yet. Run:
 opkg update
  opkg install ip
This command should be run manually, if we don't want to reboot the router. After this, command arp -a can be used to verify the mapping. Now the WOW should be ready.