sudo suCheck it out!
Monday, December 24, 2007
Login as root in Ubuntu
Wednesday, December 19, 2007
Editing PDF file in Ubuntu Linux
Ubuntu Installation On Gateway T1616
Wireless doesn't work
Here's the result of lspci for wireless :08:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E PCI Express Fast Ethernet controller (rev 01)
The way to make it work should be:
1 Install ndiswrapper :
sudo apt-get install ndiswrapper
2 Download the driver of wireless card for Windows
for Gateway,we need the driver rtl8187b Downloaded.
And use ndiswrapper to install the driver:
ndiswrapper -i xxx.inf
Load ndiswrapper by
sudo modprobe ndiswrapper
Sound Card Doesn't work
The solution turned out to be very simple:install the package alsa-toolssudo apt-get install alsa-toolsThen make sure that every thing displayed in alsamixer is NOT muted.
alsamixerUse key left and right to switch between different column,us key m to voice the muted ones\ After these two things, Gateway T1616 basicly functioned completely.Except that the mic and web camera is still not working. I'll working on it~~
Friday, December 14, 2007
Recalled a little bit C
//out put all the combinations of 5 input characters,less than 5 included #include<stdio.h> void try(int); //DFS function int used[5]; //to record if one charater is used char result[6]; char letters[5]; int depth; //to limit the depth of the search int main (void) { int i,j; for (i=0;i<5;i++) scanf("%c",&letters[i]); for (depth=1;depth<=5;depth++){ for (j=0;j<5;j++) used[j]=result[j]=0; try(0); } return 0; } void try(int lim) { int i; if (lim == depth) { //reach the leaf,time to output for (i=0;i<depth;i++) printf("%c%s",result[i],(i==(depth-1))?"\n":""); return; } for (i=0;i<5;i++) { if(!used[i]){ //pick an unused character used[i]=1; result[lim]=letters[i]; try(lim+1); //go deeper used[i]=0; //set back the usage state back } } }
Tuesday, December 11, 2007
The way to implement buttons with CSS and list in HTML
The method is to display the li element as inline,so that the list will be horizontal.Set the background color of a:hover differntely to make the change.<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>This is a damn test</title> <style type="text/css"> li { display: inline; } a { float:left; width:8em; background-color:navy; text-align:center; margin:0 2px 0 2px; color:white; } a:hover { background-color:green; } </style> </head> <body> <ul> <li><a href="http://danmarner.blogspot.com">one</a></li> <li><a href="http://www.xfocus.net">two</a></li> <li><a href="http://www.justlinux.com">three</a></li> </ul> </body> </html>
Sunday, December 9, 2007
Creating An Independent Grub Without Losing Original Linux
$ sudo mount -t ext3 /dev/sda1 /media/sda1 $ sudo mkdir /media/sda1/boot $ sudo mkdir /media/sda1/boot/sda1 $ cp /boot/grub/* /media/sda1/boot/grubmake /media/boot/grub/menu.lst like this:
defaulte 0 title Ubuntu Linux root (hd0,2) chainloader +1Reboot the system,press "c" when GRUB appears.
Grub> root (hd0,0) Grub> setup (hd0) Grub> rebootAgain,You will find that the menu becomes the new one when GRUB appears,press "c"
Grub> root (hd0,2) Grub> setup(hd0) Grub> chanloader +1 Grub> bootThis time the GRUB menu on sda3 will appear.Which means that Ubuntu is chainloaded by the independent GRUB on sda1.And we needn't do any thing next time. Next time A new Linux being installed,just make sure it won't take over MBR, and add this to menu.lst on sda1:
title Name of new OS root (hdi,j) chainloader +1(hdi,j) stands for the partition of the new system.