Archive

Posts Tagged ‘Lucid’

iOS 5 Device Support in Ubuntu Lucid 10.04

June 16th, 2012 No comments

Seems it’s quite easy to make my iPod touth 4 (iOS 5.0.1) work. 2 packages need update using PPA here. Or you can simply download them and install:

# wget http://ppa.launchpad.net/pmcenery/ppa/ubuntu/pool/main/u/usbmuxd/usbmuxd_1.0.7-1ubuntu1~lucid1_i386.deb
# wget http://ppa.launchpad.net/pmcenery/ppa/ubuntu/pool/main/u/usbmuxd/libusbmuxd1_1.0.7-1ubuntu1~lucid1_i386.deb
# sudo dpkg -i *.deb

Now your audios/videos in your iOS devices are recognized in Rhythmbox :).

Categories: Tools Tags: ,

Updating 3.0 Kernel and Official Nvidia Driver on Ubuntu Lucid

March 8th, 2012 No comments

Ubuntu Lucid(10.04) originally ships with 2.6.32 kernel. But on my T420 thinkpad, the wireless card is not recognized and graphics card is not functional well. Then I switched to 2.6.38 backport kernel, and installed bumblebee package to utilize the Nvidia Optimus Technology. Now the 3.0.0-16 backport kernel is out, it contains the fix for “rework ASPM disable code”, and it should do a better job in power saving even using the discrete Nvidia card. Moreover, it’s the new LTS kernel, so I decided to update to the 3.0 kernel. Please follow the steps if you are interested:

1. Add X-Updates PPA

# sudo apt-add-repository ppa:ubuntu-x-swat/x-updates
# sudo apt-get update
# sudo apt-get install nvidia-current

These commands install official nvidia driver. Currently, it’s the 295.20 version.

2. Enable Nvidia Driver

# sudo update-alternatives --config gl_conf

This will let you to choose opengl engines. Select nvidia over mesa. This will also enable nvidia Xorg drivers, blacklist nouveau driver and add nvidia-xconfig into /usr/bin. You may find warnings like:

update-alternatives: warning: skip creation of /usr/lib32/vdpau/libvdpau_nvidia.so.1 because associated file /usr/lib32/nvidia-current/vdpau/libvdpau_nvidia.so.1 (of link group gl_conf) doesn't exist.
update-alternatives: warning: skip creation of /usr/lib32/libvdpau_nvidia.so because associated file /usr/lib32/nvidia-current/vdpau/libvdpau_nvidia.so (of link group gl_conf) doesn't exist.

Just ignore them, seems to be safe.

# sudo nvidia-xconfig

This will generate new /etc/X11/xorg.conf file for your Nvidia card. If you cannot find the command, the original location is: /usr/lib/nvidia-current/bin/nvidia-xconfig

3. Fix ld Bindings

# echo "/usr/lib/nvidia-current/tls" | sudo tee -a /etc/ld.so.conf.d/GL.conf > /dev/null

This just add an ld path into /etc/ld.so.conf.d/GL.conf, otherwise, glx module cannot be loaded correctly. Here’s the /etc/log/Xorg.0.log segments:

(II) LoadModule: "glx"
(II) Loading /usr/lib/xorg/extra-modules/libglx.so
dlopen: libnvidia-tls.so.295.20: cannot open shared object file: No such file or directory
(EE) Failed to load /usr/lib/xorg/extra-modules/libglx.so
(II) UnloadModule: "glx"
(EE) Failed to load module "glx" (loader failed, 7)

Now, update ld runtime bindings and reboot.

# sudo ldconfig
# sudo reboot

4. Verify

# sudo apt-get install mesa-utils
# glxinfo | grep -i opengl

If your installation is successful, the output looks like:

OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVS 4200M/PCIe/SSE2
OpenGL version string: 4.2.0 NVIDIA 295.20
OpenGL shading language version string: 4.20 NVIDIA via Cg compiler
OpenGL extensions:

After installing the driver, hedgewars shows 120fps. While it used to show 4fps. It’s a great improvement. 🙂

hedgewars

Categories: Linux Tags: ,

File Encodings in Vim

May 30th, 2011 No comments

By default, You need to guide Vim to decode double-byte encodings like GBK and Big5. The default Vim configuration only works well with Unicode encodings including utf-8, utf-16, utf-16be etc..Edit your .vimrc file, add line like:

set fileencodings=ucs-bom,utf-8,gbk,big5,latin1

Now Vim is able to detect and decode GBK and Big5 encodings automatically. And according my experience, Vim respects utf-16 and utf-16be files only they have BOM byes. Otherwise, these files are wrongly decoded. In this case, you may want to manually reopen the file using a correct encoding. The Vim command like:

:e ++enc=<your_encoding>

And Vim does not store BOM when saving by default. To enable/disable BOM saving, use:

:set bomb
:set nobomb

I’ve attached a series of text files to learn the usage. These text file all contains string “123你好”, but saved in different encodings. Let’s list their code points first:

1 2 3
GBK 0x31 0x32 0x33 0xc4e3 0xbac3
Big5 0x31 0x32 0x33 0xa741 0xa66e
Unicode 0x31 0x32 0x33 0x4f60 0x597d
UTF-8 encoded 0x31 0x32 0x33 0xe4bda0 0xe5a5bd

And our hexdump’s here, note the byte order:

# hexdump -C test_gbk.txt
00000000  31 32 33 c4 e3 ba c3                              |123....|
00000007
# hexdump -C test_big5.txt
00000000  31 32 33 a7 41 a6 6e                              |123.A.n|
00000007
# hexdump -C test_ucs2be.txt
00000000  00 31 00 32 00 33 4f 60  59 7d                    |.1.2.3O`Y}|
0000000a
# hexdump -C test_ucs2be_bom.txt
00000000  fe ff 00 31 00 32 00 33  4f 60 59 7d              |...1.2.3O`Y}|
0000000c
# hexdump -C test_ucs2le.txt
00000000  31 00 32 00 33 00 60 4f  7d 59                    |1.2.3.`O}Y|
0000000a
# hexdump -C test_ucs2le_bom.txt
00000000  ff fe 31 00 32 00 33 00  60 4f 7d 59              |..1.2.3.`O}Y|
0000000c
# hexdump -C test_utf8.txt
00000000  31 32 33 e4 bd a0 e5 a5  bd                       |123......|
00000009
# hexdump -C test_utf8_bom.txt
00000000  ef bb bf 31 32 33 e4 bd  a0 e5 a5 bd              |...123......|
0000000c

My test text files are here. More info:

:help encoding
:help fileencoding
:help fileencodings
:help encoding-names
:help bomb
Categories: Linux Tags: , ,

Vim Tips in Ubuntu 10.04

May 22nd, 2011 No comments

The objective of this article is to make Vim your programmer’s editor.

First, a normal version of Vim should be installed to enable syntax highlighting. The default installation of Ubuntu 10.04 only contains a compact version “vim-tiny”:

# sudo apt-get install vim

Then copy a local vim configure file:

# cp /etc/vim/vimrc ~/.vimrc
# vi ~/.vimrc

1. Line Number

Add line into the .vimrc file:

set number

A similar command can be used to show/hide line number when editing on the fly:

:set number
:set nonumber

Related help:

:help set
:help 'number'

2. Tab-space Conversion

From the Vim help:

'tabstop' 'ts'          number  (default 8)
                        local to buffer
        Number of spaces that a  in the file counts for.  Also see
        |:retab| command, and 'softtabstop' option.

        Note: Setting 'tabstop' to any other value than 8 can make your file
        appear wrong in many places (e.g., when printing it).

        There are four main ways to use tabs in Vim:
        1. Always keep 'tabstop' at 8, set 'softtabstop' and 'shiftwidth' to 4
           (or 3 or whatever you prefer) and use 'noexpandtab'.  Then Vim
           will use a mix of tabs and spaces, but typing  and  will
           behave like a tab appears every 4 (or 3) characters.
        2. Set 'tabstop' and 'shiftwidth' to whatever you prefer and use
           'expandtab'.  This way you will always insert spaces.  The
           formatting will never be messed up when 'tabstop' is changed.
        3. Set 'tabstop' and 'shiftwidth' to whatever you prefer and use a
           |modeline| to set these values when editing the file again.  Only
           works when using Vim to edit the file.
        4. Always set 'tabstop' and 'shiftwidth' to the same value, and
           'noexpandtab'.  This should then work (for initial indents only)
           for any tabstop setting that people use.  It might be nice to have
           tabs after the first non-blank inserted as spaces if you do this
           though.  Otherwise aligned comments will be wrong when 'tabstop' is
           changed.

I will choose to use the 2nd approach, so add:

set expandtab
set tabstop=4
set shiftwidth=4

The auto-indent feature is also useful:

set autoindent

When setting expandtab, a real tab can be input by <Ctrl-v>_<Tab>

Related help:

:help autoindent
:help expandtab
:help tabstop
:help shiftwidth
:help retab

3. Option ‘modeline’:

If you start editing a new file, and the ‘modeline’ option is on, a number of lines at the beginning and end of the file are checked for modelines. This is simply enabled by adding:

set modeline

Your C/C++ comment may look like one of the following:

/* vi: set ai ts=4 sw=4: */
/* vim: set ai et ts=4 sw=4: */

And likely, the Python comments:

# vi: set ai ts=4 sw=4:
# vim: set ai et ts=4 sw=4:

Here, ai, et, ts and sw are just abbreviations. And expandtab is an option only in Vim, not Vi.

Read related help by typing:

:help modeline

4. Using Taglist:

There are lots of useful scripts in the Vim website that we can use. But Actually, Ubuntu repository also has some of them included:

# sudo apt-get install vim-scripts vim-addon-manager

After installation, these scripts are just downloaded, but not installed for your Vim. We list available script by typing:

# vim-addons

Output on Lucid 10.04:

# Name                     User Status  System Status 
align                       removed       removed       
alternate                   removed       removed       
bufexplorer                 removed       removed       
calendar                    removed       removed       
closetag                    removed       removed       
colors sampler pack         removed       removed       
detectindent                removed       removed       
doxygen-toolkit             removed       removed       
editexisting                removed       removed       
enhanced-commentify         removed       removed       
gnupg                       removed       removed       
info                        removed       removed       
justify                     removed       removed       
lbdbq                       removed       removed       
markdown-syntax             removed       removed       
matchit                     removed       removed       
minibufexplorer             removed       removed       
nerd-commenter              removed       removed       
omnicppcomplete             removed       removed       
po                          removed       removed       
project                     removed       removed       
python-indent               removed       removed       
secure-modelines            removed       removed       
snippetsEmu                 removed       removed       
sokoban                     removed       removed       
supertab                    removed       removed       
surround                    removed       removed       
taglist                     removed       removed       
tetris                      removed       removed       
utl                         removed       removed       
vcscommand                  removed       removed       
vimplate                    removed       removed       
whatdomain                  removed       removed       
winmanager                  removed       removed       
xmledit                     removed       removed

The Taglist plugin is described here, while OmniCppComplete plugin in next section. Both of them make use of ctags utility. Install it first:

# sudo apt-get install exuberant-ctags

Now install the Taglist plugin to your Vim:

# vim-addons install taglist

When editing a supported file type, Show the taglist window can be opened by one of the following:

:Tlist
:TlistOpen
:TlistToggle

Move your cursor between windows by <Ctrl-w>_w as usual. You may want to add a shortcut to toggle this feature. Add lines to your .vimrc file per official document:

nnoremap <silent> <F5> :TlistUpdate<CR>
nnoremap <silent> <F6> :TlistToggle<CR>

When your cursor hovers on a function, <Ctrl-]> takes you to its declaration, while <Ctrl-t> takes you back.

More help:

:help taglist-using
:help taglist-options

5. Using OmniCppComplete:

Vim include basic support for code completion. The simplest way is to use <Ctrl-p>. Vim will search your include headers and do insertion. See the screenshot:

vim_ctrlp

The include search path can be set by:

:set path <your_path>

More help info:

:help 'complete'
:help ins-completion

Next, Vim provides basic C language completion using ctags. No C++ is supported. Additional languages script can be found in Vim’s autoload directory, say /usr/share/vim/vim72/autoload. But you should generate necessary ctags index files first. For libc6 header files:

# cd ~/.vim 
# ctags --c-kinds=+p --fields=+aS --extra=+q -f libc /usr/include/* /usr/include/arpa/* /usr/include/bits/* /usr/include/sys/*

And add lines to .vimrc file:

autocmd FileType c set omnifunc=ccomplete#Complete
set tags +=~/.vim/libc
set completeopt=longest,menu
map <C-F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>

Omni completion can be issued by <Ctrl-x>_<Ctrl-o>.

Screenshot showing function prototype:

vim_omni_c1

Screenshot showing struct member completion:

vim_omni_c2

More help info:

:help ft-syntax-onmi

Note, the ccomplete does not work well in C++ completion. So we need to install OmniCppComplete plugin:

# vim-addons install omnicppcomplete

Generate ctags index for libstdc++ and qt4:

# cd ~/.vim
# ctags -R --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++ -f libcpp /usr/include/c++
# ctags -R --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++ -f libqt4 /usr/include/qt4

And add lines to .vimrc file:

set nocp
filetype plugin on
set tags +=~/.vim/libc
set tags +=~/.vim/libcpp
set tags +=~/.vim/libqt4
set completeopt=longest,menu
map <C-F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
" OmniCppComplete Options
let OmniCpp_ShowPrototypeInAbbr = 1  " function parameters
let OmniCpp_MayCompleteScope = 1     " autocomplete after ::
let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"]  " see :help omnicpp-faq

You may encounter problems when completing STL functions. Refer to :help omnicpp-faq and find the solution. Anyway, it works all good for me. Here’re screenshots showing STL and Qt code completion:

vim_omni_cpp1

vim_omni_cpp2

!!!NOTE!!! : The tags file for current file must be generated for OmniCppComplete to work. I’ve set Ctrl+F12 as the accelerate key. Otherwise, you’ll get “Pattern not found” error. More help:

:help omnicpp-options
:help omnicpp-features

Finally, the list of lines adding to my .vimrc file:

set number
"set autoindent
"set expandtab
"set tabstop=4
"set shiftwidth=4
set modeline

" Taglist Options
let Tlist_Exit_OnlyWindow = 1
nnoremap <silent> <F5> :TlistUpdate<CR>
nnoremap <silent> <F6> :TlistToggle<CR>

set nocp
filetype plugin on
set tags +=~/.vim/libc
set tags +=~/.vim/libcpp
set tags +=~/.vim/libqt4
set completeopt=longest,menu
map <C-F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>

" OmniCppComplete Options
let OmniCpp_ShowPrototypeInAbbr = 1  " function parameters
let OmniCpp_MayCompleteScope = 1     " autocomplete after ::
let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"]  " see :help omnicpp-faq
Categories: Linux Tags: , ,

Fix Window Button Order in Lucid

August 12th, 2010 No comments

I read this article when Lucid was just released. It works good, but there’s no window icon in the title bar(See my previous screen-shots).

Then I tried to modify the theme files. Take “Radiance” theme as example:

# sudo gedit /usr/share/themes/Radiance/index.theme

Change the last line into:

ButtonLayout=menu:minimize,maximize,close

This will set your window button order. And every time you switch to “Radiance” theme, no confirm dialog will prompt to tell that the button order will be changed. Then:

# sudo gedit /usr/share/themes/Radiance/metacity-1/metacity-theme-1.xml

Search “menu_focused_normal”, there are four lines regarding graphics drawing of menu: “menu_focused_normal”, “menu_focused_prelight”, “menu_unfocused_prelight”, “menu_unfocused_prelight”. Add first line into “menu_focused_*” and remove the image tag, and use second line to replace the image tag in “menu_unfocused_*” too.

<icon x="(width-mini_icon_width)/2" y="(height-mini_icon_height)/2" width="mini_icon_width" height="mini_icon_height" />
<icon x="(width-mini_icon_width)/2" y="(height-mini_icon_height)/2" width="mini_icon_width" height="mini_icon_height" alpha="0.5" />

OK, you’re done.

lucid_menu_icon

Update Feb 17, 2012: You can simply run:

# gconftool-2 -t string -s /apps/metacity/general/button_layout :minimize,maximize,close
Categories: Tools Tags: ,

Updating Kernel in Lucid (3)

May 19th, 2010 No comments

Today, I built the mainline kernel v2.6.33.4 on Lucid. Most instruments were taken from here: https://wiki.ubuntu.com/KernelTeam/GitKernelBuild:

1. Unpack:

# tar -jxf linux-2.6.33.4.tar.bz2

2. Config:

# cd linux-2.6.33.4
# cp /boot/config-`uname -r` .config
# yes '' | make oldconfig
# make menuconfig

The last line is optional. The wiki said:

Note that Ubuntu kernels build with debugging information on, which makes the resulting kernel modules (*.ko files) much larger than they would otherwise be (linux-image*.deb will be 200-300 MB instead of 20-30 MB). To turn this off, go into “Kernel hacking”; then, under “Kernel debugging”, turn off “Compile the kernel with debug info”.

It’s outdated maybe. When building kernel 2.6.24.x in Hardy, It WAS 200-300MB. But in Lucid, it is always 20-30MB. When you turn off the option, the build process took 80min instead of 100min, and 800MB instead of 5G storage. The option is configured by “CONFIG_DEBUG_KERNEL” in .config file.

3. Build:

# make-kpkg clean
# CONCURRENCY_LEVEL=`getconf _NPROCESSORS_ONLN` fakeroot make-kpkg --initrd --append-to-version=-custom --revision=2.6.33.4-1 kernel_image kernel_headers

After all, two files were generated. It contains 2772 modules. You may find the usage of “–append-to-version” and “–revision” options here:
*) linux-headers-2.6.33.4-custom_2.6.33.4-1_i386.deb
*) linux-image-2.6.33.4-custom_2.6.33.4-1_i386.deb

4. Install:

# sudo dpkg -i linux-headers-2.6.33.4-custom_2.6.33.4-1_i386.deb
# sudo dpkg -i linux-image-2.6.33.4-custom_2.6.33.4-1_i386.deb
# sudo update-initramfs -c -k 2.6.33.4-custom
# sudo update-grub

The last 2 lines are NOT mentioned in the wiki. They are used to generate the initrd image in Lucid. The build also do not generate abi and vmcoreinfo files in /boot.

5. Reference:

http://ubuntuforums.org/showthread.php?p=9120942

Categories: Linux Tags: , ,

Updating Kernel in Lucid (2)

May 18th, 2010 No comments

It seems a little easier when building Lucid kernel from ubuntu source.

1. Tools:

# sudo apt-get install fakeroot kernel-wedge build-essential makedumpfile kernel-package

2. Sources:

# sudo apt-get source linux-source-2.6.32

3. Customize:

cd into “linux-2.6.32” root.

I selected “core2” as my custom name.

# cp debian.master/control.d/vars.generic debian.master/control.d/vars.core2
# cp debian.master/abi/2.6.32-21.32/i386/generic debian.master/abi/2.6.32-21.32/i386/core2
# cp debian.master/abi/2.6.32-21.32/i386/generic.modules debian.master/abi/2.6.32-21.32/i386/core2.modules
# cp debian.master/config/i386/config.flavour.generic debian.master/config/i386/config.flavour.core2

Then patch some files:

*) debian.master/etc/getabis:
From: getall i386 generic generic-pae 386
To: getall i386 generic generic-pae 386 core2

*) debian.master/rules.d/i386.mk:
From: flavours = generic generic-pae 386
To: flavours = generic generic-pae 386 core2

Now, edit the config file. You will have to go through all the flavors for this script to work properly:

# debian/rules editconfigs

You should not make changes to any of the configurations until you see the core2 configuration:

* Run menuconfig on i386/config.flavour.core2... Press a key.

I disabled the “Kernel hacking ==> Kernel debugging” feature to accelerate build process. If you got the error like:

debian/scripts/misc/kernelconfig: line 121: /home/gonwan/linux-2.6.32/debian/scripts/misc/splitconfig.pl: Permission denied

Simply add the x permission to all scripts, it’s a known bug:

# chmod +x debian/scripts/*
# chmod +x debian/scripts/misc/*

4. Build:

# fakeroot debian/rules clean
CONCURRENCY_LEVEL=2 AUTOBUILD=1 NOEXTRAS=1 skipabi=true fakeroot debian/rules binary-core2

If you got the error like:

II: Checking modules for core2...
reading new modules...read 2674 modules.
reading old modules...
MISS: dccp_probe
read 2675 modules : new(0)  missing(1)
EE: Missing modules (start begging for mercy)

Add option “skipmodule=true” to the last command line. If you got:

get_debug_info: Can't create a handle for a new debug session.
makedumpfile Failed.

Add option “no_dumpfile=true” to the last command line. And there will be no vmcoreinfo-2.6.32-22-core2 file.

5. Done:

I found that Lucid has 2675 driver modules while Hardy has only 1921. It seems the kernel was greatly enhanced between the two releases.

My T60 has a Duo Core 1.83G CPU. It took about 90 minutes to finish. The kernel also consumed about 4G storage T.T. After all, two *.deb files were generated:
*) linux-headers-2.6.32-22-core2_2.6.32-22.33_i386.deb
*) linux-image-2.6.32-22-core2_2.6.32-22.33_i386.deb

6. Others:

Since the build process used so much storage, I was monitor my available disk space from time to time using “df” utility. I found the “free space” is about 500M larger than “available space”. What happened? Then I found the answer here: http://ubuntuforums.org/showthread.php?t=328786&page=3
. We can use “tune2fs” utility to set the size of reserved space:

Set the percentage of the filesystem which may only be allocated by privileged processes. Reserving some number of filesystem blocks for use by privileged processes is done to avoid filesystem fragmentation, and to allow system daemons, such as syslogd(8), to continue to function correctly after non-privileged processes are prevented from writing to the filesystem. Normally, the default percentage of reserved blocks is 5%.

7. Reference:
https://help.ubuntu.com/community/Kernel/Compile
http://blog.avirtualhome.com/2010/05/05/how-to-compile-a-ubuntu-lucid-kernel/

Categories: Linux Tags: , ,

Updating Kernel in Lucid

May 16th, 2010 No comments

Today, I updated my kernel using the official *.deb file to 2.6.33.3. This may be the easiest way: http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.33.3-lucid/. Since 2.6.33 supports DRM natively, my update was so smoothly.

lucid_kernel_1

In the later 2 blogs, I want to learn and write down how to compile kernel from ubuntu source and original kernel source.

Categories: Linux Tags: , ,

Installing Ubuntu 10.04 (2)

May 2nd, 2010 No comments

Some additional words:

Today, I finally reverted to use pidgin instead of emphathy.
There’s a plugin call “musictracker” which displays the “now playing” info.

# sudo apt-get install pidgin-musictracker

lucid_pidgin_now_playing

It seems that nickname cannot be changed when using MSN protocol.
I did set the friendly name, but Others cannot see.
And the personal message is called status in pidgin, so set it there.

For QQ protocol, using pidgin may cause activation problem.
An error shows to tell you to activate your account via jihuo.qq.com.
Open the account settings, uncheck the “Connect by TCP” may solve the issue.

I google a lot to find a plugin for rhythmbox to show lyrics automatically.
Though rhythmbox does have a lyrics plugin, it cannot find most Chinese lyrics.
Then I find LrcShow-X. It works well.

lucid_rhythmbox_lyrics

Categories: Linux Tags: ,

Installing Ubuntu 10.04

April 30th, 2010 No comments

Sorry for leaving this blog outdated for so long.
Since go out of GFW is not a so easy task.

There’s something to mention about installation.

0. installation

I installed lucid from harddisk.
There’s an lock issue when modifying the partition table.
We should umount the iso first:

# sudo umount -l /isodevice

1. grub

The original grub installation will not probe Windows OSes.
See here. So you must do it manually.

# sudo /usr/sbin/grub-mkconfig > /boot/grub/grub.cfg

2. qterm

The iBus IME issue seems to be fixed in this version.
But the “Home” and “End” key do not work correctly. This is a resolved bug.
So, change the key type to “linux” may workaround.

3. emphathy

Pidgin is replaced with emphathy.
Emphathy is not as powerful as pidgin.
But it integrates better with Gnome’s notification area.

4. totem/rhythmbox

These are video/audio players.
Please install essential codecs.
Otherwise, almost nothing could be played and seek function is not available.

# sudo apt-get install gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse
# sudo apt-get install gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse
# sudo apt-get install libavcodec-extra-52 libavutil-extra-49

Now, almost all media formats can be played.
Also, media plugins in firefox works.

5. fglrx

This is the graphics driver for ATI cards.
You may experience better performance and effects.
But after I installed it, I could not play Warcraft III using wine.
So I reverted to the original default graphics driver, and it works.
ubuntu1004_warcraft3
To play other 3D games, make sure your have turned off compiz firstly.

6. gimp

The gimp is not installed by defaut, so…

7. acpid

I’m running on a Thinkpad T60 machine.
The brightness function key works correctly, but the volume button does not.
Then I found that the hotkey mask should be enabled:
http://swiss.ubuntuforums.org/showthread.php?t=1328016
http://www.thinkwiki.org/wiki/thinkpad-acpi
After all, I add following line in the startup script, /etc/rc.local:

# cp /sys/devices/platform/thinkpad_acpi/hotkey_all_mask /sys/devices/platform/thinkpad_acpi/hotkey_mask

Then the volume button works.
The play/pause/stop/prev/next buttons also work in rhythmbox.

8. fstab

I want to mount all windows partitions when boot.
So /etc/fstab file should be edited automatically using pysdm:

# sudo apt-get install pysdm

For ntfs partitions, default option is OK.
For fat32 partitins, add the “utf8=1” string.
Or you may want to edit fstab manually.
You can copy from /etc/mtab file and do some little modification.
For me, the added modified lines are:

# windows partitions
/dev/sda1 /media/SYSTEM ntfs rw,nosuid,nodev,allow_other,default_permissions 0 0
/dev/sda5 /media/SOFTWARE ntfs rw,nosuid,nodev,allow_other,default_permissions 0 0
/dev/sda6 /media/DATA ntfs rw,nosuid,nodev,allow_other,default_permissions 0 0
/dev/sda7 /media/ENTERTAIN ntfs rw,nosuid,nodev,allow_other,default_permissions 0 0
/dev/sda8 /media/SETUP ntfs rw,nosuid,nodev,allow_other,default_permissions 0 0
/dev/sda9 /media/BACKUP vfat rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,flush 0 0

9. restricted packages

# sudo apt-get install ubuntu-restricted-extras

This will install some other useful packages.
The open-source java packages are included but not necessary.
Unmark them and install sun’s packages instead.

10. modify reserved space

# sudo tune2fs -m 3 /dev/sda2

11. ctrl+alt+backspace

See here:
Since Ubuntu 9.04, the Ctrl-Alt-Backspace key combination to force a restart of X is now disabled by default, to eliminate the problem of accidentally triggering the key combination. In addition, the Ctrl-Alt-Backspace option is now configured as an X keymap (XKB) option, replacing the X server “DontZap” option and allowing per-user configuration of this setting.
As a result, enabling or disabling the Ctrl+Alt+Backspace shortcut can now be done easily from the desktop.
– Enabling Ctrl-Alt-Backspace for Ubuntu 10.04
** Select “System” -> “Preferences” -> “Keyboard”.
** Select the “Layouts” tab and click on the “Layout Options” button.
** Select “Key sequence to kill the X server” and enable “Control + Alt + Backspace”.
– Enabling Ctrl-Alt-Backspace for Kubuntu 10.04
** Click on the Application launcher and select “System Settings”.
** Click on “Regional & Language”.
** Select “Keyboard Layout”.
** Click on “Enable keyboard layouts” (in the Layout tab).
** Select the “Advanced” tab. Then select “Key sequence to kill the X server” and enable “Control + Alt + Backspace”.

Categories: Linux Tags: ,