Friday, February 21, 2014

Port Scan using "nc"

Using the following command you can check if the ports are open or not.

The below command scans for ports in the range 1 to 1023:

nc -z test-internal.foo.com 1-1023

Friday, February 7, 2014

Editing Remote files using Sublime Text Editor

Use Case:

Sublime Text (2/3) - Installed Locally on your Linux/MacOSX box

Edit files on remote hosts via SSH protocol - using Sublime Text (any file what you wish to edit on the remote machine, should automatically open on the sublime text editor locally)


Steps:

(1)Using Package Control, install "rsub" (if you don't have PACKAGE CONTROL, install that first for Sublime Text)

(2) On the local machine, where sublime text is installed, insert the line below into the file ~/.ssh/config

Host <your-remote-server.com> RemoteForward 52698 localhost:52698

(3) SSH to <user>@<your-remote-server.com> and type the following command:

sudo wget -O /usr/local/bin/rsub https://raw.github.com/aurora/rmate/master/rmate

(4) Assign the right permissions to the file

sudo chmod 755 /usr/local/bin/rsub

(5) From local machine, SSH to <your-remote-server.com> via Remote Forwarding

ssh -R 52698:localhost:52698 <user>@<your-remote-server.com>

(6)Start Editing the files !

rsub ~/xorg.conf.new

The above command (#6), when executed on remote host, will automatically open the file locally on your machine where Sublime Text is Running !