|
|
第 46 帖 | |
|
|
标题: 启动进程管理 slackware是使用4.4BSD-list风格的Linux发行版,因此启动进程管理与其它发行版不同。
通过slackware内核将许多可用的设备支持作为模块编入(是为了提供更大的方便,为在你增加其它设备及服务时,不需要去重新编译内核,以保证系统安全性或为降低因人为错误导致系统崩溃的可能性)。哪内核是否会因此而感到臃肿!答案是不会,因为虽然以将多数不存在的设备编入内核模块,但决定真正启动的内核模块进程在/etc/rc.d目录下面,其中有一个非常重要的配置文件将决定你的系统加载什么样的设置及服务,即是/etc/rc.d/rc.modules文件。不知是否注意到,有很多Fans在安装和设置好系统后,去自己下载如ATI的显卡并重新去编译内核,希望实现3D加速或认为没有显示驱动导致屏幕很闪,或自己去写一个iptables防火墙脚本,其实不需要这么做。iptables在rc.modules文件中已有一个非常不错的范本,你只需做一个简单的改进即可使用。 # As a quick example (for a much more extensive treatment, see the IP-Masquerade # mini-HOWTO) to allow Internet access to a local network 192.168.11.0 with a # netmask of 255.255.255.0, you'd use these commands in /etc/rc.d/rc.local: # # # EXTERNAL -> external network interface # # INTERNAL -> internal network interface # EXTERNAL=eth0 # INTERNAL=eth1 # echo 1 > /proc/sys/net/ipv4/ip_forward # echo "Setting up NAT (Network Address Translation)..." # # by default, nothing is forwarded. # iptables -P FORWARD DROP # # Allow all connections OUT and only related ones IN # iptables -A FORWARD -i $EXTERNAL -o $INTERNAL -m state --state ESTABLISHED,RE LATED -j ACCEPT # iptables -A FORWARD -i $INTERNAL -o $EXTERNAL -j ACCEPT # # enable MASQUERADING # iptables -t nat -A POSTROUTING -o $EXTERNAL -j MASQUERADE 如果还需要一个更加强大的防火墙脚本,可以把以下部分加入到上面的内容中,并把上面的部分删除。 #Our complete stateful firewall script. This firewall can be customized for #a laptop, workstation, router or even a server. #这是一个完美的防火墙脚本,它不是一个基于用户顶端的工作组、路由或相等的防火墙 #change this to the name of the interface that provides your "uplink" #(connection to the Internet)指定网络端口(即是你的设备的位置) UPLINK="eth1" #if you're a router (and thus should forward IP packets between interfaces), 如果你有一个静态的路由或IP地址,你需在下面的ROUTER选项使用yse,否则如使DHCP动态分码则用No这一值。 #you want ROUTER="yes"; otherwise, ROUTER="no" ROUTER="yes" #change this next line to the static IP of your uplink interface for static SNAT, or #"dynamic" if you have a dynamic IP. If you don't need any NAT, set NAT to "" to #disable it. #以上改变将会在下一次与IP所关联,但必需是一个不受冲突的地址、路由,如果你不确定>将会使用动态分址,如果你不知道那NAT最好将NAT字义为“dynamic”。 NAT="192.168.1.1" #change this next line so it lists all your network interfaces, including lo在下一次上线时它将监听你所有的静态网络,包括lo中断。 INTERFACES="all" #change this line so that it lists the assigned numbers or symbolic names (from #/etc/services) of all the services that you'd like to provide to the general #public. If you don't want any services enabled, set it to "" #同时在下一次上线时则监听包括动态的/etc/services下的所有服务,如果你不想将所有服务启动于防火墙下,以下选项即给出一个空值"". SERVICES="http ftp smtp ssh rsync" if [ "$1" = "start" ] #如果变量值为1,那将启动它。 then echo "Starting firewall..." #显示一个有效状态 iptables -P INPUT DROP iptables -A INPUT -i ! ${UPLINK} -j ACCEPT iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT #enable public access to certain services 允许公众账户激活服务 for x in ${SERVICES} do iptables -A INPUT -p tcp --dport ${x} -m state --state NEW -j ACCEPT done iptables -A INPUT -p tcp -i ${UPLINK} -j REJECT --reject-with tcp-reset iptables -A INPUT -p udp -i ${UPLINK} -j REJECT --reject-with icmp-port-unreachable #explicitly disable ECN 中断ECN if [ -e /proc/sys/net/ipv4/tcp_ecn ] then echo 0 > /proc/sys/net/ipv4/tcp_ecn fi #disable spoofing on all interfaces 欺骗全部静态 for x in ${INTERFACES} do echo 1 > /proc/sys/net/ipv4/conf/${x}/rp_filter done if [ "$ROUTER" = "yes" ] then #we're a router of some kind, enable IP forwarding 参照主路由相关类型,实现IP传输 echo 1 > /proc/sys/net/ipv4/ip_forward if [ "$NAT" = "dynamic" ] then #dynamic IP address, use masquerading echo "Enabling masquerading (dynamic ip)..." iptables -t nat -A POSTROUTING -o ${UPLINK} -j MASQUERADE elif [ "$NAT" != "" ] then #static IP, use SNAT echo "Enabling SNAT (static ip)..." iptables -t nat -A POSTROUTING -o ${UPLINK} -j SNAT --to ${UPIP}192.168.1.100 fi fi elif [ "$1" = "stop" ] then echo "Stopping firewall..." iptables -F INPUT iptables -P INPUT ACCEPT #turn off NAT/masquerading, if any iptables -t nat -F POSTROUTING fi APM电源管理:(默认情况下,slackware不会自动关闭电源的解决办法) 依然在rc.modules文件中设置,如下: #### APM support ### # APM is a BIOS specification for saving power using several different # techniques. This is mostly useful for battery powered laptops. /sbin/modprobe apm将#号去除。
__________________
邁出沉重的一千步,決不囬頭--[Sven Hedin] 此帖于 05-11-29 19:52 被 LiEn 编辑. |
|
|
|
|
|
|
|
第 47 帖 | |
|
|
标题: X刷新率及辩率设置 前面以经提到,ATI及nVideo显示卡以被内核模块所支持,需要做的只是去更改/etc/xorg.conf文件。以17“CTR显示器为标准设置。
# ********************************************************************** # Monitor section # ********************************************************************** # Any number of monitor sections may be present Section "Monitor" Identifier "My Monitor" # HorizSync is in kHz unless units are specified. # HorizSync may be a comma separated list of discrete values, or a # comma separated list of ranges of values. # NOTE: THE VALUES HERE ARE EXAMPLES ONLY. REFER TO YOUR MONITOR'S # USER MANUAL FOR THE CORRECT NUMBERS. HorizSync 30 - 107 # HorizSync 30-64 # multisync # HorizSync 31.5, 35.2 # multiple fixed sync frequencies # HorizSync 15-25, 30-50 # multiple ranges of sync frequencies # VertRefresh is in Hz unless units are specified. # VertRefresh may be a comma separated list of discrete values, or a # comma separated list of ranges of values. # NOTE: THE VALUES HERE ARE EXAMPLES ONLY. REFER TO YOUR MONITOR'S # USER MANUAL FOR THE CORRECT NUMBERS. VertRefresh 48-120 EndSection 红色部分设置,是以发挥CTR显卡器最大刷新率支持,三星CTR17”显示器可达到以1024x768分辨率下为85Hz刷新率。 # Any number of graphics device sections may be present Section "Device" Identifier "VESA Framebuffer" Driver "ati" #VideoRam 4096 # Insert Clocks lines here if appropriate EndSection 使用ATI显卡设置类型。 # If your card can handle it, a higher default color depth (like 24 or 32) # is highly recommended. # DefaultDepth 8 # DefaultDepth 16 DefaultDepth 24 # DefaultDepth 32 # "1024x768" is also a conservative usable default resolution. If you # have a better monitor, feel free to try resolutions such as # "1152x864", "1280x1024", "1600x1200", and "1800x1400" (or whatever your # card/monitor can produce) Subsection "Display" Depth 8 Modes "1152x864" EndSubsection Subsection "Display" Depth 16 Modes "1152x864" EndSubsection Subsection "Display" Depth 24 Modes "1152x864" EndSubsection Subsection "Display" Depth 32 Modes "1152x864" EndSubsection EndSection 实现以24色1152x864的75Hz时钟频率显示效果设置参数定义。(三星17“CTR显示器为例) 此帖于 05-11-29 03:51 被 LiEn 编辑. |
|
|
|
|
|
|
|
第 48 帖 | |
|
|
标题: 挂载磁盘系统 挂载磁盘文件系统可以参照一下/etc/fstab文件内容:
/dev/sda2 swap swap defaults 0 0 /dev/sda1 / reiserfs defaults 1 1 /dev/sda3 /var reiserfs defaults 1 2 /dev/sda5 /opt reiserfs defaults 1 2 /dev/sda6 /home reiserfs defaults 1 2 /dev/sda7 /tmp reiserfs defaults 1 2 /dev/sda8 /usr reiserfs defaults 1 2 /dev/cdrom /mnt/cdrom auto noauto,user,owner,ro 0 0 /dev/scd0 /mnt/Burn-RW auto noauto,user,owner,rw 0 0 /dev/sda0 /mnt/flashdisk auto noauto,user,owner,rw 0 0 /dev/fd0 /mnt/floppy auto noauto,owner 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 proc /proc proc defaults 0 0 有人可能发现,本人的文件系统结构当中没有/boot分区。因为这是BSD风格的操作系统,当如果你真需要这么做,那么,在对文件系统分区及格式化的时候,你可能只能使用三个文件系统,(注意slackware是Linux,当然可以用Linux的方式来定义它们)即/boot,swap,和根文件/。否则你将会安装失败,Lilo不能写入MBR的0磁道分区。如果你需要专业一些,把其它的如/var、/opt、/usr、/usr/local等单独分出,则不能使用/boot分区。 如果你有一个外置USB接口的刻录机,哪可以把类似红色部分增加到你的文件中。但不一定是scd之类的,这要看你的系统情况,也许是sr0或sg0或1、2、3等等,后面的rw是可写,而ro只读系统,在些之后,你需要到/mnt目录去建一个文件夹,比如我上面的是Burn-RW,哪就建一个Burn-RW目录,让普通用户可以访问外部设备,需在属性中使用user参数。 自动挂载它们。如果你想自动挂载它们,哪在挂载属性参数中把noauto,改成auto即可实现自动挂载。(哪U盘是否可以自动挂载呢,答案是可以,一样的去做就可以啦),上面蓝色部分是U盘挂载字段。 写入/etc/fstab的作用是提供最大的快捷性,则否你可能需要在以根身分去输入一大串命令去Mounst它们,这样做反而使普通用户很难去访问它们。如果你的本地设置全局变量是GB18030,哪就不需要去增加io=936这样的定义。 此帖于 05-11-29 17:26 被 LiEn 编辑. |
|
|
|
|
|
|
|
第 49 帖 | |
|
|
标题: proftpd的配置与使用 proftpd配置在/etc/proftpd.conf文件中。
# This is a basic ProFTPD configuration file. # It establishes a single server and a single anonymous login. # It assumes that you have a user/group "nobody" and "ftp" # for normal/anonymous operation. ServerName "ProFTPD Default Installation" #ServerType standalone ServerType inetd DefaultServer on # Port 21 is the standard FTP port. Port 21 #FTP端口21,默认设置 # Umask 022 is a good standard umask to prevent new dirs and files # from being group and world writable. Umask 022 #屏蔽端口 # To prevent DoS attacks, set the maximum number of child processes # to 30. If you need to allow more than 30 concurrent connections # at once, simply increase this value. Note that this ONLY works # in standalone mode, in inetd mode you should use an inetd server # that allows you to limit maximum number of processes per service # (such as xinetd) MaxInstances 30 #最大联接数,30是默认设置 # Set the user and group that the server normally runs at. User nobody #非匿名用户名 Group nogroup #非匿名用户组 # This next option is required for NIS or NIS+ to work properly: #PersistentPasswd off #NIS支持 SystemLog /var/log/proftpd.log #日志 TransferLog /var/log/xferlog # Normally, we want files to be overwriteable. <Directory /*> AllowOverwrite on </Directory> # A basic anonymous FTP server configuration. # To enable this, remove the user ftp from /etc/ftpusers. <Anonymous ~ftp> RequireValidShell off #允许/屏蔽使用shell命令 User ftp #匿名用户 Group ftp #匿名用户组 # We want clients to be able to login with "anonymous" as well as "ftp" UserAlias anonymous ftp # Limit the maximum number of anonymous logins MaxClients 50 #最大联接数 # We want 'welcome.msg' displayed at login, and '.message' displayed # in each newly chdired directory. DisplayLogin welcome.msg #登录信息 DisplayFirstChdir .message # Limit WRITE everywhere in the anonymous chroot #限止chroot使用 <Limit WRITE> DenyAll </Limit> # An upload directory that allows storing files but not retrieving # or creating directories. # <Directory incoming/*> # <Limit READ> # DenyAll # </Limit> # # <Limit STOR> # AllowAll # </Limit> # </Directory> </Anonymous> |
|
|
|
|
|
|
|
第 50 帖 | |
|
|
标题: 一个tip:用fakeroot打包 大家知道:Slackware打包过程需要root权限(其实几乎所有包管理系统都是如此)。但是我的原则是,以最小权限办事,所以一直考虑是否能不动用root而完成Slackware软件包制作。用过debian的人都知道,Debian的fakeroot就是为此为此目的应运而生的,那么是否可以用在Slackware上,经过试验:答案是肯定的。为了使用fakeroot,需要对一般的Slackbuild稍加改动,最后部分看起来如下:
代码:
fakeroot的包我就不传上来了,因为我手头有的版本已经老了,当前版本是1.5.5,我现在没条件编译。但对此的使用大家放心,我用这个办法打过上百次软件包,都很好。 fakeroot的源码可以从以下地方下载: http://packages.debian.org/unstable/utils/fakeroot |
|
|
|
|
|
|
|
第 51 帖 | |
|
|
用tar解压时出现延时:
bzip2: (stdin) is not a bzip2 file. tar: Child returned status 2 tar: 由于前面延迟的错误而退出 解决方法: 先用 file filename 命令看看文件是什么格式的,然后根据格式而使用不同的参数: 对应 Gzip 文件: tar zxvf <file_name> 对应 Bzip 文件: tar jxvf <file_name> 参考地址: http://south.linuxsir.org/bbs/showthread.php?t=245847
__________________
* Mail/Gtalk: i.feelinglucky[at]gmail.com * My Blog: http://www.gracecode.com * Old homepage: http://slack.linuxsir.org/amdk6/ |
|
|
|
|
|
|
|
第 52 帖 | |
|
|
Slackware 在Sata硬盘下的安装技巧
本来觉得没必要说的,看到很多人都为此问题困惑,恰巧我安装服务器遇到并找到了解决此问题的方法,那就帮大家做个总结吧 Sata硬盘下安装Slackware 唯一的一点区别是在分区的时候,很多主板不会把sata硬盘模拟成ide硬盘而是认成SCSI设备,所以我们分区的时候要这样 fdisk /dev/sda 或sdb,sdc。。。。。 分区完成之后,sata与ide硬盘安装一样,slackware会自动添加你的swap分区及其他分区,需要注意的是slackware 11以下版本(不包括 11)可能默认内核不支持sata,启动的时候要选一下。 若大家分区实在有困难,可以这样试一下:用分区大师等分区软件给Slackware分好区,然后安装的时候跳过分区这一步,正常安装过程中Slackware会自动检测分区并挂载,顺便你也可以看看你的硬盘究竟被认成什么了,呵呵。 |
|
|
|
|
|
|
|
第 53 帖 | |
|
|
proftpd配置中新手容易犯错的一个小问题
使用端口方式判断虚拟ftp服务器或修改默认端口21的时候,一定要在配置文件中用ServerType standalone的方式启动,inetd启动proftpd只能用默认的21端口。 当初我就是反反复复的在这个问题上载了不少跟头 |
|
|
|
|
|
|
|
第 54 帖 | |
|
|
分页显示的时候 ls -l | less,颜色会会消失
可以用ls -l --color |less -r恢复颜色!! 刚刚知道的,呵呵~~
__________________
Lenovo ThinkPad X200 Processor Intel Core 2 Duo Screen 12.1” WXGA Widescreen RAM 3GB HDD 250GB Graphics Intel Graphics Media Accelerator X4500 Network Intel 82567LM Gigabit Ethernet, Intel 5100 802.11abgn , Bluetooth,Camera,Fingerprint 入手X200->slk current ================================= (づ ̄ 3 ̄)づ请多多指教!!共同学习!!(づ ̄ 3 ̄)づ |
|
|
|
|
|
|
|
第 55 帖 | |
|
|
移动硬盘速度问题 by zhoun
用移动硬盘的时候, 发现速度非常慢, 测试了一下, 才几百K的速度, USB2.0, 不可能是这个速度. 搜了一下, 有这篇文章: http://www.linuxsir.org/bbs/thread282961.html 在/etc/hal/fdi/policy目录, 建了一个文件: 95-usb-nosync.fdi 代码:
试了一下, 刚才复制需要十几分钟的文件, 现在只要十几秒就好了.
__________________
Free as in freedom, slack as in Slackware. 欢迎访问 http://slack.linuxsir.org 个人blog:http://blog.tuxfans.com/ RSS:http://feeds.feedburner.com/windroseblog |
|
|
|
|
|
|
|
第 56 帖 | |
|
|
Slackware12**完美解决在utf8下xterm打开非常慢的问题 by murenjian
升级到Slackware12后发现在utf8下xterm打开非常慢。 设置其他 locale后xterm的启动快是快了。但是fcitx又不能在xterm下输入中文了。 1.将LC_CTYPE设为zh_CN.UTF-8的原因是fcitx只能在utf8下xterm才能输入中文。 2.发现utf8下xterm启动狂卡,CPU差不多占100%,大概过个几秒钟xterm才姗姗来迟。这以后cpu也恢复到正常水平。 解决办法:在家目录下.Xdefaults文件里添加一条 XTerm*preeditType: Root 即可!这样打开xterm就会非常快。(可以退出X试一下。或者执行 xrdb -load .Xdefaults 亦可) |
|
|
|
|
|
|
|
第 57 帖 | |
|
|
标题: 网上看到的文本模式下的一键** cat ~/.bash_profile
#---------------------------------------------- #先使用showkey命令找出按键对应的code,比如 #showkey #按下右win,显示126 sudo loadkeys << EOF keycode 126 = F13 string F13 = "startx\n" EOF #这样在init 3下,按右边的win键就直接进入图形界面.当然也可以绑定别的. #---------------------------------------------- 两键的话 keycode 126 = F13 改成 ctrl keycode 126 = F13 就可以用〈ctrl〉+那个键来输入上述命令。
__________________
OS: Arch Linux x86_64 --------------- CPU:AMD Athon X4 640 MB: GIGA-880GM-UD2H RAM:CORSAIR 4Gx2 HD: 80Gx2 此帖于 08-02-20 03:03 被 r00to 编辑. 原因: 打错字了 |
|
|
|
|
|
|
|
第 58 帖 | |
|
|
标题: slackware 12.2配置emacs字体 环境:
os: slackware 12.2 emacs: 22.3.1 目的: 设置emacs使用文泉驿字体,并且适当美化。 步骤: 1.安装文泉驿点阵宋体(安装方法参看其自带的install),注意将字体路径加入xorg.conf那一步不能跳过。 2. $vim ~/.Xdefaults 代码:
说明:我设置的是英文字体大小为14,中文字体大小13。你可以根据你的需求设置。我没有指定英文字体,如果你有需求你可以指定自己的英文字体。效果见附件。
__________________
**************************************** Slackware 13.37 **************************************** |
|
|
|
|
|
|
|
第 59 帖 | |
|
|
握个手啊~
最近开始用 23 了,还是喜欢矢量字体,点阵的看的累。 希望 Emacs 23 快点 release,Pat 快点打包发布 13 ;-)
__________________
Opera, 好快、好用、好玩。 Slackware 12.0, 12.1, 12,2, 13.0, 13.1 -> now 13.37(2.6.37.6) HP nx6330(RQ708PA) T5500 1.66GHz/945PM/2G DDR2 667/320G/ATI Mobility Radeon X1300 64M/14.1/3495ABG current(2.6.35.7): AMD Phenom X3 8650 2.3GHz/ATI 760G/4G/250G/ATI Radeon 3000 |
|
|
|
|
|