•   Compiling custom kernel has its own advantages and disadvantages. However, new Linux user / admin find it difficult to compile Linux kernel. Compiling kernel needs to understand few things and then just type couple of commands. This step by step howto covers compiling Linux kernel version 2.6.xx under Debian GNU Linux. However, instructions remains the same for any other distribution except for apt-get command.

    Step # 1 Get Latest Linux kernel code

    Visit http://kernel.org/ and download the latest source code. File name would be linux-x.y.z.tar.bz2, where x.y.z is actual version number. For example file inux-2.6.25.tar.bz2 represents 2.6.25 kernel version. Use wget command to download kernel source code:
    $ cd /tmp
    $ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-x.y.z.tar.bz2

    Note: Replace x.y.z with actual version number.

    Step # 2 Extract tar (.tar.bz3) file

    Type the following command:
    # tar -xjvf linux-2.6.25.tar.bz2 -C /usr/src
    # cd /usr/src

    Step # 3 Configure kernel

    Before you configure kernel make sure you have development tools (gcc compilers and related tools) are installed on your system. If gcc compiler and tools are not installed then use apt-get command under Debian Linux to install development tools.
    # apt-get install gcc

    Now you can start kernel configuration by typing any one of the command:

    • $ make menuconfig - Text based color menus, radiolists & dialogs. This option also useful on remote server if you wanna compile kernel remotely.
    • $ make xconfig - X windows (Qt) based configuration tool, works best under KDE desktop
    • $ make gconfig - X windows (Gtk) based configuration tool, works best under Gnome Dekstop.

    For example make menuconfig command launches following screen:
    $ make menuconfig

    You have to select different options as per your need. Each configuration option has HELP button associated with it so select help button to get help.

    Step # 4 Compile kernel

    Start compiling to create a compressed kernel image, enter:
    $ make
    Start compiling to kernel modules:
    $ make modules

    Install kernel modules (become a root user, use su command):
    $ su -
    # make modules_install

    Step # 5 Install kernel

    So far we have compiled kernel and installed kernel modules. It is time to install kernel itself.
    # make install

    It will install three files into /boot directory as well as modification to your kernel grub configuration file:

    • System.map-2.6.25
    • config-2.6.25
    • vmlinuz-2.6.25

    Step # 6: Create an initrd image

    Type the following command at a shell prompt:
    # cd /boot
    # mkinitrd -o initrd.img-2.6.25 2.6.25

    initrd images contains device driver which needed to load rest of the operating system later on. Not all computer requires initrd, but it is safe to create one.

    Step # 7 Modify Grub configuration file - /boot/grub/menu.lst

    Open file using vi:
    # vi /boot/grub/menu.lst

    title           Debian GNU/Linux, kernel 2.6.25 Default
    root (hd0,0)
    kernel /boot/vmlinuz root=/dev/hdb1 ro
    initrd /boot/initrd.img-2.6.25
    savedefault
    boot

    Remember to setup correct root=/dev/hdXX device. Save and close the file. If you think editing and writing all lines by hand is too much for you, try out update-grub command to update the lines for each kernel in /boot/grub/menu.lst file. Just type the command:
    # update-grub
    Neat. Huh?

    Step # 8 : Reboot computer and boot into your new kernel

    Just issue reboot command:
    # reboot
    For more information see:

    • Our Exploring Linux kernel article and Compiling Linux Kernel module only.
    • Official README file has more information on kernel and software requirement to compile it. This file is kernel source directory tree.
    • Documentation/ directory has interesting kernel documentation for you in kernel source tree.

    Original source:http://www.cyberciti.biz/tips/compiling-linux-kernel-26.html

  • 2009-02-09

    Python 果然不错 - [软件]

      一直听说python不错,只是一直没有時間去学习一下,之前看过了一本a byte of vim,了解到作者还有一本a byte of python,也是一本非常不错的入门书,于是下来看了一下,一个晚上時間,基本上明白了python的使用方式,果然是一个即简单又强大的程序語言。

      找時間弄个項目做做,熟悉一下。

  •   因为一些原因,我必須要对我的本本进行系統的重新安装,包括windows XP和ubuntu.刚好也趁此机会整理一下硬盘的内容,重新规划一下安排。本来想把刚买的250GB硬盘换上本本上去的,拆开一看,发现本本的硬盘上还贴着Lenovo的标记,换了之后恐没有保修,因此还是保持原样。将所有数据转移至移动硬盘上进行系統重装。

      使用的Windows XP是lenovo专用版本,因此安装的时候是免序列号輸入的,还是蛮快,大概一个小时左右就安排完了,当中最烦人的就是那一系列的驱动安装,芯片组,声卡,网卡,无线网卡,显卡,猫等等,由于Lenovo F31原装的时候是vista的,因此在安装的时候,一定要注意显卡驱动要最后安装,如果不是的话,重新启动的话,就会非常的慢,无法退出。之前有过一次的经验,因此这次安装还是非常的成功的。安装完毕后,照例的安装一些必須就用軟件,就算是完成了大部分,最重要的,恢复了以前使用的firefox的所有addon就算完成了。

      接下来就安装Ubuntu 8.10,使用的是U盘启动的方式,进入到系統后直接就可以进行安装了,大概設置了七步,再把分区設置一下,大概二十来分钟就安装完毕了,重新启动系統。 設置一下源使用杭州的双线服务器Lupa源,sudo apt-get update,速度非常快,在我这里是10M Lan的情况下可以达到700K/s。更新内核到2.6.27-10,然后安装两个受限驱动无线网卡和Nivida显卡驱动,将需要的軟件sudo apt-get install一下,不需要的就remove一下,就可以正常使用了。

      这一次的安装过程中,明显的感覺到使用的Ubuntu要比windows快很多,不论是安装的速度,設置的速度还是运行的速度。但是,无奈的是,有一些事情还必須要在windows下运行,ubuntu商業的应用,特別是工業的应用还是不够。但是,现在也是时候慢慢的让一些没有特殊需求,只需要用电脑来上网啊,聊天啊,写写文档什么的人士就用是足夠了。

  • for i in *.txt; do mv $i ${i%%\.*}.cnx; done

     #记录于此

  •  

      以前一直在使用的卡巴斯基到期了,这个软件真是非常的好用的,也一直用它到现在,但是,金融危机嘛,我们没有这么多金钱去买这些东东,所以目光自然的转向了开源。AVG Free Edition是一款非常不错的杀毒软件,现在就用他了,分享一下。以下是官方介绍,懒得翻了。

    AVG Free Edition is the well-known anti-virus protection tool. AVG Free is available free-of-charge to home users for the life of the product! Rapid virus database updates are available for the lifetime of the product, thereby providing the high-level of detection capability that millions of users around the world trust to protect their computers. AVG Free is easy-to-use and will not slow your system down (low system resource requirements).

    Highlights include:

    • Automatic update functionality
    • The AVG Resident Shield, which provides real-time protection as files are opened and programs are run
    • The AVG E-mail Scanner, which protects your e-mail
    • The AVG On-Demand Scanner, which allows the user to perform scheduled and manual tests
    • Free Virus Database Updates for the lifetime of the product
    • AVG Virus Vault for safe handling of infected files

     需要的可以在这里下载:http://www.filehippo.com/download_avg_antivirus/

  • 2008-10-07

    FriendFeed - [软件]

      推荐一下网站www.friendfeed.com,可以将你很多的应用使用feed的方法聚合在一起,方便你的个人信息的管理.目前支持的网站,非常的多,如图所示.我的:http://friendfeed.com/brucebot

    发件人 blogpic
  •      如果有朋友和我一样经常各地来回的跑,而且又如同我一般没有网络便是没有生活的话,或许可以参考一些我的个人网络解决方案。不过,如果您有更好的方案,不仿分享一下,因为对于我来说,没有网络的日子,是不行的。当然,也有不少朋友问过我,看你蛮是喜欢玩计算机的啊,那你玩什么游戏呢?不好意思,我答案一般会让人无话可说,因为我不玩游戏。那上网一般会做什么呢?交友,玩游戏,论坛,还是其他什么?或是什么second life之类的,下载,etc...对于游戏,我是基本上的免疫的,那对我没有任何的吸引力,这种虚拟的不真实的东西,纯粹是空虚的人需要的。一般上网使用网络的话信息的获取和朋友的交流,是我的主要部分。所以,google reader一直是我使用的信息获取的方法,如碰到有好的blog,我都会直接订阅的方式来阅读,这方面了很不多。好了,言归正转。目前我主要使用的网络解决方案有两种:

    1.palm treo 680手机上网

        浙江移动在这方面的资费还是不错的,目前我是使用了20块包月使用200M流量的套餐,基本上用来收一下邮件及看一些信息,速度方面在开通了EDGE的地方还是不错的。

    2.各地无线方案

        因为手机本身不带WIFI,所以这个方案就必须要用我的计算机了,现在已经迷上了使用界面非常友好的个人定制版的ubuntu,compiz界面,dock特效,高效的处理过程,对于windows,只有在必须用的时候,出现。之前有同事同我提到在机场的无线中可以使用chinanet中国电信宽带的帐号来登录无线,之前天津测试了一下,浙江的帐号似乎不能使用。有可能是需要开通类似于漫游的功能,此不得知。今天,在杭州是可以测试成功的。各位可以不仿不试.

    目前,就此两种方案比较不错的,如果3G到来了,将会更好,速度是一种快感。当你使用了杭州的ubuntu镜像来安装软件时,那种1000k/s的速度,会让你疯狂。哈哈

     

  • 一..每次装完linux后在终端中运行命令,碰到错误或者其他情况都会发出“滴滴”声,在X Window系统下,可以使用xset 命令为之,  命令如下:xset b off (输入xset 回车后得到xset命令的选项)

    二 ..加速ubuntu compiz 及firefox
    1.禁用IPv6
    目前IPv6还没有到来,Ubuntu这个超前的功能暂时可以屏蔽掉,以加快速度
    #vi /etc/modprobe.d/aliases

    alias net-pf-10 ipv6

    ===>

    alias net-pf-10 off #ipv6

    2、并行运行开机启动脚本(慎用)

    /etc/init.d/下面的都是启动脚本,默认这些脚本是按顺序启动的,实际上,如果你使用的是SATA或SCSI接口,可以并行启动这些脚本程序,加速启动过程。

    # vi /etc/init.d/rc

    CONCURRENCY=none

    ===>

    CONCURRENCY=shell

    3、将localhost化名为主机名

    据说这个方法可以改善使用Ubuntu一段后,在GNOME中启动应用程序变慢的问题

    # vi /etc/hosts

    127.0.0.1 localhost

    127.0.1.1 Ubuntu

    ===>

    127.0.0.1 localhost Ubuntu

    127.0.1.1 Ubuntu

    注:在第一行末尾加上主机名,也就是第二行的那个名字。

    4、禁用Pango

    Pango是一个着重于国际化的,用于输出和文本渲染的库,但是这个库可能导致Firefox等一些程序占用过高的 CPU,所以我们可以禁用它。

    # vi /etc/environment

    MOZ_DISABLE_PANGO="1"

    5、禁用gettys

    # vi /etc/event.d/tty3

    把所有以start开头的行,用#注释掉(:%s/^start/#start/)

    6、安装preload

    可以把一些常用到的lib库和应用程序预加载到内存,以提高程序的启动速度

    # apt-get install preload

    7、设置swappiness

    减少系统对于swap频繁的写入,将加快应用程序之间的切换,有助于提升系统性能

    系统默认为60,你可以改为10

    # sysctl vm.swappiness=10

    如果要让它开机自动设定

    # vi /etc/sysctl.conf (加入)

    vm.swappiness=10

    三.加速firefox

    1、打开 Firefox,在地址栏输入 about:config。
    2、在过滤器中分别输入下列名字,把它们的值改为后面的就行了。

    network.dns.disableIPv6 值为 true
    network.http.pipelining 值为 true
    network.http.pipelining.maxrequests 值为 8
    network.http.proxy.pipelining 值为 true