We use Graphite to store time series metrics for Sitespeed run result. Each of Sitespeed page result data contains more than 500 metrics. It’s interesting that we only see the metrics after a few days. We checked all the logs and don’t see any network issues. We only see the root cause when we built a dashboard to see some graphites internal metrics. As you can see , the number of metrics created was very low while the drop was very high? Why there are so many drops? It turns out that in graphite we have a configure So, it only create 50 metrics perRead More →

Have you ever thought of backing up your icloud photos to your own disk? Well, i haven’t found tools to do this job yet. I spent few hours to see how ICloud photos works via web interfaces. It’s pretty simple, it use some APIs to pull your photos library information. Can you use a script instead of via Web? yes, you can , you need to get the cookies and paste it to your script. It’s interesting that once you have the cookie you can query from any place – Apple does not check the IP , it just check the cookies only.  So, ifRead More →

  I was struggling with the client certificate with Puppeteer. Can you use client certificate for authentication? Yes, you can , but you have to do 3 things: – Run the puppeteer in normal mode (headlesss=false) – Import the certificate to your profile , you need a certificate file in pfx format , this is my script to import echo “Importing certificate” mkdir -p $HOME/.pki/nssdb certutil -d sql:$HOME/.pki/nssdb -N –empty-password certutil -d sql:$HOME/.pki/nssdb -L pk12util -d sql:$HOME/.pki/nssdb -i /config/cert.pfx -W “” – Update the policy: /etc/chromium/policies/managed/policy.json ( if you using Chrome, then it should be /etc/opt/chrome/policies/managed/policy.json) Here is my sample file:   { “AutoSelectCertificateForUrls”: [“{\”pattern\”:\”*\”,\”filter\”:{}}”]Read More →

If you run a puppeteer script with docker and the docker was hang. It’s probably because your browser is still running, you might have some exceptions that cause your script never reaches to the line where you close the browser. We need to make sure that these lines below should be always run at the end: //await har.stop(); //if you collect har file await browser.close(); //process.exit(0);Read More →

When you run puppeteer, you can either to run it in headless mode or normal mode, headless is a little bit faster. Which one you should use? In my case , i select them for a few reason: Normal mode: i need to load a chrome extension to do fix the NTLM authentication Headless mode: i use it since, we have a site using certificate authentication, it has a popup. i couldn’t find a way to get rid of that certificate menu. Running in headless mode force Chrome to not authenticate with certificate.Read More →