I encountered many Python2 programs at work, where str, unicode and bytes caused me a lot of trouble. After figuring these problems out, I'll briefly share my understanding. This article introduces how to handle Chinese strings more elegantly in Python2 programs, and how to cope with the Python2-to-Python3 conversion. Please point out anything incorrect.
Debugging all types of Python servers with Tornado
No Python web framework has pretty logs, only Tornado. Maybe switching to Tornado directly in production is not appropriate, but in development, switching to Tornado can bring great convenience to development and debugging.
Shantou Travel Notes
My flatmate was going back to Shantou for the weekend to celebrate his grandfather's birthday. I didn't want to stay home alone in Guangzhou either, so I pulled another Tencent colleague along to Shantou for fun.
Trying the New Tornado — A Simple UDP Server
Tornado was the framework I used when learning Python — groundbreaking for using epoll back when the big all-inclusive Django reigned (gevent existed too, of course). Sadly my understanding of async and epoll was insufficient then, and I had no clue about coroutines. I hadn't used a framework for a long time since. Recently I happened to be writing a simple UDP server, so I gave Tornado a try.
Simple Usage of Ansible
Recently while using puppet I felt the need to broaden my horizons, and then I saw ansible — also a widely used ops tool. Here I briefly describe my recent usage and compare it with the puppet features I know, hoping to give you some inspiration. I'm a very junior ops person, so please point out any poor phrasing or errors.
Use Python AST to analysis expression and sort by weight
I used to meet a problem, in a comment's system, the operator need to dynamic adjust the factor to influence the weight of the comment, and then sort the comments by the weights.
Security Issues of the Rank Page
Notes on the security issues of the rank page
The data-* Cache Pitfall in jQuery
In jQuery, a div's data attributes are cached; wrong usage leads to wrong values. This post also briefly analyzes the related jQuery source code, hoping to help you understand more deeply.
OpenSSH Series 10: Store your key
At last, I want to share some methods to store the ssh keys.
OpenSSH Series 9: Split the ssh_config
When you have so many machines, the ssh_config will become large and hard to find the exact host.