synergy with sound over ssh

There are two computers on my desk. And I wanted to use both screens, but neither of the desktops have an extra vga port.

So, first I started with synergy http://synergy-foss.org/

This allows me to share a a single keyboard + mouse across multiple computers. This also shares the clipboard. With the only minor disadvantage of not being able to move windows across the two screens, I was running two desktops. And it is super responsive. I am also tunneling it via ssh as described in
http://synergy2.sourceforge.net/security.html. In this setup I have a synergy-server whose kbd and mouse are shared and clients.

Second, I wanted all apps on the client-desktop to forward their sound to the server desktop. To do that, I captured the alsa output on the client and pipe it to the server via ssh, where it is

On the client, I did
amixer set ‘Mix’ cap 1>/dev/null 2>/dev/null

amixer set ‘Capture’ cap 1>/dev/null 2>/dev/null

amixer set ‘Capture’ 10% 1>/dev/null 2>/dev/null

amixer set ‘Master’ mute 1>/dev/null 2>/dev/null

amixer set ‘PCM’ 72% 1>/dev/null 2>/dev/null

arecord -f cd 2>/dev/null | \
ssh -c blowfish server “aplay -f cd – 1>/dev/null 2>/dev/null” &

This works perfectly, and after I am done, I kill the ssh process and set back the controls to old values

A single ssh command can also be used to pipe both the audio stream and tunnel synergy data.
arecord -f cd 2>/dev/null | \
ssh -c blowfish -L localhost:24800:server:24800 server \ “aplay -f cd – 1>/dev/null 2>/dev/null” &

I also used a few tricks to sync screen-lock etc, but those are too ugly and specific to my setup.

Posted in Uncategorized | Leave a comment

package management with aptitude

Some tips for aptitude :

Updating package lists and upgrading
aptitude update

aptitude safe-upgrade
upgrades as many packages as possible but doesn’t uninstall anything

aptitude full-upgrade
upgrades as many packages as possible

To install / remove / reinstall packages
aptitude install/remove/reinstall <package name>
This also automatically resolves dependencie.

Purging Packages
remove doesn’t remove configuration files in a package.

aptiture purge <package name>
removes (if installed) and deletes any configuration files of the package.

aptiture purge ~c
purges all removed packages

to hold/unhold packages
holding a package means it will not be upgraded until it is unholded
aptitude hold/unhold <package name>

to search for packages
aptitude search <pattern>

in particular
aptitude search ~ahold lists all packages that are currently on hold

for details see SearchTermQuickGuide

Posted in Uncategorized | Leave a comment