I had some difficulties when trying to install collectd on Redhat 7 – the error was No package collectd available. I tried different method, and ends up with this solutionRead More →

I think i need to bookmark this website https://mitmproxy.org/ . This is an open source proxy. Why do i bookmark this instead of other proxy? The beauty of this proxy is coming from the fact it can interfere with the content, meaning you can modify the web traffic between your browser , it’s like the middle man , it can watch the traffic and modify it as well. Another great feature is that it will also allow you to capture https traffic, this is done by installing a root certificate to your machine. This will remove all https warning.Read More →

I hava a small utility which accept some input from command line from another system. To keep the utility more open, i don’t want to restrict some parameters, the caller can provide more parameters, i will just need to ignore them. In Python, we use argparse for this job, by default if the user provide more parameters that you expect, it will trigger the error. There is a way to overcome this Below is the script i use for this job,  Read More →

Supposed that you have a command line like this:   How do you get that options in php?  Please note the “:” in the option myscript.php –url “http://www.google.com” –proxy “127.0.0.1:8080”  Read More →

let say you have a query string ?var1=test;abc&var2=ok when you use function parse_qsl to parse query to get the variable , you will see you have a several variables: var1 = testabc=””var2=ok This is because parse_qsl use “&” and “;” as a separate , to overcome this we need to replace “;” with %3B , then we’ll replace it back in our variable valuesRead More →

When you start to write your own http python server, the easiest way is to start with with BaseHTTPServer class. there are many behavior that you want to customize such as the timeout , or error handling. This is the link to original BaseHTTPServer, it’s for your reference to modify it https://svn.python.org/projects/python/trunk/Lib/BaseHTTPServer.py This is my timeout and finish override functionRead More →