Adding flags to Gnome keyboard layout switch

One of the little things that has been bugging me for a few years now is the Gnome keyboard layout switch.  I am using two layouts – English and Russian – and instead of having two nice flags, like in KDE, I had to live with ‘USA’ and ‘RUS’ letters in my task bar.  Not that big of a problem, but annoying.  Icons are much easier and faster to understand than text.  And all the other things in my task bar are graphical, so the text stands out too much.

Today I finally decided to do something about.  Thanks to this forum post I had a solution in hand which almost worked.  The steps were:

  1. Download en.png and ru.png icons into ~/.icons/flags/ folder.
  2. Run gconf-editor.
  3. Change the value of /desktop/gnome/peripherals/keyboard/indicator/showFlags to true.

The only thing that went wrong for me were the actual images.  Gnome scaled them to 24×24 pixels and they looked rater ugly.  So I created my own icons using Gimp.  I created a new image 24×24 pixels with transparent background and then dropped in the center of it the flag icon that I got from the FamFamFam icon set.  Saved the results back into the ~/.icons/flags/ folder and vuala!

It’s not 00, it’s a +

I am getting tired complaining and explaining the difference between 00 and a + in the telephone and fax numbers.  It’s quite simple actually and I wonder why the mistake is so frequent.  So, here it goes in written form, so that I won’t have to explain it anymore – just provide a URL.

If you are writing phone number as 0035799513109, you are doing it wrong. It works for some, but not for everyone.  00 in this case is international dialing code.  Many countries are using 00 for international dialing code, but not all of them, by far.  For example, in Russia, the international dialing code is 810.  So the phone number should be 81035799513109, not 0035799513109. See?

So, how are you supposed to know all these codes for each country and how are you supposed to provide your phone number so that anyone in any country can dial it and get where they are supposed to?  The answer is simple: use ‘+’ for the international dialing code, followed up by the country code, and then the rest of the number.  Each telephone company in every country will replace the plus in the beginning of the phone number with the appropriate international dialing code.  Write the phone number as +35799513109. This will always work.  And where it won’t, the person will at least know what to do with the number.

Google Translate tip for Google Chrome

Here is something that I thought of today, played with, and found quite useful – integration of Google Translate with Google Chrome via the search engine configuration.  Of course, I know that there are addons for Google Chrome to integrate Google Translate.  Of course, I know that Google Chrome comes with certain integration out of the box.  But what I need is something else.  Once in a while, when I write an email or a blog post or something like that I’d forget a word in English that I know in Russian, or the other way around.  I usually open a new tab, go to Google Translate, and type the word in faster than I think of a better way to solve the problem.  It’s a completely automated process for me.  My fingers know how to do it.  Plus it’s all so fast because I do it from the keyboard with shortcuts, so even if I’d have some addon installed with a button in the toolbar, I’d need to reach for the mouse, which would slow me down.

So, here is what I did.  I went to Options->Basics->Default Search->Manage.  Of course, I didn’t want to change my default search engine from Google to anything.  Instead I wanted to add a new search engine.  See the above screenshot.  I named the search engine “Google Translate (English->Russian)” to avoid ambiguity when I add more search engines for translations between other languages.  I assigned the keyword “en,ru”, which is what I’ll have to type in the address bar for this search engine to kick in.  And I configured the search URL.  Nothing fancy.

Now, whenever I type “en,ru” in the browser address bar, Google Chrome switches from generic completion to a search engine, where I just have to type the word that I want translated and hit Enter.  Again, see the screenshot above for how the address bar looks.

In exactly the same way I can add more search engines to translate between different languages.  It’s even possible to use “auto” as the source language for Google Translate to figure out in which language the original word or phrase is.  And, of course, you don’t have to limit yourself to Google Translate search engines only.  I have search engines defined for PHP functions lookup, Wikipedia and IMDb searches, and more.  The trick is to find the search URL by performing the actual search on the site that you want to add, and then replace the search query with “%s”.  That’s all. Enjoy!

Shell keyboard shortcuts

I came across a very useful post with the listing of many shell keyboard shortcuts.  The article covers a mix of bash, csh, zsh, and Cisco shell keyboard shortcuts.  The article is in Russian, but I think it will be helpful for more people, so I took the liberty to translate it.  Continue reading for the translation.

Continue reading “Shell keyboard shortcuts”

Monitoring tree of Linux processes

Once in a while there is a need to see the tree of processes on a Linux system.  When such a need arises, I usually run “ps auxw –forest“, which results in something like this (partial output, top only):

/bin/ps auxw --forest

Today, via this blog post, I’ve learned that there is another way – “pstree“.  This command accepts a number of parameters, but in its simplest form, results in something like this (partial output, top only):

/usr/bin/pstree

On my Fedora box, /usr/bin/pstree is a part of the psmisc RPM, which is the one that brings /usr/bin/killall to the system.