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 […]
Author: Asif Rehan
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 […]
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 […]
Personal note: du -shc /path/to/directory Here, shorthand -s stands for ‘specific’, -h for human-readable and -c for complete (total volume)
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 […]