JWHOIS uses 100% of CPU on CentOS

Occasionally we hit a bug where the ‘whois’ command hangs on one of our CentOS servers and goes CPU-bound. This has been happening on several CentOS versions, including 6.8. Specifically, this is a problem in jwhois, the whois client included in CentOS.

Apparently, CentOS (and RHEL, on whose source code it’s based) is missing a number of fixes that have been added to other Linux versions including Fedora over the last couple of years. So the problem is actually known and a fix has been available for years, it’s just not included in the product.

Comparing the change logs for jwhois between CentOS and Fedora, everything matches up to and including build 4.0-18 in September 2009, but then the two diverge.

On Jan 26, 2010, Fedora received a fix (“Use select to wait for input (patch by Joshua Roys <joshua.roys AT gtri.gatech.edu>)”) for a new 4.0-19 build that resolved bug #469412 for precisely this issue. There are many more changes in Fedora’s jwhois after that, unlike its RHEL and CentOS equivalent, which in all the years since then received only a single update. This is also called 4.0-19, but it was made on Jun 23, 2011 and it includes only two fixes for unrelated issues that were fixed in Fedora’s jwhois updates 4.0-24 (Dec 20, 2010) and 4.0-26 (Mar 15, 2011), but not the earlier select fix or fixes for any of the other issues. CentOS is missing the “jwhois-4.0-select.patch” and that’s why WHOIS hangs.

Google broke Picasa uploads

Having used Google Picasaweb for picture-hosting for many years, Google’s transition to Google Photos has been a frustrating experience. The original Picasaweb has always worked better for me than its supposed replacement. Several friends of mine who had also been using Picasaweb have already switched to other services, including Facebook.

The latest nail in the coffin came a few days ago, when the Picasa 3 application failed to upload new albums to Google Photo. The error message was:

Error: Request failed
Click here to View Errors

The link revealed that it was a server error:

HTTP Error 400 – https://picasaweb.google.com/post?tok={long-token-here}[156]

It looks like someone at Google broke the upload servers. When they announced the transition a year ago, Google wrote:

Desktop application
As of March 15, 2016, we will no longer be supporting the Picasa desktop application. For those who have already downloaded this—or choose to do so before this date—it will continue to work as it does today, but we will not be developing it further, and there will be no future updates.

For now, the workaround appears to be to use “File | Export Picture to Folder” in the Desktop application to create files no wider than 1600 pixels (below the limit for unlimited free uploads) and then upload those file sets to Google Photo using its web interface.

At the moment it is still possible to share Google Photo images in blog and forum posts but for how much longer? First you must share the album, for example by clicking on the “share” icon in the album in Google Photo, then “Get Link” to generate a link, which you don’t actually have to use. Then you can view an image, right-click on it and select “Open image in new tab”. The URI above the new tab that opens can be used for embedding images in blogs and forums. If or more precisely, when Google also breaks this feature then Google Photos will become unusable for me.

I am looking for a good solution to be hosted on one of my own servers that will replace Google Photos, without size limits and without any hassle for resizing images for public sharing, that will let me control who can see what images like the old Picasaweb did.

Nexus 6P Flashing Charge Icon

Recently the USB-C quick charger that came with my Huawei Nexus 6P appeared to stop working. I normally leave the phone charging over night, but one morning I found its battery charge was low and it hadn’t been charging. When I disconnected and reconnected it to the cable (which is reversible with USB-C connectors on both ends), the lightning bolt inside the battery charge indicator kept blinking (flashing on and off), rather than being solid on as it normally would while the device is charging.

Disconnecting and reconnecting the device or unplugging and reconnecting the charger to the wall socket made no difference whatsoever. Reversing the cable direction did not help either.

My only way to still charge the phone was to use a USB-A to USB-C cable that draws power from a PC USB socket, which is a much slower way to charge the phone. So I decided that the charger must have failed after less than a year of use. I already started looking for USB-C quick chargers on Amazon (they exist but are much more pricey than USB-A chargers), but didn’t order one yet.

Today I decided to Google for the problem and found others who had the exact same issue. It turned out that simply powering down the phone and powering it up again will fix the problem: Yepp, it will charge again!

I’m not sure what the fundamental issue is, but it seems I won’t have to rush out and buy a new charger (which wouldn’t have helped anyway!), as the issue is on the phone side.

If a simple phone reboot fixes it and it doesn’t happen too often, I guess I can live with that. The Nexus 6P has worked great for me so far.

Removing “Suggested for you” category from Google News

In November 2014 Google added a “Suggested for you” category to Google News which includes articles on topics that it thinks are of interest to you.

Now, Google has some pretty smart algorithms for rating websites with content that people are searching for to give you the most relevant information, but even 18 months after this particular feature was launched in Google News I find its results pretty poor. They merely distract from news items I am really interested in.

For example, if you search for the lyrics of a song by a particular artist because a family member asks you to then you’re likely to be seeing articles about that artist popup in your feed daily for weeks and months…

The solution is easy:

  • Open Google News while you’re logged in to Google
  • Click on the “Personalize” button on the top right
  • Look for a “Suggested for you” category with a slider next to it.
  • Move the mouse to that category and click the trash can that appears next to the slider
  • Save the changes

Should you ever want to restore the category, you can click “Personalize” and “Reset” to undo all personalization.

Upgrading to 14.04.1 LTS or If It Ain’t Broke, Don’t Fix it

I should have left my Ubuntu 12.04 LTS well alone. Yes, it is over 2 years old, but it worked rock solid and I’ve been good about installing updates on it.

I don’t know what devil rode me last Friday, but when the system informed me that an upgrade to 14.04.1 LTS was available, I went ahead and gave it a try. I should have known better.

When the upgrade finished many hours later, POP access to the dovecot server was no longer working and rsync using modules was broken (rsync daemon not running). I had accepted all the defaults to keep existing configuration files during the upgrade. It turned out that dovecot needed some changes for namespace inbox:

namespace inbox {
...
inbox=yes
}

The rsync daemon needed to be manually enabled again via

sudo vi /etc/default/rsync

RSYNC_ENABLE=true

Hopefully I won’t stumble across more problems that will need fixing, but the experience was a reminder not to needlessly mess with a working system.

Google Maps Engine brings back custom routes

Last year I stopped updating Google Maps on my Android phone because Google had dropped important functionality with Google Maps 7.x. Google Maps 6.x for Android was a great tool for following mapped routes on long bicycle rides, especially randonnes of 200 km and more. After an update I had to revert to Google Maps 6.x to get it back. This also meant I could no longer allow Android to install all available updates in one go. I always had to manually confirm all updates except Maps to not lose 6.x again.

Finally Google has brought this functionality back. There are still missing bits, but at least the product seems usable again for my purposes.

On Android there is an app called Google Maps Engine, which supports loading custom maps. Select “Open a map” in the menu. You’ll get a list of maps created by you or shared with you.

This menu can be populated from a desktop machine. There you can import existing maps created for Maps 6.x. Go to https://mapsengine.google.com/map/ and select “Open a map” (you need to be logged in to your Google account). Select “Classic My Maps”. You’ll be able to select one of your existing maps and import it in to Maps Engine. After that it will become available to the Google Maps Engine app on your Android and you can use it for navigation. The route will show as a blue line and special locations, such as my brevet PCs (“points de controle”, route check points) will show marked with a pin.

One drawback of Maps Engine on the Android compared to the old Google Maps 6.x is that it doesn’t seem to support displaying a ruler on a map yet. Thus when you zoom in or out you won’t be able to tell how far you are from any point you see on the map, whether one cm on the screen corresponds to 100 m or 10 km on the map. This is the same problem that Google Maps 7.x had when it was launched last year. Hopefully it will be fixed soon. Still, it is disconcerting that Google misses out such basic functionality when launching products. Are all their eyes on monetization these days?

Adding sudo on Debian Linux

For a long time I had been using the sudo command on Ubuntu and other Linux versions, but my main server did not have it installed. I always had to use ‘su’ with the root password to do be able to do administrative jobs. It turns out it was really easy to fix. Simply follow these steps as root (using your actual user name in place of jsmith):

apt-get install sudo
adduser jsmith sudo

This installs the sudo package, creates a sudo user group and the /etc/sudoers configuration file. It then adds your user to the user group sudo, which per the default /etc/sudoers file is permitted to run sudo.

Note that these changes do not take effect for any ssh sessions already open. If you have a running session logged in as the user you just added to the sudoers list and you attempt to use sudo from there, it will ask for your password and then fail with this error message:

jsmith is not in the sudoers file. This incident will be reported.

The fix is simple: log out and log back in again. On the new login, the new configuration will be picked up and you will be able to use sudo as intended.

If you would like to do multiple commands from sudo like you could from su, it’s very easy. Simply use sudo to launch a copy of bash and exit after you’re done:

sudo bash

Google does an “Apple Maps” to its own Maps

Last night Google proved to me that you don’t have to be Apple to shoot yourself in the foot with a major Maps application release.

Naturally, online maps are a big feature on mobile devices, which is why it’s important to get them right.

Not too long ago Apple ended up with egg on their faces when they introduced their own Maps application to replace Google Maps. Google has just done the same. They rolled out a completely new Maps app starting from the middle of July and yesterday it landed on my Android phone. I was just preparing for a 280 km bicycle trip and had mapped out the route to follow, which I usually use Google Maps for. Imagine my surprise when I found that following an externally mapped route file was no longer supported on the latest Google Maps app: It doesn’t support the “My Maps” feature any more. With “My Maps” you can map a route using a number of third party products and highlight key locations, such as restaurants or shops on the map and assign a name to this. Google Maps then marks these points of interest with asterisks and highlights the route with a coloured line that you can follow easily. Simple but powerful. Well, that’s how it used to be before the “upgrade”.

This is what they say on their official blog:

Finally, My Maps functionality is not supported in this release but will return to future versions of the app.

Sounds to me like they were keen to release a new version of the product, even thought it wasn’t ready yet — just like Apple. Interestingly enough, the iOS version of Google Maps didn’t have the “My Maps” feature either. So what Google has done is to dumb down its flagship product to the level of the inferior version it ships on its competitor’s operating system!

Another annoying omission was the ability to display a scale bar (ruler) illustrating distances on the map, at whatever zoom level. This option has gone. It was quite useful to be able to estimate distances on the map. Without it, I simply don’t have a clue about distances unless I’m totally familiar with the area, in which case I presumably wouldn’t be using Google Maps in the first place.

My temporary fix was to uninstall Google Maps, reverting back to the factory installed version of Google Maps. This gets Google Maps working again, but it’s not sticky. After uninstalling it, the “upgrade” (i.e. downgrade) was back again the following day. Therefore it is important to disable automatic updates in the Google Play settings. Once you do that you will have to manually confirm all updates for apps other than Maps (and you need to avoid confirming Maps updates, which will still be offered).

Other problems that caused user complaints:

  • No more offline maps – the new version only supports map viewing with a mobile data or WiFi connection
  • Removal of +/- (zoom buttons) – zooming in and out now takes two fingers
  • Fewer and less relevant local search results
  • No more green/red/yellow lines along roads to indicate congestion levels
  • Removal of Google Latitude (which I never used)

UPDATE (2013-08-16): Version 7.1.0 appears to have brought back the scale bar. However, I won’t be installing it until My Maps also comes back.

Acer One D260 system restore

The hard disk in my wife’s Acer One D260 netbook got damaged. A new hard disk is about a quarter the price of a new netbook, so I wanted to install a new drive. Like with most PCs these days there aren’t any Windows install DVDs included.

The netbook came with Windows 7 Starter, which we needed to somehow install on the new hard disk. Fortunately, the damaged hard disk was still limping along enough to use the Acer eRecovery system to create two Recovery DVDs. These should allow restoring the initial system state to a hard disk in the machine, wiping all the data on the drive.

To replace the hard disk, I had to undo seven clips around the edge of the keyboard, lift off the keyboard and disconnect the keyboard ribbon cable to the motherboard connector. Then I needed to undo 4 screws underneath and push through, to pop out the cover on the bottom of the machine. This opened access to the single memory slot and drive cage.

The 1 GB memory module on the motherboard can be replaced with a 2 GB PC3-8500 1066MHZ DDR3 module available for about $20. This is a wortwhile investment and I already have the module on order.

I replaced the damaged 250 GB WD Scorpio Blue drive with a spare 500 GB drive (available new for about $60-$80). Then I closed the cover and reinstalled the screws and then the keyboard.

With the new drive it was possible to boot off the first Recovery DVD using a USB DVD drive. The eRecovery software copied data from both DVDs to the hard disks and then rebooted. However, that reboot failed because the new drive did not yet have a Windows Master Boot record (MBR) on it. You can install an MBR from within Windows, but not from the bootable eRecovery DVD. So I had a chicken and egg problem.

I overcame this hurdle by booting off a Ubuntu Live DVD (32 bit), installing the ‘lilo’ package and telling it to install the Linux equivalent of Microsoft’s MBR code:

sudo apt-get install lilo
sudo lilo -M /dev/sda mbr

At the next attempt to boot off the hard disk, Windows started installing its components and drivers and launched into its initial configuration, just like the first time we had unboxed the machine more than two years ago. So we are back to a working Winmdows 7 machine!

Thank you, Linux — you saved my day again! 🙂

Too late to revive Flickr?

Yahoo has just given its Flickr photo sharing service a much needed facelift. I have a Flickr account and used to love the service, but switched to Google’s Picasaweb more than 2 years ago. I loved the Flickr user interface, in fact I much preferred it to Picasaweb, yet I moved on.

Admittedly, Flickr’s 100 MB/month traffic limit was inconvenient, but what really killed it for me was that they limited free accounts to a maximum of 200 uploaded pictures. Not per week or per month, but in total. Facebook has no picture limit at all and Picasaweb has none provided you use the default setting in which it resizes uploads such that the width and height does not exceed 2048 pixels, which is more than enough for anyone with a 1920×1280 or smaller monitor. The greatest user interface was worthless without the ability to upload more pictures. Over the past 12 months alone I uploaded 7.3 GB in 107 sets consisting of 3385 pictures and videos to Picasaweb.

It’s great that Flickr will now offer up to 1 TB of storage for full size images. But how many former users will be prepared to give them another try, now that they have become familiar with Facebook and Google’s competing services? On a positive note though, the new Flickr will force Google to be more careful where it moves with Picasaweb / Google Photo. The Flickr facelift may not make it a winner yet, but any misstep by Google could.