30/08/2014

[Remmina] Cannot connect to RDP server

When using Remmina you may sometimes encounter the generic 'Cannot connect to RDP server' error even if all settings are correct, and usually there's no other debug information available.

What has helped me most of the times is simply deleting the server entry line from ~/.freerdp/known_hosts then trying to reconnect. You should be prompted to accept the server key again and eventually it should connect.

[Oracle] Find DB components versions

Here's a simple query to quickly find the currently installed versions of Oracle DB's components:

SELECT * FROM v$version;

27/07/2014

[Linux] MPlayer 5.1 AAC to AC3 encode on the fly

Mplayer is arguably the most powerful media player for Linux, but unlike VLC, it lacks an intuitive and powerful configuration GUI (though SMPlayer is amazing).

Thus, in order to set it up correctly, you'll need to fiddle both with the GUI and some old-school text file configuration.

First, install it as (for Ubuntu/Debian):

sudo apt-get install mplayer2 smplayer

Then check you have some output like this:

lavcac3enc     : runtime encode to ac3 using libavcodec

when you run this command:

 mplayer -af help | grep lavcac3enc

Now, to have it encode a 5.1 AAC audio track to AC3 on the fly, you'll need to:

configure via GUI (SMPlayer):

- disable the audio equalizer under Preferences->General->Audio
- enable AC3/DTS pass-through S/PDIF under the same section
- add this parameter:

lavcac3enc=1:640

under Advanced->Options for MPlayer->Audio filters

configure via text file by editing ~/.mplayer/config:

ao=pulse
afm=hwac3,
channels=6
af=scaletempo,lavcac3enc=1:640:3

I'm using pulse since alsa gives me nearly 2 seconds of audio delay, but if you wish you can use it by setting instead:

ao=alsa

05/07/2014

[Ubuntu] Enable hibernation

Ubuntu by default has the hibernation option disabled, even if the system is installed with enough swap space.

Before enabling it, first check if it works without issues by running this command:

sudo pm-hibernate

If the system hibernates correctly and you don't see any errors, edit the /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla file:

gksu gedit /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla

Then look for these two sections:

[Disable hibernate by default in upower]
[Disable hibernate by default in logind]

And change the ResultActive value to yes

Save, reboot and you'll have the option to hibernate the system now.


[Ubuntu] Fix volume reset after reboot

A small but annoying bug in Ubuntu causes the sound volume to be unmuted and reset to 100% after a reboot or logout.

This can be fixed by editing the /etc/pulse/default.pa configuration file for PulseAudio:

gksu gedit /etc/pulse/default.pa

Then look for these lines:

### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore

and comment out the first one:

### Automatically restore the volume of streams and devices
#load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore

Save, logout or reboot and you're set.

07/06/2014

[OpenSSH] Convert putty PPK key to OpenSSH format

To convert a putty-generated PPK key to the OpenSSH format, you can use puttygen:

puttygen MY_PPK_KEY.ppk -O private-openssh -o MY_OpenSSH_KEY

to convert a private key and:

puttygen MY_PPK_KEY.ppk -O public-openssh -o MY_OpenSSH_KEY

to convert a public key

[VMware Player] Share USB mobile broadband between host and guest OS

To share a USB mobile broadband connection between the host and guest OSs with VMware Player, simply set the guest OS network interface to use the NAT mode instead of the bridged mode.

This way you'll also be able to set up routing rules on the host OS which will apply to the guest OS too.