Pathos solves PicklingError for multiprocssing

Python multiprocssing is useful in executing concurrent tasks with multiple processes. But it also requires the objects being executed support pickling, which is not always true for types like class instance methods, staticmethods and etc. Pathos has a multiprocessing implementation that uses dill on the backend which supports serializing and deserializing for almost all types.

Generate two dimensional arrays with serial numbers

Generate n*n two dimensional arrays with serial numbers in python.

SQL case statement

How to use CASE statement in sql select statement to deal with if-then-else logic.

Insert into mongodb with DBRef

How to insert a new object into mongodb using pymongo with reference to other objects using DBRef.

Print or remove duplicates in list

How to quickly print out or remove duplicated items from given list in python.

SSL error with python requests

Quick fix to an ssl error was encountered with python requests on ubuntu 14.04.

Enable https for github pages with cloudflare

Github pages currently does not support https for blogs that use custom domain name, and here is what CloudFlare comes to a rescue.

Redirect http to https in nginx

How to redirect http traffic to https in nginx configuration.

Enable ssl with letsencrypt

Let’s Encrypt is a free, automated, and open CA (Certificate Authority) and let’s make use of it to enable ssl access to web application serviced by nginx.

Compiling error installing lxml on ubuntu

A compiler error was observed during installing lxml on ubuntu the error looks something like: error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 4, and it’s most likely caused by low memory.