Archive for the 'Linux' Category

How to Modify PYTHONPATH on Linux

When you are installing modules in Python that need to be available to Python scripts stored in various locations on the server, you can use PYTHONPATH to specify where those resources are on the server. This environment variable tells Python where to find those modules/libraries.
This post explains how to set environment variables in Linux. You [...] Read more »

How to Use the vi Text Editor in Linux

In Linux, a common way to edit text files is to use a utility called vi. I haven’t used it a lot, but from what people tell me, it takes awhile to get used to (you do everything with keystrokes rather than a mouse), but once you figure it out it is very powerful.
To edit [...] Read more »

Setting Environment Variables in Linux

I have an application that relies on environment variables to find shared object files. If these are not in place, I get an error like “lib.so: cannot open shared object file: No such file or directory.”
If I set these variables the following way, it works temporarily:

export VARIABLE_NAME=/path/abc

But I want it to persist for all sessions [...] Read more »

Copy Files From One Linux Server to Another

Let’s say you have a file on your Linux server and want to copy it to another server. Or vice versa. You can also copy files from one remote server to another. An easy way to do this is with the scp tool, which is built on top of ssh.
Open a command line. The command [...] Read more »

How to See Which Processes Are Running in Linux

This is pretty straightforward to experienced Linux users, but it wasn’t obvious to me when I started using Linux. Linux has a nifty program that will tell you what processes are currently running, how much memory/CPU they are using, etc. It also allows you to kill processes that may be running in the background.
At the [...] Read more »

Encrypt and Decrypt Large Files in Linux

One tool I’ve found really useful and easy to use for encrypting files is called bcrypt. This is an open source project that uses the BlowFish encryption algorithm. All you have to do is enter the file pattern for the files you want to encrypt and a password. Then when you want to decrypt them, [...] Read more »

How to Kill a Running Process in Linux

First you must determine the PID of the process you want to kill. This can be done usually pretty easily with the top command in Linux. When you type top at the command line, it shows you the processes that are consuming the most resources at the time on the system. Most likely the one [...] Read more »