Archive

Posts Tagged ‘Linux’

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 ,

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 ,

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 ,