1. Download setuptools, (setuptools-0.6c11.win32-py2.7.exe)
http://pypi.python.org/pypi/setuptools
2. Add C:\Python27\Scripts in PATH variable
3. Install compiler
http://www.microsoft.com/express/Downloads/#2008-Visual-CPP
3. try using easy_install to install some stuff
個人在學習Linux過程當中的個人筆記,提供個人及有需要的人查閱,若有錯誤歡迎提供指正,謝謝。 This Blog recorded notes about my learning Linux and provides myself and others reference. If there are any incorrect information, welcome to leave a message to correct me, Thanks.
2012年2月28日 星期二
2012年2月9日 星期四
讓Linux可以解析到WINS下的機器
1. 在/etc/samba/smb.conf新增
[global]
wins server = ip
2. 更改/etc/nsswitch.conf 的hosts解析方式增加wins
hosts: wins dns files
參考資料:
https://bbs.et8.net/bbs/showthread.php?t=885180
[global]
wins server = ip
2. 更改/etc/nsswitch.conf 的hosts解析方式增加wins
hosts: wins dns files
參考資料:
https://bbs.et8.net/bbs/showthread.php?t=885180
2012年2月7日 星期二
Install freeradius2 on CentOS
1. using yum install freeradius2 and freeradius2-utils (CentOS 5.X)
#yum install freeradius2 freeradius2-utils
CentOS 6.X:
package name is freeradius and freeradius-utils
2. start radiusd with debug mode
#radiusd -X
or, start radiusd service
#service radiusd start
3. add a user. add following line at the top of /etc/raddb/users
4. add a accept client rule in /etc/raddb/client.conf:
client 192.168.0.0/24 {
secret = testing123
shortname = private-network
}
5. restart the radiusd
#service radiusd restart
6. try the user testing is acceptable
(If show Access-Accept, It success.
If show "radclient:: Failed to find IP address for XXX", That mean radclient can't resolve XXX, add a line to /etc/hosts likes "127.0.0.1 XXX" or setup DNS correctly)
7. try the user testing from remote client
reference:
http://freeradius.org/doc/
http://tec1021.pixnet.net/blog/post/28639573-%E8%BC%95%E9%AC%86%E6%9E%B6%E5%A5%BDradius%E4%BC%BA%E6%9C%8D%E5%99%A8~
#yum install freeradius2 freeradius2-utils
CentOS 6.X:
package name is freeradius and freeradius-utils
2. start radiusd with debug mode
#radiusd -X
or, start radiusd service
#service radiusd start
3. add a user. add following line at the top of /etc/raddb/users
testing Cleartext-Password := "password"
4. add a accept client rule in /etc/raddb/client.conf:
client 192.168.0.0/24 {
secret = testing123
shortname = private-network
}
5. restart the radiusd
#service radiusd restart
6. try the user testing is acceptable
$ radtest testing password 127.0.0.1 0 testing123
(If show Access-Accept, It success.
If show "radclient:: Failed to find IP address for XXX", That mean radclient can't resolve XXX, add a line to /etc/hosts likes "127.0.0.1 XXX" or setup DNS correctly)
7. try the user testing from remote client
$ radtest testing password 192.168.1.1 0 testing123
reference:
http://freeradius.org/doc/
http://tec1021.pixnet.net/blog/post/28639573-%E8%BC%95%E9%AC%86%E6%9E%B6%E5%A5%BDradius%E4%BC%BA%E6%9C%8D%E5%99%A8~
2012年1月6日 星期五
Install Celery on CentOS6
1. insall epel (ref-link)
2. install erlang
#yum install erlang
3. install rabbitmq
a. download rabbitmq rpm (link)
b. install:
#rpm -Uvh rabbitmq-xxxx.rpm
c. let rabbitmq daemon auto-start on boot up:
#chkconfig rabbitmq-server on
d. start rabbitmq server:
#service rabbitmq-server start
4. install Celery
#easy_install Celery
5. install django-celery
#easy_install django-celery
6. setting up django-celery on project (link)
2. install erlang
#yum install erlang
3. install rabbitmq
a. download rabbitmq rpm (link)
b. install:
#rpm -Uvh rabbitmq-xxxx.rpm
c. let rabbitmq daemon auto-start on boot up:
#chkconfig rabbitmq-server on
d. start rabbitmq server:
#service rabbitmq-server start
4. install Celery
#easy_install Celery
5. install django-celery
#easy_install django-celery
6. setting up django-celery on project (link)
2011年12月29日 星期四
using mod_wsgi deploy django project
1. install httpd-devel, python-devel
# yum install htppd-devel, python-devel
2. install mod_wsgi
a. Download mod_wsgi source code. modwsgi
b. untar & using ./configure; make; make install
3. edit /etc/httpd/conf/httpd.conf
LoadModule wsgi_module modules/mod_wsgi.so
WSGIScriptAlias /mysite /usr/local/www/mysite/apache/django.wsgi
4. Create django project
#cd /usr/local/www
#django-admin.py startproject mysite
5. create apache folder
# cd /usr/loca/www/mysite
# mkdir apache
6. Create django.wsgi file in apache folder, the content is:
7. restart httpd
8. open brower and open link: http://localhost/mysite
Reference:
http://code.google.com/p/modwsgi/wiki/QuickInstallationGuide
http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide
https://docs.djangoproject.com/en/1.3/howto/deployment/modwsgi/
# yum install htppd-devel, python-devel
2. install mod_wsgi
a. Download mod_wsgi source code. modwsgi
b. untar & using ./configure; make; make install
3. edit /etc/httpd/conf/httpd.conf
LoadModule wsgi_module modules/mod_wsgi.so
WSGIScriptAlias /mysite /usr/local/www/mysite/apache/django.wsgi
4. Create django project
#cd /usr/local/www
#django-admin.py startproject mysite
5. create apache folder
# cd /usr/loca/www/mysite
# mkdir apache
6. Create django.wsgi file in apache folder, the content is:
import os
import sys
path = '/usr/local/www'
if path not in sys.path:
sys.path.append(path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
7. restart httpd
8. open brower and open link: http://localhost/mysite
Reference:
http://code.google.com/p/modwsgi/wiki/QuickInstallationGuide
http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide
https://docs.djangoproject.com/en/1.3/howto/deployment/modwsgi/
2011年12月22日 星期四
python with statement
python 2.5支援with statement,用法像這樣,以open file為例:
若自定class implement __enter__(self)和__exit__(self, type, value, traceback)也能利用with statement來簡化
參考資料:
http://effbot.org/zone/python-with-statement.htm
http://effbot.org/pyref/with.htm
printf("xxxx");
with open("x.txt") as f:
data = f.read()
do something with data
因為file object已經有了__enter__()和__exit__()這兩個method,利用with statement就能自動達到像是try-except-finally的程式流程若自定class implement __enter__(self)和__exit__(self, type, value, traceback)也能利用with statement來簡化
參考資料:
http://effbot.org/zone/python-with-statement.htm
http://effbot.org/pyref/with.htm
2011年12月21日 星期三
解決yum update perl conflict問題
若yum update perl發生
conflicts with file from package perl.x.x.x
用rpm -e移除perl.i386 (若妳的CentOS是x64)
rpm -e perl.i386
在執行yum update perl應該就不會發生conflicts了
參考資料:
http://slash4.de/tutorials/CentOS_5.4_perl_update_problem
conflicts with file from package perl.x.x.x
用rpm -e移除perl.i386 (若妳的CentOS是x64)
rpm -e perl.i386
在執行yum update perl應該就不會發生conflicts了
參考資料:
http://slash4.de/tutorials/CentOS_5.4_perl_update_problem
訂閱:
文章 (Atom)