我对电子产品向来没什么抵抗力. 今天败了htc p4550和sony prs 505. 等货到手这段时间是最心焦的. p4550还好, 是天津过来的. 505得从美国过来. 估计得个10天半月
我等 我等
我对电子产品向来没什么抵抗力. 今天败了htc p4550和sony prs 505. 等货到手这段时间是最心焦的. p4550还好, 是天津过来的. 505得从美国过来. 估计得个10天半月
我等 我等
安装步骤基本和Ubuntu下差不多, 只不过需要多装一个pam_userdb, 我是yum装的 yum install db4-utils
ubuntu下参考之前的文章: http://blog.bigcomic.com/post/241.html
有一点不同的是ubuntu下的pam日志在 /var/log/auth.log. 而centos5.2是在 /var/log/secure
EOF
NRPE
NRPE is an addon that allows you to execute plugins on remote Linux/Unix hosts. This is useful if you need to monitor local resources/attributes like disk usage, CPU load, memory usage, etc. on a remote host. Similiar functionality can be accomplished by using the check_by_ssh plugin, although it can impose a higher CPU load on the monitoring machine - especially if you are monitoring hundreds or thousands of hosts.
NSCA
NSCA is an addon that allows you to send passive check results from remote Linux/Unix hosts to the Nagios daemon running on the monitoring server. This is very useful in distributed and redundant/failover monitoring setups.
NSClient++
Monitoring private services or attributes of a Windows machine requires that you install an agent on it. This agent acts as a proxy between the Nagios plugin that does the monitoring and the actual service or attribute of the Windows machine. Without installing an agent on the Windows box, Nagios would be unable to monitor private services or attributes of the Windows box.
NDOUtils
NDOUtils is an addon that allows you to store all status information from Nagios in a MySQL database. Multiple instances of Nagios can all store their information in a central database for centralized reporting. This will likely serve as the basis for a new PHP-based web interface for Nagios in the future.

整天在电脑前工作却很少有时间去看新闻, 搞到不闻不问天下事. 久而久之孤陋寡闻. 拥有最先进的新闻渠道, 却也是什么都不知道.
Vista推出一个很有意思的东西Sidebar. 可以在桌面显示一些小工具.
这周计划制作一个工具, 可以显示当前最热门的关键词.
参考地址:
http://msdn.microsoft.com/en-us/library/aa974179.aspx#rightui
http://msdn.microsoft.com/en-us/library/bb456468(VS.85).aspx#_sidebar_basic_example
EOF
| 色彩数 | 640 X 480 | 800X600 | 1024X768 | 1280X1024 |
| 256 | 0x301 | 0x303 | 0x305 | 0x307 |
| 32k | 0x310 | 0x313 | 0x316 | 0x319 |
| 64k | 0x311 | 0x314 | 0x317 | 0x31A |
| 16M | 0x312 | 0x315 | 0x318 | 0x31B |
过滤器组合:
Q(id__ge=10),Q(pid__ge=10) (id > 10) AND (pid > 10)
Q(id__ge=10)|Q(pid__ge=10) (id > 10) OR (pid > 10)
条件搜索:
order_by() 排序
distinct() 消除重复结果
id__gt=10 id > 10
id__gte=10 id >= 10
id__lt=10 id < 10
id__lte=10 id <= 10
id__startswith='xx' id like 'xx%'
id__istartswith='xx' id ILIKE 'xx%'
id__endswith='xx' id LIKE '%xx'
id__iendswith='xx' id ILIKE '%xx'
id__exact='xx' id LIKE 'xx'
id__iexact='xx' id ILIKE 'xx'
id__contains='xx' id LIKE '%xx%'
id__icontains='xx' id ILIKE '%xx%'
id__in=[1, 3, 4] id IN (1, 3, 4)
id__exact=14 id = 14
id__exact=None id IS NULL
id__isnull=Ture id IS NULL
start_date = datetime.date(2005, 1, 1)
end_date = datetime.date(2005, 3, 31)
id__range=(start_date, end_date) id BETWEEN '2005-01-01' and '2005-03-31';
id__year=2009 EXTRACT('year' FROM id) = '2009'
id__iregex=r'^(an?|the) +' id REGEXP '^(an?|the) +'
返回结果数量限制:
Entry.objects.all()[:5] LIMIT 5
Entry.objects.all()[5:10] OFFSET 5 LIMIT 5
Entry.objects.all()[:10:2] step 2
Entry.objects.order_by('headline')[0] LIMIT 1
数据操作:
.delete() 删除
.save() 更新
.count() 结果数量
容错处理:
from django.core.exceptions import ObjectDoesNotExist
try:
e = Entry.objects.get(id=3)
except ObjectDoesNotExist:
print "Either the entry doesn't exist."
try:
obj = Person.objects.get(first_name='John', last_name='Lennon')
except Person.DoesNotExist:
obj = Person(first_name='John', last_name='Lennon', birthday=date(1940, 10, 9))
obj.save()
mysql
# tar zxvf mysql-5.1.30.tar.gz
# cd mysql-5.1.30
# ./configure --prefix=/usr/local/mysql --enable-thread-safe --enable-assembler --enable-shared --with-charset=utf8 --with-
collation=utf8_general_ci --with-mysqld-ldflags=-all-static --without-debug
# make && make install
# cp /usr/src/mysql-5.1.30/support-files/mysql.server /etc/rc.d/init.d/mysqld
# chmod 755 /etc/rc.d/init.d/mysqld
# chkconfig --add mysqld
# chkconfig --level 345 mysqld on
# cp support-files/my-medium.cnf /etc/my.cnf
# vi /etc/my.cnf
- skip-federated
+ #skip-federated
# ./scripts/mysql_install_db
# cd /usr/local
# groupadd database
# adduser mysql -G database
# vi /etc/passwd
- mysql:x:500:501::/home/mysql:/bin/bash
+ mysql:x:500:501::/home/mysql:/sbin/nologin
# chmod 750 mysql -R
# chgrp database mysql -R
# chown mysql mysql/var -R
# ln -s /usr/local/mysql/bin/mysql /sbin/mysql
# ln -s /usr/local/mysql/bin/mysqladmin /sbin/mysqladmin
# ln -s /usr/local/mysql/bin/mysql_config /sbin/mysql_config
# service mysqld start
Python
# tar zxvf Python-2.5.2.tgz
# cd Python-2.5.2
# ./configure --prefix=/usr/local/python
# make && make install
# ln -s /usr/local/python/bin/python /usr/bin/python
# ln -s /usr/local/python/lib/python2.5 /usr/lib/python2.5
MySQL-python
# tar zxvf MySQL-python-1.2.2.tar.gz
# cd MySQL-python-1.2.2
# python setup.py install
# ln -s /usr/local/mysql/lib/mysql/libmysqlclient_r.so.16 /usr/lib/libmysqlclient_r.so.16
# python
>>> import MySQLdb /检验mysql-python安装是否正确
Django
# tar xzvf Django-1.0.2-final.tar.gz
# cd Django-1.0.2-final
# python setup.py install
pcre
# tar zxvf pcre-7.8.tar.gz
# cd pcre-7.8
# ./configure
# make && make install
lighttpd
# tar xzvf lighttpd-1.4.20.tar.gz
# cd lighttpd-1.4.20
# ./configure --prefix=/usr/local/lighttpd --disable-ipv6 --with-linux-aio --without-bzip2
# make && make install
# mkdir /usr/local/lighttpd/conf
# mkdir /usr/local/lighttpd/logs
# cp doc/lighttpd.conf /usr/local/lighttpd/conf/
# vi /usr/local/lighttpd/conf/lighttpd.conf
@ server.document-root
@ server.errorlog
@ index-file.names
@ accesslog.filename
# cp doc/rc.lighttpd.redhat /etc/rc.d/init.d/lighttpd
# chmod 755 /etc/rc.d/init.d/lighttpd
# vi /etc/rc.d/init.d/lighttpd
- LIGHTTPD_CONF_PATH="/etc/lighttpd/lighttpd.conf"
+ LIGHTTPD_CONF_PATH="/usr/local/lighttpd/conf/lighttpd.conf"
# chkconfig --add lighttpd
# chkconfig --level 345 lighttpd on
python-flup
# tar zxvf flup-1.0.1.tar.gz
# cd flup-1.0.1
# python ez_setup.py
# python setup.py install
#
# vi settings.py
+ FORCE_SCRIPT_NAME = ""
# vi /usr/local/lighttpd/conf/lighttpd.conf
- # mod_rewrite
+ mod_rewrite
- # mod_fastcgi
+ mod_fastcgi
+ fastcgi.server = ( "/mysite.fcgi" =>
+ ( "main" =>
+ ( "socket" => "/tmp/fcgi.sock",
+ "check-local" => "disable",
+ )
+ )
+ )
+ url.rewrite = (
+ "^(/media.*)$" => "$1",
+ "^(/.*)$" => "/mysite.fcgi$1",
+ )
# service lighttpd restart
#server.document-root = "/home/radio/htdocs/"
server.document-root = "/home/radio/workspace/pywork/bigcomic/"
"^(/media.*)$" => "$1",
"^(/.*)$" => "/mysite.fcgi$1"
下载subversion-1.5.0.tar和subversion-deps-1.5.0.tar
# tar xvf subversion-1.5.0.tar
# tar xvf subversion-deps-1.5.0.tar //会解到一个subversion-1.5.0目录下
# cd subversion-1.5.0
# ./configure -prefix=/usr/local/svn
# make
# make install
# mkdir /home/svndata //建立项目的存储库
# vi svn_service
#!/bin/sh
#
# chkconfig: - 91 35
# description: Starts and stops the Subversion service
# subversion options
OPTIONS="-d -r /home/svndata"
prog=_subversion
RETVAL=0
_subversion=/usr/bin/svnserve
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
start() {
KIND="SubVersion"
echo -n $"Starting $KIND services: "
daemon $_subversion $OPTIONS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/subversion || \
RETVAL=1
return $RETVAL
}
stop() {
KIND="SubVersion"
echo -n $"Shutting down $KIND services: "
killproc $_subversion
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/subversion
echo ""
return $RETVAL
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
restart
;;
status)
status $dc_server
RETVAL=$?
;;
condrestart)
[ -f /var/lock/subsys/subversion ] && restart || :
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status|condrestart}"
exit 1
esac
exit $?
# chmod 755 svn_service
# cp svn_service /etc/rc.d/init.d/svn
# chkconfig --add svn
# chkconfig --level 345 svn on
# netstat -an|grep 3690 //查看svn的端口是否已经开启,没记错的话应该就是3690端口
可以使用绿毛龟(svn客户端)来查看项目情况,使用svn://ip:port/test来查看项目源码
配置
#cd /home/svndata/test/conf
#vi authz
[groups]对组进行配置
# harry_and_sally = harry,sally
# [/foo/bar]按目录进行用户读写配置
# harry = rw
# * =
[repository:/test]对svn库的路径进行配置
# @harry_and_sally = rw
# * = r
radio=rw
pencat=rw
koala=rw
soul=rw
#vi passwd
[users]
# harry = harryssecret
# sally = sallyssecret
radio=123456
都是明文的
#vi svnserv.conf
password-db = passwd将这行的注释去掉,就会要求用户验证
svn换端口
#./svnserve --help 可以看到命令,里面有个参数--listen-port
不过我没有使用过
因为ssl关系出现认证失败的解决办法
1、停掉ssl
2、# authz-db = authz这行的#保留
#去掉#[general]前面的#号
[general]
#匿名访问的权限,可以是read,write,none,默认为read
anon-access = none
#认证用户的权限,可以是read,write,none,默认为write
auth-access = write
#密码数据库的路径,去掉前面的#
password-db = passwd