Categories
Uncategorized

Thoughts on Leadership

This is my thoughts on winning life and winning friends. Often times, I have random realizations and discover an abstract connections between different domains. I would like to keep my thoughts here. It is more like the series of essays written by Paul Graham. Almost always people invest in promises, and to win investment it […]

Categories
blog OMSCS

My Application to OMSCS

I applied for Georgia Tech’s OMSCS program in 2018 and started my first semester in January 2019. Since I have been into the program for over a year, I felt sometimes that I should share my admission essays. After this Spring 2020 semester, I will be halfway there to graduate in terms on credits. So […]

Categories
blog

How I added SSL Certificate to my personal blog site on NameCheap.com

This blog site is currently hosted using the managed WordPress hosting called EasyWP available on NameCheap.com. Though there are many hosting services that integrate with the free Let’s Encrypt SSL tool, NameCheap does not seem to have any plan to do that. Instead NameCheap asks you to pay $8.88 per year for the basic SSL […]

Categories
Uncategorized

How much memory does importing PANDAS library take?

Objective Let us compare the memory consumption of Python PANDAS library. Methodology Small script called memtest.py: @profile def a(): import pandas if __name__==”__main__”: a() Test it with $python -m memory_profiler memtest.py Results: Output: The increment of memory usage in line#4 shows, it took 36.527MB to import pandas on my machine. What does your benchmarking result […]

Categories
Uncategorized

Merge a repo with another as a subfolder

Sometimes we may end up with one main repository and another independently developed repository for a new feature. Later it may turn out, that the independent repo needs to become a part of the main repo as a subfolder. To do that, we can use the git command using subtree. We need to put the […]

Categories
Linux system

Best way to setup PYTHONPATH for crontab

There are many suggestions on this. Add PYTHONPATH at the end of the ~/.bash_profile or ~/.bash_login files. If they do not exist, add it to ~/.bash_profile as suggested by this StackOverflow post. export PYTHONPATH=”${PYTHONPATH}:/home/path/to/your/python/package/” But this will add the package to the current user’s PYTHONPATH. To ensure crontab gets it right away. add this line to […]

Categories
Uncategorized

Best way to setup PYTHONPATH for crontab

When setting up a crontab job in Linux machine, these essential steps are required for a successful system operation Update the cron file by adding the new script on schedule Check the frequency of the schedule. Such as for running at 7 minutes interval, use */7 * * * *   python /path/to/script.py Or for running every hour […]

Categories
Uncategorized

How to check size of a directory in Linux

Personal note: du -shc /path/to/directory Here, shorthand -s stands for ‘specific’, -h for human-readable and -c for complete (total volume)

Categories
Uncategorized

How to unzip and read gzipped JSON files from URL in Python

The Problem Sometimes we end up zipping JSON files and putting up somewhere on the interweb. Now we need to read it back from the HTTP server and parse the file using Python. For that situation, let us assume that the zipped JSON is located at this URL: http://example.com/python_list_turned_into.json.gz. To read this file, we need to […]