30 Oktober 2010

live in dignity

Recent months I learn more about living in "real" neighbourhood, particularly how the chinese live. I wonder how they can survive in this tough days, when even many spaniard cannot resist. Chinese live their life as merchant, small merchant of food particularly that try to provide daily needs for people who are too busy or lazy to go to the supermarket, or provide stuffs during holidays(yes, they're never closed, unless once during general strike). In the beginning I wonder how they live against cruel supermarket price and very small captive market, but they make it. Their price is more expensive so it is unlikely that people will buy something there unless they don't have any choice, this chinese shops are really helpful actually.

Unlike other immigrants ethnic, chinese live in dignity, live upon their own business. They live really tough life, instead of obtain cheaper reseller price, they merely shop in cheap supermarket with ordinary retail price, and carefully pick the items which are in discount or membership sale program. Once I examined how one of them shop, incredible!, they check each item which are listed on the sale program one by one, take them (sometime all of these sale item).

they're great.

14 Oktober 2010

Nice Lattice theorem tutorial

http://www.iseclab.org/people/enji/infosys/lattice_tutorial.html

13 Oktober 2010

Configuration for 'optimal' eco performance linux on USB disk

It has been around 1 year I've been using my USB-disk linux installation as my main computing platform. Generally it is slow, particularly for writing. I even feel it runs much slower during shutdown. Just like general flash-disk devices, USB-disks have limited read-write lifetime, therefore I try to minimize any access to the disk. The idea is maximizing the usage of memory for read-write operations that occur very often.
Here are my configuration:

  1. /tmp. This directory is used for temporary read-write by default. I think in some distro this directory is put on memory by default when there are vast amount of memory. I also put the cache of favorite application there. Add a starting script on /etc/rcS.d/. Copy from one of it, change the name into Ssomething and modify the content as the following:

    ...
    ### END INIT INFO

    . /lib/init/vars.sh
    . /lib/lsb/init-functions

    make_tmp() {
    #preparing /tmp
    mkdir /dev/shm/tmp
    chmod 777 /dev/shm/tmp
    #we also prepare the browsers cache
    mkdir /dev/shm/tmp/google-chrome
    chmod 777 /dev/shm/tmp/google-chrome
    mkdir /dev/shm/tmp/epiphany
    chmod 777 /dev/shm/tmp/epiphany
    }
    case "$1" in
    start)
    # Using 'no !=' instead of 'yes =' to make sure async nfs
    # mounting is the default even without a value in
    # /etc/default/rcS
    make_tmp
    ;;
    ...
    Note: I usually use those two browser, haven't found out where are the cache of opera nor firefox/iceweasel.
  2. Swap file. Never ever use the flash disk as swap file/swap partition, I think it will shortened the lifespan of the disk a lot. I use my unused VGA memory as my swap file. The script is following. Note that sometime you need to run it twice, I don't know why.
    modprobe slram map=VRAM,0xc4000000,+0x0c000000
    modprobe mtdblock
    mkswap /dev/mtdblock0
    swapon /dev/mtdblock0
    swapon -s

  3. Installation cache and configuration (/var/cache/apt/) can be put on external disk and make a symlink to its proper directory
Warning: you must aware that having cache on memory may cause your computer runs out of memory, and using VGA card as swap file is unsafe.