Smallpoke's Blog

hard to say…

Bunch of tips from Linux

How-to check your line speed? – iperf

Iperf is clinet/server application, on one side you have to start listener, on the other client. You need 2 computers for our test. Let’s start with server at :

$ iperf -s -p 12222
Server listening on TCP port 12222
TCP window size: 85.3 KByte (default)

Client side

$ iperf -c -p 12222 -t 60
Client connecting to, TCP port 12222
TCP window size: 16.0 KByte (default)
[  3] local port 36809 connected with port 12865
[  3]  0.0-61.5 sec  1.51 MBytes    206 Kbits/sec

The example above shows communication between both computers through port 12222 (server listen port) and port # 36809 (its random outgoing port from client side). There is again a lot of settings, for more information use:

$ iperf --help

How-to disable Ctrl+Alt+Backspace? – xorg.conf

Find and modify your xorg.conf file (usually ‘/etc/X11/xorg.conf’ ) and put/modify there following section:

Section "ServerFlags"
        Option      "DontZap" "yes"

Restart X server and try key-combination Ctrl+Alt+Backspace.

How-to change Windows/Linux encoding – iconv

File encoding on Windows is different to Linux. Sometimes we need to change it, so here is few examples:

$ iconv -f windows-1252 -t utf8 <file-with-win1252.txt >file-with-utf8.txt

There is a list of allowable types of encoding:

$ iconv -l

If you don’t know which encoding the file actually uses, you can try another utility:

Which encoding does this file use? – enca

$ enca my-file.txt

What about hundred files? – find

Example below changes all *.txt files in current directory from Win1252 to UTF8:

$ find . -type f -exec iconv -f cp1252 -t utf-8 {} \;

7 January, 2009 - Posted by | Linux | ,

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: