Posts in 'Linux'

SCP/Rsync transfers stall at exactly 2112 kB

In case your SCP, Rsync, or other sort of file transfer works for a short period and then suddenly stalls (permanently), then you may want to examine the MTU configuration on your network interface. After trawling the web for hours, attempting to find a solution to why an SCP transfer of one file stalls between server A and B, whilst the exact same file transfers fine from C to B, the answer finally ended up being the MTU configuration.

Curiously, the SCP transfers stall at exactly 2112 kB, which was thankfully my saving grace when I was searching. I’d …

Java HTTP request fails with “javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated”

Searching the above-mentioned stack trace reveals lots and lots of results, unsurprisingly.  Most results are workarounds where you modify the code, but what about if an application (like Jenkins/Hudson CI, in my case) throws this error at you? The reason the error is occurring is because the SSL certificate of the target you’re connecting to isn’t considered valid by your Java instance’s keystore. This may be because the certificate itself is invalid, or, in my case, the CA chain couldn’t be validated (my OS is RHEL (Red Hat) 5.7, with OpenJDK 1.6).  For …

Logitech G930 Headphones audio quality under Ubuntu

So I recently purchased a new set of Logitech G930 headphones and am currently using them with the latest version of Ubuntu, 11.10.  Set up was a breeze - just plug, check your PulseAudio config, and play.  For those of you, like me originally, who were wondering whether the G930 works on Linux, it certain does on Ubuntu.

Now, it wasn’t all peaches and cream because of two things.  Firstly, the audio output with the default configuration was completely lacking any depth and ‘substance’ to the sound being produced.  I’m not an audiophile and I have slight hearing …

SCP remote files back home using reverse SSH (in 1 command)

My recent work has involved copying files from a remote host, only accessible via a hop, back to my local computer. This has been simple in the past as the remote host has been able to connect to the local computer and SCP files directly, on account of the firewall allowing this. Recently, the firewall against the local computer has been reconfigured for security and direct connection is no longer possible. I could pass my files through a 3rd-party that both the remote and local machines can get to, but let’s say I don’t have one.

What you …

Ubuntu 11.04 boot freezes with 2.6.38-8-generic-pae kernel

So you’ve just installed 32-bit Ubuntu 11.04 (Natty Narwhal), and in my case, upgraded from Ubuntu 10.04 (Maverick Meerkat).  The upgrade process seemingly went fine and then you were asked to restart your computer.  You diligently do so, only to come back to find that your computer has frozen at GRUB2 upon trying to boot the 2.6.38-8-generic-pae kernel from the GRUB list.  Now what?  How do you fix this?

The issue appears to stem from some form of installation issue where this new kernel isn’t set up right.  Note: I don’t actually know …

Linux: Make time with faketime

So you, like me, have hit a situation where you’ve got a time-sensitive application that won’t run? Maybe you’ve downloaded one of those apps (like a demo) that won’t run after a certain date and time because it’s “expired”. Or else, maybe some other arbitrary time constraint is keeping you from running a Linux (or even Windows) program. On Linux (Ubuntu for me), there’s faketime to the rescue - a very handy tool that does what it says on the box, changes the system time for given command.

After installing faketime by something like:

sudo …

Things to do on Ubuntu 10.04 Lucid Lynx after install

I’m skipping actually quantifying the number of things to do because this post will undoubtedly get updated as time goes on.  I’ve just updated both my computers (personal laptop and work desktop) to Ubuntu 10.04 from 9.10 and I’m very happy with how things have gone. That isn’t to say a few minor things haven’t annoyed me, such as Project Hamster removing its Day view for task management or Python 2.4 being dropped entirely, but overall, it’s gone well. Here’s my thoughts on what you should do as soon as …

Installing Python 2.4 on Ubuntu 10.04 Lucid Lynx

Whoops.  No one sent me the memo that Python 2.4 support was being removed entirely from the latest version of Ubuntu, 10.04 Lucid Lynx.  To be fair, I was presented with the message that ‘these outdated packages will be removed’ and in that list was python2.4.  I made the unfortunate assumption that this just mean the package was outdated (which it certainly is) and I’d have the ability to install it again in Lucid.  There were a number of different packages on the list and in order to save time, I let the updater remove them …

Ubuntu: Crackling audio noises on a Dell M1530 (or HDA cards)

The problem I found (so did everyone else) when updating to Ubuntu 9.10 Karmic was static/popping noises when your sound card is silent (aka goes into power-save mode). It applies to my Dell XPS M1530 laptop’s on-board sound and probably to the same chipset elsewhere.

The fix couldn’t be simpler! Simply edit this file (as root):

/etc/modprobe.d/alsa-base.conf

and comment out the last line. Then, restart ALSA to save you having to do a reboot to check it worked:

sudo /etc/init.d/alsa-utils stop sudo alsa force-reload sudo /etc/init.d/alsa-utils …

Start screen after su’ing to another user

Today’s problem is one that requires no introduction (well, maybe it does :-| ) but it’s a problem nonetheless.  The issue is that after using the ‘su‘ command to become another user, there’s trouble running screen sessions.

This page (http://dbadump.blogspot.com/2009/04/start-screen-after-sudo-su-to-another.html) details it simply and perfectly (which, yes, I know in turn came from another page).  Essentially the error is thus:

Cannot open your terminal '/dev/pts/1' - please check.

Which really doesn’t man nor beast with its descriptiveness.  From that page, which came from another page mentioned on that page (?), here …