This post is concerned with running jobs (one or more programs) in foreground and background using just a terminal. Here, I use
firefox as an example to demonstrate the same. <username> on screenshots shown below is scrambled for privacy concerns.
Running programs from terminal
You can always runa job in foreground by typing a command on to the terminal as
But once the program starts we lose the bash prompt. Another way to start firefox is to run the program in background. This will return bash prompt as shown below.
Continue reading “Running jobs from terminal in background [foreground and pausing]”
When you start a notebook after installing a new environment, sometimes you will not find your environment-kernel in the dropdown from the notebook.
To fix this, install ipykernel on to your desired environment. Here, we install it into
Continue reading “Activating python-kernel for an environment in jupyter-notebook”
tmux , I would say is one of the finest interface to work on a remote server. But it comes with a boring shell. This post will help you configure
zsh as the default shell when logging into
Step 1 : Install zsh
sudo apt-get update
sudo apt-get install zsh
# check `zsh` version.
# It is prefereable to use a version above 5.0
Continue reading “Setting up tmux with z-shell (zsh) as default”
Bare with me as I periodically update this list with useful commands for linux (ubuntu/debian).
Continue reading “Useful commands on Ubuntu (debian)”
- Use the command below after modifying
.gitignore and to remove tracking files already committed before
git rm -r --cached .
- List all the files currently being tracked under the branch master
git ls-tree -r master --name-only
- Print a decorated log of branches on command line
git log --all --decorate --oneline --graph
Continue reading “GIT hacks”
When creating training data for RNN, the target label for a given input label is the input label itself but shifted by one position. Please refer to the diagram below.
Continue reading “Creating input (x) and target (y) for RNNs”
enumerate() is a useful function to make an iterator when used with a
for loop. Here we explain different ways of using
enumerate() using a python list.
enumerate() acts as an iterator yielding a tuple
(index,element)when applied on a list.
Continue reading “Usage of enumerate() with python list”
Extend() when acting on a list
Continue reading “Append and Extend python list”
get() method is useful when accessing key-value pair from a dictionary. It returns a pre-defined value (
-1 in the example below) if key is not present in dictionary, else it returns the value associated with key.
Continue reading “get() method for python dictionary”