SSH over HTTP Proxy

Using SSH to connecting to an host when an HTTP Proxy is between the client and the host, can not be done directly without some configuration.

On Linux based machines the solution is to install and run corkscrew, a program that can tunnel the SSH protocol through an HTTP Proxy.

So how to do the configuration?

1) First install the corkscrew program with your package manager. On Ubuntu family: apt-get install corkscrew

2) Then you need to configure SSH to use corkscrew when connecting to the host that has a http proxy between.

3) Goto to your home directory and change to the hidden directoy .ssh within a command shell window.

4) Create or edit a file named config. The name is just config. No extensions.

5) Add the following lines to the config file

Host <IP_of _remote_host>  
 ProxyCommand corkscrew <IP_of_HTTP_Proxy> <HTTP_Proxy_Port> %h %p <auth_file>

Where the <IP_of_remote_host> is the public ip address of the host where you wish to connect.

The <IP_of_HTTP_Proxy> and <HTTP_Proxy_Port>  are the IP address and Port of you local http proxy server that you wish to go through.

And finally, if your proxy server requires authentication, by username and password, just give a complete path to a file where Proxy credentials are stored, for example /home/primalcortex/.corkscrew_auth

This file content must be something like:

username:password

For example a complete config file example:

Host 78.0.1.3
    ProxyCommand 192.168.1.1 8080 %h %p /home/primalcortex/.corkscrew-auth

and the .corkscrew-auth file:

myproxyuser:rtwertjwe4

6) Just connect now:

ssh myremoteuser@78.0.1.3

or when not using the default ssh port:

ssh -p 12345 myremoteuser@78.0.1.3

7) Done!

So why we need this?

Well, first is of course, to access a remote machine, but ssh can forward local ports to remote ports, and this is important because, with this feature we can use Thunderbird to directly connect to a remote server by using the standard IMAP and SMTP protocols through an HTTP proxy.

MySQL on a Ubuntu VPS

Using the great site lowendbox.com I’ve “bought” a Ubuntu based VPS (Virtual Private Server) so that I can use for my testings…

Anyway, I needed to install MySQL database on this Ubuntu Server based VPS, which is simply done by running the following command:

apt-get update
apt-get install mysql-client mysql-server

During the installation process a password for the root user is required. Just make sure that it’s strong enough (Hint: use keypass password generator…)

After installing and running the MySQL server is available at port 3306 and normally only available at the loopback address. But anyway I’ve changed the local firewall rules to block all connections to port 3306 from outside the loopback adapter: Just edit the /etc/rc.local file and add the following lines before the exit 0 command

iptables -A INPUT -p all -s localhost -d localhost -j ACCEPT
iptables -A INPUT -p tcp --destination-port 3306 -j REJECT

Then as the root user just run the file: /etc/rc.local and make sure that the rules are active:

root@vpss:~# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  localhost.localdomain  localhost.localdomain 
ACCEPT     all  --  localhost.localdomain  localhost.localdomain 
ACCEPT     all  --  localhost.localdomain  localhost.localdomain 
ACCEPT     all  --  localhost.localdomain  localhost.localdomain 
REJECT     tcp  --  anywhere             anywhere             tcp dpt:mysql reject-with icmp-port-unreachable
ACCEPT     all  --  localhost.localdomain  localhost.localdomain 
ACCEPT     all  --  localhost.localdomain  localhost.localdomain 
ACCEPT     all  --  localhost.localdomain  localhost.localdomain 
ACCEPT     all  --  localhost.localdomain  localhost.localdomain 
REJECT     tcp  --  anywhere             anywhere             tcp dpt:mysql reject-with icmp-port-unreachable

And that’s it.

Now we need a backup policy so that anything goes wrong, at least we have some data to recover…

 

 

Kubuntu upgrade from 12.04 to 13.04

Despite Kubuntu 12.04 being a LTS release, and after some weeks upgrading to 13.04 on my personal desktop computer, I decided to do the same on my Work Laptop.

Things didn’t ran as expected…

First the upgrade from 12.04 to 12.10 deleted a bunch of packages, by my command :( and I ended up with no graphical display… A quick look at Xorg.0.log file showed me that my Xorger’s driver for my Intel graphic card was gone.

Anyway, I’ve installed the xservers-xorg-video-intel package and proceeded to upgrade to 13.04.

At the end despite having a graphical desktop, after login on KDE, a qdbus error appeared… qdbus package was missing… (apt-get install qdbus).

Also on 12.04 the transition from the login greeter to the desktop is silky smooth (it is on my desktop), on my laptop it blanks showing a black screen with a mouse cursor, but the desktop shows up abruptly. I don’t have now the KDE logon progress icons…

And finally, DNS settings from my DHCP servers didn’t worked, I had to manually add the dns servers IP to resolv.conf…  This issue was also a missing package, namely dnsmaq. After adding up the nameserver 127.0.0.1 to my /etc/resolv.conf file, everything is up….

Let’s see what is waiting again in the dark…

Android SDK and NetBeans

I’m user of Netbeans for my Java related work.

The Android SDK instructions refer the use of Eclipse as the IDE of choice, but is also possible to use Netbeans with the NBAndroid plugin, available at http://www.nbandroid.org/

Just following the instructions for installing the plugin in into Netbeans, namely by adding the plugin URL and installing them.

One issue that I’ve found was that the New Project Wizard didn’t show the Android type applications for creation…

For making on the New Project Wizard the Android Projects available to be created, you must enable the JAVA ME plugin, so just go again to Plugins and select JAVA ME and press Enable at the bottom of the window.

It should work now.

 

[K]Ubuntu on the Asus N73SV video issues – i915, Nouveau, Nvidia and Bumblebee

Well, after a month on using this Asus Laptop N73SV there are some issues with it.

The first one, and I’m not sure if it’s a driver issue or just a plain hardware issue is that the external connected monitor was working fine, and then started to have a blue tint and now it has a green tint. So first I wonder if the VGA cable or the monitor itself was bad, but replacing it by another same monitor brand and model  and different VGA cable, it has shown the same issues. So Ok, it’s a laptop issue that some HP owners are also having… Just search for HP an video tint… Removing the battery and power, waiting some time, and booting up with the external monitor, even the ASUS logo is tinted… So it’s not a K/Ubuntu issue. Solution? None so far. I have to try with a different monitor/and cable namely HDMI.

The second part of this post related with the video issues that I have is due to the fact that this N73SV has dual cards: an Intel i915 and NVidia GT540M. While trying to debug the above issue, I ended up with no desktop effects on KDE KDM by messing around with the desktop effects options… Whatever I did to enable them I was also greeted with the message that Effects couldn’t be enabled. So issue was related to the fact that the GLX libraries couldn’t be found/loaded… When running glxgears this error appear:

name of display: :0.0
Xlib: extension “GLX” missing on display “:0.0″.
Xlib: extension “GLX” missing on display “:0.0″.

The solution:
I’ve removed bumblebee and nvidia, which cleared the issue:

apt-get purge bumblebee
sudo apt-get purge nvidia*
apt-get install –reinstall xserver-xorg-video-intel libgl1-mesa-glx libgl1-mesa-dri xserver-xorg-core
dpkg-reconfigure xserver-xorg
reboot

And after this I could enable  again Desktop effects but I was using the default Intel driver and the Nouveau driver.

Finally, I’ve installed again MrMee/Bumblebee, which by itself installed again the Nvidia drivers, and after that I could only boot into Recovery Mode, because a normal start wouldn’t give me the Kubuntu boot logo and at final boot stage I just had a black screen with an hanged computer…

This issue is due to the fact that the nouveau driver is/was enabled, and I had to disable it. I found no complete instructions for doing that, but these do work:

The nouveau driver needs to be disabled, by editing two files:

/etc/modprobe.d/blacklist.conf

Add at the end of this file the following line: blacklist nouveau

And then, the other file to edit it depends of your grub version. For Grub2 , there is the need to add the following to the file /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash pci=nomsi nouveau.blacklist=1

And then run the command: update-grub2

On Grub1, just edit the menu.lst file and add the nouveau.blacklist=1 to yur booting kernel options, keeping in mind that after a kernel upgrade you need to blacklist the module again.

Booting up now with the Intel Driver and the Nvidia driver installed by Bumblebee should work.

Kubuntu, Bumblebee upgrade and NVidia

Yesterday, I’ve upgraded bumblebee on my Asus N73SV, which by itself downloaded and installed a new version of the proprietary Nvidia driver.

During the upgrade process, I was asked to install the maintainer version or my version… and I kept my version.

So after rebooting, I had no Kubuntu splash screen, just a black screen and after a while it just computer just hang with a dead keyboard. So unbootable and only rebootable by pressing the power button several seconds.

After some fiddling around I found out that booting into safe mode, getting into a root shell and starting KDM, everything seemed to work fine.

To keep a long story short, at boot time the X server loaded the Nouveau driver, and it was failing (looping) with some strange IRQ error. So the computer hanged.

The solution: Goto System -> Additional Drivers and enable the NVidia driver.

Reboot, and everything is Ok: Splash screen and Kdm.

A good solution is probably to purge completely the Nouveau driver if you’re really want to use the Nvidia driver. Instructions here: https://help.ubuntu.com/community/BinaryDriverHowto/Nvidia

I reality this is the same issue with the ATI drivers. After upgrading the drivers it is, at least in my case, to explicitly enable them.

[K]Ubuntu on Asus N73SV

So my employer replaced my old work laptop HP nx9420 by a new ASUS N73SV, more precisely N73SV-V1G-TZ393V, which by the way is  a great name (not…). The Asus N73 is the bigger screen brother of the Asus N53.

My old HP was able to do any work I could ask for, but it’s limitations on handling virtual machines where showing up, delaying work significantly. This Asus is a completly different beast. It’s fast, and has 3 SODIMM slots, so right now I have it with 12GB of RAM (8GB are two 4GB of Kingston memory plus the original 4GB of RAM). To open up it, you must remove the keyboard (small tabs near the ESC key, F5, F9, PRTSC and End at the top)  and one SODIMM slot is available right away (on th Q2630 CPU’s). Then after removing some screws (check the manual), the disk bay and remaining memory slot is also available at the bottom by removing the bottom cover.

The first thing to do with it was of course to nuke Windows 7, and after much indecision between KUbuntu and Arch, I installed Kubuntu 11.04 64 bit edition. After some fiddling with partitioning (I just left the original recovery partition), everything installed smoothly. Going to KUbuntu was more for getting a full working computer as fast as I can, without too much fiddling, but I left a partition to try out Arch on my spare time.

So what works out of the box? Well almost everything. Let’s talk about what doesn’t work.

First I’ve followed these instructions on the Ubuntu Help Pages for the N53SV and installed the acpi4asus_dkms, blueetooth driver and Bumblebee for the dual card support.

Still USB3 with USB2 devices doesn’t work, and hibernation/suspension doesn’t work. Regarding USB3 it’s a confirmed bug, so in the near future a solution will be available. Regarding hibernation/suspension I think it’s related to the NVidia card driver, but not sure because the computer does shutdown, but comes up to a black screen.

Also this specific version of the N73SV ha a DVB-T card with the Philips chipset SAA7231. It doesn’t work and there is no driver available because the manufacturer doesn’t won’t to support Linux. There is a two year old drive, but I think I doesn’t work with the recent kernels.

At the end I have a full accelerated desktop, dual monitor support, Wifi, bluetooth, networking, webcam, USB2, TurboBoost and the left media keys working fine.

Moving from the old computer, was just a matter of copying my home directory and following these instructions to re-install all software.

The good:

  • Screen size and quality: Superb
  • Fast, fast, fast
  • Big Hard disk (640GB). Available slot for a second hardisk/SSD
  • Allows a lot of memory: 12GB
  • ExpressGate

The bad:

  • Fiddly keyboard, getting time to get used to.
  • Keyboard sunken a bit when pressing keys.
  • No ExpressCard Slot
  • No eSata port
  • Location of some USB ports at the back is not very practical.