How to Upgrade to Python 3.8 on Ubuntu

In this article, we upgrade to python 3.8 and configure it as the default version of python. Out of the box default python version for Ubuntu 18.04/10 is python 3.6 and for Ubuntu 19.04/10 is Python 3.7. As now, Python 3.8.1 is the lastest stable version released on Dec 18, 2019. So it would be better to upgrade last major version. My Ubuntu version is 18 LTS, however for 19.
Read more →

How to Remove Duplicates in $PATH zsh

It is so easy to do that in zsh: typeset -U path That’s all. As you can imagine -U stands for ‘unique’. From doc: -U For arrays (but not for associative arrays), keep only the first occurrence of each duplicated value. This may also be set for colon-separated special parameters like PATH or FIG‐ NORE, etc. This flag has a different meaning when used with Btw. just care it is not -u.
Read more →

How to Add Path Uniquely to $PATH

Configuration Add a path to $PATH if it is not already in $PATH: [[ ":$PATH:" != ":/path/to/add:" ]] && PATH="${PATH}:/path/to/add" For instance add ~/projects dir to $PATH: [[ ":$PATH:" != ":${HOME}/projects:" ]] && PATH="${PATH}:${HOME}/projects" If you need it at the start use PATH=/path/to/add:${PATH} instead of PATH=${PATH}:/path/to/add. Add this into your .profile/.bash_profile/.zprofile. You can add it into .bashrc/.zshrc as well but I do not prefer this method. Since environment variables should be set in ~/.
Read more →

Restore Tmux Sessions After Reboot

OK, we see how we save and restore our sessions in tmux. Look at this article Restore Tmux Sessions But after rebooting the system how can we start the saved sessions? Here what I was doing before: To restore sessions after reboot I run: $ tmux new-session Then I hit prefix + ctrl-r This restores all of my sessions and windows, but it also leaves me with the “extra” session that was created with new-session.
Read more →

Restore Tmux Sessions

tmux is a great tool for “black panel geeks” like me. For those who don’t know tmux, it is a terminal multiplexer for Unix-like operating systems. It enables a number of terminals to be created, accessed, and controlled from a single screen. tmux may be detached from a screen and continue running in the background, then later reattached. It is really great for handling terminal sessions whether local or remote.
Read more →