June 13th, 2009 . Posted in _ | No Comments »
Tags: net9, wordpress
wordpress will malfunction on net9.org because query on “SELECT FOUND_ROWS()” do not return the result as expected (always 0) (apparently it is because some part of php or mysql is not configured correctly or not upgraded to the latest version.). This makes wordpress working on net9 not be able to show “next posts” link. To walk around this problem, I make a patch on the wp-includes/query.php to avoid using “FOUND_ROWS()“; I query it once more. It works fine.
The patch is here:
2274,2275c2274,2276
< $found_posts_query = apply_filters( 'found_posts_query', 'SELECT FOUND_ROWS()' );
< $this->found_posts = $wpdb->get_var( $found_posts_query );
---
> $temp_request = "SELECT $found_rows $distinct $fields FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby";
> $found_posts_query = apply_filters('found_posts_query', $temp_request);
> $this->found_posts = count($wpdb->get_results( $found_posts_query ));
May 23rd, 2009 . Posted in _ | No Comments »
Tags: linux, smartdimmer, ubuntu, vaio
I said that when I upgraded to Ubuntu 9.04, the smartdimmer program changes. Originally, in 8.10, the value range is 1-15, while in 9.04, it is 15-100. The main problem is that when I set 1 in 8.10, the screen looks really dark, and when I set 15 in 9.04, the screen is not so dark as it is in 8.10, and will consume more battery of course. So I would like my smartdimmer in 8.10 back, and I find this, which works quite well. My laptop is Sony VAIO VGN-FE15C.
Reference: http://www.nvnews.net/vbulletin/showthread.php?t=53225
April 28th, 2009 . Posted in _ | 2 Comments »
Tags: linux, term
I used to publish a post here. I used gnome-terminal for visiting bbs, but the home/end keys are not functioning correctly.
I have found a temporary solution now.
- Modify file
/usr/share/vte/termcap/xterm file, change line :kh=\EOH:@7=\EOF:\ to :kh=\E[1~:@7=\E[4~:\
I am sure it is just a sort of walkaround; it has some risk to change the default behavior of xterm emulation. I tried to add my own termcap, but it did not work exactly the same as xterm. I think perhaps there are some other config files outside the file /usr/share/vte/termcap/xterm for xterm emulation. Plus, gnome-terminal do not call vte_terminal_set_emulation at all, it is just using the default one. (Yeah, I have seen the source code.)
Anyway it is fine till now. Everything is cool.
By the way, navigating through codes is fun.
April 26th, 2009 . Posted in _ | No Comments »
Tags: game, linux, war3, wine
Just use wine, nothing so special. There are many reference pages on the web, but mainly what I have done is:
- apt-get the latest wine.
- Get a Warcraft 3 copy. (You should know that Warcraft 3 is green.)
- DISABLE windows visual affects.
wine your-installation-path/Frozen\ Throne.exe
Several additional concerns:
- It is not neccessary to use the
-opengl option. I can support DirectX quite smoothly on my computer in Ubuntu.
- Movies will not be displayed correctly. I simply renamed the movie folder and it will skip all the movies.
- Alt key have some super function (windows moving, minimizing, etc.) in Ubuntu by default. Use System->Preference->Windows to change it. I changed it to Super(Win) Key.
- You can manually set nvidia driver to center your screen in low resolution instead of stretching it. I can find it in System->Administration->NVIDIA X Server Settings->GPU 0 – (Nvidia Default Flat Panel)->GPU Scaling Method. It is just so great that in linux you get control to everything so simple. The path is always straight and direct, if you can find the entrance of course…
- By default, you can not switch to other applications by pressing Alt-Tab. (Technically, maybe, you can, but you can not see it happening.) Now we use the Super key and right click on anywhere and a pop-up menu will show up. Deselect the “always on top” option, and you will get rid of this trap.
- You can even run it in a wine virtual desktop, but I do not enjoy that very much.
Additional Tip: Here is a script for automatically disable visual effects and turn it on again after playing.
metacity --replace &
wineconsole ~/warcraft/Frozen\ Throne.exe
compiz --replace &
April 26th, 2009 . Posted in _ | No Comments »
Tags: linux, ubuntu
- From 8.10. Manually modified sources.list, just replace all intre* to jaunty.
sudo apt-get update
sudo apt-get dist-upgrade
- All done quite smoothly, except:
smartdimmer is different. I used to set smartdimmer -s 7 as a startup command line by default. But now the valid valuing range is 15-100, 7 is invalid. (Want a better smartdimmer? See here.)
- I reinstalled my nvidia driver for once.
- Auto-login is disabled. I re-enabled it.
By the way, the splash screen of ubuntu looks much better than the former version.
April 26th, 2009 . Posted in _ | No Comments »
Tags: icbc, linux, wine
Mainly referencing this page: http://www.callmeageek.com/linux/ies4linux-icbc.html
Several points:
- No need to set IE6 security level to low.
- ies4linux gui installer pygtk version will have some problem when downloading. It will have no response when the text rolls out of the textarea and triggers a scrollbar to emerge. It is basically triggered by a line of auto roll down code. You can modify the python script yourself by comment down that single line of auto scroll bar rolling and it will work fine. Or, run
./ies4linux -no-gui or ./ies4linux -nogui. (I am not sure about this no-gui parameter, see your README file.)
- The swf flash cab can not be extracted correctly. Don’t know why. Fortunately, ICBC uses no flash. So I just ignored it.
- The icbc plugin is moved to new location here: http://www.icbc.com.cn/icbc/html/download/dkq/icbc_netbank_client_controls.exe
April 16th, 2009 . Posted in _ | 1 Comment »
Tags: linux, term
The command line is something like this.
LANG=zh_CN.GB18030 gnome-terminal --disable-factory --window-with-profile=bbs \
--hide-menubar --maximize --title=newsmth -x telnet newsmth.net
To enable this you need to install zh_CN.GB18030 locale, it is not installed correctly in ubuntu 8.10 by default even when you installed all Chinese support. Add a line like:
zh_CN.GB18030 GB18030
in file /var/lib/locales/supported.d/zh, and run:
sudo dpkg-reconfigure locales
You should also need add a profile named “bbs” to gnome-terminal. I use an English monospace font and it will switch to your default Chinese font when displaying Chinese characters. (English characters in Chinese fonts are usually ugly.) Please reference my .fonts.conf to see how to set a default Chinese font (.fonts.conf is located in your home directory, if there does not exist one, create one yourself.) You may also want to use a larger font size, and disable scrollbars. The coolest thing about this is that you can set a background image for it…
The only bad thing is that <home> key and <end> do not behave as expected in gnome-terminal. I have not found a good solution for that yet. The solution for this problem is here.
April 14th, 2009 . Posted in _ | No Comments »
Tags: linux, monitor, nvidia, screen, vaio
Add something like this into /etc/X11/xorg.conf:
Section "Device"
Identifier "Configured Video Device"
Option "TwinView" "True"
Option "TwinViewOrientation" "LeftOf"
Driver "nvidia"
Option "NoLogo" "True"
EndSection
This works for my VGN-FE15C VAIO laptop, which is using an nvidia card.
April 4th, 2009 . Posted in _ | No Comments »
Tags: linux, skype, ubuntu
My Skype WebCam suffers from a green screen problem in Ubuntu 8.10:
cheese works fine.
skype WebCam Test shows a flashy green screen
skype WebCam shows a flashy green screen when using
To fix this problem
- Install package
libv4l-0
- Instead of use
skype to start the program, use
LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so skype
Reference: http://ubuntuforums.org/showthread.php?t=945803