Install Graphviz and PyGraphviz on Mac

Use brew to install graphviz, then add install option when using pip to install pygraphviz

brew install graphviz

pip install pygraphviz –install-option=”–include-path=/usr/local/lib/graphviz/” –install-option=”–library-path=/usr/local/lib/graphviz”


Shell – Check SSL Certificate

Just a few minutes after trying to check domain’s SSL Certificate expiry date with python which requires around ten lines of code, I found a shell script which doing that task in just one line, here’s the script


echo | openssl s_client -servername -connect 2>/dev/null | openssl x509 -noout -dates



Python – Check SSL Certificate Expiry Date

Just playing with python 3 to make a simple utility to check my domain expiry date

# save as

import OpenSSL
import ssl, socket
import argparse

# get domain
parser = argparse.ArgumentParser()
args = parser.parse_args()
domain = args.domain

# get SSL Cert info
cert = ssl.get_server_certificate((domain, 443))
x509 = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM, cert)
x509info = x509.get_notAfter()

exp_day = x509info[6:8].decode(‘utf-8’)
exp_month = x509info[4:6].decode(‘utf-8’)
exp_year = x509info[:4].decode(‘utf-8’)

exp_date = str(exp_day) + “-” + str(exp_month) + “-” + str(exp_year)

print(“SSL Certificate for domain”, domain, “will be expired on (DD-MM-YYYY)”, exp_date)

then run with the domain you want to check as the argument




Docker – Couldn’t Connect to Docker Daemon

I got the error message “Couldn’t connect to Docker daemon” after trying to invoke docker-compose up -d command

The solution is quite simple:

  • Run docker-machine restart default
  • Run eval $(docker-machine env default)

jQuery : Select All Checkbox

Yahoo! Mail and GMail both has a checkbox on top of their email list which will “checked” all chekboxes when clicked. Previously I use plain old javascript like those in this link, I just try to use jQuery to do this, its only 5 lines

        this.checked =;

Python – Oracle : Connect and Query using cx_Oracle

import cx_Oracle

my_dsn = cx_Oracle.makedsn(‘localhost’, 1521, ‘xe’)
my_connection = cx_Oracle.connect(‘HR’, ‘your_password’, my_dsn)
my_cursor = my_connection.cursor()
my_cursor.execute(‘select FIRST_NAME from EMPLOYEES’)

for row in my_cursor:
print row[0]


Android Studio Error on First Run (Windows)

After installing Android Studio on my new laptop and then running it for the first time, it throw a dialog box detailing error messages, a quick search on Google point me to this link Issue 172032: Android Studio Start failed with internal error and the “temporary solution” is simple, just edit file located in

C:\Program Files\Android\Android Studio\bin\

then add this text

and save, then try to relaunch Android Studio, it works like a charm 🙂

Note: editing file required Administrator privileges so you maybe need to launch your editor as Administrator