Sunday, March 24, 2013

Create Intellij IDEA launcher on Ubuntu

If you develop using Intellij IDEA on Ubuntu, then it is handy to have launcher on unity panel. There are three relatively easy steps to make it happen:

1. Get current Unity launcher configuration

gsettings get com.canonical.Unity.Launcher favorites

Output:

['application://nautilus-home.desktop', 'application://firefox.desktop', 'unity://running-apps', 'unity://expo-icon', 'unity://devices']

2. Create IDEA desktop launcher

sudo vim /usr/share/applications/idea.desktop

Copy this content into the file and save it:

[Desktop Entry]
Name=Intellij IDEA 12
Comment=Development IDE
Exec=idea
Icon=/opt/idea12.0.4/bin/idea.png
Terminal=false
Type=Application
Categories=Development;IDE;


3. Update Unity launcher configuration

gsettings set com.canonical.Unity.Launcher favorites "['application://nautilus-home.desktop', 'application://idea.desktop', 'application://firefox.desktop', 'unity://running-apps', 'unity://expo-icon', 'unity://devices']"

Launcher is ready to be used

Thursday, September 27, 2012

Lightweight OS on an old laptop

Since features of modern operating systems require more and more memory, the old laptops with small amount of memory and poor CPU frequency may not be used properly.

In a world of Linux one such example is Ubuntu 12.04. The operating system supports a CPU consuming visual effects, for example, switching between windows.

In such situation an OS with small memory consumption is a must. One such an OS is a lightweight Linux OS named Lubuntu. At the start it consumes around 100M, which allows comfortably programming with such tools as Eclipse and web Browser.

In order to install Lubuntu one may go to their official website http://lubuntu.net/ and download their distribution. Or if have already installed some OS, such as Ubuntu, you may want to simply install Libuntu desktop with:

sudo apt-get install lubuntu-desktop

Sunday, August 26, 2012

Regular expressions vs shell patterns

Today I have discovered an important difference between regular expressions and shell patterns in a context of file searching in Linux. Their both applications may be found in a powerful utility find. Its arguments -name, -path and -wholename are interpreted as shell patterns, and -regex - as regular expressions.
The difference between regular expressions and shell patterns is in how some characters are interpreted.
Let's consider a star character (*). In shell pattern it is interpreted as match of zero or more characters. In regular expression is interpreted differently: it matches preceding character or group zero or more times.
For example, the string '*tmp' will match all strings ending with tmp by shell pattern processor, but regular expression processor won't match anything at all! In order to write an equivalent regular expression of a shell pattern we have to write '.*tmp'.
These commands are equivalent:
find . -name '*tmp'
find . -regex '.*tmp'
So be careful when writing matching expressions and know how it is interpreted.

Saturday, August 11, 2012

How to set up keyboard layout changing in xfce

One may change keyboard layout in xcfe with the following command:

setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,de,it

Moreover most users may want to do it only once on login. For this reason the command has to be saved in whether ~/.profile or ~/.bash_profile or ~/.bash_login if one of the two latter files exist. 

Thursday, August 9, 2012

How to enable vim syntax highlighting in Ubuntu 12.04

There are much information on the internet, about how to enable syntax highlighting in Ubuntu.
Some of them advice using the command :syntax=on, another saying about installing vim-full.
These advises are valid for earlier versions of Ubuntu, but not for the 12.04.
So in order to enable syntax highlighting one has to install vim-gnome and it will be enabled automatically:
sudo apt-get install vim-gnome