Sunday, August 30, 2009

speed up video card of T41

Mine is radeon M7500.
And in my xorg.conf, I have:
-------------------------------------------
Section "Device"
Identifier "Configured Video Device"
Boardname "ATI Radeon"
Busid "PCI:1:0:0"
Driver "radeon"
Screen 0
Vendorname "ATI"
Option "MergedFB" "off"
Option "AccelMethod" "EXA"
Option "EXANoComposite" "false"
Option "AGPFastWrite" "On"
Option "FBTexPercent" "50"
Option "MigrationHeuristic" "greedy" # the most effective option
Option "DRI" "true"
Option "GARTSize" "256"
Option "AGPMode" "4"
Option "Colortiling" "On"
EndSection
-------------------------------------------

Saturday, August 15, 2009

ubuntu 256 bit color urxvt (from internet)

Steps used to recompile urxvt with the 256 bit color patch.
$ apt-get source rxvt-unicode
$ sudo apt-get build-dep rxvt-unicode
$ cd rxvt-unicode*
$ patch -p1 < doc/urxvt-8.2-256color.patch
$ sudo dpkg-buildpackage -us -uc
$ sudo dpkg -i rxvt-unicode_9.05-4_i386.deb
$ echo "rxvt-unicode hold" | sudo dpkg --set-selections
in your .Xdefaults file, type: rxvt.termName=xterm, so that most ssh to other machine will support 256 color.

The last step makes sure apt doesn't reinstall the old package the next time you update.

Friday, August 14, 2009

opera keyboard issues

I found that sometime my keyboard didn't respond in opera. I can get this fixed by start a terminal and close it, then my keyboard come back.
But today I found a solution.
It is caused by conflict between it and scim.
So:
sudo apt-get install scim-qtimm
sudo vim /usr/bin/opera

add "export export QT_IM_MODULE=SCIM" at second line.

restart opera and all is fine.

Thursday, August 13, 2009

Opera with Chinese font config

First, you need to have YaHei font, which I think can give you best profile when Chinese+English is showing. I even use it as the font in terminal. I think it is better than WenQuanYi.
Methods of installing YaHei is in another post of mine.

1. Tools->Preferences->advanced->fonts; all change to YaHei Consolas Hybrid.
2. type opera:config in address bar, search antialiasing and dismark it.
3. open a terminal, type:
echo 'html,body,*{font-family:"YaHei Consolas Hybrid" !important;}' > ~/.opera/styles/user/user.css
4. restart opera, view->style->user.css.
tools->preferences->general->language->details->encoding to assume...->gb18030
5. restart opera.
You will find the Chinese font is perfect.

Sunday, June 21, 2009

Chinese configure in wine

1. add wine-cn source
wget -O- 'http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0x84DD336194625C2F' | sudo apt-key add -

echo -e "deb http://ppa.launchpad.net/wine-cn/ppa/ubuntu jaunty main\ndeb-src http://ppa.launchpad.net/wine-cn/ppa/ubuntu jaunty main" | sudo tee /etc/apt/sources.list.d/wine-cn.list


2.
sudo apt-get update
sudo apt-get install wine


3.
If you "Locale" is not zh_CN, MODIFY the command line in ~/.local/share/applications/wine-Programs-XXX.desktop TO env LANG=zh_CN.UTF-8 wine "C:\Program Files\XXX.exe" to provide Chinese support.

Saturday, June 20, 2009

Chinese font configuration in ubuntu 9.04

I prefer YaHei font, due to its good mix of Chinese and English
1. Download from http://rs54l33.rapidshare.com/files/34563809/5101584/YaHei.Consolas.1.11b.zip
2. Copy the ttf file to ~/.fonts
3. fc-cache -fv (to refresh the font list)
4. Right click on desktop -> Change Desktop Background -> Fonts. Change all to YaHei ....

Done.

Thursday, June 18, 2009

watch video in ubuntu 9.04

1. Remove totem media player.

Remove totem media player from synaptic.
sudo rm /usr/share/applications/totem.desktop

2. Install mplayer, codec and plugin for firefox

sudo apt-get install mplayer mplayer-fonts mozilla-mplayer
download all-20071007.tar.bz2 from http://www2.mplayerhq.hu/MPlayer/releases/codecs/
tar jxvf all-20071007.tar.bz2 /usr/lib/codecs/

3. Fix realplayer codec: drvc.so

sudo apt-get install libstdc++5

4. Add restricted video format

sudo apt-get install ubuntu-restricted-extras

5. Also better to do the following:

sudo wget http://www.medibuntu.org/sources.list.d/jaunty.list --output-document=/etc/apt/sources.list.d/medibuntu.list
sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update
sudo apt-get install w32codecs


Enjoy now!

Saturday, May 23, 2009

config ubuntu

My laptop has little resources(Thinkpad T41) so I need to shut down all the desktop effect as follows:
1. Don't use compiz.
2. gconf-editor:
1)/apps/panel/toplevels, for all the panel, clear "enable_animations"
2)/apps/metacity/general, mark "reduced_resources"
3)/apps/panel/global, clear "enable_animations"
4)/desktop/genome/interface, mark "accessibility"
3. sudo vim ~/gtkrc-2.0, add: gtk-menu-popup-delay = 0
4. (important)
sudo vim /etc/hosts:
change: 127.0.0.1 localhost
127.0.1.1 your-laptop
to: 127.0.0.1 localhost your-laptop
127.0.1.1 your-laptop
5. sudo vim /etc/default/console-setup
ACTIVE_CONSOLES="/dev/tty[1-6]" -> ACTIVE_CONSOLES="/dev/tty[1-2]"
cd /etc/event.d/
for each tty3-tty6, comment lines start with "start on runlevel".

Sunday, May 3, 2009

Saturday, May 2, 2009

eps file issues in latex

EPS file is the most commonly used figure type in latex.

Two issues involved:
1. Decide bounding box and output a neat graph.
Use the shell program here to get it done: http://www.gnuplot.info/scripts/files/fixbb

2.Solve the eps-pdflatex conflict.
If you want to directly generate pdf file from tex file. Add following lines:
\usepackage{epstopdf}
before your:
\begin{document}

Also, simply use command: pdflatex -shell-escape yourfile.tex to compile your tex file. Final pdf will be built.
The reason is it will automatically generate yourgraph.pdf and use it in your tex file.

Friday, May 1, 2009

Vim+latexsuite in ubuntu 9.04

After struggling a whole day, I finally got vim+latexsuite work in ubuntu 9.04.

Here is the points(at least work for me):
1. DON'T download the latex-suite file from http://vim-latex.sourceforge.net/ and unzip into ~/.vim/. It just simply doesn't work because vim-addons cannot find it, even if ~/.vim/ is in the runtimepath of vim. I don't know why.
2. USE sudo apt-get install vim-latex to let ubuntu install it for you. Also do sudo apt-get install vim-addons-manager if you haven't.
3. sudo vim-addons -w install latex-suite
4. vim-addons
5. You should see
#name User Status System Status
latex-suite installed(or removed, doesn't matter) installed
6. put your own tex.vim file in /usr/share/vim/addons/ftplugin/
7. In .vimrc, add:

set runtimepath+=/usr/share/vim/addons
filetype plugin on
set grepprg=grep\ -nH\ $*
filetype indent on
let g:tex_flavor="latex"


8. sudo vim yourfile.tex
9. you will see an error involved with remoteOpen.vim. But latex-suite works.

Right, it's wierd that I need to use sudo to launch vim. If I only type vim yourfile.tex, the remoteOpen.vim error will also occur and latex-suite will not be called.

Update:


1. I eliminate those error by commenting out the specific lines in remoteOpen.vim
2. The reason that I can only use sudo to launch latexsuite is because the privilege of .vimrc is superuser. I "chown" it to my own user and get it done.

Saturday, March 7, 2009

Universe will expand or collapse?

I have a question about the modern physics.
According to some theory, the universe will first expand then collapse if its mass is less than some constant C. We also know that the value of an object's mass is different if we observe it in different inertial reference systems. Suppose there is a small universe and two observers in different inertial reference systems. One finds that its mass is larger than the constant C and he will observe an expanding then collapse. The other finds that its mass is smaller than C so he observes an forever expanding. Is it possible?

Thursday, February 26, 2009

Install video card for CQ50 laptop

It's nvidia 8200M. And I finally got nvidia driver 180.22 working on it. It's not perfect but at least the definition is 1280*960. I actually tested 178.xx before, and found it also work.
The most important is to clean all the former nvidia files out of your system before you start to install new driver. It can be done by searching "nvidia" in the Synaptic Package Manager and get rid of them. The new nvidia package can not remove old version or related stuffs.
Details are in here:
http://www.nvnews.net/vbulletin/showthread.php?t=72490

Or you can search "install nvidia linux" online.

Install wireless for pressario CQ50 in Ubuntu

After struggling for a whole day, I finally found the right package for my Atheros wireless card.
It's very simple, watch this post:
http://ubuntuforums.org/showpost.php?p=5535562&postcount=3
Or you can search "compat wireless ath9k" online.
You can also type

echo 'ath9k' | sudo tee -a /etc/modules

to let your wireless auto-start when boot.

I tried to compile several drivers by myself but all failed to work, until I found the link above. So don't waste your time to compile yourself, just use the script in the link.
Good luck.

Sunday, February 22, 2009

How about making an info-all-in-one website

The layout can be simple as google search, which only includes a search box. It can also contain multiple tabs right above the search box, which represent different source website. The tabs structures as a tree. Following is an example:

Search
Text Search | deals search | flight search
google | yahoo | baidu nextag | slickdeals priceline | ...

Translation
Chi->Eng
dict.cn | youdao |...

Jobs
monster | dice |...

Sorry that it doesn't support complicate html syntax here, so I only show it in text.
Actually a child-tab will only appear when its father-tab is selected. So the layout can be very neat.

Thursday, February 19, 2009

How to expand domestic demand in China?

As we all know, expanding domestic demand is the first priority of Chinese government to stimulate economy. However, the pressure from housing, medical care as well as education are the largest obstacles which impede Chinese people from unfilling their pockets. The fear of losing money always brings the desire of making fast money. So what is the largest demand in China now? Not clothes, not food, not house, but money.
Money is commodity, for sure. If people don't want to buy clothes, food, etc., give them the chance to buy money. Make the illusion that he can buy more money with less cash. The clever Chinese government is doing that currently. Based on my estimation, they will boost another big bull market and let its value doubled. In that way, an illusion that there is a place where less cash can exchange for more cash will be created. It has been created again and again in the past and never failed. Then, government sell in the peak and raise thousands of billions.
The next step is to use that money to bail out companies, which were struggling on their decreasing export to abroad, but now can sell their productions to the government. Then, the government can sell those productions to its people for free or in large discount. In that way, the government acts as an intermediary agent, who successfully help the manufactures to sell out their goods.
Great, domestic demand is expanded at last!