22
May/09
2

Synergy

Synergy

The Setup

I have one desktop computer running Ubuntu Linux connected to a wall mounted screen. I also have a 15″ Unibody MacBook Pro connected to a 24″ Apple Led Cinema Display.

The Problem

All this hardware creates a clutter on my desk requiring me to have more than one set of keyboard and mouse. It also makes it difficult to work on both computers at the same time.

The Solution

A small piece of software called Synergy. This piece of software gives me the ability to share my keyboard and mouse connected to one of the computers via the network interfaces, either being wireless or wired.

Synergy works with almost any setup and any operating system that being either windows, macintosh or linux. And the best part is that the client computers do not have to have a keyboard or mouse connected to them.

Synergy give me the ability to control 2 or more computers (windows, mac, linux) with the keyboard and mouse of only one of them. This means that the wall mounted computer doesn’t need to have any keyboard or mouse. For my problem this was the perfect solution.

Not having a keyboard for said computer in the long run presented some other problems. Like I could not restart the machine, or logout or switch users. Since when I did any of the previously mentioned actions it resulted in Synergy loosing connection and me needing to plug in a keyboard to make everything work again.

Thus a solution was needed to be created.

I’ve altered my login scripts to start Synergy so it will connect to the sever automatically. Bellow you will find what files I’ve either edited or created in order to make this work.

File: /etc/gdm/init/default and File: /etc/gdm/PreSession/default

/etc/init.d/synergy stop
/etc/init.d/synergy start

File: /etc/init.d/synergy

#!/bin/sh
# Start synergy to connect to server pc2

case "$1" in
'start')
    synergyc pc2
    ;;
'stop')
    killall synergyc sleep 1
    ;;
'status')
    ps auwxx | grep synergyc
    ;;
*)
    echo "Usage: $0 { start | stop | status }"
    ;;
esac
exit 0

Also for the above file the following command need to be executed.

chmod +x /etc/init.d/synergy

For the configuration file of Synergy itself here is a sample but this depends on your setup. Remember that the opposite of this configuration file must exist on the server otherwise you won’t be able to move your mouse back to it.

File: /etc/synergy/synergy.conf

section: screens
        pc1:
        pc2:
end
section: links
        pc1:
                right = pc2
        pc2:
                left = pc1
end
8
Mar/09
0

Ubuntu: Stuck Sound

If you are like me then there is no doubt that you’ve had the sound stuck while you where playing something, watching a movie or checking out a new software.

Now if the sound has stuck and you keep hearing something through the speakers even though you have killed the application responsible for the sound crash the sound won’t stop. If that’s the case you don’t need to reboot the machine all you need to do is stop the sound.

As a first step you can try to restart the sound daemon using the following command although for me it never worked.

sudo /etc/init.d/alsa-utils restart
If it works then you can stop here, if not then carry on. The following command will show you the processes that are currently holding up the sound device.
sudo lsof | grep pcm
Here is what my computer shows.
xine   20374     ckr  mem    CHR         116,6            13714 /dev/snd/pcmC0D0p
xine   20374     ckr    9w     CHR         116,6          13714 /dev/snd/pcmC0D0p

Then you will need to kill these processes. the first number of each line from the result shown above is the process id. You can kill each process issuing the following command replace the number 20374 which is my process id to yours.

kill -9 20374

After doing that you should hear or not hear to be more precise the sound. After that all you need to do is to issue the following command to restart the sound daemon.

sudo /etc/init.d/alsa-utils restart

Hope this works for you. If you know a better way please say so in the comments.

16
Oct/08
0

BOFH: Bastard Operator From Hell

Today we are going to be installing a funny package that allows you to telnet into a linux machine (we are going to be using debian) and gives you a funny reason.

First off we login to the debian machine we are going to use open a terminal window and gain root access. Then type the following command, make sure you have internet because it will be need to download this packages.