What version of Ubuntu do I have?

Ubuntu is a free, Linux-based open source operating system with a long list of releases. When you first log in to an Ubuntu system, it is always a good idea to check the version of Ubuntu on the machine before you do anything on it. Finding which version of Ubuntu runs on your system may be essential to fix problems or seek installation guides.
In this tutorial, we’ll show you several ways to find your Ubuntu version using the command line or from the graphical interface.

Read moreWhat version of Ubuntu do I have?

Github Emoji Cheatsheet

Github People Emojis

:bowtie: :bowtie:smile :smile:laughing :laughing:
blush :blush:smiley :smiley:relaxed :relaxed:
smirk :smirk:heart_eyes :heart_eyes:kissing_heart :kissing_heart:
kissing_closed_eyes :kissing_closed_eyes:flushed :flushed:relieved :relieved:
laughing :satisfied:grin :grin:wink :wink:
stuck_out_tongue_winking_eye :stuck_out_tongue_winking_eye:stuck_out_tongue_closed_eyes :stuck_out_tongue_closed_eyes:grinning :grinning:
kissing :kissing:kissing_smiling_eyes :kissing_smiling_eyes:stuck_out_tongue :stuck_out_tongue:
sleeping :sleeping:worried :worried:frowning :frowning:
anguished :anguished:open_mouth :open_mouth:grimacing :grimacing:
confused :confused:hushed :hushed:expressionless :expressionless:
unamused :unamused:sweat_smile :sweat_smile:sweat :sweat:
disappointed_relieved :disappointed_relieved:weary :weary:pensive :pensive:
disappointed :disappointed:confounded :confounded:fearful :fearful:
cold_sweat :cold_sweat:persevere :persevere:cry :cry:
sob :sob:joy :joy:astonished :astonished:
scream :scream::neckbeard: :neckbeard:tired_face :tired_face:
angry :angry:rage :rage:triumph :triumph:
sleepy :sleepy:yum :yum:mask :mask:
sunglasses :sunglasses:dizzy_face :dizzy_face:imp :imp:
smiling_imp :smiling_imp:neutral_face :neutral_face:no_mouth :no_mouth:
innocent :innocent:alien :alien:yellow_heart :yellow_heart:
blue_heart :blue_heart:purple_heart :purple_heart:heart :heart:
green_heart :green_heart:broken_heart :broken_heart:heartbeat :heartbeat:
heartpulse :heartpulse:two_hearts :two_hearts:revolving_hearts :revolving_hearts:
cupid :cupid:sparkling_heart :sparkling_heart:sparkles :sparkles:
star :star:star2 :star2:dizzy :dizzy:
boom :boom:boom :collision:anger :anger:
exclamation :exclamation:question :question:grey_exclamation :grey_exclamation:
grey_question :grey_question:zzz :zzz:dash :dash:
sweat_drops :sweat_drops:notes :notes:musical_note :musical_note:
fire :fire:hankey :hankey:hankey :poop:
hankey :shit:+1 :+1:+1 :thumbsup:
-1 :-1:-1 :thumbsdown:ok_hand :ok_hand:
fist_oncoming :punch:fist_oncoming :facepunch:fist_raised :fist:
v :v:wave :wave:hand :hand:
hand :raised_hand:open_hands :open_hands:point_up :point_up:
point_down :point_down:point_left :point_left:point_right :point_right:
raised_hands :raised_hands:pray :pray:point_up_2 :point_up_2:
clap :clap:muscle :muscle:metal :metal:
middle_finger :fu:walking :walking:runner :runner:
runner :running:couple :couple:family :family:
two_men_holding_hands :two_men_holding_hands:two_women_holding_hands :two_women_holding_hands:woman_dancing :dancer:
dancers :dancers:ok_woman :ok_woman:no_good :no_good:
tipping_hand_person :information_desk_person:raising_hand :raising_hand:bride_with_veil :bride_with_veil:
:person_with_pouting_face: :person_with_pouting_face::person_frowning: :person_frowning:bow :bow:
couplekiss :couplekiss:couple_with_heart :couple_with_heart:massage :massage:
haircut :haircut:nail_care :nail_care:boy :boy:
girl :girl:woman :woman:man :man:
baby :baby:older_woman :older_woman:older_man :older_man:
:person_with_blond_hair: :person_with_blond_hair:man_with_gua_pi_mao :man_with_gua_pi_mao:man_with_turban :man_with_turban:
construction_worker :construction_worker:police_officer :cop:angel :angel:
princess :princess:smiley_cat :smiley_cat:smile_cat :smile_cat:
heart_eyes_cat :heart_eyes_cat:kissing_cat :kissing_cat:smirk_cat :smirk_cat:
scream_cat :scream_cat:crying_cat_face :crying_cat_face:joy_cat :joy_cat:
pouting_cat :pouting_cat:japanese_ogre :japanese_ogre:japanese_goblin :japanese_goblin:
see_no_evil :see_no_evil:hear_no_evil :hear_no_evil:speak_no_evil :speak_no_evil:
guardsman :guardsman:skull :skull:feet :feet:
lips :lips:kiss :kiss:droplet :droplet:
ear :ear:eyes :eyes:nose :nose:
tongue :tongue:love_letter :love_letter:bust_in_silhouette :bust_in_silhouette:
busts_in_silhouette :busts_in_silhouette:speech_balloon :speech_balloon:thought_balloon :thought_balloon:
:feelsgood: :feelsgood::finnadie: :finnadie::goberserk: :goberserk:
:godmode: :godmode::hurtrealbad: :hurtrealbad::rage1: :rage1:
:rage2: :rage2::rage3: :rage3::rage4: :rage4:
:suspect: :suspect::trollface: :trollface:

Read moreGithub Emoji Cheatsheet

How to fix “Directory not empty” when using mv in Linux

mv (or move) is a Unix/Linux command that moves one or many files or directories from one place to another.

mv is usually used for two purposes:

  • It rename a file or folder.
  • It moves group of files to different directory.

mv syntax and usage should be straightforward. However, when you’re learning to use Linux for the first time or when you’ve come to Linux with a solid background in another operating system, you may run into some things that it doesn’t allow.

If you’ve ever received a Directory not empty when trying to move files or directories, then this guide can help you.

Read moreHow to fix “Directory not empty” when using mv in Linux

How to fix “unindent does not match any outer indentation level” indentation error in Python

Fix unindent does not match any outer indentation level

Python is an emerging language in the developer field. It’s great as first language because it’s concise, easy to read, fast enough for most tasks and has a large ecosystem which fits mostly everything from web development to scientific programming.

Back then when I was new to Python, one of the thing that frustrates me the most was IndentationError: unindent does not match any outer indentation level. Look at how it made people pull their hair out :

Fixing this error is easy, and should be easy, but to understand why it happens so that you can write clean, concise, maintainable code requires more reading.

Read moreHow to fix “unindent does not match any outer indentation level” indentation error in Python

How to fix locale.Error: unsupported locale setting in Python

Fix Python locale.error

Python is a popular general purpose programming language that can be used to serve many different use cases. Created by Guido van Rossum with the name inspired from British comedy show Monty Python, it was set out to be straightforward and easy-to-use, emphasized in wp-block-code readability. Python 3 is the latest version of the language and is considered to be the future of Python.

The set up of Python 3 on your Linux machine should be straightforward without any error, but sometimes you will encounter locale.Error: unsupported locale setting – one of the most common problem of Python. This tutorial will show you how to fix it explicitly on Ubuntu 18.04, but the process remains the same for other distro.

Read moreHow to fix locale.Error: unsupported locale setting in Python

How to install pip on Ubuntu 18.04 the official way

Installing pip on Ubuntu 18.04 the official way

pip is the standard, de-facto package installer for Python. Created to be a better alternative to easy_install, It enables you to install and manage additional packages from PyPI that are not part of the standard Python library. This tutorial will show you the official, recommended way to install pip for both Python 2 and Python 3 on Ubuntu 18.04 LTS and how they will coexist peacefully.

Why do I need to care about pip for Python2 and pip for Python 3?

As the Python community grows, more and more parts of Ubuntu switched to the language. Because of that, Python 2 is now a part of the standard installation of Ubuntu. Despite the fact that Python 3 has many advantages over Python 2, the latter remains a crucial depency of the system. Removing Python 2.7 from Ubuntu 18.04 can cause a lot of trouble in the long run.

Ubuntu 18.04 ships with both Python 2 and Python 3 preinstalled. One pip installation works with only one Python distribution, so we need to separate both the command to invoke pip and the installation itself. For example, pip, by default, calls pip-for-python2 and pip3 is equivalent to pip-for-python3.

Installing pip3 and pip from Ubuntu Repository

Start off by updating system repository using the following command : 

sudo apt update

Then using the following command to install pip for Python 3 (refered to as pip3) and pip for Python 2 (pip) as well as all their depencies.

sudo apt install python3-pip python-pip -y

One the installation is completed, check and verify that pip and pip3 installs successfully using the following command : 

pip3 --version

pip number version may vary depending on the current updated repo, but it should look like this : 

pip 19.0.3 from /usr/local/lib/python3.6/dist-packages/pip (python 3.6)

Similarly, pip version can be verified using the command below : 

pip 19.0.3 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)

Installing pip independently using official install script

While the installation method above is fast and easy, there is another official method using the script provided by pip development team.

First you need to verify that your system doesn’t have any existing pip installation.

pip --version Command 'pip' not found. Try: sudo apt install <deb name>

Then download the installation script by running

wget https://bootstrap.pypa.io/get-pip.py

Proceed by using the python version of your choice to run the script. Be cautious as the script doesn’t coordinate well with the preinstalled pip version and can cause conflict if you have get-pip.py installed over the preinstalled one.

For example, the command for installing pip for Python 3 system-wide would be 

sudo python3 get-pip.py

If you want to install pip for Python 3 for the current user, run

python3 get-pip.py --user

Similarly, the command for pip-on-Python2 should be

sudo python get-pip.py OR python get-pip.py --user

Basic pip usage

Installing a package with pip

pip is made to manage the installation of third-party packages, one of the functionality is installing packages via the following command.

pip install <package_name>

Uninstalling a package

If you don’t need the package anymore you can uninstall it easily with the following command

pip uninstall <package_name>

Searching for Libraries

One can fire up the browser and search for a package on PyPI official website, but you can also do that using command line. For our example let’s look for packages related to “requests“. The search command shows us an extensive list similar to the one below.

pip search requests requests-hawk (1.0.0) - requests-hawk requests-dump (0.1.3) - `requests-dump` provides hook functions for requests. pydantic-requests (0.1.1) - A pydantic integration with requests. requests-foauth (0.1.1) - Requests TransportAdapter for foauth.org! requests-auth (4.0.1) - Easy Authentication for Requests Requests-OpenTracing (0.0.1) - OpenTracing support for Requests yamlsettings-requests (1.0.0) - YamlSettings Request Extension requests-aws4auth (0.9) - AWS4 authentication for Requests requests-middleware (0.1.2) - Composable HTTP middleware for requests jupyter-requests (0.0.2) - Send requests to a Jupyter server. requests-twisted (0.1.2) - Twisted adapter for the requests library. requests-oauthlib (1.2.0) - OAuthlib authentication support for Requests. requests-ftp (0.3.1) - FTP Transport Adapter for Requests. requests-async (0.5.0) - async-await support for `requests`. requests-cache (0.5.0) - Persistent cache for requests library requests-circuit (0.1.0) - A circuit breaker for Python requests requestor-requests (0.1.0) - Requestor Helper to request package requests-core (0.0.0) - A minimal HTTP Client, for Requests. .........and many more.................

Batch installing depencies

Python codes distributed online often includes requirements.txt file declaring all the depencies. If you see this file, you can run this command to install all depencies instead of manually run pip install for each depency.

pip install -r requirements.txt

Show what files are installed and its paths

Sometimes you want to analyze a package’s code, then this command will help you locate its files.

pip show --files OnePackage Name: OnePackage Version: 1.0 Location: /my/env/lib/pythonx.x/site-packages Files: ../OnePackage/__init__.py [...]

Conclusion

Now you should have a basic understanding on how to install pip on your Ubuntu 18.04 and how to manage Python packages using pip. For more information, visit the pip user guide page.

How to install rclone on Ubuntu 18.04

Install Rclone on Ubutu 18.04

In this article, we are going to learn about a powerful command-line tool to sync files and directories to and from different cloud storage providers.

Dubbed “rsync for cloud storage”the open-source rclone enables you to send data back and forth to the likes of Google Drive, OneDrive, Amazon S3, Yandex Disk, etc.

rclone comes with a few useful features:

  • Always checks for file integrity using MD5/SHA-1 hashes
  • Timestamps preserved on files uploaded
  • Partial syncs supported on a whole file basis
  • Built-in Copy mode to just copy new/changed files
  • Sync (one way) mode to make a directory identical
  • Check mode to check for file hash equality
  • Can sync to and from network, e.g. syncing two different cloud accounts
  • Optional encryption (Crypt), optional cache (Cache), optional FUSE mount (rclone mount)
  • Multi-threaded downloads to local storage
  • Supports HTTP/WebDav/FTP/SFTP/DLNA

How to install rclone on Ubuntu

Because rclone is written in Go programing language, it comes in a single binary file.

There are several ways to install it on Ubuntu. The easiest approach would be to use official package for apt or the snap package manager. Alternatively, you can install rclone using a bash install script provided by its development team.

We will walk you through all of them in this article.

Install rclone the official package from Ubuntu repositories (for Ubuntu 18.04 onwards).

Since Ubuntu 18.04 Bionic Beaver, rclone has become mature enough to become a part of the official repositories. To most users, this is the best way as you will have the most stable, well-tested version of rclone on your system.
If the package manager of your choice is apt, simply run these commands in your terminal. We’ll first make sure that the system is fully updated.

sudo apt update && sudo apt upgrade sudo apt install rclone -y

Unfortunately, if you prefer snap app store, I have bad news for you : rclone development team has abandoned support for the snap package because it’s too hard to make it work properly (and peacefully) with the security confinement of snap.

Install rclone using the official bash script

If you have any problem with the package provided by Ubuntu (which is quite rare by the way), you can always install rclone using an official bash script from the development team. Open up your terminal and run the following commands :

You have to make sure curl is installed on your system :

curl --version

If you see something like this, then you’re good to go:

curl 7.58.0 (x86_64-pc-linux-gnu) libcurl/7.58.0 OpenSSL/1.1.0g zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3 Release-Date: 2018-01-24 Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy PSL

If you see something like this, you will need to install curl first :

Command 'curl' not found, did you mean: command 'curl' from deb curl Try: sudo apt install

Get curl to your system :

sudo apt install curl -y

Download the bash script and let it does the install :

curl https://rclone.org/install.sh | sudo bash

If you have any difficulties in installing rclone using any of the methods above, please dont hesitate, let me know in the comments below.