yuwei.net.nz | Bits of what I am doing

Jun/10

29

One week with iRiver Story

Today, I have had my iRiver Story ebook reader for 1 week. I have read 3 short books on it. I think it is time I should share my experience with it.

Here is some spec of it:

  • 6″ e-ink screen
  • qwerty keyboard
  • 2GB internal storage
  • support SD card up to 32G
  • 3.5mm headphone jack and external speaker for mp3

For photos, visit my flickr. It looks like an Amazon Kindle.

I always like to find what I can do more with things, like what I done to my ASUS router. I few searching online, I found it runs Linux, yeah! With busybox and uses cairo for drawing vectors. It is listed on Openinkpot as work in progress, so I don’t think it will take long to have a working rom.

I mainly using this reader for reading book in Chinese, that includes books in epub, PDF and txt format. It does a good job with epub and txt. Especially for txt format, text font can be customized by uploading .ttf font files. However, it does not go well with PDF format. It can zoom in to user defined part of the PDF document and reorganize paragraphs, but the font of the PDF document is usually not dark and bold enough for reading. There are a few online book/comic sources provides PDF documents that is formated for 6″ readers, these document works really well.

Furthermore, there are few things I don’t like about it. Firstly, I would say it is impossible to read magazines on this reader. It only has 8 levels of greyscale. The pictures looks ugly and 6″ is not big enough for magazine. If you wanna read magazine, get an iPad. Secondly, battery lifetime is not as good as they advertised, 7000 pages turns. Mine only takes around 3000 to 3500 pages. I don’t know whether it is because the battery need couple more cycles to do a batter job, or because my books are stored on SD card. Thirdly, the list of books is listed  in a single list and display 7 of them in each page(just for book, it does put comic into different list), which make it really hard to find a book. It requires to flip through multiple pages to find a book. It needs a better way of listing book or a search functionality. Finally, the slowness of turning page. I think this is the comment problem for e-ink readers.

In conclusion, I am happy with the hardware, and couple of tweaks on the system would make it a great reading device. I think it worth the money I paid for it (~ NZ$375). For those of you want to buy it, WAIT!!! They are working on a new version that includes WIFI.

For more information, here are some links people that want to know more about iRiver Story:

http://www.gennard.net/blog/tag/iriver-story/

http://vanderwijk.info/

http://openinkpot.org/wiki/Device/Story

No tags

  • It is almost impossible to model every normal behavior. Also, definition of normal and anomalous is not precise.
  • Intrusion/malicious attacks try to make their behavior looks like normal.
  • State of normal is changing over time.
  • Anomaly is defined differently over different application. (medical, education, stock market, etc.)
  • Lack of validation data
  • Noise in the data makes detection more difficult.

Summary from Anomaly Detection: A Survey

1541882

Anomaly detection: A survey (article)

Author

Chandola, Varun and Banerjee, Arindam and Kumar, Vipin

Journal

ACM Comput. Surv.

Year

2009

Volume

41

Number

3

Pages

1–58

Address

New York, NY, USA

Date-Added

2009-10-19 15:26:32 +1300

Date-Modified

2009-10-19 15:26:32 +1300

Doi

http://doi.acm.org/10.1145/1541880.1541882

Issn

0360-0300

Publisher

ACM

@article{1541882,
Address = {New York, NY, USA},
Author = {Chandola, Varun and Banerjee, Arindam and Kumar, Vipin},
Date-Added = {2009-10-19 15:26:32 +1300},
Date-Modified = {2009-10-19 15:26:32 +1300},
Doi = {http://doi.acm.org/10.1145/1541880.1541882},
Issn = {0360-0300},
Journal = {ACM Comput. Surv.},
Number = {3},
Pages = {1–58},
Publisher = {ACM},
Title = {Anomaly detection: A survey},
Volume = {41},
Year = {2009},
Bdsk-File-1 = {YnBsaXN0MDDUAQIDBAUIJidUJHRvcFgkb2JqZWN0c1gkdmVyc2lvblkkYXJjaGl2ZXLRBgdUcm9vdIABqAkKFRYXGyIjVSRudWxs0wsMDQ4RFFpOUy5vYmplY3RzV05TLmtleXNWJGNsYXNzog8QgASABqISE4ACgAOAB1lhbGlhc0RhdGFccmVsYXRpdmVQYXRo0hgNGRpXTlMuZGF0YU8RAbAAAAAAAbAAAgAADE1hY2ludG9zaCBIRAAAAAAAAAAAAAAAAAAAAMSis9dIKwAAABLceRBhMTUtY2hhbmRvbGEucGRmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAqOFQxwI13wAAAAAAAAAAAAEAAwAACSAAAAAAAAAAAAAAAAAAAAARYW5vbWFseSBkZXRlY3Rpb24AABAACAAAxKILFwAAABEACAAAxwF/DwAAAAEAEAAS3HkAC6OWAAujfwAAev4AAgBETWFjaW50b3NoIEhEOlVzZXJzOmFsZXg6RG9jdW1lbnRzOmFub21hbHkgZGV0ZWN0aW9uOmExNS1jaGFuZG9sYS5wZGYADgAiABAAYQAxADUALQBjAGgAYQBuAGQAbwBsAGEALgBwAGQAZgAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAASADdVc2Vycy9hbGV4L0RvY3VtZW50cy9hbm9tYWx5IGRldGVjdGlvbi9hMTUtY2hhbmRvbGEucGRmAAATAAEvAAAVAAIAC///AACABdIcHR4fWCRjbGFzc2VzWiRjbGFzc25hbWWjHyAhXU5TTXV0YWJsZURhdGFWTlNEYXRhWE5TT2JqZWN0XxAiYW5vbWFseSBkZXRlY3Rpb24vYTE1LWNoYW5kb2xhLnBkZtIcHSQloiUhXE5TRGljdGlvbmFyeRIAAYagXxAPTlNLZXllZEFyY2hpdmVyAAgAEQAWAB8AKAAyADUAOgA8AEUASwBSAF0AZQBsAG8AcQBzAHYAeAB6AHwAhgCTAJgAoAJUAlYCWwJkAm8CcwKBAogCkQK2ArsCvgLLAtAAAAAAAAACAQAAAAAAAAAoAAAAAAAAAAAAAAAAAAAC4g==}}

No tags

Oct/09

20

wavr test

No tags

Aria2-1.6.0 Makefile:


include $(TOPDIR)/rules.mk

PKG_NAME:=aria2
PKG_VERSION:=1.6.0
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://path.to/source

#PKG_MD5SUM:=c97eb0d4f36aa76448ecd660b143c467
#PKG_CAT:=zcat

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)

TARGET_LDFLAGS+= \
	-Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
	-static

TARGET_CXXFLAGS+= \
	-s

include $(INCLUDE_DIR)/package.mk

define Package/aria2
SECTION:=net
CATEGORY:=Network
DEFAULT:=y
TITLE:=download manager
URL:=http://aria2.sourceforge.net/
DEPENDS:=+libgnutls +zlib
endef

define Package/aria2/description
	download manager
endef

define Build/Configure
        (cd $(PKG_BUILD_DIR); \
		$(TARGET_CONFIGURE_OPTS) \
		 LDSHARED="$(TARGET_CC)" \
		 CXXFLAGS="$(TARGET_CXXFLAGS) $(TARGET_CFLAGS) $(FPIC)" \
		 LDFLAGS="$(TARGET_LDFLAGS)" \
		 UNAME_S="Linux" \
		 ./configure \
			 --with-gnutls --host=mipsel-linux --disable-nls \
			 --with-libz-prefix=$(STAGING_DIR)/usr/lib \
	 );
endef

define Build/Compile
	$(MAKE) -C $(PKG_BUILD_DIR)
endef

define Package/aria2/install
	install -m0755 -d $(1)/usr/bin
	install -m0755 $(PKG_BUILD_DIR)/src/aria2c $(1)/usr/bin/
endef

$(eval $(call BuildPackage,aria2))

· ·

Sep/09

13

Xnet Dashboard Widget 0.1

Xnet is one of ISPs in New Zealand. Personally, I am enjoying use their services. However, there is one thing that I dislike after I changed to use Safari instead of Firefox. Since I am using Xnet’s FUSION plan, I would like to know how many data I have used (of course, how much I have spent). The disappointment is Xnet only provides Windows widget and Firefox extension usage monitor. In my case Mac + Safari, there is no way to keep myself up to date of data usage. At the end, I decided to write myself a usage monitor dashboard widget.

By browsing the Windows widget, I found the information I need, for example, query link and data encryption. There is not much point to go under the hood to explain the code. So here is what the widget looks like.

Xnet Usage Monitor Widget Front

Xnet Usage Monitor Widget Front

And the preferences (Back side of the widget)

Xnet Usage Monitor Widget Back

Xnet Usage Monitor Widget Back

For those of Mac users who are using Xnet as well, try it out. Download. If you found any bug, you are welcome to report it in the comment area.

No tags

Sep/09

5

Composition and Pattern

It’s a sunny day for some shadow photographing. I captured some shadow.

Before all the shooting, check white balance. I used a white A4 paper and took a photo of it. The image of the paper then was used for custom white balance.

The first photo is an easy weatherboard wall shadow. You can find these all around NZ. The classic diagonal composition makes it looks less boring.

Wall Pattern

Second photo is an outside table and its shadow on the wall. This time, there are more lines and they are no longer in parallel. This photo is kind broken the 1/3 composition rule. The separation is right in the middle. The thinking was that I want it to be balanced between dark shadow and bright desk. It also tells what object that shadow is from.

Table Shadow

The object I am capturing is getting larger and lager. Here is the shadow from fence. Same as the first photo, it was composited in the diagonal way. More to that, this time I added 3rd dimension to it, the depth. The fence is way too colorful to make viewer to just look at the composition, therefore I changed it to black and white.

B&W Fence Shadow

To upload the last photo is to proof I have done my laundry while I were taking photos. And it is diagonal too.

Laundry Day

No tags

Aug/09

28

Stay 2 Degree

2 Degree is a new mobile services provide in NZ. Having this blog entry just wanna upload a photo of the envelop they used for sending me the free sim card.

IMG_6120

No tags

Jul/09

21

Audio on WL-500W

I bought a USB audio controller of trademe to continue add things to my WL-500W. The USB audio controller is one of those cheapest one(It cost me $6 plus $4 for postage.).  The reason I wanna add a USB audio controller to my WL-500 is that I want to use it as a mpd server for music.

The USB audio controller looks like this.

The package

The package


USB audio controller

USB audio controller

To get OpenWrt kernel to pick it up, there are some packages need to be installed

kmod-sound-core

kmod-usb-ohci

kmod-alsa

Of course, I would like to control the volume, so also

alsa-lib

alsa-utils

After install the modules and utilities, kernel recognized the audio controller. I tested it is working by using madplayer(is included in opkg repository) to play some mp3s. Of course, install mpd. That’s it. Music on.

There are some problems I found with this setup. Firstly, the USB audio controller only works when I plug in to the router directly. When I plug it to a USB hub which connect to the router, it doesn’t work. This means I only have one spear USB port left when I use this USB controller. Dmesg shows following error:

ALSA usbaudio.c:875: cannot submit datapipe for urb 0, error -89: enable CONFIG_USB_EHCI_SPLIT_ISO to play through a hub

I will look into that to find what is wrong or I just need to enable it by compiling my own kernel.

The second problem I found is that the volume control does not fully work. I uses alsamixer to control the volume. The problem is it can only turn on the volume(full/100) or turn it off(0). To cop with this, I use the volume control nob on my speaker. It is a big problem when using headset.

Another problem is that the USB controller itself just too big physically. It can only fit into the bottom USB port on the router. After plug it in, it doesn’t leave any space for the top port to be usable. Therefore, I am using a USB extension cord which solved this problem.

No tags

In last post, I use the mips compiler from buildroot to compile axel then copy it over to OpenWrt router for using. Today, I spent a little while to investigate the way to compile axel to an ipkg package.

First step is to create a directory for axel under $(TOPDIR)/package, where $(TOPDIR) is the buildroot root.

cd /path/to/trunk

mkdir package/axel

Then create a Makefile in that directory. The Makefile contains  following lines

include $(TOPDIR)/rules.mk

PKG_NAME:=axel
PKG_VERSION:=2.4
PKG_RELEASE:=1

PKG_BUILD_DIR:=$(BUILD_DIR)/axel-$(PKG_VERSION)
PKG_SOURCE:=axel-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://path.to/axel-source
PKG_CAT:=zcat

include $(INCLUDE_DIR)/package.mk

define Package/axel
SECTION:=net
CATEGORY:=Network
DEFAULT:=y
TITLE:=axel
URL:=http://axel.alioth.debian.org/
endef

define Package/axel/install
install -m0755 -d $(1)/usr/bin
install -m0755 $(PKG_BUILD_DIR)/axel $(1)/usr/bin/
endef

$(eval $(call BuildPackage,axel))

This is for telling make what it is compiling, where the source code is and how it can be compiled. Remember to replace the PKG_SOURCE_URL to where your package is located.

Since axel does not use autoconf for Makefile configuration, it gets a bit hard to tell buildroot how to build it. The Makefile showed in above left out the compiling section to get buildroot to compile it by running ./configure and make. Therefore, I prepared a customized version of axel source code that uses autoconf.

Axel’s configure script not only generates the Makefile.settings which contains all the flags and arch settings, but also creates config.h file that contains the defined variables for code. Since I am only going to use axel on my openwrt router, I hardcoded the config.h file, as follow:

/* Axel settings, generated by configure */
#define _REENTRANT
#define _THREAD_SAFE
#define ETCDIR “/usr/bin”
#define LOCALE “/usr/share/locale”
#define ARCH “mipsel”

with this, we can now replace the configure script with autoconf. Configure.in file looks like this

AC_INIT(axel.c)

dnl find and test the C compiler
AC_PROG_CC
AC_LANG_C

AC_PROG_MAKE_SET

AC_HEADER_STDC
#AC_CHECK_FUNCS(gettext libpthread,,AC_MSG_ERROR(oop!))

VERSION=”2.4″
AC_SUBST(VERSION)

dnl read Makefile.in and write Makefile
AC_OUTPUT(Makefile)

I left out the dependemcy check for libintl and libpthread. If I enable it, buildroot would complain that libintl could not be found even it is installed.  Just remember to install them as well. and the Makefile.in looks like this

CC = @CC@
VERSION = @VERSION@
CFLAGS = @CFLAGS@ -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Os -s
LFLAGS = -lpthread -lintl -static -L../../../staging_dir/target-mipsel_uClibc-0.9.30.1/usr/lib/libintl/lib

all: axel

axel: axel.o conf.o conn.o ftp.o http.o search.o tcp.o text.o
$(CC) *.o -o axel $(LFLAGS)

.c.o:
$(CC) -c $*.c -o $*.o -Wall $(CFLAGS)

clean:
rm -f axel *.o

distclean:
rm -f axel *.o Makefile

With these 2 file, run autoconf. Configure script will be generated. Now tar and zip your axel source folder to axel-2.4.tar.gz use the command:

cp -r /path/to/axel axel-2.4

tar zcvf axel-2.4.tar.gz axel-2.4

remember here, the folder must called axel-2.4. Otherwise, buildroot will complain that it can’t locate the source.

This is all. The next step is to build to world

cd /buildroot/directory

make package/symlink

make menuconfig          — select axel under network/net

make

Here is a version of axel I compiled. axel_2.4-1.ipkg

No tags

Jul/09

15

Crosscompile axel for OpenWrt

After the ASUS WL_500W has been setup, I had many fun playing with it. Since it has 2 USB 2.0 ports, it is a nice hardware to become my downloading machine, instead of my old 250W big box. Yep, save power bill. Usually, I downloading files from a remote server with Axel. By searching the package list from opkg, there is no sign of it. Google didn’t give much as well. So, last option, compile it myself.

Router itself is not suitable for compiling, considering the ram size and CPU speed. Therefore, cross compiling is the way to go. There are many ways to do that. I fell buildroot is the most straight forward method. Follow the link instruction, check out buildroot from svn, and compile it. We don’t really care about ‘make menuconfig’, since we only want the liberaries and compilers. However under the package directory where all the package is stored, there is no sign of gettext/libintl which is required for axel. So go back to the svn, check out gettext from branches/packages_8.09 and place it under package directory. They just type ‘make’ to compile the buildroot. This should give you all the things you need to compile axel.

Next, grab axel source from their website or svn. From openwrt’s buildroot doc, they would like you to compile the package under the packages directory with all the Makefile setup. In my case, I just want a working copy of axel, so I didn’t do that. I just compiled axel with the cross compiler from buildroot.

First of all, run ‘./confiure –i18n=0 –strip=0′ inside the axel source folder. This will disable the internationalization and binary stripping. Then edit the Makefile.setting. Replace

ARCH=Linux

to

ARCH=mipsel.

Edit LFLAGS to

LFLAGS=-static -L/path/to/buildroot/staging_dir/mipsel/usr/lib/libintl/lib -lintl -L/path/to/buildroot/staging_dir/toolchan-mipsel_gcc3.4.6/lib -lpthread

change CFLAGS to

CFLAGS=-Os -s -I/path/to/buildroot/staging_dir/toolchain-mipsel_gcc3.4.6/include -I/path/to/buildroot/staging_dir/mipsel/usr/lib/libintl/include -I/path/to/buildroot/staging_dir/mipsel/use/include

Remember the ‘-Os -s’. It helps to reduce the size of output binary. It is usually done during ‘make install’, but we are not doing that. So add it into your CFLAGS.

Next, change CC to your cross compiler

CC=/path/to/buildroot/staging_dir/toolchain-mipsel_gcc3.4.6/bin/mipsel-linux-gcc

Then, type ‘make’ to compile axel. An executable file called ‘axel’ should appear in the source directory. Copy it to your router and go nuts. For those of you don’t wanna compile it, here is a working copy I made.

No tags

Older posts >>

Theme Design by devolux.nh2.me