Saturday, August 30, 2008
If you install ubuntu first and want to get vista, you should be careful . Because vista dont add ubuntu to its bootloader.
Before install vista, you should save your boot information. It's in /boot/grub/menu.lst.
To save that file just let you remember the partition of the hard drive, for example, I install ubuntu in the 6th partition on the first hard disk (ONLY ONE) and vista in the 2th partition on the same disk. It should like:
title Ubuntu 8.04.1, kernel 2.6.24-19-generic
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=3ee4ca11-0ceb-4071-8854-b43f86bf25f8 ro quiet splash
title Ubuntu 8.04.1, kernel 2.6.24-19-generic (recovery mode)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=3ee4ca11-0ceb-4071-8854-b43f86bf25f8 ro single
title Ubuntu 8.04.1, memtest86+
### END DEBIAN AUTOMAGIC KERNELS LIST
# This is a divider, added to separate the menu items below from the Debian
title Other operating systems:
# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda3
Because vista rewrite the MBR which is a headfile in the disk. MBR will tell computer whereis the booter. Vista will erase the MBR, so it can not find ubuntu. So we need write boot information in MBR by Ubuntu's boot loader :"grub".
So we do:
1,put in your ubuntu cd
2,restart from cd
3,choose "try ubuntu without any change to your computer"
4,open a terminal
5, in the comand line ,type:
grub>root (hd0,6) //here you need know which partition is your ubuntu stand.
grub>setup (hd0) //here setup MBR file.
6,after reboot computer, you will go into the ubuntu system, now do:
then add follow code to the last line of menu.lst
title Windows Vista/Longhorn (loader)
Friday, August 29, 2008
If it find the matched name in known_hosts, but the host key is not matching with that key the host has gived. It will failed to connect. If you are sure the hostkey has been changed and want to use new hostkey, then you can delete the old hostkey in "known_hosts",and do "$ssh username@ip" again, this time you have choice to add new hostkey to file.
In the "ssh_host_rsa_key.pub" and "known_hosts", the key is writen in unreadable format. If you want to see it or regenerate new key, you should use command "ssh-keygen". For example, you can use "ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub" to see the readable format of the key. For detail information ,do "man ssh-keygen".
There are three different key file, rsa,rsa1 and dsa. You can choose different protocal to connect host. But normally, it should use rsa.
Thursday, August 28, 2008
Monday, August 18, 2008
then if it ask you yes or no,just say yes, type your password.
If you want get x-window, use:
$ ssh -x [username]@[ip]
If you want to copy file from another computer:
$scp [username]@[ip]: /from/file1 /to/file2
If it's a directory,then use:
$scp -r [username]@[ip]: /from/directory1 /to/direcotry2
Friday, August 15, 2008
It's awfull to play on debian etch..
I spent almost two weeks to solve debian system problems and upgrade the kernel from 2.6.8 to 2.6.18.
It's first time for me to play linux as a root, also first time for me to touch the heart of computer-kernel...
The first problem is no higher resolution for my new LCD.
The second problem is no mouse been found.
The third problem is ungrade failed.
I write the problem and solution here for me and other guys who have same problem.
1,for higher resolution.
All x-server information was setted in /etc/X11/xorg.conf. Before you want to change it ,you should save it in a copy file,like xorg.conf_old.
First you should know your graphic card information, of couse ,sometimes you don't know ,becouse you are not the guy who build it. If you want to know it ,the best way should be to look /var/log/Xorg.log.0. There you can see many information about the xserver.
From log file ,I see my graphic card is nVidia, which need nv driver. And I see the best resolution 1280*1024..You also can see why some mode of resolution can not be used by xserver..(such as frequence much more than maxmimum 144MHz). For Lcd, YOu don 't need big frequence, 60Hz is ok. If there is no right mode , you can add modeline in xorg.conf by yourself.
DisplaySize 380 300
Modeline "1280x1024" 108.88 1280 1360 1496 1712 1024 1025 1028 10
Modeline "1280x1024" 106.97 1280 1360 1496 1712 1024 1025 1028 10
Modeline "1280x1024" 105.15 1280 1360 1496 1712 1024 1025 1028 10
In fact , my problem is that I choose wrong driver "vesa" for gcard.
I do :(# as root)
#dpkg-reconfigure -phigh xserver-xorg
It show me to choose driver,so I choose "nv". Now restart x server by type "startx" in shell or CTL+ALT+BACKSPACE.
This time I can not use mouse anymore.
I use old input setting for the mouse and restartx. This time it works. I can see the higher resolution in Desktop->preference->screen resolution. Then I choose higher resolution. I get it.
2, no sound .
Old kernel version is 2.6.8, but my debian is etch which should be has 2.6.18 or newer version .
In linux ,alsa is a tool to manage the sound setting.
For 2.6.8, alsa is a part of kernel. But in etch ,it need more modules .
I install alsa-base and alsa-util by "apt-get install alsa-base alsa-util".
Now it works.
3,update you kernel in etch.
Fisrt you should update package database and install all needed package:
#apt-get install kernel-package libncurses5-dev fakeroot wget bzip2 build-essential
(1)download the kernel souce, two way :
one way is from debian kernel, you can do:
#apt-get install linux-souce-2.6.18
If you want to know the new version of linux-souce, you can do "#apt-get search linux-souce".
Another way is to download from kernel.org:
I use second method.
(2), After download , unpack the souce code:
#tar -xjf linux-2.6.18.tar.bz2
#ln -s /usr/src/linux.2.6.18 linux
#make clean && make mrproper
Then copy old configure file to here if you want to use old configure file, otherwise skip this. 'uname -r 'is your old kernel version,for me it's 2.6.8-386
#cp /boot/.config-'uname -r' ./.config
This command will show a menu, you need choose "Load an alternate configuration file" and it will show you ./config, choose it and type "yes","exit".If it ask you if save the configure file ,you choose "yes".
#fakeroot make-kpkg --append-to-version=-custom kernel_image kernel_headers
wait about one or two hours.
After it finish, if there is no errors:
Now install these deb file, as it's deb file ,so somebody call it's in debian way.
#dpkg -i linux-image-2.6.18-custom_2.6.18-custom-10.00.Custom_i386.deb
#dpkg -i linux-headers-2.6.18-custom_2.6.18-custom-10.00.Custom_i386.deb
After that, do:
#apt-get install module-init-tools initrd-tools procps
#mkinitrd -o /boot/initrd.img-2.6.18-custom 2.6.18-custom
Add "initrd /boot/initrd.img-2.6.18-custom" in the file like this:
## ## End Default Options ##
title Debian GNU/Linux, kernel 2.6.18-custom
kernel /boot/vmlinuz-2.6.18-custom root=/dev/sda1 ro
title Debian GNU/Linux, kernel 2.6.18-custom (recovery mode)
kernel /boot/vmlinuz-2.6.18-custom root=/dev/sda1 ro single
title Debian GNU/Linux, kernel 2.6.8-2-386
kernel /boot/vmlinuz-2.6.8-2-386 root=/dev/sda1 ro
title Debian GNU/Linux, kernel 2.6.8-2-386 (recovery mode)
kernel /boot/vmlinuz-2.6.8-2-386 root=/dev/sda1 ro single
Now congratulation ,we finish upgrade.
#shutdown -r now
You will see new kernel and old kernel when you start the computer. You can choose anyone whatever.
When I update the kernel to 2.6.24, it tell me that it can not find sda1.
I go to /lib/modules/2.6.24-custom, there I didn't see ata_piix sata_via libata sd_mod scsi_mod etc modules which were needed by SATA.
I get answers from google, that because the configure file is different between 2.6.8 and 2.6.24.
For 2.6.8, in configure file it like:
But in 2.6.24,it likes:
# CONFIG_ATA_NONSTANDARD is not set
So if you use old configure file for 2.6.8 to configure 2.6.24, you should notice this difference.
Before you copy ,first you should change the name from CONFIG_SCSI_SATA to CONFIG_SATA.("m" is modules loaded by kernel, "y" is built in the kernel)
Monday, August 11, 2008
When I log in the xWindow , I change the environment "PATH" IN .bash_profile, but it doesn't work. If I change the "PATH" in .bashrc, it works..It's suprising .
After google,,I find that the "log in" is login the termainal ,not the xwindow. So the .bash_profile does not work when you login the xwindow.
In fact .bashrc can work whatever you login termainal or xwindow.
The reason is you will find follow command in .bash_profile:
# include .bashrc if it exists
if [ -f ~/.bashrc ]; then
So if you want create or add the environment variable ,it should be better to change .bashrc.
When I do :
$ whereis firefox
firefox: /usr/bin/firefox /usr/lib/firefox /usr/X11R6/bin/firefox /usr/bin/X11/firefox /usr/share/man/man1/firefox.1.gz
I go to /usr/bin/
$ ls -al firefox
firefox -> ../lib/iceweasel/iceweasel
Now I get it..The problem is Debian build a soft link from firefox to iceweasel.
So we need build a new soft link to the real firefox .
$ mv firefox firefox.old
# ln -s " /home/my/firefox/directory/firefox"
so let 's see what happen in /usr/lib
$ls -al firefox
firefox -> /home/my/firefox/directory/firefox
When I run firefox ,it turn out "need gtk2,10"
Debian just has gtk2.8.
I goolgle it and download gtk2.10 ..It' s deb file , so I just need
$dpkg-deb -x libgtk2.0-0_2.10.13-2~bpo.1_i386.deb ~/lib/gtk2-10
As deb is a specil file, you just need extract it by dpkg and it will install by itself.
If you download the tar.gz file ,you need configure and make install manually.
Now we need tell firefox where is the gtk 2.10.
go to ~/firefox/
Now restart the firefox, you can use it now..
I also want to get icon on the debian panel.
So I go to
Use this tool to add new icon. Highlight the "Internets"column
But after I do this, I still can't see new icon on my Application/Internet
I don't know why.
But I find that I can change the old icon,such as iceweales and opera..
So I change iceweales to firefox and save it.
Now the iceweales icon become firefox icon..
cannot open shared object file: No such file or directoryFor example , I can not find the opencv library "libcv.so.1", so I type:
~$ whereis libcv.so.1
libcv.so: /usr/lib/libcv.so.0 /usr/local/lib/libcv.so.0 /usr/local/lib/libcv.so.1 /usr/local/lib/libcv.so
~$ locate libcv.so.1
you can open "/etc/ld.so.conf"
if you can not find /usr/local/lib in that file, you should add this file as root.
else if you see it in , you can do:
you run ldconfig to update share library link.
Maybe you worry about if the opencv library work because you see old version in /usr/lib, the new version in /usr/local/lib,and the ld.so.conf contain two directory .
Don't worry about that, because the linux 's shared library is linked dynamically.
You can go to /usr/lib and type:
~$ ls -al libcv*
You will find:
lrwxrwxrwx 1 root root 28 2006-07-23 16:21 libcvaux.so.0 -> /usr/local/lib/libcvaux.so.0
lrwxrwxrwx 1 root root 25 2006-07-23 16:16 libcv.so.0 -> /usr/local/lib/libcv.so.0
so they link with each other now. Linux can find the new version automatically (by name ).
We learn that after we install shared library, we should update dynamic link in the system by "ldconfig". Before do this , you should check if the shared library's route in the "/etc/ld.so.conf"
Tuesday, August 5, 2008
The nice thing is I have right to do everything on the computer, not like just a user.
Original screen resolution is 1024*768, but I get a better Lcd screen which need 1280*1024 to show image .
First I google many method to do it.
Second I want to know which Gcard I am using .
lspci to see the pci card.
Also you can check module which your system load :
go to /etc/X11,and find xorg.conf. here you can set the x server system ,such as mouse ,monitor,screen etc..
If you want to see what's wrong when the system is doing by this xorg.conf, you can go to
to see what happen ..
if you just want to check error and warning things , you can add
egrep '^\(EE\)|\(WW\)' /var/log/Xorg.0.log
In fact , I install the wrong driver for my graphic card
I reconfigure the x server.. and choose nv instead of vesa..
Now I can get higher resolution, but I can't use the mouse. I copy old file's mouse setting to new xorg.conf. So it works..Although I get some warning information in my log file ..
If you want to calculate odometry automatic , you should need encoder on motor .\
First time , I didn't get what gear ratio mean, so I get the wrong encoder resolution.