Upgrade to Ubuntu Feisty, solve no sound problem

April 23, 2007

Superb supried after upgrade to Ubuntu Feisty (7.04). The first edition of Ubuntu I installed is 6.04, and the upgrade to 6.10 is just so so, I didn’t feel any big change, to be honest. But, this time, I feel my Ubuntu+KDE is faster 5 times!!

Honestly, I do not know what’s essential new stuff in this Feisty edition, the next version is coming up October anyway… I just want to be updated… The result is surprisingly good. For the first time, I feel my Ubuntu is actually faster than Windows, yes!

Here is some problems after the upgrade, though: 1. fcitx, a Chinese input software crashes everytime; 2. My Chinese fonts become mess; 3. no sound at all!

Fortunately, all these three problems are solved right now. I’ll just list my solution to the third problem here, as I think most of the viewers are not Chinese 🙂

The no sound problem is quite annoying. My problem is no sound at all! I found a nice HOWTO article in the Ubuntu forum here. It’s a Comprehensive Sound Problem Solutions Guide. But I can find my sound card by the command “aplay -l” and the rest of the article cannot help me out.

Then I came across a Chinese article that just solve my problem, and it’s quite simple! I consider this as a Ubuntu/Linux upgrade bug! Here is the solution:

Type “gnome-volume-control” in the terminal. As I am using KDE, there is no icon in my system tray. I need to type the command.

“Edit” -> “Preference”, check “Headphone Jack Sense” and “Line Jack Sense”.

Goto “Switch” tab, Uncheck both of them. Then you will hear a “dong” sound, and the sound is back!

You might also want to turn off the Microphone (make it mute), as I find my Thinkpad has lousy noises when the volume is up. This is due to the internal microphone in my laptop. Turning it off will solve this.

I do not come across any new software of the Feisty version yet, but the speed of the system is very good. I feel very satisfied.

Use shortcut to replace “Esc” in VIM/GVIM

March 22, 2007

I bought a second hand Canon 300D recently. Had much fun with it. I’ll probably write something about using a DSLR in Ubuntu. Really love this “old” camera.

OK. Here is the problem I recently found when I was using GVIM-latex-suite to type my final thesis, when I want to change back to normal mode from the insert mode by pressing “Esc” it is quite unconfortable. Although “Esc” key is not far from other keys, it is just not that convenient. Because when you typing, your fingers are alway around “ASDF”and “JKL:” keys. You’ll need to move your hand to reach the “Esc” key…

This can be quite easy to solve. I am sure there is a way using VIM setting itself to remap Esc key. But don’t want to research such settings. The KDE control center, can do this quite easily. Here is the steps:

  1. KDE control center-> Reginal & accessibility-> Input Actions.
  2. “New Action”. Note you’d better to create a new group first.
  3. Go to “Trigger” tab, “New”-> Shortcut Trigger-> I use “Right Alt +  L”. It’s quite convenient when you are in the type position. Try it yourself.
  4. Go to “Actions” tab, “New”-> Keyboard input -> type Escape.
  5. Leave all the other settings default.

That’s it. Now in every active windows, if you press “Right Alt+L” the actual key activated is “Esc” key. Enjoy your VIM typing!

HOWTO: count “real” word in Latex document

February 6, 2007

Well, this should apply to all Latex documents, no matter it is edited in Windows or Linux environment. I jot this down because I am currently writing my final thesis, and just finished the first chapter. Then I want to check the word I’ve written, but I realised that the word count may include all the latex command which is not the real word count. Then I search the web find the ways to tackle this:

  •  First “sudo apt-get install untex“. then “untex target.tex > count“, then “wc -w count“. Well, don’t know is there any untex in Windows.
  • This is quite convinient. There is a Perl script that can do this job nicely in here. The online script is even more convinient, just upload all the code, and the result will come out in a second (click on the icon in that webpage, or click here directly).

Recommend: Yakuake, a cool terminal Emulator for KDE

February 1, 2007

In KDE, I use Konsole all the time, until I met Yakuake. I add this small tool to my long-term using applications immediately. The reason is simple. It’s pretty convenient, fast, and cool.

KDE lets me define a shortcut (I set it to Win+Ctrl+T, whilst Win+T to start it) to activate my Konsole no matter what desktop it is, or it is minimised or not. This is quite handy as whenever I want to switch to an opened Konsole instead of opening a new one, I just press the hotkey. However, it is annoy that after this I have to minimise it manually, otherwise it will be the current active window in my every 9 desktop!!

By using Yakuake, this wouldn’t be an issue anymore. I add it to my autostart applications. So instead of start a terminal and switch it every time and minimise after using it, I just press a hotkey (I set it to Alt+X as it is very handy for my left hand), a console will slide from my top screen edge, then I can type and command I want, or add more tabs. To inactivate it, just click outside this console it will slide back as nothing happens, or press the hotkey again. This applies to all my desktops. Besides, the interface is really cool, I set it to use Konsole’s settings, others default. Here is a screenshot:


To install is quite simple: in terminal “sudo apt-get install yakuake” , then say goodbye to your old terminal emulators.

My note on GIMP to edit digital photos

January 30, 2007

Before struggling with Canon EOS 400D or 30D, or … making money first…, I figured out that before I have money to buy a DSLR, I’d play around with digital photo editing softwares in Linux first. I then searched for a good photo editing software for sometime. But a voice told me in my head: “Hey, dude, don’t you know GIMP was in your Ubuntu from the very beginning.” Yeah, I am stupid, how can I ignore such a powerful tool that comes with Ubuntu (in fact, I think most distributions would have it). Then I started to learn it. Here are some notes in case I forget them:


  • Remove red eye. Comes from here. Quick steps:
  1. In the picture window, zoom to the pupils, press “Z”.
  2. Play around the threshold to select red areas.
  3. Filters/Colors/Channel Mixer. Choose around “Red 10%, Green 60% and Blue 30%” , done.
  • Blur background, focus object. Comes from here. Doing this can make my picture more like taken from DSLR. The link shows a wee complicated way, my lazy way is:
  1. Always select object area first. Either use quick mask (Shift+Q, then use white brush to brush areas to select, and black brush to brush unwanted areas, then Shift+Q again to see the selection area), or use keyboard “I” to select.
  2. Use Filters/Enhance/Unsharp Mask to sharp the object a bit.
  3. Ctrl+I. Use Filters/Blur/Gaussan Blur to blur background. (radius around 20 would be OK)
  • Make colors better. This comes from a lot of links.
  1. First of all. Tools/Color Tools/Levels/Auto would be a good automatic way to better color.
  2. If I feel some colors are too thick in the picture (say blue), change chanel in the Levels dialogue from value to that chanel, say blue. and drag the righ triangle to left. Need to play around.
  3. Also /Tools/Color Tools/Curves is worthy playing around. I haven’t figured out the principles of these tools, but they are good…
  4. /Tools/Color Tools/Brightness-Contrast is self-explained.
  5. Tools in /Layer/Color/Auto can also do some automatic jobs to make colors better.
  • Heal picture. This is so amazing. With this Clone tool, I can remove dust in the picture. It can achieve some amazing effect far more than dust removing. Just play around it once, you’ll get the idea.
  1. In the picture window, zoom to the dust I don’t want. keep some good area around it, because clone tool needs place to clone. Press “C” key.
  2. Ctrl+Click the spot you think that is very similar to the dust area that you want to heal. This is the original area to clone.
  3. Click on the dust to heal it with the clone area. Choose proper brush size. Sometimes I find a big fuzzy brush can do better job than small ones.
  4. Notice that if you click hold and drag the brush around the dust area, the original clone area are moving too. This can avoid making picture too fake (all copy from the same spot). There is an option of Alighnment to select, try it, you’ll get the idea.

These are the notes I learned so far. Anyway, GIMP is an amazing free software, I’ll keep learning it:). The picture below is my practice, with my normal Kodak digital camera without flashlight (along with the original picture). First I used Levels and Curves to deal with the color. Then I used unsharp mask to sharpen nemo, then Gaussian blur to blur the background.

Nemo Nemo origin

HOWTO: quick search terminal history commands

January 20, 2007

I like the MATLAB way of input command — it has the same tab-complete feature; in addition, it has a up-arrow-auto-complete-history-command feature. For example, if I have typed a command “x=39;y=23;” before, now I can just type “x” and then type the up arrow button, then this command would auto-complete. It can also switch between all the history commands that has the same starting letters.

Vert unfortunately, I haven’t found any similar feature in the Linux terminal, or say bash. There is a command called “history” that can list all the history commands. I can type “history | grep xxx” to search the command I want to find. The same example, I can type “history | grep x=” try to find that command. There would come up something like “201 x=39;y=23;“. The number in the beginning is the index of in the history. Then I can type “!201” to repeat this command. But I find this quite time-consuming.

Then I came across a shortcut of bash “Ctrl + R“, it can “search through previously used commands”. Say in the terminal I type “Ctrl + R”, then “(reverse-i-search):” came up, then I can type keyword of my previous command, say “x=” then the most related command would come up. After the right command comes up, then type enter, finish. Although not as convinient as the MATLAB mode, this is way better than using “history” command, in my view.

HOWTO: make vim latex-suite always recognise tex file

January 9, 2007

Although the KDE latex tool Kile looks very nice to me, I like use the famous vim editor with its latex-suite to edit my latex files. I got a problem with this editor recently. The problem is that vim can’t invoke my tex file automatically. For instance, there is an empty file called “empty.tex”. If I open it with vim, the latex-suite won’t load automatically. As long as I added some latex keywords like “/usepackage”, vim would recognise this file as latex tex and load the latex-suite.

I searched the vim “filetype plugin manual” and got —

Vim can detect the type of file that is edited. This is done by checking the
file name and sometimes by inspecting the contents of the file for specific

So it seems that vim detect the latex tex file by the content of the file, not the extension name “tex” . After some searches, I found there are three ways to make sure the latex-suite will be loaded if the file have a tex extension name.

  1. In the vim when edit the file. Use “: set filetype=tex
  2. Put this line “/* vim: set filetype=tex : */” in the file.
  3. vim ~/.vimrc. add this line: “let g:tex_flavor = “latex”“.

I think the last method is the best.

No more Fedora Core?

January 6, 2007

I ran across this RSS title from digg.com this morning. Feeling sad for FC, which is my first Linux distribution. I was attracted by the blue-style of FC before touching Linux. However, a close look into the article seems this a “joke”, here is the link.

Starting with Fedora 7, there is no more Core, and no more Extras; there is only Fedora. One single repository, built in the community on open source tools, assembled into whatever spins the Fedora community desires.

Is this a word game just like rename “Fedora Core” into “Fedora”? At least, it seems nothing differnt to me. I think there is one thing for sure, there is no more the name of “Fedora Core”, not Fedora Core.

Tomboy icon on the KDE tray, finally

January 5, 2007

Tomboy is a nice note taking application that I am using it everyday. But it is really annoying that no icon is there on the KDE tray. But it is really there, like a transparent icon. These problem seems a bug in the 0.4 release, because I saw someone else got the same question in some forums. But now with the 0.5.1 release, the tomboy icon finally can be displayed on the KDE tray. Of course there are other new features, please check here.

Tomboy icon on the KDE tray

Superswitcher — A nice Alt+Tab alternative

January 5, 2007

Today I came across a nice small application called “Superswitcher” from LinuxTOY. It is quite handy to use Win+direction keys to switch from desktops and applications in one desktop.

“SuperSwitcher is a (more feature-ful) replacement for the Alt-Tab window
switching behavior and Ctrl-Alt-Left/Right/Up/Down workspace switching behavior
that is currently provided by Metacity.”

Don’t worry about the homepage of Superswitcher is inside the Gnomefile, because I found it works perfectly in my KDE desktop environment. It also has some other features like move windows, find particular windows by key combinations. The only problem I found so far (after trying 2 min only…) is that it conflicts with my KDE shortcut. I have Win+ KEY to open applications, and Win+Ctrl+KEY to switch to that window. Now I can’t use them if I have Superswitcher on. I’ll try to find a way to overcome this…

A screenshot here: