Software and hardware annotations 2009 September

This document contains only my personal opinions and calls of judgement, and where any comment is made as to the quality of anybody's work, the comment is an opinion, in my judgement.

[file this blog page at: digg Technorati]

090919 Sat Creating a database file with many small records
base# rm manyt.db
base# time perl manyt.db 1000000 2000 10000
  1 percent done, 990000 to go
  2 percent done, 980000 to go
  3 percent done, 970000 to go
 98 percent done, 20000 to go
 99 percent done, 10000 to go
100 percent done, 0 to go

real	81m6.812s
user	0m29.957s
sys	0m30.124s
base# ls -ld manyt.db 
-rw------- 1 root root 8108961792 Sep 19 20:36 manyt.db
base# time perl manyt.db 1000000 10000
  1 percent done, 9900 to go
  2 percent done, 9800 to go
  3 percent done, 9700 to go
 98 percent done, 200 to go
 99 percent done, 100 to go
100 percent done, 0 to go
average length: 5984.4108

real	7m22.016s
user	0m0.210s
sys	0m0.442s
090918 Fri How the NX proxies work on their own

The NX product has three completely different components:

The nxclient wrapper creates a rootless connection if the type of connection is selected as Unix and the flavour as Custom. This creates an xterm (or other window if desired and selects in the relevant Settings).

As to protocol optimization, the proxy is called nxproxy if it is like dxpc, and nxagent if it is like dxpc with VNC. The nxagent contains both a proxy and a virtual X server, and the virtual X server can run in both rooted and rootless mode.

To use it manually the typical sequences is, if the local computer is L and the remote computer is R ((and using FreeNX, the original NX does not have nxproxy but only nxagent, see below for that):

#1 on L: ssh -L R PORTL:localhost:PORTR R
#2 on R: nxproxy -C accept=localhost listen=PORTR display=localhost:DD&
#3 on L: nxproxy -S connect=localhost port=PORTL link=SPEED
#4 on R: xterm -display localhost:DD&

To get the extra VNC style optimization, #2 can be replaced with:

#2 on R: nxagent :DD -nolisten tcp -[DR] -forcenx \
  -display nx/nx,accept=localhost,listen=PORTR,display=unix:DD&

For comparison the equivalent VNC looks like:

#1 on L: ssh -L R PORTL:localhost:PORTR R
#2 on R: Xvnc :DD -SecurityTypes none -localhost -rfbport PORTR -geometry WWWxHHH&
#3 on L: vncviewer localhost:PORTL
#4 on R: xterm -display localhost:DD&

In both cases one can merge #1, #2 and #4 in a single command line.

In the VNC case, if one wants to access the primary display:

#1 on L: ssh -L R PORTL:localhost:5900 R
#2 on L: vncviewer localhost:PORTL

The nxclient and nxserver just add a kind of metaprotocol to do the above 4 steps in a use-friendly way. Since the nxserver is not really needed, I feel like a much simpler wrapper script...

Ah just found one but I don't like it a lot.

There is another set of reviews (1, 2 3) of a some of the same tools and others.