Use RTL8192SE wireless card in Gentoo with kernel 3

Although I had solve this problem earlier, I forgot the solution when I built a new system today. The configuration in kernel’s menuconfig is:

1
2
3
4
5
6
7
8
9
10
Symbol: RTL8192SE [=m]
Type  : tristate
Prompt: Realtek RTL8192SE/RTL8191SE PCIe Wireless Network Adapter
Defined at drivers/net/wireless/rtlwifi/Kconfig:13
Depends on: NETDEVICES [=y] && WLAN [=y] && MAC80211 [=m] && EXPERIMENTAL [=y]
Location:
-> Device Drivers
-> Network device support (NETDEVICES [=y])
-> Wireless LAN (WLAN [=y])
Selects: FW_LOADER [=y] && RTLWIFI [=m]

But after reboot, it still not loaded. Via dmesg, it caused by firmware missing. There’s a package named rtl8192se-firmware in portage tree but it is NOT the one we need. What we need to do is to:
# emerge linux-firmware.
After this step, it works. 🙂

Use PHP 5.3 and Lighttpd on CentOS 5

The default packages built-in my CentOS box are Apache HTTP Server 2.2 and PHP 5.1. If we want to replace them with Lighttpd and PHP 5.3, we need some modification to the system. This post is an annotation of the procedure.

1. The Lighttpd package is not provided by official repository. We need to add the support via EPEL x86_64 repository (I’m using 64-bit CentOS): # rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

2. After update, we can install lighttpd: # yum install lighttpd lighttpd-fastcgi

3. Update PHP from 5.1 to 5.3, first we need to list all installed 5.1 packages: # rpm -qa | grep php and then to remove them all.

4. Install the PHP53 and related packages we need: # yum install php php-cli php-mysql.
Note: The PHP53 packages also install httpd packages which we cannot removed individually.

5. Enable fastcgi support for Lighttpd in /etc/lighttpd/lighttpd.conf as this reference: lighttpd + FastCGI in CentOS.
Note: The cgi.fix_pathinfo=1 configure is installed by default in /etc/php.d/lighttpd.ini and we can skip to set it up.

6. Finally, the most important step for some application use sessions. We need to set up the permissions by: # chown -R root:lighttpd /var/lib/php because the web server we use is not httpd. If we do not set this, some application like phpMyAdmin we raise error while login.

7. Restart the Lighttpd and enjoy it. 🙂

Use GCIN and gnome-shell on Gentoo

Despite the common usage of input method is iBus, GCIN is still my favorite one for Chinese. But with the upgrading of GNOME 3 (gtk3) and in Gentoo, there are notes should be wrote down.

1. The GCIN package is not provided officially by Gentoo’s portage tree. But with hard works of gentoo communities in gentoo-zh (from gentoo-taiwan and gentoo-china), we can use GCIN via layman:

1
2
# layman -L
# layman -a gentoo-zh

2. Add gtk3 use flag for GCIN in /etc/portage/package.use:
# echo 'app-i18n/gcin gtk3' > /etc/portage/package.use
3. Some note to make GCIN works is listing in Linux/X window gcin 無法使用的檢查事項.For example:
a) My own configuration for environment variable declare is in ~/.xprofile:

1
2
3
export GTK_IM_MODULE=gcin
export QT_IM_MODULE=gcin
export XMODIFIERS=@im=gcin

b) To install GCIN’s module in gtk2/3 on x86 (i686) Gentoo OS:

1
2
# gtk-query-immodules-2.0 > /etc/gtk-2.0/i686-pc-linux-gnu/gtk.immodules
# gtk-query-immodules-3.0 --update-cache

[20120209 edit]
The latest version since 2.7.1 disable the En input method (IM) for switching by default. And for my newly installed gentoo box, I cannot switch IM if the default method is set as En.

It is not convenient when I set other IMs as default, because I need to change to En by pressing an additional shift key or ctrl-space hotkey.

Help from GCIN forum by coolcd, the solution is to close the default attribute after IM launch. The setting is to un-check the box in gcin-tools for:

Default input method and toggle key > Toggle on input mode by default (non-XIM only)

After restart GCIN, the IM mode by default is En that like most IME done.

Enjoy it. 🙂

Tab switching order of Firefox

As introduced in Firefox 3.6, the function of tab switching order via CTRL-TAB shortcut improved. I did not try the functions because I’ve installed the plug-in: Ctrl-Tab and it works through lots of Firefox version upgrading. But in recent days, with the Firefox 10 release and I do some profile clean up, the plug-in malfunctioned. With trying lots of plug-ins, I cannot find a LIGHT-WEIGHT and SIMPLE one just like the Ctrl-Tab. And I have no idea why it didn’t work from now on. So I turn to try the built-in functions in Firefox (ported from the Ctrl-Tab plug-in?).

The reference is here: Ctrl Tab Preview Feature in Firefox 3.6 Explained with screen-shots to explain how it works, just like the pluig-in. The procedure to enable most-recently-used tab switching order:
1. Type about:config in address bar and press ENTER
2. Click I’ll be careful, I promise! in the notification
3. Search for browser.ctrlTab.previews and double click the entry to set it as true
4. Finish and enjoy it. 🙂

New site, new domain and mobile version

This is first post with brand new domain – nullspace.me hosting on GoDaddy.com and VPS on Hostitek. It is a different experience to build a system via VPS and OpenVZ. For days of work, some services are back.

On the other hand, the mobile view is now supported via Device Theme Switcher plugin with Carrington mobile theme. I’ve test the MobilePress plugin recently but the comment related functions are broken. Now with mobile devices, the theme will transient automatically fit in screen size with a simple layout.

In the beginning of 2012, it’s a good point to start with. 🙂

Some note of Android and Eclipse

1. Avoid the EditText got focus automatically on create or the soft keyboard will show.
Add

1
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);

in onCreate. And the soft keyboard will not show automatically on view create but show when focus it we touch.
Ref: Android-防止EditText自动获得焦点

2. The Graphic Layout disappear when open xml of a layout.
Sometimes Eclipse use the default XML editor instead of the Graphic Layout design when open a layout file of Android. The solution is:
Right click on the file > Open With > Android Layout Editor.
Ref: Graphical Layout tab does not appear for some layout files into Eclipse

3. Fix Android project properties in Eclipse.
Right Click on the project > Android Tools > Fix Project Properties. And the default Android settings may add (or fix).
Ref: Android Eclipse Classpath – want to add classpath container path but eclipse won’t let me

Replace Unity with gnome-shell on Ubuntu 11.10

This article is about how to remove Unity (and its dependency packages) and launch the Gnome Shell by default.

Note: Some of the packages we want to remove may not installed in your system. Just remove the package name in the remove list.

1. Remove Unity and its dependency packages:
$ sudo apt-get remove unity unity-2d-places unity-2d unity-2d-panel unity-2d-spread unity-asset-pool unity-services unity-lens-files unity-lens-music unity-lens-applications gir1.2-unity-4.0 unity-common indicator-sound indicator-power indicator-appmenu libindicator6 indicator-application evolution-indicator indicator-datetime indicator-messages
This will also remove the tomboy and transmission. If you need them, just install back:
$ sudo apt-get install tomboy transmission

2. Install GNOME-shell and some BEST extra packages:
$ sudo apt-get install gnome-shell gnome-themes-standard gnome-sushi gnome-contacts gnome-tweak-tool

3. Remove scrollbar and appmenu of unity:
$ sudo apt-get remove appmenu-gtk indicator-applet-appmenu indicator-appmenu overlay-scrollbar

4. Use the native notification daemon (Or some notify may use ubuntu’s daemon and make us confuse):
$ sudo apt-get install notification-daemon
$ sudo apt-get remove notify-osd
This also remove gnome-power-manager but we need it.
$ sudo apt-get install gnome-power-manager

5. Clean up the system:

1
2
3
$ sudo apt-get autoremove
$ sudo apt-get autoclean
$ sudo dpkg --list |grep "^rc" | awk '{print $2}' | xargs sudo dpkg --purge

The first line is to clean up dependency packages while the second one is for the unused packages downloaded in system. The third one is to find the records which had been installed but remove and make a purge step.

6. Logout. And now you can log into GNOME Shell via click the ‘gear’ icon in login window and select GNOME Shell. Enjoy it. 🙂

The references are:
Ubuntu 11.10 GNOME Shell Guide
How can you remove Unity?
Ubuntu 11.10 Oneiric: Remove Unity and use Gnome Classic by Default