...

Python 2-to-3 Tips

This is a short post to help those of you who need help translating code from Python 2 to Python 3. Python 2 is the most popular Python version...

...

How can I determine the size of a directory or folder in Linux?

du -hs /path/to/directory -h: human-readable -s: summary (don't show size of each individual file within the...

...

Tutorial: How to use Linux Screen

A problem that often arises when you’re dealing with lots of data is that it takes forever to process. So you SSH into your Amazon EC2 machine,...

...

Install all your statistics and numerical computation libraries for Python in one go on Ubuntu

sudo apt-get install python-numpy python-scipy python-matplotlib ipython ipython-notebook python-pandas python-sympy...

...

How to password-protect a PDF file on Ubuntu

In a terminal, type: sudo apt-get install pdftk Then, to add a password to a PDF file, type: pdftk <input-file> output...

...

Find and Replace Text from the Command Line in Linux

Use sed sed -i 's/<original_text>/<replacement_text>/' <file.txt> Example: sed -i 's/Bob/Alice/'...

...

Setting up your dev environment

These days most start-ups / engineering teams are using the same dev setup, even if they are using different technologies in their stack. This is...

...

Output to standard out AND a file at the same time

Let’s say you’re running a script, and you want the output to show up in the terminal and be output to a file simultaneously. This is how to do...

...

Automation: For loops in bash (for loops on the command line)

If you have to run a script that processes data for a particular file for a particular day, i.e. your file is on hadoop with the date in the path,...

...

Can’t restart Apache in Ubuntu

When I try to restart Apache using the command: sudo apachectl -k restart I get this error: apache2: Could not reliably determine the server’s...