Monday, March 25, 2013

Synergy Linux Setup

Install
sudo aptitude install synergy

Given the following computers:
computerA  (Synergy server)
computerB  (Synergy client)

And given: 
computerA is the name returned by the 'hostname' command on the server; ip is 192.168.0.102
computerB is an alias (setup in synergy.conf) to 192.168.0.101


Edit /etc/synergy.conf on the Synergy Server
section: screens
    computerA:
    computerB:
end

# we might not want to go through the effort of setting up DNS for computerB, so we can alias here instead.
section: aliases
    computerB:
        192.168.0.101
end

section: links
    computerA:
       right = computerB
    computerB:
       left = computerA
end

On the server, run the following: 
 synergys -f --config /etc/synergy.conf

On the client, run the following: 
synergyc -f 192.168.0.102


launchctl / launchd on OSX

Launch definitions are in the form of plist documents

List jobs managed by launchctl (shows job label)
launchctl list

Show detail information about launchctl managed job
launchctl list job_label
i.e. launchctl list homebrew.mxcl.postgresql
# output will look like:
{
"Label" = "homebrew.mxcl.postgresql";
"LimitLoadToSessionType" = "Aqua";
"OnDemand" = false;
"LastExitStatus" = 0;
"PID" = 17312;
"TimeOut" = 30;
"StandardErrorPath" = "/usr/local/var/log/postgres/stderror.log";
"ProgramArguments" = (
"/opt/homebrew/bin/postgres";
"-D";
"/usr/local/var/postgres";
"-r";
"/usr/local/var/log/postgres/server.log";
);

};

Stop a job managed by launchctl
launchctl stop job_label

Good tool for making launchctl plists
http://sourceforge.net/projects/lingon/

Plists located in one of the following places
FILES
 ~/Library/LaunchAgents -  Per-user agents provided by the user. 
 /Library/LaunchAgents   -  Per-user agents provided by the administrator. 
 /Library/LaunchDaemons  -  System-wide daemons provided by the administrator. /System/Library/LaunchAgents -  Per-user agents provided by OS X.
 /System/Library/LaunchDaemons -  System-wide daemons provided by OS X.


https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man5/launchd.plist.5.html