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 →

Proxy: Understanding the Role and Importance in Networking and Security In the world of networking and internet security, the term proxy is widely used, but it can often be misunderstood or underappreciated. A proxy serves as an intermediary between a client and a server, offering various benefits like increased privacy, security, and performance. Whether you’re managing a network or just browsing the web, understanding proxies and how they work can help you make informed decisions about your digital interactions. In this article, we’ll explore what a proxy is, how it functions, and the different types of proxies commonly used. We’ll also look at the benefitsRead 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=okThis 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 →

When it comes to web monitoring, we normally use Curl to accomplish it. But things getting more complex such password protection, single sign-on using Microsoft ADFS, these new authentication requires some javascript integration which Curl is failed to do. I did some works with Sitespeed for end user monitoring. We use sitespeed docker to visit the website and collect browser metric. By the way, if you don’t know what sitespeed is , visit http://www.sitespeed.io Sitespeed is doing pretty well in collecting the metrics, there is a very nice feature that Sitespeeds does is the ability writing our own selenium script. So imagine that , weRead More →

I have a folder like this: total 4.0K -rwxrwx—. 1 root vboxsf 101 Dec 25 08:03 notes.txt drwxrwx—. 1 root vboxsf 64 Dec 24 22:43 test drwxrwx—. 1 root vboxsf 64 Dec 25 07:45 test2 Then I run a docker sudo docker run -i -v /Data:/Data ubuntu bash cd /Data mkdir test3 I got permission denied. After some research, it turned out that this related to SELinux, it’s a security feature to limit root access. You can easily identify this by looking at the dot (.) at the end of the listing. You can temporary disable it by using: su -c “setenforce 0” To makeRead More →

Having some spare time during Christmas, i spent sometime to install Redhat on my Imac 2011. I followed this guides: https://www.mimiz.fr/install-rhel7-virtualbox-macos.html It’s very straight forward, you don’t need to read all, but you might face some challenges like me. My issue was with internet connection, i do not have internet after the installation. It turned out that i haven’t turned on the network during the installation. To fix this i have to do this manually by run this command: ifup enp0s3 In order to install additional software, we normally use yum utility to install. Redhat require us to register with their subscription manager, it’s free.Read More →

Is your iMac 2011 working? is it too hot? You are so lucky. But you need to keep it cooler otherwise you will have the same problem as me. One day you might see that it’s not booting and you see some stripes in the screen. If you see that, that means your GPU (graphic card) is failed. It’s could be an easy/cheap fix if you can buy a used part on eBay. My original card is HD 6970M 2GB, it’s still now almost $200 on eBay. So I finally have to use an older card , it’s about $40. It’s 6770M 512MB. It’s originallyRead More →