Project

redcap

0.0
No commit activity in last 3 years
No release in over 3 years
A service that translates SSH forward ports to process IDs. Built for Flying Sphinx.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 0
>= 0
 Project Readme

Redcap

Redcap was written because I need to track SSH remote forwards by their process id, and all I have is the port they’re forwarding to. You can’t pair the two together unless you have root access, though – and that’s where Redcap comes in. You run Redcap as root, and then you can ask it to do the pairing for you.

Installation

gem install redcap

Usage

As a server, you’ll also want EventMachine installed:

gem install eventmachine

And then, the service must be run as root (so it can get all the requierd port and process information):

$ sudo redcap

And in code, as a client:

require 'rubygems'
require 'redcap'
Redcap.pid_for_port(10342) #=> 26151

Author

Pat Allan wrote this code in May 2011, but all the hard work for daemonising the process, logging, and a pid file was done in a gist by James Healy.

Licence

Released under the MIT Licence. Fork, contribute, re-use, whatever.