Monthly Archives: September 2010

Library info, linux command.

Library Info:

The command “nm” lists symbols contained in the object file or shared library.

Use the command nm -D libctest.so.1.0
(or nm --dynamic libctest.so.1.0)

0000000000100988 A __bss_start
000000000000068c T ctest1
00000000000006a0 T ctest2
                 w __cxa_finalize
00000000001007b0 A _DYNAMIC
0000000000100988 A _edata
0000000000100990 A _end
00000000000006f8 T _fini
0000000000100958 A _GLOBAL_OFFSET_TABLE_
                 w __gmon_start__
00000000000005b0 T _init
                 w _Jv_RegisterClasses

Man page for nm

Symbol Type Description
A The symbol’s value is absolute, and will not be changed by further linking.
B Un-initialized data section
D Initialized data section
T Normal code section
U Undefined symbol used but not defined. Dependency on another library.
W Doubly defined symbol. If found, allow definition in another library to resolve dependency.

Also see: objdump man page

Original source from : http://www.yolinux.com/TUTORIALS/LibraryArchives-StaticAndDynamic.html

My synergy configuration file and install procedures.

1. Download synergy source from repository

svn co http://synergy-plus.googlecode.com/svn/trunk/ ./

2. Create make file by configuration

./hm.sh configure -g 1

3. Configure error handle.
If this procedure well done, move to step 4, unless read on the following step.

If you encounter this error.

CMake Error at CMakeLists.txt:203 (message):
  Missing library: Xtst

Type the following command.

$synergy_top_folder$ rm -rf ./*
svn co http://synergy-plus.googlecode.com/svn/trunk/ ./
sudo apt-get install libxtst-dev
./hm.sh configure -g 1

4. Compiling.

./hm.sh conf
./hm.sh setup
./hm.sh build

5. Create configuration file ~/.synergy.conf with the following file.

 # sample synergy configuration file
#
 # comments begin with the # character and continue to the end of
 # line.  comments may appear anywhere the syntax permits.
 # +——-+  +——–+
 # |Laptop |  |Desktop1|
 # |       |  |        | |         |
 # +——-+  +——–+

 section: screens
     # three hosts named:  Laptop, Desktop1, and iMac
    # These are the nice names of the hosts to make it easy to write the con    fig file
     # The aliases section below contain the “actual” names of the hosts (the    ir hostnames)
     MyMacbookPro_Name:
         ctrl = alt
         alt = ctrl
     MyDeskTop_Name:
 end

 section: links
     # Laptop is to the left of Desktop1
     MyDeskTop_Name:
         left  =MyMacbookPro_Name

     # Desktop1 is to the right of Laptop
    MyMacbookPro_Name:
         right =MyDeskTop_Name
end

section: aliases
MyDeskTop_Name:
 	enddl22-HP-Compaq-8100-Elite-CMT-PC
MyMacbookPro_Name:
	ianyi-macbook
end

6. Start synergy server

./synergys -f --config ~/.synergy.conf

Snyergy for Virtual KVM.

original source from

http://synergy-foss.org/pm/projects/synergy/wiki/Setup

Setup

Setup and configuration guide.

Introduction

Synergy lets you use one keyboard and mouse across multiple computers. To do so it requires that all the computers are connected to each other via TCP/IP networking. Most systems come with this installed.

Details

Step 1 – Choose a server

The first step is to pick which keyboard and mouse you want to share. The computer with that keyboard and mouse is called the “primary screen” and it runs the synergy server. All of the other computers are “secondary screens” and run the synergy client.

Step 2 – Install the software

Second, you install the software. Choose the appropriate package and install it. For example, on Windows you would run SynergyInstaller. You must install the software on all the computers that will share the mouse and keyboard (clients and server). On OS X you’ll just have a folder with some documentation and two programs. You can put this folder anywhere.

Step 3 – Configure and start the server

Next you configure the server. You’ll tell synergy the name of the primary and secondary screens, which screens are next to which, and choose desired options. On Windows there’s a dialog box for setting the configuration. On other systems you’ll create a simple text file.

Note that when you tell synergy that screen A is to the left of screen B this does not imply that B is to the right of A. You must explicitly indicate both relations. If you don’t do both then when you’re running synergy you’ll find you’re unable to leave one of the screens.

Windows
On Windows run synergy by double clicking on the synergy file. This brings up a dialog. Configure the server:

  • Click the Share this computer’s keyboard and mouse (server) radio button
  • Click the Screens & Links Configure… button
  • Click the + button to add the server to the Screens list * Enter the name of server (the computer’s name is the recommended name) * Optionally enter other names the server is known by * Click OK
  • Use the + button to add your other computers * Using a computer’s name as its screen name is recommended * Choose desired screen options on the Add Screen dialog
  • Use the controls under Links to link screens together * Click (once) on the server’s name in the Screens list * Choose the screen to the left of the server; use — if there is no screen to the left of the server * Choose the screens to the right, above and below the server * Repeat the above steps for all the other screens
  • Click OK to close the Screens & Links dialog
  • Use Options… to set desired options
  • If the server’s screen name is not the server’s computer name: * Click Advanced… * Enter the server’s screen name next to Screen Name * Click OK

Now click Test. The server will start and you’ll see a console window with log messages telling you about synergy’s progress. If an error occurs you’ll get one or more dialog boxes telling you what the errors are; read the errors to determine the problem then correct them and try Test again. See Step 5 for typical errors.

Unix or Mac OS X
Unix and Mac OS X currently require a text-based configuration file, so create a text file named synergy.conf with the following:

    section: screens
       screen1:
       screen2:
    end
    section: links
       screen1:
           right = screen2
       screen2:
           left = screen1
    end

Replace each occurrence of screen1 with the host name of the primary screen computer (as reported by the hostname program) and screen2 with the host name of a secondary screen computer. In the above example, screen2 is to the right of screen1 and screen1 is to the left of screen2. If necessary you should replace right and left with left, right, up, or down. If you have more than two computers you can add those too: add each computer’s host name in the screens section and add the appropriate links. See the configuration guide for more configuration possibilities.

Now start the server. Normally synergy wants to run “in the background.” It detaches from the terminal and doesn’t have a visible window, effectively disappearing from view. Until you’re sure your configuration works, you should start synergy “in the foreground” using the -f command line option.

On unix type the command below in a shell. If synergys is not in your PATH then use the full pathname.

    synergys -f --config synergy.conf

On OS X open Terminal in the Utilities folder in the Applications folder. Drag the synergys program from the synergy folder onto the Terminal window. The path to the synergys program will appear. Add the following to the same line, type a space at the end of the line but don’t press enter:

    -f --config

Now drag the synergy.conf file onto the Terminal window and press enter. Check the reported messages for errors. Use ctrl+c to stop synergy if it didn’t stop automatically, correct any problems, and start it again.

Step 4 – Start the clients

Next you start the client on each computer that will share the server’s keyboard and mouse.

Windows
On Windows run synergy by double clicking on the synergy file. This brings up a dialog. Configure the client:

  • Click the Use another computer’s shared keyboard and mouse (client) radio button
  • Enter the server’s computer name next to Other Computer’s Host Name * This is not the server’s screen name, unless you made that the server’s host name as recommended
  • If the client’s screen name is not the client’s computer name: * Click Advanced… * Enter the client’s screen name next to Screen Name * Click OK

Now click Test.

Unix or Mac OS X
To start a client on unix, enter the following:

    synergyc -f server-host-name

where server-host-name is replaced by the host name of the computer running the synergy server. If synergyc is not in your PATH then use the full pathname.

On OS X open Terminal in the Utilities folder in the Applications folder. Drag the synergyc program from the synergy folder onto the Terminal window. The path to the synergys program will appear. Add the following to the same line and press enter:

    -f server-host-name

When you added the client to the server’s configuration you chose a name for the client. If that name was not client’s host name then you must tell the client the name you used. Instead of the above command use this instead:

    synergyc -f --name name server-host-name

where name is the name for the client in the server’s configuration. (On OS X drag the synergyc program to the Terminal window rather than typing synergyc.)

Step 5 – Test

Clients should immediately report a successful connection or one or more error messages. Some typical problems and possible solutions are below. See the troubleshooting and the FAQ pages for more help.

  • failed to open screen (X11 only) * Check permission to open the X display; * check that the DISPLAY environment variable is set * use the –display command line option.
  • address already in use * Another program (maybe another copy of synergy) is using the synergy port; stop the other program or choose a different port in the Advanced… dialog. If you change the port you must make the same change on all of the clients, too.
  • connection forcefully rejected * The synergy client successfully contacted the server but synergy wasn’t running or it’s running on a different port. You may also see this if there’s a firewall blocking the host or port. Make sure synergy is running on the server and check for a firewall.
  • already connected * Check that the synergy client isn’t already running.
  • refused client * Add the client to the server’s configuration file.
  • connection timed out * Check that server-host-name is correct. * Check that you don’t have a firewall blocking the server or synergy port.
  • connection failed * Check that server-host-name is correct.

If you get the error “Xlib: No protocol specified” you’re probably running synergy as root while logged in as another user. X11 may prevent this for security reasons. Either run synergy as the same user that’s logged in or (not recommended) use “xhost +” to allow anyone to connect to the display.

When successful you should be able to move the mouse off the appropriate edges of your server’s screen and have it appear on a client screen. Try to move the mouse to each screen and check all the configured links. Check the mouse buttons and wheel and try the keyboard on each client. You can also cut-and-paste text, HTML, and images across computers (HTML and images are not supported on OS X yet).

Step 6 – Run

Once everything works correctly, stop all the clients then the server. Then start the server with the Start button on Windows and without the -f option on Unix and Mac OS X. Finally start the clients similarly. On Windows before clicking Start you may want to set the Logging Level to Warning so the logging window doesn’t pop up (because you currently can’t close it, just minimize it).

You can also configure synergy to start automatically when your computer starts or when you log in. See the autostart guide for more information.

Command Line Options Guide

Common Command Line Options

The following options are supported by synergys and synergyc.
     -d,     --debug level           use debugging level level
         --daemon         run as a daemon (Unix) or background (Windows)
     -f,     --no-daemon         run in the foreground
           --display display           connect to X server at display (X11 only)
     -n,     --name name         use name instead of the hostname
         --restart         automatically restart on failures
     -1,     --no-restart         do not restart on failure
     -h,     --help         print help and exit
         --version         print version information and exit

Debug levels are from highest to lowest: FATAL, ERROR, WARNING, NOTE, INFO, DEBUG, DEBUG1, and DEBUG2. Only messages at or above the given level are logged. Messages are logged to a terminal window when running in the foreground. Unix logs messages to syslog when running as a daemon. The Windows NT family logs messages to the event log when running as a service. The Windows 95 family shows FATAL log messages in a message box and others in a terminal window when running as a service.

The –name option lets the client or server use a name other than its hostname for its screen. This name is used when checking the configuration.

Neither the client nor server will automatically restart if an error occurs that is sure to happen every time. For example, the server will exit immediately if it can’t find itself in the configuration. On X11 both the client and server will also terminate if the connection to the X server is lost (usually because it died).

Server Command Line Options

    synergys [options]

The server accepts the common options and:

     -a,     --address address           listen for connections on address address
     -c,     --config pathname           read configuration from pathname

address has one of the following forms:

    hostname
    :port
    hostname:port

`hostname` is a hostname or IP address of a network interface on the server system (e.g. somehost or 192.168.1.100). `port` is a port number from 1 to 65535. `hostname` defaults to the system’s hostname and port defaults to 24800.

Client Command Line Options

    synergyc [options] address[:port]

`address` is the hostname or IP address of the server and port is the optional network port on the server to connect to. The client accepts the common options.