SSH Tunneling

Hi Folks,

From now on I will need to use the SSH by tunneling to connect from my Home machine (Client) to my Office machine (Server) through a SSH Gateway because my Office machine is not directly connected to the Internet anymore, it seems a little bit complicated but I will try to simplify the things.

First of all the scheme to guide those who still may not have understood:

To access/connect the server I want, I can do by 2 ways:

    1. Connect to the SSH Gateway and then, connect to the desired server, it is the simplest solution but become quite costly and annoying when you need the SSH or SCP often, especially the SCP because you must copy to a tmp directory of the SSH Gateway all the files you want and then copy to desired server.


    1. Open a port in the client machine that connects to the desired server directly by tunneling, may seem more complicated but worth it. I will show how to do it bellow.


How to open the tunnel:

ssh -p <SSH_port_in_SSH_gateway> -fN -L <Port_to_use_in_client_machine>:<Server_IP>:<SSH_port_in_Server> <user>@<SSH_Gateway_IP>



ssh -p 22 -fN -L 6666: my_user@


How to use the tunnel – SSH:

ssh -p <Port_to_openned_in_client_machine> <user>@localhost



ssh -p 6666 my_user@localhost


How to use the tunnel – SCP:

scp -P <Port_openned_in_client> <user>@localhost:<file_to_be_coppied_in_server> <file_destination_in_client>


example 1 (copy from server):

scp -P 6666 my_user@localhost:/home/my_user/Desktop/foo /home/my_user/Desktop/


example 2 (copy to server):

scp -P 6666 /home/my_user/Desktop/foo my_user@localhost:/home/my_user/Desktop/


That’s it folks


Thanks to my friend Marcelo Gomes, who gave me the tips: Marcelo’s Blog (Blog in portugueses).

Chrome PDF browser viewer problem

Hi folks,

Sometimes I have the problem with the “Chrome PDF Web Viewer”, it display the content wrongly. The solution I found is to disable this feature, its quite simple.

Just go to Chrome Plug-ins preferences, by typing at the URL:


and disable this feature like it shows in the image bellow

By doing this the PDF will be downloaded like a normal file and you can use the Viewer of your
preference e. g.: Adobe Reader.

Thats it


Install Lexmark E210 printer on Windows 7

Today I faced my lab printer old problem: “How to install this old printer model on Windows”

The problem:

– This old printer model does not have the native driver in the Windows 7/Windows Vista and in the lexmark website just have the driver until windowsXP (32-bits), Lexmark E210 website.

The solution:

– Trick the windows and use the SAMSUNG ML-1210 driver. I read that these printers have the same hardware beneath the plastic.

How to do it:

– In the add printer option simply choose the SAMSUNG ML-1200 Series driver, this driver is native in Windows 7 but I am not sure about other Windows versions.

– If you could not find the driver, just go to Samsung USA website, click on “Driver” and download the correct driver for your windows version and proceed to the trick part.

Thats it folks

Remove old Kernel

Hi folks,

This is a problem that I face almost every month and every time I forget how to do it and lose some time googling it: “How to remove old linux kernel”

In 4 easy steps:

1) Become sudo

sudo su

2) Show my current kernel:

uname -r

3) List installed kernels:

ls /boot | grep vmlinuz | cut -d'-' -f2,3

Once you choose the kernel you want to remove

4) Remove kernel and its compounds:

for kernel_nro in `dpkg -l | grep ^ii | grep <nro_kernel_to_remove> | awk -F' ' '{ print $2 }'`; do apt-get remove -y $kernel_nro; done;

Expand HD size in Virtual Box


Today I had solved a very common problem and I want to share with folks: “How to EASILY expand the HD size from my Win7 in a VirtualBox”.

IMPORTANT 1: Close the running VM!!

IMPORTANT 2: Backup the HD imagem before starting:

tar -cvzf <bkp_name>.tar.gz <hd_name>.vdi

Resizing the HD in 4 steps:

1) In the linux terminal run:

VBoxManage modifyhd <hd_name>.vdi --resize <size_in_MB>

2) Start the windows and go: Control Panel -> Administrative Tools -> Computer Management -> Disk Management. With the right button over the Disk 0 image, click to “Convert to Dynamic Disk” (IMPORTANT: See Note).

3) Reboot the windows

4) Once again go to: Control Panel -> Administrative Tools -> Computer Management -> Disk Management. Right click over the C: partition, click on “Extand volume…” and do the windows process (OK, OK, OK…)

If you convert the HD to the same size or a smaller size it probabily will crash your HD, so you must resize the HD to one at least 5 or 10 Gb bigger.

Thanks to my friend Marcelo Gomes, who gave me the tips: Marcelo’s Blog (Blog in portugueses).


Fixing empathy bug: Gtalk contact doesn’t appear


Today I had a problem with my messenger client the Empathy 2.30 on my ubuntu 10.04, I use it for (MSN, Gtalk and Facebook chat), it stopped to show my online GTALK contacts; MSN and Facebook chat were still OK. After some hours trying to find a solution, I got one:

The problem:

- A bug in the Telepathy package that made the Empathy client doesn’t show the online gtalk contacts, this bug is not yet fixed in the official repositories.

The solution:

- Add the pseudo-oficial Telepathy PPA (Personal Package Archives) that already have the bug fixed

How to do it:
- Close empathy

- Add the PPA to your repository list:

sudo add-apt-repository ppa:telepathy/ppa

- Update the Package Index:

sudo apt-get update

Upgrade System Packages: 

sudo apt-get upgrade


If you done everything right you should start to see the contacts now