2010年8月26日星期四

enovo Think产品IWS(全球联保)申请指南 ZZ

http://www.weigblog.com/2008/07/18/apply-lenovo-think-iws.html

2010年8月16日星期一

ubuntu 10.04 problem: Kernel panic - not syncing

After updating the package lists in Ubuntu 10.04 as well as BIOS (probably),
there is the error messenger when booting from Ubuntu, as follows:
[ 1.901413] Kernel panic - not syncing : VFS: Unable to mount root fs on unknown-block(0,0)

The reason of the problem: it seems like the linux image(or Kernel) file on disk is broken.

The way to solve: (try to recompile the kernel in your system.)
cd /boot/
mkinitramfs -o initrd.img-2.6.34-rc6-custom 2.6.34-rc6-custom
update-grub
reboot the system.

There you go! :)

2010年8月14日星期六

Install GNU Radio on Mac OS X (ZZ)

http://staff.washington.edu/jon/gr-osx/gr-osx.html

maintained by this amazing biology guy
wow~~

How to use CP command in linux (or ubuntu) ZZ

To make a copy of a file in the current directory, enter:
cp prog.c prog.bak

To copy a file in your current directory into another directory, enter:
cp jones /home/nick/clients

To copy all the files in a directory to a new directory, enter:
cp /home/janet/clients/* /home/nick/customers
To copy a directory, including all its files and subdirectories, to another directory, enter:
cp -R /home/nick/clients /home/nick/customers

To use pattern-matching characters to copy files, enter:

cp programs/*.c .
This copies the files in the programs directory that end with .c to the
current directory, signified by the single . (dot). You must type a
space between the c and the final dot.

2010年8月10日星期二

Andriod applications

http://blog.csdn.net/Android_Tutor

How to restore the Ubuntu/XP/Vista/7 bootloader (Updated for Ubuntu 9.10) ZZ

This How-to is for windows dual booters who reinstall an operating system only to find that it has taken away access to their other operating system.
Whether you want to restore the XP, Vista, 7 or Ubuntu (Grub) bootloader, this guide will walk you through it.

All three parts of this tutorial require that you boot from a cd. If you don't know how to do this, check here.

If you have made a mistake and want to revert the changes, simply follow the instructions for reinstalling the previous bootloader. For example, if you have installed vista over ubuntu, try to get the ubuntu bootloader back, but want to get the vista bootloader back, simply follow my instructions for installing the vista bootloader.


How to restore the Ubuntu grub bootloader (9.10 and beyond)

First you need to find out what your drives are called. You can do this by going to a terminal and typing:
Code:
sudo fdisk -l
From that you need to find the device name of your Ubuntu drive, something like “/dev/sda5″.
So, still in the terminal, type:
Code:
sudo mkdir /media/sda5

sudo mount /dev/sda5 /media/sda5
And then, to reinstall the grub:
Code:
sudo grub-install --root-directory=/media/sda5 /dev/sda
Push enter and you’re done! Of course you need to replace “/dev/sda5″ and “/dev/sda” with what you found in the fdisk output.

How to restore the Ubuntu grub bootloader (9.04 and older)

First of all, all credit for this part of the tutorial goes to catlet. I am simply rewriting his tutorial to have all three bootloaders in this tutorial.

So, lets begin. To restore the grub, you must boot off the ubuntu live cd. Any ubuntu live cd will do.

Once there, open a terminal (Applications>Accessories>Terminal) and type this:

Code:
sudo grub
Next, you need to find which hard drive ubuntu and the grub is installed to. You do this by running this command:

Code:
find /boot/grub/stage1
Take note of what it returns (something like (hd0,1).)

Now you need to tell Grub where it is installed. Using the output of the last command, change this one and run it:

Code:
root (hd,)
Replacing and with what you got back before. For example, if "find /boot/grub/stage1" gave me "(hd0,1)", you would run "root (hd0,1)"

Ok, so thats the configuration over and done with. Now we just need to run one command to install the Grub to your hard drive:

Code:
setup (hd0)
Now to quit and check if it has worked:

Code:
quit
Code:
sudo reboot
Make sure you have taken the live cd out of your disc tray. All going well, you should start back up and see the grub once again.


How to restore the Windows XP bootloader

For this you will need your Windows XP installation CD. Boot into it now.

You will get to a part where it asks if you want to repair or recover. To do so, press "r".

If prompted, enter your Windows XP administrator password. This will leave you at at a command line, so type in the following two commands:

Code:
fixboot
Code:
fixmbr
Then type
Code:
exit
then remove your XP cd. If everything has gone well, you should come to your XP bootloader.


How to restore the Windows Vista or 7 bootloader

To restore the Windows Vista/7 bootloader, you must first boot off your Windows Vista/7 installation DVD.
If you have one of the many OEM computers that didnt come with a Vista/7 installation disk, you can get the same effect with a Vista recovery disk, which you can download for
Vista or Win 7.
When you get to the Regional settings, select your Location/Keyboard setting then click next. On the next page you must click on "Repair your computer."

On the next page, if it finds your Windows Vista/7 installation, make sure it is UNSELECTED before clicking next.
Then click on "Command prompt". From there, type in the folowing:

Code:
bootrec.exe /fixboot
Code:
bootrec.exe /fixmbr
Now close the two windows and click "Restart."

Take out your Vista/7 DVD and hopefully, you will be left with your Windows Vista/7 Bootloader.

2010年8月9日星期一

ubuntu崩溃后怎么挽救数据ZZ

1.首先从livecd启动
2.非wubi安装(假设安装到第一个扩展分区),挂载分区,将数据导出来。
代码:
sudo mount /dev/sdaX /mnt

3.wubi安装(假设安装到第一个扩展分区),先挂载分区
代码:
sudo mount /dev/sdaX /mnt

接下来用loop设备挂载虚拟磁盘文件,再将数据导出来。
代码:
sudo mount /mnt/ubuntu/disks/root.disk /media -o loop

2010年8月5日星期四

Reinstalling GRUB 2 (ZZ)

https://help.ubuntu.com/community/Grub2#Reinstalling%20from%20LiveCD

重装Windows7后,Ubuntu无法启动的解决方案ZZ

经过不懈的努力与查论坛资料,找出了可行的一套方案
需要注意的是,与重装XP不一样,因为Longhorn系列的系统引进了bcd启动的bootmgr机制,
和过去XP与之前时代的boot.ini是完全不同的,所以相对于Vista和最新的Windows 7系统来说,boot.ini不行

废话少说下面就是方案
---------------------------------------------
如果你有LiveCD,那么就会很容易解决
随光盘启动,在终端下输入
代码:
sudo su

密码确认再输入
代码:
grub


随后在grub>提示符下输入
代码:
root (hdx,y)
setup (hdx)

请注意,这里的x是指硬盘号,y表示分区号
通常情况下,我们只使用一个硬盘,因此x为0
分区号,我们假设你的ubuntu在第n个分区,那么y=n-1
我的ubuntu在分区5上,因此我需要输入
代码:
root (hd0,4)
setup (hd0)

关于到底是第几个分区的问题,如果你不清楚,那么可以挨个地试,1,2,3,4,5...



如果你没有LiveCD,那么需要做更多的工作
1.下载grub4dos,下载地址:http://sourceforge.net/projects/grub4dos
2.解压后,将grldr与grldr.mbr文件复制到C盘根目录下
3.在Vista下找到 开始-附件-命令行,在命令行这一项上面鼠标点击右键选择“使用管理员权限运行”
4.在cmd下输入如下命令:
代码:
bcdedit /create /d "GRUB" /application bootsector

系统会返回一个长串的id号,下面需要用到这个变量,继续输入
代码:
bcdedit /set {id} device partition=C:
bcdedit /set {id} path \grldr.mbr
bcdedit /displayorder {id} /addlast

注意!这里的{id}就是上面获得的变量,请注意小心核对输入,输错一个就基本面临崩溃了

5.下载一个可以在windows下查看linux分区的工具
关于这个问题,我不知道是否是我系统的关系,无法用explore2fs来查看ext3分区,通常你可以下载explore2fs这个工具在windows下查看ubuntu的分区。下载地址:http://www.chrysocome.net/downloads
我个人推荐另一款工具,因为explore2fs无论如何我都用不了,地址:http://www.eisoo.com/cn/professional/diskgenius/download.htm
这个工具叫做DiskGenius

6.通过这个工具,将ubuntu分区上,/boot/grub/menu.lst文件复制到C盘根目录下
7.重启系统,在系统选单中选择GRUB
8.进入Ubuntu后,你可以在终端上重复我开头时livecd提到的操作
sudo su
grub
root (hdx,y)
setup (hdx)
详情请看上面的livecd时的操作
9.Done

这样,工作就完成了,加入你重新安装的vista或windows7并不在原先的分区上,那么你可以进一步在你的ubuntu下修改menu.lst。另外,如果你觉得windows选单下的GRUB变得多余,你可以用easyBCD工具去除。

我感觉很奇怪的时,以上cmd命令行操作中的内容虽然确实也可以用easyBCD等工具来完成,但是我用easyBCD做出来的引导老是出问题,我也就没有去细想问题出在哪儿,总之直接用上面的方法就好了
这则方案参考了http://forum.ubuntu.org.cn/viewtopic.php?f=139&t=148913&start=15 这张帖子里面,fishtear的方法,不过他们那个时wubi安装的就是了。

2010年8月3日星期二

Install Win 7 from XP without using CD Drive

  1、下载windows 7 7057ISO镜像(RC或RTM),用虚拟光驱拷贝至非C盘(如D:\7057)

  2、把D:\7057目录下的bootmgr和boot目录(其实只要里面的boot.sdi和bcd文件)拷贝到c盘根目录下,并在C盘根目录下建 个sources文件夹。(XP下不需要取得管理员权限)

  3、把D:\7057\sources下的boot.win复制到C盘刚建的sources文件夹

  4、用管理员身份运行cmd,然后输入c:\boot\bootsect.exe/nt60 c: 提示successful(即成功了!)

  5、关闭cmd窗口重启计算机,自动进入安装界面,选择安装语言,同时选择适合自己的时间和货币显示种类及键盘和输入方式

  6、出现“开始安装界面”,(要注意了,不点击“现在安装”)点左下角“修复计算机”(repair mycomputer),进入"系统恢复选择",选择最后一项"命令提示符"(commandprompt),进入DOS窗口

  7、输入“D:\7057\sources\setup.exe“(不带引号),开始安装

  8、选择安装语言、格式化C盘,就OK了

2010年8月2日星期一

Convert the data between matlab and gnuradio

-. Moving Data from MATLAB to GNU Radio

write_float_binary() : write the float value in matlab to the binary data in gnuradio.
write_complex_binary() : write the complex value in matlab to the binary data in gnuradio.

-. Moving the data from GNU Radio to Matlab:
read_float_binary()
read_complex_binary()

All the above functions are with extended name "*.m", which can be found in the folder "~/gnuradio/gnuradio-core/src/utils/"