1. Download .egg from http://pypi.python.org/pypi/setuptools/ (according your python version)
2. using sh to execute .egg file
個人在學習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年7月16日 星期一
2012年7月12日 星期四
replace new line (\n) using sed
sed ':a;N;$!ba;s/\n/ /g' filereference:
http://stackoverflow.com/questions/1251999/sed-how-can-i-replace-a-newline-n
2012年6月6日 星期三
install OpenLDAP on CentOS6
1. 使用yum安裝openldap-servers(slapd)和openldap-client(ldap)
yum install openldap-servers openldap-clients
2. 編輯or產生/etc/openldap/ldap.conf
vi /etc/openldap/ldap.conf
3. 複製slapd.conf和DB_CONFIG
yum install openldap-servers openldap-clients
2. 編輯or產生/etc/openldap/ldap.conf
vi /etc/openldap/ldap.conf
URI ldap://127.0.0.1 BASE dc=my-domain,dc=com
3. 複製slapd.conf和DB_CONFIG
cp /usr/share/openldap-servers/slapd.conf.obsolete /etc/openldap/slapd.conf
cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG
cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG
4. slappasswd
打上欲設定的ldap server密碼,將最後一行{SSHA}xxxxxxxxx複製起來
5.編輯/etc/openldap/slapd.conf
把裡面的dc=my-domain,dc=com改成自己要的
在rootpw的地方把剛剛複製的{SSHA}xxxxx貼上去
6.建立一root.ldif檔,內容
#root |
dn: dc=my-domain,dc=com |
dc: my-domain |
objectClass: dcObject |
objectClass: organizationalUnit |
ou: my-domain.com |
7. 先把slapd.d裡的資料移除
rm -rf /etc/openldap/slapd.d/*
8. 使用slaptest將slpad.conf轉成slapd.d/
slaptest -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d
9. 改變檔案權限及擁有者
chown -R ldap:ldap /var/lib/ldap
chown -R ldap:ldap /etc/openldap/slapd.d
10.將slapd設為system boot up自動啟動
chkconfig slapd on
11.啟動slapd
service slapd start
12. 登入Webmin的LDAP Users and Groups (config要設好)
LDAP server uses encryption? -> Yes SSL
Bind to LDAP server as -> cn=Manager,dc=my-domain,dc=com
Credential for bind name above -> Set to "ldap server password"
13. Open port 389 TCP in firewall
Reference:
http://jamyy.dyndns.org/blog/2012/01/3506.html
13. Open port 389 TCP in firewall
Reference:
http://jamyy.dyndns.org/blog/2012/01/3506.html
2012年6月4日 星期一
nsupdate出現SERVFAIL
查看/var/log/message,因為權限的問題,所以
chown -R named:named /var/named
or
chown -R named:named /var/named/chroot/var/named
還有SELINUX預設也會擋,要關掉bind的部分 named_write_master_zones
http://en.wikipedia.org/wiki/Nsupdate
http://fedoraproject.org/wiki/SELinux/named
chown -R named:named /var/named
or
chown -R named:named /var/named/chroot/var/named
還有SELINUX預設也會擋,要關掉bind的部分 named_write_master_zones
setsebool -P named_write_master_zones 1
http://en.wikipedia.org/wiki/Nsupdate
http://fedoraproject.org/wiki/SELinux/named
2012年4月11日 星期三
yum repo setting
若出現cannot find a valid baseurl for repo的訊息
請編輯/etc/yum.repo.d/裡面的.repo檔案
把baseurl前面的#去掉
請編輯/etc/yum.repo.d/裡面的.repo檔案
把baseurl前面的#去掉
2012年4月10日 星期二
ntlmaps
1. Download ntlmaps
http://ntlmaps.sourceforge.net/
2. extract
tar xvfz ntlmaps-0.9.9.0.1.tar.gz -C /usr/local/bin
3. create soft symbolic link
ln -s /usr/local/bin/ntlmaps-0.9.9.0.1 /usr/local/bin/ntlmaps
4. Edit server.cfg
vi /usr/local/bin/ntlmaps/server.cfg
5. Run!
/usr/local/bin/ntlmaps/main.py -c /usr/local/bin/ntlmaps/server.cfg
6. Optional: Add run command into /etc/rc.local
Reference:
[1]
http://ntlmaps.sourceforge.net/
2. extract
tar xvfz ntlmaps-0.9.9.0.1.tar.gz -C /usr/local/bin
3. create soft symbolic link
ln -s /usr/local/bin/ntlmaps-0.9.9.0.1 /usr/local/bin/ntlmaps
4. Edit server.cfg
vi /usr/local/bin/ntlmaps/server.cfg
5. Run!
/usr/local/bin/ntlmaps/main.py -c /usr/local/bin/ntlmaps/server.cfg
6. Optional: Add run command into /etc/rc.local
Reference:
[1]
訂閱:
文章 (Atom)