September 2009 Archives

For a long time, I was looking for PowerPC machine to run Linux on it. I was planning to buy some PowerBook when I get good offer, but that opportunity never really came.

Playstation 3 hardware

Meantime, Sony has been reducing price of PlayStation 3 up to point where they don't include hyper-visor which is a shame. (also known as Other OS support). If I wanted to run Linux on it, I was running out of time. So, I decided to take a leap of fate and buy one 40Gb (CECHGxx) model for ~240 € which seemed like a good price for PowerPC at 3.2GHz with 256 Mb RAM and slowish disk:

dpavlin@ps3:~$ cat /proc/cpuinfo 
processor       : 0
cpu             : Cell Broadband Engine, altivec supported
clock           : 3192.000000MHz
revision        : 16.0 (pvr 0070 1000)

processor       : 1
cpu             : Cell Broadband Engine, altivec supported
clock           : 3192.000000MHz
revision        : 16.0 (pvr 0070 1000)

timebase        : 79800000
platform        : PS3
model           : SonyPS3
dpavlin@ps3:~$ free
             total       used       free     shared    buffers     cached
Mem:        213728      63372     150356          0       2608      25212
-/+ buffers/cache:      35552     178176
Swap:       586332          0     586332
root@ps3:~# hdparm -tT /dev/ps3da

/dev/ps3da:
 Timing cached reads:   1640 MB in  2.00 seconds = 819.90 MB/sec
 Timing buffered disk reads:   82 MB in  3.02 seconds =  27.17 MB/sec
You will not get access to graphic cards, but you can use it's 256 Mb of VRAM (DDR3) as block device, but it's also not very fast:
root@ps3:~# hdparm -tT /dev/ps3vram 

/dev/ps3vram:
 Timing cached reads:   1682 MB in  2.00 seconds = 841.64 MB/sec
 Timing buffered disk reads:   96 MB in  3.06 seconds =  31.40 MB/sec

root@ps3:~# dd_rescue -m 236M /dev/zero /dev/ps3vram
Summary for /dev/zero -> /dev/ps3vram:
dd_rescue: (info): ipos:    241664.0k, opos:    241664.0k, xferd:    241664.0k
                   errs:      0, errxfer:         0.0k, succxfer:    241664.0k
             +curr.rate:    15911kB/s, avg.rate:    15669kB/s, avg.load:  7.4%

root@ps3:~# dd_rescue -m 236M /dev/ps3vram /dev/zero
Summary for /dev/ps3vram -> /dev/zero:
dd_rescue: (warning): /dev/zero (241664.0k): Invalid argument!    
dd_rescue: (info): ipos:    241664.0k, opos:    241664.0k, xferd:    241664.0k
                   errs:      0, errxfer:         0.0k, succxfer:    241664.0k
             +curr.rate:    32621kB/s, avg.rate:    31898kB/s, avg.load: 14.8%
Normal usage is as swap (with higher priority than disk), but this basically just saves disk from spinning because disk is faster at writing (which you really care about if you are swapping to media) but slower at reading:
root@ps3:~# dd_rescue -m 236M /dev/zero /tmp/disk.speed.test
Summary for /dev/zero -> /tmp/disk.speed.test:
dd_rescue: (info): ipos:    241664.0k, opos:    241664.0k, xferd:    241664.0k
                   errs:      0, errxfer:         0.0k, succxfer:    241664.0k
             +curr.rate:    18400kB/s, avg.rate:    18392kB/s, avg.load: 19.2%

root@ps3:~# dd_rescue -m 236M /dev/zero /tmp/disk.speed.test
Summary for /tmp/disk.speed.test -> /dev/zero:
dd_rescue: (warning): /dev/zero (241664.0k): Invalid argument!    
dd_rescue: (info): ipos:    241664.0k, opos:    241664.0k, xferd:    241664.0k
                   errs:      0, errxfer:         0.0k, succxfer:    241664.0k
             +curr.rate:    24036kB/s, avg.rate:    22819kB/s, avg.load:  4.7%
Good news is that USB disks are almost as fast as internal drive:
root@ps3:~# hdparm -tT /dev/sdb

/dev/sdb:
 Timing cached reads:   1740 MB in  2.00 seconds = 870.84 MB/sec
 Timing buffered disk reads:   72 MB in  3.01 seconds =  23.89 MB/sec
Having said that, it's probably one of best machines I saw after my first Alpha :-). It's quiet, all hardware available is supported under Linux and provides great platform for PowerPC development.

Ethernet, on the other hand is fastest way to get data to or from machine:

root@ps3:~# nc -l -p 8888 < /dev/zero

root@t61p:~# nc 192.168.2.103 8888 | dd_rescue -m 1G - /dev/null
Summary for - -> /dev/null:
dd_rescue: (warning): /dev/null (1048576.0k): Invalid argument!    
dd_rescue: (info): ipos:   1048576.0k, opos:   1048576.0k, xferd:   1048576.0k
                   errs:      0, errxfer:         0.0k, succxfer:   1048576.0k
             +curr.rate:        0kB/s, avg.rate:    86905kB/s, avg.load: 12.4%
root@t61p:~# nc -l -p 8889 < /dev/zero

root@ps3:~# nc 192.168.2.61 8889 | dd_rescue -m 1G - /dev/null
Summary for - -> /dev/null:
dd_rescue: (warning): /dev/null (1048576.0k): Invalid argument!    
dd_rescue: (info): ipos:   1048576.0k, opos:   1048576.0k, xferd:   1048576.0k
                   errs:      0, errxfer:         0.0k, succxfer:   1048576.0k
             +curr.rate:        0kB/s, avg.rate:    68914kB/s, avg.load: 21.2%

What about graphics?

Basic support is frame-buffer in various resolutions over HDMI (I can't really test compost output). ps3-video-mode -m 130 is something you will type often if you are sitting away from your 1920x1200 LCD...

There is sample code to run RSX from 2007, but it doesn't seem it had any changes since then. There is also libps3rsx and video of it looks promising. It's also from 2007. And it seems you need firmware older than 2.10 which I don't have. Forum thread PS3 Development seems to be dead, but RSX page on wiki is nice overview.

Different approach is to use 6 available SPU cores for YUV to ARGB conversions with scaling. There is also patch for console mplayer -vo to enable movie decoding usable under Linux using SPUs. There is Debian packages for xserver-xorg-video-spu but for sid and it doesn't work for me (next step: recompile).

What about cells?

I still don't know. But, following projects also look very interesting:

Debian installation

I tried to install Debian following instructions for squeeze but between fighting with Sony menu (which I didn't like when I saw it first time on PSP) and trying to type of wireless keyboard which had incredibly short repeat key I wasn't successful. So I tried Debian Live for PS3 and it worked. apt-get dist-upgrade and few hours later I had 2.6.31.1 from www.kernel.org working.

Pitate se što imam protiv Java aplikacija na Internetu?

moj.t-com.hr-checkout-fail.png

Ovo je bio moj pokušaj da završim narudžbu i platim T-Com-u flat-rate ADSL na novom sučelju za korisnike. Tužno zar ne? Možda mi pokušavaju reći da promjenim davatelja usluga ako želim flat-rate? Ili jednostavno ne žele još 100 Kn svaki mjesec od mene?

Svaka enterprise Java aplikacija jednostavno nije dobra. Staro sučelje je lijepo radilo i tokom 5 godina koliko sam bio korisnik nekoliko puta sam bez problema mijenjao modele.

Few days ago, I was writing wiki page with user management description. In it, I wanted to have current data about users. Since I'm using wiki which has RSS feed include, I decided to hack on SQL2XLS until it produced RSS feed which I can include within page.

Usage is very similar to SQL2XSL: you just create a bunch of SQL files, and each of them will create one item in RSS feed. Items links in RSS feed will return just that SQL query.

If you need something similar, and have CGI enabled server, get sql2rss.cgi, create SQL files and you are ready to go...

Roughly six months ago, I wrote first version of Redis perl bindings. For some strange reason, I didn't push it to CPAN at the same time, but recent discussion on Redis list (and two pending e-mail about it) forced me to finally make a push.

And it was worth it! Just a day later we have KiokuDB::Backend::Redis. Did I mentioned it was just one day later? Remember: release often, release early, but also release at right place :-)

In my continuous quest to endless disk storage, I have ordered two D-Link DNS-323 NAS devices. Since this is my second NAS device (first was DSM-G600 which is PowerPC) I have some experience, so let's see what is inside this (big, black, heavy, metal) box.

dlink-DFDADE:~# uname -a
Linux dlink-DFDADE 2.6.12.6-arm1 #30 Mon Aug 18 14:19:14 CST 2008 armv5tejl GNU/Linux

dlink-DFDADE:~# free
            total      used      free    shared   buffers    cached
Mem:        61904     54808      7096         0     11824     30592
-/+ buffers/cache:     12392     49512
Swap:     1060208         0   1060208

dlink-DFDADE:~# cat /proc/cpuinfo 
Processor      : ARM926EJ-Sid(wb) rev 0 (v5l)
BogoMIPS       : 331.77
Features       : swp half thumb fastmult edsp java 
CPU implementer : 0x41
CPU architecture: 5TEJ
CPU variant    : 0x0
CPU part       : 0x926
CPU revision   : 0
Cache type     : write-back
Cache clean    : cp15 c7 ops
Cache lockdown : format C
Cache format   : Harvard
I size         : 32768
I assoc        : 1
I line length  : 32
I sets         : 1024
D size         : 32768
D assoc        : 1
D line length  : 32
D sets         : 1024

Hardware       : MV-88fxx81
Revision       : 0000
Serial         : 0000000000000000
So, it's a 330 Mhz ARM with 64Mb or RAM (expandable to 128Mb with SMT soldering, sic!) and a disk. D-Link provided firmware has oldish 2.6.12.6 kernel and usb modules just for printer support. Even worse (than usb keychains or wifi dongles not working) is RAID performance: in RAID0 (which is called performance by firmware) I get 32 Mb/s from single disk and just 37 Mb/s from stripe.

But, all is not bad, because we can install full Debian on DNS-323 which brings us latest software which is just apt-get away, LVM, and support for various recent hardware.

After flashing, and updating to latest Debian arm kernel for orion platform I got 44 Mb/s from single disk and 42 Mb/s from RAID0. So I'm really hitting some bus bandwidth problem somewhere... Even worse, RAID1 is just 36 Mb/s, suggesting that 330 Mhz arm just can't keep up with pair or 1.5Tb SATA drives connected to it.

Next logical step would be to think about a way to use drives individually, because aggregating them on device doesn't make sense. With 220 Mb/s bandwidth on network (which is supposedly 1 Gb/s, sic!) it should be possible to get 44 Mb/s of disk speed onto another machine. I tried vblade which provides AoE server in user-space and it's slow: just 8 Mb/s to directly connected ThinkPad over cross cable.

I will test NFS (and CIFS if everything else fails), but I can guess that I will end up using this device for incremental backup dumps on top of ext4 or maybe nilfs. We'll see...

Update: I didn't choose DSM-323 randomly. When I was deciding which NAS device to buy, I watched Debian on Network Storage Devices and Other Devices which is embedded below for your viewing pleasure (download hi-res version). Orion related stuff starts at about 13:50.

Did you ever wanted to write following on bottom of e-mail confirmation page?

If you registered somebody else, that person will get e-mail and not you. Sorry, we are not telepathic yet :-)
Well, we'll just add e-mail address to page with confirmation request. That should be enough, right?

Interesting title, isn't it? It's just what you need when you have classroom full of Windows machines and yet you want to share terminal screen which you are projecting onto every screen for easy copy/paste from your Linux laptop. Can it be done?

So, what do we have?

  • presentation laptop running xterm (with white background) projecting picture to whiteboard
  • Windows PC in front of every student
  • local network
And what do we want?
  • copy/paste from session to own editor on student's computer
  • students session should be view only
At first, VNC came to mind. But, then again I didn't find easy way to relay single session to multiple computers. And I wasn't really sure how well it would work with my copy/paste requirement. And it seemed a bit too complex. And after all, it's not graphic session, but instead just terminal running presentation in vim for syntax highlighting...

Windows

Biggest requirement on Windows in minimal deployment under normal user privileges. Putty seems like perfect fit: single executable, good terminal emulation. No brainier.

Linux

On my laptop, I used screen with session sharing but with read-only twist (giving every student my account on personal laptop just... doesn't seem sane).

First I created new student user which will connect to screen which shares my session. This account has well-known password written on whiteboard together with IP address of my laptop.

student user is starting screen and attaching to my shared perl session using shell script configured in /etc/passwd as default shell.

exec screen -x dpavlin/perl
So, to participate, students just ssh using Putty from Windows machines. So far, so good...

To make session read-only I needed to remove write permission from student user in screen. This proved to be a challenge in this solution, but not something that reading man screen can't solve:

# screenrc
multiuser on
acladd student
aclumask student-w

After starting shared session named perl

screen -S perl -c screenrc
everything is ready. If you can thing of simpler thing to do, I would love to hear it :-)

Unexpected consequence of this setup is my ability to switch to other screen in shared session screen on my laptop which changes projected session on whiteboard (to show table of contents or some random example in middle of presentation), but students will still see perl session with presentation.

Detailed step-by-step instructions how to setup view only screen sharing are available in my Sysadmin Cookbook.

About this Archive

This page is an archive of entries from September 2009 listed from newest to oldest.

August 2009 is the previous archive.

October 2009 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Pages

  • pics
OpenID accepted here Learn more about OpenID
Powered by Movable Type 5.04