Friday, January 11, 2013

ssh tunneling

The SSH tunneling (also know as port forwarding) is ability to access computer ip ports through third computer, assuming that direct access are forbidden and we have an ssh access to the third computer which has access to that port.

This kind of techniques can be used also to securely connect to remotes computer's only locally open ports. For example lets we have some server running on port 5432 on dbserver machine. There is no permission to connect to dbserver:5432 from outside, but we have an access to dbserver with ssh.
On our local computer by running the following
ssh -NC -L 1234:127.0.0.1:5432 dbserver
the ssh will listen on local machine port 1234 and all data packets will forward to dbserver, where the ssh server will redirect them to 127.0.0.1:5432
The -C option is for compressing the data, and the -N option for not executing any command remotely(by default ssh executes specified command or login to the shell)

By adding -f we can send ssh to background
ssh -NC -L 1234:127.0.0.1:5432 -f dbserver

Saturday, May 5, 2012

Samsung Galaxy S2 codes

Here are some codes for Samsung Galaxy S2.
  • *#1234#  -- Firmware Version.
  • *#232337#  -- Bluetooth MAC Address.
  • *2767*3855# -- Factory Reset.

Tuesday, April 24, 2012

VirtualBox shared folders

In the Oracle VirtualBox, to add a shared folder to a Linux guest, open Devices>Shared Folders...  and click Add Shared Folder (a tiny "plus" icon on the right). Then fill folder path and folder name.
In Linux, do the mount by the following commands:
> sudo mkdir /home/shared # creating mount point
> sudo mount -t vboxsf VShared /home/shared
# use previously filled folder name
After every reboots the mount command is needed to repeat.
To do it automatically, just add the following lines to fstab.
> sudo echo "VShared    /home/shared    vboxsf    rw    0    0" >> /etc/fstab