在这里仅保留了计划任务,网络,ssh以及日志
适用redhat和centos
chkconfig --list | grep 3:on | \
grep -v "crond\|network\|sshd\|syslog" | \
awk '{print "chkconfig " $1 " off"}' | sh
grep -v "crond\|network\|sshd\|syslog" | \
awk '{print "chkconfig " $1 " off"}' | sh
适用redhat和centos
Linux内核漏洞最近几乎是一月一爆,在8月15号才爆了一个几乎通杀所有版本所有内核所有架构的内核漏洞;通杀内核2.6 < 2.6.19的所有32位Linux。
redhat已经发布补丁 RHSA-2009:1223 – Security Advisory
rhel4打到2.6.9-89.0.9内核就没事了,RHEL5没时间验证,基本上yum升级一下可以解决问题。
##########################
iptables的output链对UDP包做了限制会导致无法成功提权
跟一下这个程序:
redhat已经发布补丁 RHSA-2009:1223 – Security Advisory
rhel4打到2.6.9-89.0.9内核就没事了,RHEL5没时间验证,基本上yum升级一下可以解决问题。
##########################
iptables的output链对UDP包做了限制会导致无法成功提权
跟一下这个程序:
脚本示例:
使用shell批量删除10天内没访问过的文件
find命令有一个参数可以避免特殊字符对后面执行的命令产生影响
命令变成这样:
一般来说不会有什么问题,但如果每个文件路径都特别深,那么会导致参数很多,命令行很长。
比如会看到如下提示:
那可以让xargs一次处理一条试试:
-l1是一次处理一个
-t是处理之前打印出命令,适合调试或者欣赏观看用
find . -type f -atime +10 | xargs rm -f
使用shell批量删除10天内没访问过的文件
find命令有一个参数可以避免特殊字符对后面执行的命令产生影响
-print0
True; print the full file name on the standard output, followed by a null character (instead of the new-
line character that ‘-print’ uses). This allows file names that contain newlines or other types of
white space to be correctly interpreted by programs that process the find output. This option corre-
sponds to the ‘-0’ option of xargs.
True; print the full file name on the standard output, followed by a null character (instead of the new-
line character that ‘-print’ uses). This allows file names that contain newlines or other types of
white space to be correctly interpreted by programs that process the find output. This option corre-
sponds to the ‘-0’ option of xargs.
命令变成这样:
find . -type f -atime +10 -print0 | xargs -0 rm -f
一般来说不会有什么问题,但如果每个文件路径都特别深,那么会导致参数很多,命令行很长。
比如会看到如下提示:
xargs: argument line too long
那可以让xargs一次处理一条试试:
find . -type f -atime +10 -print0 | xargs -0 -l1 -t rm -f
-l1是一次处理一个
-t是处理之前打印出命令,适合调试或者欣赏观看用
题记:如果您刚看到此文,相信一定不想错过怎么将Ubuntu安装进U盘、LAMP网站开发环境搭建这两篇文章。由了以上两篇文章,即便是从零起步,也可以用Ubuntu做些什么了。在这篇文章里,我将列举一些,Ubuntu平台必备工具软件。
在xp和ubuntu的双系统用grub启动引导,可能默认是ubuntu,如果xp用的多,可以改为默认xp启动
下次启动就默认进入xp了
#编辑此文件改变默认次序
root@lhq-laptop:/home/lhq# gedit /etc/default/grub
#gedit里改为 GRUB_DEFAULT=5
#视你自己情况而定,xp位于第几个,N-1
#更新grub
root@lhq-laptop:/home/lhq# update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.35-23-generic
Found initrd image: /boot/initrd.img-2.6.35-23-generic
Found linux image: /boot/vmlinuz-2.6.32-26-generic
Found initrd image: /boot/initrd.img-2.6.32-26-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Microsoft Windows XP Professional on /dev/sda1
done
root@lhq-laptop:/home/lhq# gedit /etc/default/grub
#gedit里改为 GRUB_DEFAULT=5
#视你自己情况而定,xp位于第几个,N-1
#更新grub
root@lhq-laptop:/home/lhq# update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.35-23-generic
Found initrd image: /boot/initrd.img-2.6.35-23-generic
Found linux image: /boot/vmlinuz-2.6.32-26-generic
Found initrd image: /boot/initrd.img-2.6.32-26-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Microsoft Windows XP Professional on /dev/sda1
done
下次启动就默认进入xp了
安装:
配置:
复制别的机器的配置可能会出错,如果可以,还是从默认配置文件修改为好
yum install net-snmp
配置:
引用
1、基本配置
其实配制一个snmpd.conf文件不算太难,
(1)首选是定义一个共同体名(community),这里是public,及可以访问这个public的用户名(sec name),这里是notConfigUser。Public相当于用户notConfigUser的密码:)
# sec.name source community
com2sec notConfigUser default public
(2)定义一个组名(groupName)这里是notConfigGroup,及组的安全级别,把notConfigGroup这个用户加到这个组中。
groupName securityModel securityName
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
(3)定义一个可操作的范围(view)名, 这里是all,范围是 .1
# name incl/excl subtree mask(optional)
view all included .1
(4)定义notConfigUser这个组在all这个view范围内可做的操作,这时定义了notConfigUser组的成员可对.1这个范围做只读操作。
# group context sec.model sec.level prefix read write notif
access notConfigGroup "" any noauth exact all none none
其实配制一个snmpd.conf文件不算太难,
(1)首选是定义一个共同体名(community),这里是public,及可以访问这个public的用户名(sec name),这里是notConfigUser。Public相当于用户notConfigUser的密码:)
# sec.name source community
com2sec notConfigUser default public
(2)定义一个组名(groupName)这里是notConfigGroup,及组的安全级别,把notConfigGroup这个用户加到这个组中。
groupName securityModel securityName
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
(3)定义一个可操作的范围(view)名, 这里是all,范围是 .1
# name incl/excl subtree mask(optional)
view all included .1
(4)定义notConfigUser这个组在all这个view范围内可做的操作,这时定义了notConfigUser组的成员可对.1这个范围做只读操作。
# group context sec.model sec.level prefix read write notif
access notConfigGroup "" any noauth exact all none none
复制别的机器的配置可能会出错,如果可以,还是从默认配置文件修改为好
参考以下做法吧,可用
引用
sudo add-apt-repository ppa:happyaron/ppa
sudo apt-get update
sudo apt-get install openfetion
通过上述三步,轻松安装最新版Openfetion,若点击图标迟迟没反应,请在终端中运行: sudo ldconfig
sudo apt-get update
sudo apt-get install openfetion
通过上述三步,轻松安装最新版Openfetion,若点击图标迟迟没反应,请在终端中运行: sudo ldconfig






