30/12/2011

MOSLO, a short story of how is it cooked

Well, MOSLO has been OUT for some time now, and I was thinking it might be time for me to explain more about it!

First, for those not knowing it yet, it is available here: http://wiki.meego.com/ARM/N950. The MOSLO was done to support multiple OS loading on the N9/N950 devices from Nokia.

The basic "architecture" or flow is this:
  1. Bootloader launches the kernel
  2. The kernel boots from rootfs
  3. Rootfs contains the scripts to either:
    1. export USB to the Host PC so that the developer can put another kernel (in the boot/bzImage) and rootfs or
    2. load the boot/bzImage from the "exported USB" image if there is such kernel
Another thing about MOSLO is how to install it. Here we need to understand a bit about the role of the Harmattan flashing architecture. The design is to load into the device the right software that will do the work of flashing MOSLO. For that, we can use any Harmattan image (or "fiasco.bin") that is released with the One Click Flasher (or OCF).

Once we have the right image loaded, we can send the MOSLO to be flashed. As such, MOSLO comes packaged for N950 or N9.

21/05/2011

Ubuntu, extra repositories (ppa's) and living on the edge...

For those that are using launchpad, the term PPA should be quite familiar. This short entry is for them. I have been using PPA since 4-5 years ago. Before, I used to have my own repos in: packages.antoniac.name. Then, something changed and Ubuntu guys, through launchpad.net, started allowing personal package archive access (or PPA) and builds. Now, the trouble with them is the conflicting of packages (you might think). However, behind the PPA submission of packages is a clever name convention and ultimately you have quite a good control of where the package comes from. Now, to add more honey to the sweet thing, you could use several commands to automate inclusion and removal of the ppa's:

sudo aptitude install ppa-purge # To be able to remove it later (if you don't have it)
sudo apt-add-repository ppa:pan1nx/ppa
sudo aptitude update
sudo aptitude safe-upgrade # or install new packages
sudo ppa-purge ppa:pan1nx/ppa # To remove the packages and install the original

Hope this help some of you handle the ppa's in a friendlier way...

20/04/2011

Console rulez (as in linux console)

Yep, once again I find myself dragged into blabbing about the beauty of the consoles. I had some troubles with the network and the only way to work in the servers room was, you guessed, console.

Now, I want to briefly share some goodies with you:

wavemon
Awesome tool for helping you with debugging the wifi signal at the server (if you have such thing at the server)
iperf
Another good tool to test the performance between two points on the network
nload
Comes very handy if you need a graph showing the bandwidth. There are other tools here, like iptraf, etc. I just like this one...

Hack, I should expand this article later when I remember other goodies like this...

17/02/2011

QNAP, FlexGet and Transmission or How to watch your favorite TV shows without a DVR/TiVo...

Well, if you, like me, enjoy downloading shows from the web via RSS, there is FlexGet (from FlexGet.com. Problem is, how to get that egg running on your NAS (especially when you have the old QNAP x09). Here are some steps to come to your aid:

  1. You need to have ipkg. I used the QPKG to install the IPKG then, in ipkg, I use the repository from:

    http://ipkg.nslu2-linux.org/feeds/optware/tsx09/cross/unstable/Packages
  2. Second, you need to install the right python setuptools (after running ipkg update, of course):

    [~] # ipkg install py25-setuptools
    Installing py25-setuptools [.....]
    Successfully terminated.
    

    Be patient, this took a while to install...
  3. Then, from the FlexGet page you get the right download and install it (at the time at this post I was running it like this):

    mkdir /share/tmp
    export TEMP=/share/tmp
    cd /share/tmp/
    wget http://download.flexget.com/unstable/FlexGet-1.0r1419-py2.6.egg
    ls
    # shows FlexGet-1.0r1419-py2.6.egg
    easy_install ./FlexGet-1.0r1419-py2.6.egg
    Another alternative to fix the TEMP is to make the /tmp size bigger:
    mount -o remount,size=128M /tmp

    Make sure you change the default temp directory as it will run out of space if you use the default one.
  4. Now you have it installed in /opt/local/bin/flexget and you should make it work for you. Edit the crontab and add (username is whatever user you have there, or other favorite location). Beware that crontab is in /etc/config/crontab or /mnt/HDA_ROOT/.config/crontab:
    0 4 * * * /opt/local/bin/flexget --cron -c /share/*USERNAME*/.flexget/config.yml
    
  5. Config file shold be linked also:

    ln -s /share/username/.flexget/config.yml /share/MD0_DATA/.qpkg/Optware/local/config.yml
    
  6. Install transmission
    ipkg install transmission
  7. Install your own rc.local that will auto-start the transmission at reboot:
    cat > /share/*USERNAME*/rc.local <<EOF
    #!/bin/sh
    echo "/share/MD0_DATA/.qpkg/Optware/lib/" >> /etc/ld.so.conf
    ldconfig
    export EVENT_NOEPOLL=0
    export TRANSMISSION_WEB_HOME=/share/MD0_DATA/.qpkg/Optware/share/transmission/web
    /share/MD0_DATA/.qpkg/Optware/bin/transmission-daemon -p 9091 -T -a YOUR.SUBNET.IP.* -w /share/Qdownload/ -g /share/Qdownload/config/ > /var/log/debug_tm.txt
    EOF
    
  8. And if you want to be more of a maniac and optimize the TCP/IP stack default, you can append this:
    cat >> /share/*USERNAME*/rc.local <<EOF
    # Some tcp/ip optimizations
    ifconfig eth0 txqueuelen 50000
    # ifconfig eth1 txqueuelen 50000
    # default: 0
    echo 1 > /proc/sys/net/ipv4/tcp_rfc1337
    # default: 0
    echo 2 > /proc/sys/net/ipv4/tcp_frto
    # default: 0
    echo 1 > /proc/sys/net/ipv4/tcp_mtu_probing
    # default: 0
    echo 1 > /proc/sys/net/ipv4/tcp_workaround_signed_windows
    # default: 0
    echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse
    # default: 0
    echo 1 > /proc/sys/net/ipv4/tcp_low_latency
    # default: 0
    echo 1 > /proc/sys/net/ipv4/tcp_ecn
    EOF
    

Comments are welcome. There are other fine tunning things that you can do also, especially regarding the transmission configuration, twonkymedia, or even flexget, so fell free to ask me questions...

Useful link for:
1. Transmission
2. wiki: Running Your Own Application at Startup
3. Network speed optimizations