摘要:
1 import glob 2 print glob.glob("/tmp/*.py")
阅读全文
posted @ 2013-01-19 15:59
baoyiluo
阅读(246)
推荐(0)
摘要:
经常需要把一些脚本打包到rpm包中去,安装rpm后能把脚本复制到指定位置。这个东西写完就忘了,在这里记一下在rhel5里SPECS和SOURCES目录在/usr/src/redhat/下,rhel6里需要自己创建。yum -y install rpm-buildmkdir -p /root/rpmbuilder/{SPECS,SOURCES}把源码包放到SOURCES目录里,在SPECS里建立一个.spec文件。例如:Name: hpcwebVersion: 1.0Release: 1Summary:this is a hpcweb test rpm! ...
阅读全文
posted @ 2013-01-18 11:28
baoyiluo
阅读(459)
推荐(0)
摘要:
最简单的办法就是删除usb模块,或者可以用udev策略来实现插入U盘不相应事件。禁用:mv /lib/modules/`uname -r`/kernel/drivers/usb/storage/usb-storage.ko /lib/modules/`uname -r`/kernel/drivers/usb/storage/usb-storage.ko.bakreboot开启mv /lib/modules/`uname -r`/kernel/drivers/usb/storage/usb-storage.ko.bak /lib/modules/`uname -r`/kernel/drivers
阅读全文
posted @ 2013-01-17 14:53
baoyiluo
阅读(4023)
推荐(0)
摘要:
rsync -av test/ 192.168.8.1:/root/ 当网络中断后在获取链接可继续复制
阅读全文
posted @ 2013-01-17 11:15
baoyiluo
阅读(152)
推荐(0)
摘要:
1 import pexpect 2 newpasswd = 'www.baoyiluo.com' 3 oldpasswd = 'www.longgeek.com' 4 child = pexpect.spawn('passwd') 5 child.expect('(current).*:') 6 print 'old over' 7 child.sendline(oldpasswd) 8 child.expect('New password.*:') 9 child.sendline(newpas
阅读全文
posted @ 2013-01-17 11:09
baoyiluo
阅读(415)
推荐(0)
摘要:
djangobookIf you get a UnicodeEncodeErrorIf you're taking advantage of the internationalization features of Django (seeInternationalization) and you intend to allow users to upload files, you mustensure that the environment used to start Apache is configured to acceptnon-ASCII file names. If you
阅读全文
posted @ 2013-01-16 16:51
baoyiluo
阅读(353)
推荐(0)
摘要:
echo password|passwd --stdin username其中password为修改后的用户密码username为修改的用户名
阅读全文
posted @ 2013-01-16 15:45
baoyiluo
阅读(397)
推荐(0)
摘要:
打开/etc/vimrc 添加如下内容:set nu显示行号 set et sta sw=4 sts=4 设置tab键等于4个空格:%s/ *$//gc vim开放中替换行未空格为空
阅读全文
posted @ 2013-01-16 15:39
baoyiluo
阅读(382)
推荐(0)
摘要:
<VirtualHost *:80>DocumentRoot "/var/www/ieecas/ieecas"ServerName www.blog.com 虚拟主机域名<Location "/">SetHandler python-programPythonHandler django.core.handlers.modpythonSetEnv DJANGO_SETTINGS_MODULE ieecas.settings#PythonOption django.root /PythonDebug OnPythonPath &qu
阅读全文
posted @ 2013-01-16 13:27
baoyiluo
阅读(222)
推荐(0)
摘要:
1.安装apache服务:yum -y install httpd*2.安装php: yum -y install php*3.修改apache的配置文件:/etc/httpd/conf/httpd.conf在相应位置添加如下:AddType application/x-httpd-php .phpLoadModule php5_module modules/libphp5.soDirectoryIndex一行末尾添加 index.php重启apache。4.在/var/www/html/下建立info.php文件,内容如下:<?phpphpinfo();?>用于检测apache上
阅读全文
posted @ 2013-01-16 12:22
baoyiluo
阅读(296)
推荐(1)