Port rewriting with iptables

Sometime it is useful to rewrite incoming connection to a different port. It’s very easy with iptables:

iptables -t nat -A PREROUTING -i eth0 -p tcp –dport 443 -j REDIRECT –to-ports 9090

Obviously you have to change source port (443 in my example) and the destination post (9090 in the example) and maybe the interface.

I used this solution for a Apache server running inside a VirtualBox that offers HTTPS through VB’s NAT. The problem is that I don’t launch the VirtualBox using root, but with a not privileged user, so I cannot map the NAT on hosts’ 443 port, but I choose for a not standard 9090 port. Unfortunately external applications need to access the service on the standard port. Rewriting the port with iptable was a cheap solution 🙂

 

Using command line subversion with svn+ssh and identity file

Apache Subversion (SVN) is a good and commonly used versioning tool. Even if there are a lot of graphical interfaces for it you sometimes have the need to use it on command line (using the svn client) or it can be your choice. Anyway using Subversion this way isn’t very difficult, just a little bit less comfortable.

A secure system configuration requires that connections to your remote repository will be tunneled through SSH and a more secure configuration avoids password and uses identity files. The question is: how can i pass the position of my identity file to svn? And the user to use on the remote machine?

The solution is not obvious, but really simple: use the ~/.ssh/config file!

The SSH config file allows you to set different values to be used when connecting with SSH. This is a example:

Host example
HostName www.example.com
IdentitiesOnly yes
IdentityFile ~/.ssh/id_dsa
User admin

Every time you try to connect to www.example.com the given identity file and username will be used. Very easy!

Amarok doesn’t play Mp3s with GStreamer backend

I think Amarok is the best music player available. It organizes your music in a good way and the various plugins gives you a lot of useful informations about what you are hearing.

Unfortunately by updating my Slackware to KDE 4.8, using Alien Pastures packages, my Amarok doesn’t play Mp3 files anymore. Ok, I now Mp3 is not the best format for many reasons (audio rendering, licence, …), but the most music I have on my PC is in this format and converting it to something else is not a good idea. Anyway when I try to start a Mp3 Amarok notifies me that he is not able to play this format and suggest to take a look in the FAQs. But i had no luck there.

On my KDE box I need to use GStreamer as Phonom backend because it’s the only that works with my configuration where the monitor is connected through HDMI. I want to use mainly the monitor’s audio boxes, so I have to use HDMI as the main audio interface and apparently only GStreamer makes the job.

GStreamer uses a lot of plugins to play different audio files formats. This plugins are commonly grouped into several packages: base, good, bad and ugly. The first one are the absolutely necessary. The second one are good quality plugins and a good license. Bad plugins are not to good about quality or don’t have some feature. Finally the ugly group are plugins with a good quality, but a bad licence… like Mp3!

So, I think you have already understood, to play Mp3s with GStreamer you have to install the ugly plugins package. For Slackware you can retrive it on Slacky.eu.

 

Choqok, un client di microblogging per KDE

Il microblogging è una delle tendenze di questi anni e Twitter è il progetto che ha dato a questa idea una forma importante. Microbloggare vuol dire scrivere post frequenti e molto corti, tipicamente un massimo di 140 caratteri. Per questa attivitĂ  è quindi importante dotarsi di uno strumento che faciliti il compito e che quindi sia sempre a portata di click. Sui device mobile ci sono una miriade di app che fanno al caso, per KDE c’è Choqok.

  Read more

Slow connection to VirtualBox guest with NAT port forwarding

I noticed that when you have a VirtualBox guest, no matter what kind of OS, making a lot of connection to the Internet, the incoming connection using NAT port forwarding will became very slow. In my case the inbound SSH connection froze after a few minutes and the HTTP connection has a very huge latency. The load on both guest and host will be low as usual, so no bottleneck could be found.

It seems like a VirtualBox  problem because, as said before, it happens with different guests and hosts.

The workaround is very simple: just use two NATs! Use the first for the many outbound connections (configure it as guest’s default gateway), the second for the few inbound connection (configure port forwarding for this one).

NovitĂ  Nokia in arrivo il 27 Febbraio tra cui Symbian Carla

Dal 27 Febbraio al 1 Marzo Nokia sarĂ  al Mobile World Congress per presentare le ultime novitĂ . VerrĂ  sicuramente data l’anticipazione riguardo al futuro Lumia 900 anche perchĂ© è ormai chiaro che tutte le attenzioni della casa finlandese sono rivolte ai dispositivi Windows. Eppure sembra che si parlerĂ  anche di Symbian Carla che potrebbe vedere la luce nel terzo trimestre 2012.

Read more

Solve NS_ERROR_FACTORY_NOT_REGISTERED on VirtualBox 4

If you setting up VirtualBox on a server you will probably try to set users and groups by you preferences. Changing UIDs and GUIs by your preference after VirtualBox is installed could bring you in a inconsistent situation and you get this message:

VBoxManage: error: Failed to create the VirtualBox object!
VBoxManage: error: Code NS_ERROR_FACTORY_NOT_REGISTERED (0x80040154) - Class not registered (extended info not available)
VBoxManage: error: Most likely, the VirtualBox COM server is not running or failed to start.

This cryptic message is in fact saying you that something is wrong with users or groups. But what? Not the libraries, not any file created during the VirtualBox installation but… the files created in the /tmp folder. Simply delete all related thing, even the hidden ones, and you will be fine again!

Contribuire a KDE, la guida definitiva

La Community di KDE ha pubblicato un libro che riassume tutto quello che c’è da sapere per aiutare concretamente il progetto. L’idea è nata grazie ad un’iniziativa di Google che era disposta a stampare un libro se fosse stato scritto in meno di una settimana. Il piccolo team ha elaborato un’idea e ha lavorato sodo per 3 giorni. Il risultato è molto utile. Oltre alla versione cartacea, che magari può diventare un oggetto da collezione, c’è ovviamente anche la versione eBook. Read more