Faster X11 forwarding

November 4th, 2009
Comments Off

Usually, X11 forwarding is slow. However, we can choose some options to make it faster.

1. choose an appropriate cipher specification for encrypting the session

Here is a benchmark done in Ubuntu bug report (#54180)

$ for c in 3des-cbc aes128-cbc aes192-cbc aes256-cbc aes128-ctr aes192-ctr \
aes256-ctr arcfour128 arcfour256 arcfour blowfish-cbc cast128-cbc; \
do echo using cipher $c; ssh -c $c localhost dd if=/dev/zero bs=32k \
count=10000 >/dev/null; done

results:

 3des-cbc	22.6 MB/s
 aes128-cbc	63.8 MB/s
 aes192-cbc	67.6 MB/s
 aes256-cbc	67.4 MB/s
 aes128-ctr	74.9 MB/s
 aes192-ctr	73.6 MB/s
 aes256-ctr	73.3 MB/s
 arcfour128	109 MB/s
 arcfour256	108 MB/s
 arcfour	107 MB/s
 blowfish-cbc	75.0 MB/s
 cast128-cbc	62.0 MB/s

2. choose an appropriate MAC (message authentication code) algorithms

Here is also a benchmark

$ for m in hmac-md5 hmac-sha1 umac-64 hmac-ripemd160; \
do echo using digest $m; ssh -c arcfour128 -m $m localhost \
dd if=/dev/zero bs=32k count=10000 >/dev/null; done

results:

 hmac-md5	108 MB/s
 hmac-sha1	97.9 MB/s
 hmac-ripemd160	83.0 MB/s

3. enable compression

For example, you can establish a much faster connection for X11 forwarding by using

ssh -c arcfour,blowfish-cbc -m hmac-md5 -XC

Linux, computer ,

Pasting without Formatting in MS Word

June 22nd, 2009
Comments Off

Create a macro and write the following into it

Selection.PasteSpecial DataType:=wdPasteText

assign a shortcut key for this macro for your convenience.

computer ,

Downloading a file through different IP addresses

May 29th, 2009
Comments Off

Some websites/ftpsites have a restriction that one IP address can only have one  connection for downloading files. Linux has a very cool download tool can overcome this limitation. The tool, curl, can let you download a file through different local IP addresses or network interfaces simutanously by using the following command

curl --interface eth0:1  --range 0-1000 [URL] -o outputfile1 &
curl --interface eth0:2  --range 1001- [URL] -o outputfile2 &

The first command will download 0-1000 bytes of the file, and the second command will download the rest. After finish the downloading, use cat to join the files.

Linux, computer ,

Dandelions

May 2nd, 2009
Comments Off

Baby birds

April 18th, 2009
Comments Off

Using dummy X server

April 18th, 2009
Comments Off

Sometimes I need to run applications, which need an available X server, on cluster. I find this ‘Xvfb’ command really useful. It will create a virtual framebuffer X server using virtual memory.  All you need to do is lunch this Xvfb

Xvfb :{display number} &

and set the environment variable DISPLAY to ‘localhost:{display number}’, then lunch anything you want. In some Linux distribution, there is an even simpler command called ‘xvfb-run’. You can run any X-based program by

xvfb-run {program name}

Linux, computer ,

Check Ram Speed and Type on Linux

April 8th, 2009
Comments Off

How to check the memory speed without opening the computer case? An easy way to do that is using biosdecode command line utility. Dmidecode is a tool or dumping a computer’s DMI (some say SMBIOS) table contents in a human-readable format. The output contains a description of the system’s hardware components, as well as other useful pieces of information such as serial numbers and BIOS revision. This command works under Linux, UNIX and BSD computers.
Type the following command in a shell with super user privilege

dmidecode --type 17

will give you the memory infomation like this

SMBIOS 2.5 present.

Handle 0x1100, DMI type 17, 27 bytes.
Memory Device
        Array Handle: 0x1000
        Error Information Handle: No Error
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 4096 MB
        Form Factor: <OUT OF SPEC>
        Set: None
        Locator: DIMM 1       
        Bank Locator: Not Specified
        Type: <OUT OF SPEC>
        Type Detail: Synchronous
        Speed: 667 MHz (1.5 ns)
        Manufacturer: 80AD808980AD
        Serial Number: 4266120A
        Asset Tag: 010810
        Part Number: HYMP151F72CP4N3-Y5

Handle 0x1101, DMI type 17, 27 bytes.
Memory Device
        Array Handle: 0x1000
        Error Information Handle: No Error
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 4096 MB
        Form Factor: <OUT OF SPEC>
        Set: None
        Locator: DIMM 2       
        Bank Locator: Not Specified
        Type: <OUT OF SPEC>
        Type Detail: Synchronous
        Speed: 667 MHz (1.5 ns)
        Manufacturer: 80AD808980AD
        Serial Number: 42661005
        Asset Tag: 010810
        Part Number: HYMP151F72CP4N3-Y5

Linux, computer ,

Dumplings, Happy Chinese New Year 2009

January 28th, 2009
Comments Off

List of some numerical computation libraries and routines

January 9th, 2009
Comments Off
ADIFOR automatic differentiation of Fortran codes
ALFPACK Legendre functions of first kind
ARPACK large scale eigenvalue problems
Aztec an iterative sparse linear solver package
BLAS basic linear algebra subprograms
CERNLIB CERN Program Library
CMLIB NIST core math library
DAEPAK differential algebraic equations
DASPK solution of systems of alg./diff. eqns (BDF/Krylov method, CM/F90/MPI)
EDA exploratory data analysis
EISPACK eigenvalues and eigenvectors
FISHPAK FFT, separable elliptic pdes
FLIB FLIB (The Fortran Library) is a World Wide Web repository of fortran code
CHARPAK character/string manipulation
GEOMPAK geometrical transformations
RANPAK random number generation
TIMPAK system date manipulation
GSLIB GSLIB: Geostatistical Software Library and User’s Guide” by C.V. Deutsch and A.G. Journel Oxford Univ. Press, New York, 1992
Harwell-Boeing sparse matrices (also Matrix Market)
HPFlibrary HPF library in F90
HSL Harwell Subroutine Library
INTLIB interval arithmetic
IMSL Visual Numerics, Inc.
ITPACK sparse matrices, iterative methods
LAIPE parallel direct solvers (linear equations)
LANCELOT large-scale optimization problems
LAPACK linear algebra on shared memory machines
LINALG some nonstandard solvers for linear algebra
LINPACK linear algebra
MPFUN a portable multiprecision package
MINPACK nonlinear problems
MINPACK-2 nonlinear problems
MINUIT nonlinear problems
Mtask parallel programming language (Windows NT/95)
MUDPACK multigrid, linear elliptic PDEs
NCARM NCAR’s local math libraries
ODEPACK LSODE
ODEs stiff/nonstiff, explicit/implicit methods
ODE software of J. Cash
PIM Parallel Iterative Solvers
RANLIB random number generation (C, FORTRAN)
ScaLAPACK MIMD version of LAPACK
SCILIB a portable FORTRAN emulation of CRAY SCILIB
SLATEC common mathematical library
SLEIGN2 Sturm-Liouville problems
SPARSKIT sparse matrices
SPBLAS NIST Sparse BLAS
SPHEREPACK spherical harmonics
SPECFUN special functions
STARPAC statistical data analysis
TENSOR nonlinear problems (tensor methods)
TLCPACK regridding (1-4D orthogonal grids)
TOMS algorithms from Comm. of the ACM
UMFPACK sparse linear problems with iterative refinement

computer ,

How to change font size in a fixed-font chm file

January 6th, 2009
Comments Off

Sometimes the font size of a chm file is fixed. To change the font size, go to IE and select Tools>>Internet Options. In the General tab, click the Accessibility button, and then check the “Ignore font sizes…” option. You even can apply your own css style file there.

Adjust the font size:
1. change the font size in IE or
2. directory change the IE font size settings in the registry:

[HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerInternationalScripts3]
“IEFontSize”=hex:02,00,00,00
the first two bytes can be 00, 01, 02, 03 and 04 from the smallest to the largest.

computer ,

WordPress Loves AJAX
Warning: Unknown: open(/tmp/sess_0186576647d69d3937602bbf2b75ab59, O_RDWR) failed: Permission denied (13) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0