显示标签为“网络”的博文。显示所有博文
显示标签为“网络”的博文。显示所有博文

2009年1月28日星期三

转一个针对EEEPC的kernel(Ubuntu8.04和8.10的都有~)

简单的翻译一下~~Setup the Repository

* Install Ubuntu v8.04. Make sure your EeePC can boot into Ubuntu without the aid of a USB Stick or external CD-ROM drive. (就是把Ubuntu装在我们的eeepc上)
* Setup the Array.org repository. This will add the following line to your APT Sources list. (应该就是加入kernel的更新源)deb http://www.array.org/ubuntu hardy eeepcwget http://www.array.org/ubuntu/array-hardy.list
sudo mv -v array-hardy.list /etc/apt/sources.list.d/
* Install the Array.org repository public key. (这个好像是那个key文件下载)wget http://www.array.org/ubuntu/array-apt-key.asc
sudo apt-key add array-apt-key.asc
* Update your local apt cache (呵呵下面这条命令应该很多人都知道吧,更新一下源)sudo apt-get update

Download the EeePC Kernel

* Install the EeePC-optimized kernel. (这个就是下载kernel和安装kernel)sudo apt-get install linux-eeepc
* Reboot. (重启)
* During GRUB's initialization, press ESC to open the boot options menu. The new kernel is labelled "2.6.24-21-eeepc". If it is not at the top of the boot list, scroll down to it and hit enter. (重启以后就可以看到在grub启动菜单中多了一项2.6.24-21-eeepc的选项了~~这个就是新内核了)

Uninstall the Generic Kernel (Optional)

* To remove yourself from Ubuntu's generic kernel updates, run the command: sudo apt-get remove linux-generic linux-image-generic linux-restricted-modules-generic
Note, this will keep the last generic kernel on your device, but any future updates to this generic kernel will be stopped. It's useful to keep this last generic kernel around just incase you encounter an unexpected problem with the eeepc kernel need an "official ubuntu" kernel to fall back to.
* (Not recommended) If you want to remove the last generic kernel as well, run the command: sudo apt-get remove linux-.*-generic

至于卸载的话估计没有几个人会用到如果用对哦啊的话就按照命令来就可以了~~~
上面这个是针对8.04的估计以前应该有人发过~~


8.10的步骤和8.04的一样~除了下载源列表文件不一样别的都差不多的~~
Setup the Repository

* Install Ubuntu v8.10. Make sure your EeePC can boot into Ubuntu without the aid of a USB Stick or external CD-ROM drive.
* Setup the Array.org repository. This will add the following line to your APT Sources list. deb http://www.array.org/ubuntu intrepid eeepcwget http://www.array.org/ubuntu/array-intrepid.list
sudo mv -v array-intrepid.list /etc/apt/sources.list.d/
* Install the Array.org repository public key. wget http://www.array.org/ubuntu/array-apt-key.asc
sudo apt-key add array-apt-key.asc
* Update your local apt cache sudo apt-get update

Download the EeePC Kernel

* Install the EeePC kernel. sudo apt-get install linux-eeepc
OR
Install the EeePC-lean kernel. sudo apt-get install linux-eeepc-lean
* Reboot.
* During GRUB's initialization, press ESC to open the boot options menu. The new kernel is either labelled "2.6.27-8-eeepc" or "2.6.27-8-eeepc-lean" If it is not at the top of the boot list, scroll down to it and hit enter.

Uninstall the Generic Kernel (Optional)

* To remove yourself from Ubuntu's generic kernel updates, run the command: sudo apt-get remove linux-generic linux-image-generic linux-restricted-modules-generic
Note, this will keep the last generic kernel on your device, but any future updates to this generic kernel will be stopped. It's useful to keep this last generic kernel around just incase you encounter an unexpected problem with the eeepc kernel need an "official ubuntu" kernel to fall back to.
* (Not recommended) If you want to remove the last generic kernel as well, run the command: sudo apt-get remove linux-.*-generic

这个是针对8.10的,具体优化在什么地方我还没有仔细看,不过应该是把eeepc的驱动都写入内核中了~至于8.10的我还没有测试过~~等我的1000H拿回来了以后测试一下~~

简单几步优化ubuntu降低CPU使用率

本文介绍的Ubuntu优化方法来自国外文章Feisty Performance - “Fly Like A Butterfly” (中文翻译),作者总结了很多关于优化和加速 Feisty的方法。按照下面的方法来做,到底有没有实际效果,就得大家试了才知道,至少我使用后,发现启动速度有了很大的提高。

  警告:以下部分步骤如果修改错误,会导致系统无法启动,所以需要认真一点。

1、禁用 IPv6

目前 IPv6 还没有到来,Ubuntu 这个超前的功能暂时可以屏蔽掉,以加快速度。
编辑 sudo gedit /etc/modprobe.d/aliases,把:
alias net-pf-10 ipv6
修改为
alias net-pf-10 off #ipv6

2、并行运行开机启动脚本

/etc/init.d/ 下面的都是启动脚本,默认这些脚本是按顺序启动的,实际上,如果你使用的是 SATA 或 SCSI 接口,可以并行启动这些脚本程序,加速启动过程。
使用 vi 编辑 sudo vi /etc/init.d/rc,把:
CONCURRENCY=none
修改为
CONCURRENCY=shell

3、将 localhost 化名为主机名

据说这个方法可以改善使用 Ubuntu 一段后,在 GNOME 中启动应用程序变慢的问题。
编辑 sudo gedit /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,所以我们可以禁用它。这样可以很好的降低CPU的使用率。
编辑 sudo gedit /etc/environment,添加:
MOZ_DISABLE_PANGO=”1″

5、禁用 gettys

打开 sudo gedit /etc/event.d/tty3,把所有以 start 开头的行,用 # 注释掉。

6、安装 preload

可以把一些常用到的 lib 库和应用程序预加载到内存,以提高程序的启动速度。
sudo apt-get install preload

7、设置 swappiness

减少系统对于 swap 频繁的写入,将加快应用程序之间的切换,有助于提升系统性能。
系统默认为 60,你可以修改为 10:
sudo sysctl vm.swappiness=10
如果要让它开机自动设定,编辑 sudo gedit /etc/sysctl.conf 文件,加入:
vm.swappiness=10

8、使用 grub 的 profile 选项

grub 有个叫做 profile 的选项,它是一种系统启动时所要读取的所有的文件的索引,这样使得随后系统查找并且读取这些文件的速度就会加快。
在开机进入 grub 画面时按 esc 键,然后找到需要启动的内核,按 e 键,编辑启动参数,在后面加入 profile 后再按 b 进行启动。设置后,第一次开机需要建立索引,所以开机速度会慢一点,以后每次更新内核都需要这么做。

9、使用 sysv-rc-conf 关闭不必要的服务.

具体方法,请参考这里。
#############################################3
将localhost化名为主机名,编辑hosts文件,把127.0.0.1等于localhost和本机名写到一行中,比如:
127.0.0.1 localhost
127.0.1.1 fwolf_pcname
==> 变成
127.0.0.1 localhost fwolf_pcname
禁用ipv6,编辑/etc/modprobe.d/aliases:
alias net-pf-10 ipv6
==>
alias net-pf-10 off #ipv6
并行运行开机启动脚本,编辑/etc/init.d/rc:
CONCURRENCY=none
==>
CONCURRENCY=shell
但据说这种方法可能会造成启动问题,慎用,建议多核cpu才使用。
禁用Pango的输出和文本渲染,主要针对mozilla和firefox,可能会导致cpu占用过高。编辑/etc/environment,添加一行:
MOZ_DISABLE_PANGO=”1″
关闭之后明显感觉到firefox的显示速度变快了,但显示形式也有了一些变化,比如、网页标题的黑体字现在能体现了,但也感觉字体渲染略微“模糊”了一点点。
安装preload,它可以把一些常用到的库文件预加载到内存,用部分内存空间换取应用程序启动速度的提升。另外注意,prelink从Feisty 7.04起就没用了:
sudo apt-get install preload
禁用多余的虚拟终端,编辑/etc/inittab,把getty部分只留一个就可以了:
1:2345:respawn:/sbin/getty 38400 tty1
#2:23:respawn:/sbin/getty 38400 tty2
#3:23:respawn:/sbin/getty 38400 tty3
#4:23:respawn:/sbin/getty 38400 tty4
#5:23:respawn:/sbin/getty 38400 tty5
#6:23:respawn:/sbin/getty 38400 tty6
Ctrl+Alt+F2-F6就没东西了,F1是我们保留的终端,用于应急处理,F7就是正常的图形环境啦。
注:有些情况下这样好像不行,还要编辑/etc/event.d/tty2,把start开头的两行都注释掉,3456都如法炮制,依然只保留1,再用热键切换过去就是空空的一个提示符了。
调整hdparm加速硬盘,编辑/etc/hdparm.conf,参考内容如下:
/dev/sda {
dma = on
io32_support = 1
mult_sect_io = 32
}
对于内存充足的机器减少对swap的使用,编辑/etc/sysctl.conf,添加:
vm.swappiness=10
这个数值的默认值为60,越小对swap的写入可能就越小,有网友说1G内存调整为5感觉最合适,建议至少512M内存以上再调整这个数值,设为0的话就几乎等于不实用swap了。
使用LVM,但暂时没有进一步的资料。
用bootchart协助,优化系统启动过程,对耗时较多的过程进行优化。
使用bum关闭掉不需要的服务,不推荐用sysv-rc-conf的原因是bum对服务、进程有比较详细的解释说明。
如果fstab中挂有外部磁盘,启动时不需要检测,可以把pass设置为0(fstab中最后一列)。如果在安装系统时就选用更合理的分区方案、分区类型(比如XFS)效果更佳。
现在应该都在用6.10Edgy之后的发行版了,如果是486机器,请选用386内核;P4以后的机器,包括同期的AMD,请选用generic内核;服务器请选用linux-server内核,性能可能会有一点点的提升。

详细请参考:Difference between linux-generic, linux-386。
用deborphan删除不用的库文件:
sudo deborphan | xargs sudo apt-get -y remove –purge

使用CDMA连接笔记本无线上网

我们使用CDMA连接笔记本无线上网的目的是为了在任何地方无限制的上网!(Wifi毕竟还是不方便!并不是什么地方都能找到无线路由器的!)它不能用来玩大型网络游戏!也不能用来看网络上的任何视频文件!更不能用来挂 BT,ED等P2P网络下载软件!但是它能让你在关键的时候抛售或者买进一只利润客观的股票,可以让你在关键的时候接到老板或者领导给你的一封重要的电子邮件,可以让你在火车上不用忍受孤独和寂寞,可以让你在夜晚深刻不用忍耐........(好像严重跑题了,大家还是发挥自己的想象力看看是否在你的生活和工作方面有什么重要的地方发挥它的作用吧!)

下面开始说正题吧!

既然是最低端的方案,费用方面肯定能省不少钱,但是同样的它的使用效果也并不是相当的理想!
首先你得有一台CDMA手机.我个人不推荐联通等一些厂商推荐的CDMA上网卡,费用太高了,光一张卡就要花将近大好几白块钱!我建议您去旧货市场找一台CDMA手机!只要能正常通话就行! 我的手机就是花了50块钱弄来一台电池只能用5分钟,屏幕无显示的CDMA手机!(反正不用它来打电话!无所谓的!)然后再去联通弄张SIM卡来!随便什么卡!反正CDMA上网的费用都是1小时3块6!(至少福州就这个价.......)

然后有了以上设备!就可以进行配置了!

以下是ghost_diy的配置方法,我做了相对修改!
$dmesg

看一下有没有类似"ttyUSB"的字样出现,如果有,直接跳到5步,如果没有,应该至少有以下信息出现:

引用:
usb 5-1: new full speed USB device using uhci_hcd and address 2
usb 5-1: configuration #1 chosen from 1 choice

有以上信息至少说明系统设别到了你的usb设备,但只是不知道该用什么内核模块匹配它而已。
3、执行
代码:
$sudo lsusb
应该有类似cdma的字样出现,比如我的就是这样:
引用:
Bus 005 Device 002: ID 05c6:3197 Qualcomm, Inc. CDMA Wireless Modem/Phone
这里面的05c6:3197很重要,它对应下面一步模块参数中的vendor和product,可能你的数值不一定和我的一样。
4、现在就来加载合适的内核模块,一般用usbserial,但要指定具体的参数,就是让内核知道usb设备的vendor和product,比如我的就用命令:
代码:
$ sudo modprobe usbserial vendor=0x05c6 product=0x3197

具体根据lsusb 看到的vendor和product数值写,但0x是一定要加的,不然不会成功。现在再执行dmesg,是不是看到有类似下面的信息了:
引用:
usbcore: registered new interface driver usbserial
drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
usbserial_generic 5-1:1.0: generic converter detected
usb 5-1: generic converter now attached to ttyUSB0
usbserial_generic 5-1:1.1: generic converter detected
usb 5-1: generic converter now attached to ttyUSB1
usbcore: registered new interface driver usbserial_generic
drivers/usb/serial/usb-serial.c: USB Serial Driver core

有些系统可能会是ttyACM0之类的。

usbcore: registered new interface driver usbserial
drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
usbserial_generic 5-1:1.0: generic converter detected
usb 5-1: generic converter now attached to ttyACM0
usbserial_generic 5-1:1.1: generic converter detected
usb 5-1: generic converter now attached to ttyACM1
usbcore: registered new interface driver usbserial_generic
drivers/usb/serial/usb-serial.c: USB Serial Driver core


(ghost_diy兄弟和我说使用PPPconfig来进行配置上网,但是我个人建议使用wvdial,配置方法比较自由!)

打开终端输入:sudo gedit /etc/wvdial.conf
然后在wvdial.conf文件中如下配置!
==================================
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = USB Modem #我见过这里有人填CDMA,GPRS等等等等的...........反正是五花八门,什么都有!但是记住既然你用的是
手机连接USB上网!那这里Modem的类型就应该是USB Modem!区分CDMA和GPRS等等,或者说GPRS连接Wap网络的接入点,应该是在Init2这一行下面新建一行Init3,并在这一行写入GPRS接入点!
Baud = 460800 #手机专业人士应该能告诉你这一行写的是什么...........(也就这里!我有些不理解........)
New PPPD = yes
Modem = /dev/ttyACM0 #这里是你的设备端口!注意,以上步骤4上面显示的是那个端口,这里就填哪个端口!千万别填错!
ISDN = 0
Phone = #777 #这里是你的Modem拨号的电号码!CDMA好像都是这个!
Password = CARD #你拨号用的密码!
Username = CARD #你拨号用的用户名!
Stupid Mode = 1
==================================================
配置好后,连接网络的方法是打开一个终端,输入sudo wvdial 看到如下信息就表示网络连接成功!你的手机应该也显示拨号页面!
WvDial<*1>: WvDial: Internet dialer version 1.56
WvModem<*1>: Cannot get information for serial port.
WvDial<*1>: Initializing modem.
WvDial<*1>: Sending: ATZ
WvDial Modem<*1>: ATZ
WvDial Modem<*1>: OK
WvDial<*1>: Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
WvDial Modem<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
WvDial Modem<*1>: OK
WvDial<*1>: Modem initialized.
WvDial<*1>: Sending: ATDT#777
WvDial<*1>: Waiting for carrier.
WvDial Modem<*1>: ATDT#777
WvDial Modem<*1>: CONNECT
WvDial<*1>: Carrier detected. Starting PPP immediately.
WvDial: Starting pppd at Thu Nov 29 01:13:26 2007
WvDial: Pid of pppd: 5910
WvDial<*1>: Using interface ppp0
WvDial<*1>: pppd: [10]�[06][08]��[06][08]
WvDial<*1>: pppd: [10]�[06][08]��[06][08]
WvDial<*1>: pppd: [10]�[06][08]��[06][08]
WvDial<*1>: pppd: [10]�[06][08]��[06][08]
WvDial<*1>: pppd: [10]�[06][08]��[06][08]
WvDial<*1>: local IP address 220.207.67.143
WvDial<*1>: pppd: [10]�[06][08]��[06][08]
WvDial<*1>: remote IP address 220.192.64.1
WvDial<*1>: pppd: [10]�[06][08]��[06][08]
WvDial<*1>: primary DNS address 220.192.8.58
WvDial<*1>: pppd: [10]�[06][08]��[06][08]
WvDial<*1>: secondary DNS address 220.192.32.103
WvDial<*1>: pppd: [10]�[06][08]��[06][08]

注:拨号后请不要关闭用来拨号的终端!

还有其他拨号方法我就不一一叙述了!个人感觉就这么拨号挺好的,没必要把这个放到Xwindows里面!(有一次去外地学习,临时离开了2 天,结果我的本本被同室发现,并且他用他Windows的功底找到Xwindows的这个CDMA连接,被他残忍的聊了2天的QQ我不得不为这两天的 CDMA网费买单后,才发现有时候命令行还是挺好用的阿!)

这套方案我用到现在!几乎是任何地方都可以享受Internet!所以拿出来分享一下!高手别寒颤我,如果我有什么地方有错误,请您帮忙指出我的错误,并留下修改方案,我毕竟是个才学linux不到一个星期的超级大菜鸟 ^_^! ....... 各位有条件弄到以上设备,周边又没有网线,又急于上网的人事可以尝试一下!

Linux操作系统中实现DDOS攻击的方法

无法查看这则摘要。请 点击此处查看博文。