Saturday, January 29, 2011

Use Text based GUI Runlevel configuration tool to add or remove services

In Fedora, we can use chkconfig command to set the run level of the serveice. However, it is missing in Ubuntu.

rcconf is Debian runlevel configuration tool. Rcconf allows you to control which services are started when the system boots up or reboots. It displays a menu of all the services which could be started at boot. The ones that are configured to do so are marked and you can toggle individual services on and off. If rcconf is not installed use apt-get command:
$ sudo apt-get install rcconf


Now run rcconf and just follow on screen instructions:
$ sudo rcconf

Friday, January 28, 2011

dos2unix missing in Ubuntu 10.04

"dos2unix" is an important tool for developer especially when they need to deal with windows files. This tool converts dos format text file to unix format. However, when you typed "dos2unix", you should get this error under Ubuntu 10.04

dos2unix: command not found


To install dos2unix package back:
$ sudo aptitude install tofrodos


If you want "dos2unix" type "fromdos" and if you want "unix2dos", type "todos".
Alternatively, you can create symbolic links for your convenience:

Go to /usr/bin:

$ sudo ln -s /usr/bin/fromdos /usr/bin/dos2unix
$ sudo ln -s /usr/bin/todos /usr/bin/unix2dos

Thursday, January 27, 2011

Setting up keybindings for the Command Window and Editor

For purely historical reasons, the Command Window ships with its keybindings set to “MATLAB Classics (Emacs)”. We used to only have one set of keybindings for the Command Window and we didn’t want to change the behavior that people were used to. The Editor, however, uses the platform’s keybinding set as its default. This often causes confusion when a keybinding doesn’t work in the Command Window like expected. I quite often get requests from customers to hook up a keybinding that is already there. We will probably make changes in this area in a future release, but in the meantime check your keybinding preferences to make sure that they are set they way you want them.

If you are on a Mac, you will probably be much happier if you change the keybindings to the Mac set for the Command Window. Once you do this, command-a will select all and the navigational keystrokes work more like you would expect.

On Windows, if you set your keybindings to the Windows set, you will get the Windows keybindings that you expect. For instance, Ctrl-P will print instead of recalling the previous command history item.

So, if you haven’t done this before, take a look at your keybinding preferences (File->Preferences menuitem) and try changing the keybinding sets to the appropriate platform set and see if you like it:

Setting Lenovo IdeaPad S10-3′s touchpad with two finger scroll support on Ubuntu 10.10


After buying my Lenovo IdeaPad S10-3 I read some reviews about the hardware and all of them agreed that to integrate the mouse’s buttons to the touchpad wasn’t the best thing Lenovo have done... I agree too.



On Windows 7 the touchpad has a better performance than on Linux without setting Synaptics in the graphical environment, so I thought it should be a way to set it on Linux. As the x11 config file has been removed in Ubuntu 10.10. I need to use synclient to set the mouse pad value. Thus, I created a bash script and if you like, you can put it as startup program. Also, I added two finger scroll support in this script

1. You can copy the script below and save it as "lenovo_mousepad.sh" (change it whatever you like).

#!/bin/bash                                                                                 

synclient LockedDrags=false
synclient VertEdgeScroll=true
synclient HorizEdgeScroll=false
synclient TapButton1=1
synclient LTCornerButton=2
synclient MaxDoubleTapTime=120
synclient TapButton2=3
synclient EmulateTwoFingerMinZ=20
synclient EmulateTwoFingerMinW=5
synclient AreaBottomEdge=4200

# comment the following 4 lines if you don't want two finger scroll support
synclient VertTwoFingerScroll=1
synclient HorizTwoFingerScroll=1
synclient EmulateTwoFingerMinW=5
synclient EmulateTwoFingerMinZ=48


2. set it as executable
$ chmod +x lenovo_mousepad.sh


3. execute the script
$ ./lenovo_mousepad.sh


4.(Optional) put it as startup program under the administration menu

Note: you can query all current values by typing this
$ synclient -l


Here the parameters of interest are:

Parameter Description
TapButton1 Which mouse button is reported on a non-corner one-finger tap.
LTCornerButton Which mouse button is reported on a left top corner tap.
TapButton2 Which mouse button is reported on a non-corner two-finger tap.
EmulateTwoFingerMinZ This sets the Z pressure threshold to emulate a two finger press.
EmulateTwoFingerMinW This sets the finger width threshold to emulate a two finger press.
AreaBottomEdge Ignore movements, scrolling and tapping which take place below this edge.

Saturday, January 8, 2011

Taglist for vim

ctags is a very important tools for programmers who use vim as the major editor. You can install taglist plugin for vim. However, ctags program is not installed by default in Ubuntu. Thus, it shows the following error when lauching vim with taglist.

Taglist: Exuberant ctags (http://ctags.sf.net) not found in PATH. Plugin is not loaded.


To solve this, for sure we need to install ctags. To do so
$ sudo apt-get install exuberant-ctags

`gnome-256color' not known

When using vim, I usually set it to be gnome-256color to have better appearance.
However, it showed an error to me when I launched vim. The error is :
E558: Terminal entry not found in terminfo
'gnome-256color' not known. Available builtin terminals are:
builtin_riscos
builtin_amiga
builtin_beos-ansi
builtin_ansi
builtin_pcansi
builtin_win32
builtin_vt320
builtin_vt52
builtin_xterm
builtin_iris-ansi
builtin_debug
builtin_dumb
defaulting to 'ansi'


To solve this problem, we need to install the corresponding package
$ sudo apt-get install ncurses-term

Saturday, January 1, 2011

Compiz Plugin `Grid'

I used 15" and 17" small monitors before as I have no money :-(. Recently, I bought a 22" wide screen monitor and it makes lots of change for me.

In the past, I maximized all the application as the screen size was not too large. 17" for a browsing application is suitable at all. However, for 22", a web page is too large if I maximized the browser. In fact, good use of wide screen monitor should be view multiple applications at the same time. Thus, I should use half of monitor for browsing and remaining area for other applications.

Fortunately, there is a simple awesome plugin in Compiz named `Grid'. This plugin changes your screen to a 3x3 matrix and you can put one application in one entry by using Alt + Ctrl + (Num pad 1 - 9) [you can change the setting via compiz setting manger]. Hope that this application can help you to organize your application better and have a better feeling of using Linux!

Related Resource:
  1. http://www.webupd8.org/2009/12/linux-w-compiz-tile-position-and-resize.html