Dec. 7, 2019, 3:28 p.m. by lufy, 0 comment(s)
Catch multiple exceptions in one line: >>> except (KeyError, AttributeError) as e: ..... ... Full text
Nov. 24, 2019, 9:19 a.m. by lufy, 0 comment(s)
This site is hosted on Bandwagon before September, 2019, I had made backup the database every day. As it expired, I tried to rebuild the site on my new VM, but at last, I found the backup data was broken, caused by the wrong backup script, which is not strong enough... Therefore, my blogs after Sep... Full text
March 23, 2020, 5:31 p.m. by lufy, 9 comment(s)
This a test post for testing my site after migrating to CentOS8 and python3. 迁移后的中文测试 Though only for testing the site, I add some problems remarks here 1. Former site was running on centos 7 that disabled SElinux for hosting reasons, new site hosted on vutlr.com works fine, and I'm not g... Full text
June 3, 2018, 5:16 p.m. by lufy, 830 comment(s)
How to configure rsyslog Some records of resent works. The point is to test rsyslog's file size limit and log format. 1. Create log format: Next is to add a new template about system logs. $ vim /etc/rsyslog.d/test.log # Define template test_format $template test_format, "%$year% %msg%\n" # A... Full text
May 2, 2018, 2:28 p.m. by lufy, 0 comment(s)
In shell scripts, symbols are very usefull to handle strings in variables. Next list some frequently used methods of getting specified strings from variables. ${var##*str} get string after the last str in $var ${var#*str} &nb... Full text
April 22, 2018, 10:44 a.m. by lufy, 0 comment(s)
Records of commanly used svn commands. 1. Create SVN server: a. Install package. yum install subversion b. Create directory: mkdir /var/svn c. Create repository: svnadmin create /var/svn/test0 d. Edit /var/svn/conf/{passwd, authz,svnserve.conf} passwd: add user=password in [user] block. au... Full text
Dec. 29, 2017, 12:43 p.m. by lufy, 2 comment(s)
Original site: http://blog.redbranch.net/2015/07/30/centos-7-as-nat-gateway-for-private-network/ The scenario is a small private network connected via a switch and using 192.168.0.* addresses. One of the machines (let’s call it RTR001) on the network has two network interface cards. One ... Full text
Dec. 9, 2017, 5:02 p.m. by lufy, 0 comment(s)
When we are doing some tests on linux that take very long time, and we have to monitor its status at every moment, in this case, we can set the mail client on linux, to inform test status through email. Next is how to set. 1. Edit /etc/mail.rc # add the followed lines set from=fei.lu@i-soft.com.c... Full text
Dec. 6, 2017, 11:20 p.m. by lufy, 0 comment(s)
Mark my first little spider about scrapy. Motivation: Recent days, I was busy with testing the VMServer 4.3 (a virtualization software of PUHUA). The beta2 version is just released last morning. VMServer 4.3 has several parts: clients on different OSes and different server softwares, and the... Full text
Nov. 14, 2017, 8:51 a.m. by lufy, 2 comment(s)
Original link: https://stackoverflow.com/questions/231767/what-does-the-yield-keyword-do To understand what yield does, you must understand what generators are. And before generators come iterables. Iterables When you create a list, you can read its items one... Full text
Powered by Blog