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是处理之前打印出命令,适合调试或者欣赏观看用
昨天到今天,一直有个sql语句让我很郁闷
一个查询语句怎么会多做事一个列呢?
在前后加上单引号,选出的数据是 categoryid=0的,更加郁闷了,明显不应该~~
虽然人老了,可脑子还没有退化到写错sql的地步
今天发现了问题,做url地址时href="xxx?id=808"
点击后发现地址栏不对,=和808之间有空格
估计是特殊字符,urlencode结果是 “%EF%BB%BF808”
前面真的是特殊字符!
这个文本是从excel复制的,问题出现在此
从excel复制文本的童鞋要注意了。。。以此为戒。。 再复制一次即可
把这个文本再复制,粘贴到另外一个文本,就正常了。
#1054 - Unknown column '808' in 'where clause'
SELECT max( ma.magid ) magid
FROM aslibra.z_magazine ma
LEFT JOIN test.mag m ON m.id = ma.magid
WHERE ma.categoryid = 808
AND m.pub = '1'
GROUP BY ma.categoryid
LIMIT 0 , 30
SELECT max( ma.magid ) magid
FROM aslibra.z_magazine ma
LEFT JOIN test.mag m ON m.id = ma.magid
WHERE ma.categoryid = 808
AND m.pub = '1'
GROUP BY ma.categoryid
LIMIT 0 , 30
一个查询语句怎么会多做事一个列呢?
在前后加上单引号,选出的数据是 categoryid=0的,更加郁闷了,明显不应该~~
虽然人老了,可脑子还没有退化到写错sql的地步
今天发现了问题,做url地址时href="xxx?id=808"
点击后发现地址栏不对,=和808之间有空格
估计是特殊字符,urlencode结果是 “%EF%BB%BF808”
前面真的是特殊字符!
这个文本是从excel复制的,问题出现在此
从excel复制文本的童鞋要注意了。。。以此为戒。。 再复制一次即可
把这个文本再复制,粘贴到另外一个文本,就正常了。
最近上传图片和发表内容比较多的文章都会出现500的错误提示。
php程序在第一句exit也出错,看来问题不是出现在php,而是nginx
看看nginx的错误日志
这个是出错的地方,显然是读写缓存的问题,大的请求需要临时目录的读写。
权限修改了也没有用,很奇怪,加了如下几个定义就好了,可以参考:
php程序在第一句exit也出错,看来问题不是出现在php,而是nginx
看看nginx的错误日志
2011/02/10 21:14:00 [crit] 9504#0: *204 open() "/Data/apps/nginx/fastcgi_temp/6/02/0000000026" failed (13: Permission denied) while reading upstream, client: 67.195.115.28, server: aslibra.com, request: "GET /blog/ HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "www.aslibra.com"
2011/02/10 21:14:27 [crit] 9504#0: *216 open() "/Data/apps/nginx/fastcgi_temp/7/02/0000000027" failed (13: Permission denied) while reading upstream, client: 202.160.179.48, server: aslibra.com, request: "GET /blog/go.php/page/1/199/ HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "www.aslibra.com"
2011/02/10 21:22:44 [crit] 9504#0: *408 open() "/Data/apps/nginx/fastcgi_temp/8/02/0000000028" failed (13: Permission denied) while reading upstream, client: 67.195.115.28, server: aslibra.com, request: "GET /blog/read.php/1114.htm HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "www.aslibra.com"
2011/02/10 21:25:06 [crit] 9504#0: *477 open() "/Data/apps/nginx/fastcgi_temp/9/02/0000000029" failed (13: Permission denied) while reading upstream, client: 218.213.130.180, server: aslibra.com, request: "GET /blog/go.php/page/1/2/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.aslibra.com"
2011/02/10 21:14:27 [crit] 9504#0: *216 open() "/Data/apps/nginx/fastcgi_temp/7/02/0000000027" failed (13: Permission denied) while reading upstream, client: 202.160.179.48, server: aslibra.com, request: "GET /blog/go.php/page/1/199/ HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "www.aslibra.com"
2011/02/10 21:22:44 [crit] 9504#0: *408 open() "/Data/apps/nginx/fastcgi_temp/8/02/0000000028" failed (13: Permission denied) while reading upstream, client: 67.195.115.28, server: aslibra.com, request: "GET /blog/read.php/1114.htm HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "www.aslibra.com"
2011/02/10 21:25:06 [crit] 9504#0: *477 open() "/Data/apps/nginx/fastcgi_temp/9/02/0000000029" failed (13: Permission denied) while reading upstream, client: 218.213.130.180, server: aslibra.com, request: "GET /blog/go.php/page/1/2/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.aslibra.com"
这个是出错的地方,显然是读写缓存的问题,大的请求需要临时目录的读写。
权限修改了也没有用,很奇怪,加了如下几个定义就好了,可以参考:
题记:如果您刚看到此文,相信一定不想错过怎么将Ubuntu安装进U盘、LAMP网站开发环境搭建这两篇文章。由了以上两篇文章,即便是从零起步,也可以用Ubuntu做些什么了。在这篇文章里,我将列举一些,Ubuntu平台必备工具软件。
apache的配置参考
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /codeigniter
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|robots\.txt|css)
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
RewriteEngine On
RewriteBase /codeigniter
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|robots\.txt|css)
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
在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了






