Archive for July 2012

The sorry state of desktop Linux

I’ve used desktop Linux for 15 years, and for all these years, it’s a continuous path of failures and sorry state.

Anyone still remembers KDE? KDE2 wasn’t so great, but KDE3 improved a lot and was really pleasant to use. Heck, no, the developers had to introduce the chaotic and unstable KDE4 – user base dramatically dropped and nobody has confidence in KDE anymore.

Gnome? Became even more popular after KDE4 was introduced. Unfortunately, Gnome developers, much as most Linux desktop developers, don’t learn on success of the others, rather, they repeat the errors of the others (KDE4). So Gnome 3 made it to the world, with users leaving and having same mixed feelings about it, just like they have with KDE4.

The new kid on the block, Unity, is as controversial and annoys a lot of its user with its inconsistency.

There are others, too, like MATE, Cinnamon, Xfce, but they suffer from even more immaturity than their bigger brothers.

 

What do we have so far on the Linux desktop? No organised engineering, no long term plans, no QA, releasing alpha versions as stable products, in short, just total revolutions every couple of years.

 

Frustrating.

 

date conversion oneliners in bash

Some handy date conversion oneliners in bash.

Assuming we have a unix timestamp format (seconds since 1970-01-01 00:00:00 UTC) and we want to make it human readable:
$ date --date=@1343351724
Fri Jul 27 01:15:24 GMT 2012

 

Same as above, but we’d rather make it output in a different format:

$ date --date=@1343351724 +%d/%b/%Y:%R:%S
27/Jul/2012:01:15:24

 

Need the above for a different timezone? Try this:

$ env TZ="Asia/Tokyo" date --date=@1343351724 +%d/%b/%Y:%R:%S
27/Jul/2012:10:15:24

 

Date “now” in Tokyo, our custom outputĀ  format:

$ env TZ="Asia/Tokyo" date +%d/%b/%Y:%R:%S
27/Jul/2012:19:11:39

 

12 hours later from now in Tokyo:

$ env TZ="Asia/Tokyo" date +%d/%b/%Y:%R:%S --date="+12 hours"
27/Jul/2012:19:13:08

 

For a list of possible timezones on your system, see ls /usr/share/zoneinfo.

 

First day of this month:

$ date +%F
2012-08-07
$ date -d "-$(date +%d) days + 1 day" +%F
2012-08-01

Last day 2 months ago:
$ date +%F
2012-08-07
$ date -d "-$(date +%d) days - 1 month" +%F
2012-06-30

Convert syslog date to unix timestamp – assuming your log line begins with:

Nov 5 08:49:45

you can convert it to unix timestamp with:

date --date="Nov 5 08:49:45" +%s

“Setting filesystem feature ‘metadata_csum’ not supported” when trying to enable ext4 checksums

Linux kernel version 3.5 added support for ext4 checksums. It should be possible to enable it with the following command:

# tune2fs -O metadata_csum /dev/sda1
tune2fs 1.42 (29-Nov-2011)
Setting filesystem feature 'metadata_csum' not supported.

However, as you see, it may well fail for you.
Continue reading ‘“Setting filesystem feature ‘metadata_csum’ not supported” when trying to enable ext4 checksums’ »

Motorola Razr and Android ICS / 4.0 upgrade screenshots

If you’re one of these Motorola Razr or Motorola Razr Maxx owner, you’ve perhaps waited pretty long for the Android Ice Cream Sandwitch (ICS) / 4.0 upgrade.

Fortunately, it’s being deployed on more and more handsets now.

Continue reading ‘Motorola Razr and Android ICS / 4.0 upgrade screenshots’ »

/etc/apt/sources.list, Debian Lenny and error 404

Since Debian Lenny is now deprecated and no longer supported, its packages are now removed from the mirrors. Because of this, you may experience 404 when trying to install the packages with apt-get, or update sources lists.

If you’re not going to upgrade to Debian Squeeze, here are /etc/apt/sources.list lines giving you access to Lenny packages (stored on archive.debian.org servers):

# packages
deb http://archive.debian.org/debian lenny main contrib

# security updates
deb http://archive.debian.org/debian-security/ lenny/updates main contrib

If you’re getting the following error:

root@server:~# apt-get update
Hit http://archive.debian.org lenny Release.gpg
Ign http://archive.debian.org/debian/ lenny/contrib Translation-en
Ign http://archive.debian.org/debian/ lenny/contrib Translation-en_GB
Ign http://archive.debian.org/debian/ lenny/main Translation-en
Ign http://archive.debian.org/debian/ lenny/main Translation-en_GB
Hit http://archive.debian.org lenny/updates Release.gpg
Ign http://archive.debian.org/debian-security/ lenny/updates/contrib Translation-en
Ign http://archive.debian.org/debian-security/ lenny/updates/contrib Translation-en_GB
Ign http://archive.debian.org/debian-security/ lenny/updates/main Translation-en
Ign http://archive.debian.org/debian-security/ lenny/updates/main Translation-en_GB
Hit http://archive.debian.org lenny Release
Hit http://archive.debian.org lenny/updates Release
E: Release file expired, ignoring http://archive.debian.org/debian-security/dists/lenny/updates/Release (invalid since 224d 17h 7min 51s)

you have to use the “-o Acquire::Check-Valid-Until=false” option:


# apt-get -o Acquire::Check-Valid-Until=false update
Hit http://archive.debian.org lenny Release.gpg
Ign http://archive.debian.org/debian/ lenny/contrib Translation-en
Ign http://archive.debian.org/debian/ lenny/contrib Translation-en_GB
Ign http://archive.debian.org/debian/ lenny/main Translation-en
Ign http://archive.debian.org/debian/ lenny/main Translation-en_GB
Get:1 http://archive.debian.org lenny/updates Release.gpg [836 B]
Ign http://archive.debian.org/debian-security/ lenny/updates/contrib Translation-en
Ign http://archive.debian.org/debian-security/ lenny/updates/contrib Translation-en_GB
Ign http://archive.debian.org/debian-security/ lenny/updates/main Translation-en
Ign http://archive.debian.org/debian-security/ lenny/updates/main Translation-en_GB
Hit http://archive.debian.org lenny Release
Hit http://archive.debian.org lenny/updates Release
Hit http://archive.debian.org lenny/main amd64 Packages
Hit http://archive.debian.org lenny/contrib amd64 Packages
Hit http://archive.debian.org lenny/updates/main amd64 Packages
Hit http://archive.debian.org lenny/updates/contrib amd64 Packages
Fetched 836 B in 0s (9,565 B/s)
Reading package lists... Done

java leap second bug – 30 June / 1 July 2012 – fix

If your java applications suddenly started to use 100% CPU, you’ve hit java leap second bug (actually it’s a bug in Linux kernel, just java programs seem to be severely affected).

First, you may check if you have the following in your dmesg:


[10703552.860274] Clock: inserting leap second 23:59:60 UTC

Fortunately the fix is straightforward:

/etc/init.d/ntp stop
date -s "$(date)"

(the other suggested way around the web would be date `date +"%m%d%H%M%C%y.%S"`, having the same effect).

You don’t have to restart your java applications (tomcat, solr, wowza, or whatever using java, but also non-java Ruby, Redmine, collectd etc. were affected); it should be enough to run the above commands.

You may want to enable ntp the next day (there were some reports that enabling it makes java misbehave on some installations).

Apparently this issue has knocked down lots of Linux servers running Debian, Ubuntu, CentOS and the like around the globe!
Continue reading ‘java leap second bug – 30 June / 1 July 2012 – fix’ »