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 myserver.mydomain.eu :

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

Client side yourclient.yourdomain.eu:

$ iperf -c myserver.mydomain.eu -p 12222 -t 60
------------------------------------------------------------
Client connecting to myserver.mydomain.eu, TCP port 12222
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  3] local 192.168.1.21 port 36809 connected with 74.125.45.100 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"
EndSection

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 | , | Leave a comment

Share keyboard & mouse between 2 computers

Sometimes we need to work with two computers in the same time and here is a great solution: Synergy . It works on client/server program. Each computer uses its own OS and own monitor. The advantage is in one keyboard & mouse. In my case also clipboard is shared (I use Fedora8 x Fedora9).

Installation:

Download and install Synergy (you can find it also in your repository in your favorite distribution). At first create/modify your config file ( ‘/etc/synergy.conf’ ). Then start server side (in our example on computer eg.: ‘/usr/bin/synergys’ ) and then start client (on notebook eg.: ‘/usr/bin/synergyc 192.168.1.53’ ). Make sure, that you don’t have blocked communication at port 24800 (which is default port for synergy) on both machines – it means, that you should have exception in your firewall for port 24800. If you don’t provide path to config file, the program try to load ‘~/.synergy.conf’ or ‘/etc/synergy.conf’ .

Below are examples of ‘/etc/synergy.conf’ (one for server, one for client):

Client (notebook is on left side):

section: screens
  computer:
        halfDuplexCapsLock = true
        halfDuplexNumLock = true
  notebook:
        meta = alt
end

section: aliases
  computer:
        192.168.1.33
  notebook:
        192.168.1.53
end

section: links
        computer:
                right = notebook
        notebook:
                left = computer
end

Server (computer is on right side):

section: screens
  notebook:
        halfDuplexCapsLock = true
        halfDuplexNumLock = true
  computer:
        meta = alt
end

section: aliases
  notebook:
        192.168.1.53
  computer:
        192.168.1.33
end

section: links
        computer:
                left = notebook
        notebook:
                right = computer
end

1 January, 2009 Posted by | Linux | , | Leave a comment