Installing Powerline in Ubuntu 18.04

Powerline is a “statusline plugin for vim, and provides statuslines and prompts for several other applications, including zsh, bash, fish, tmux, IPython, Awesome, i3 and Qtile”. It looks this cool (this is the most simply form):

Poweline for Bash

In combination with ZSH, it becomes an extremely powerful -and beautiful- tool.

To quickly install just Powerline for the bash:

sudo apt install powerline powerline-fonts

Add the following at the end of ~/.bashrc:

# Powerline
if [ -f /usr/share/powerline/bindings/bash/ ]; then
  powerline-daemon -q
  source /usr/share/powerline/bindings/bash/

Sorting the fonts:

mkdir -p ~/.fonts
wget -O ~/.fonts/Liberation\ Mono\ Powerline.ttf
wget -O ~/.fonts/Liberation\ Mono\ Powerline\ Bold.ttf
wget -O ~/.fonts/Liberation\ Mono\ Powerline\ Italic.ttf
wget -O ~/.fonts/Liberation\ Mono\ Powerline\ Bold\ Italic.ttf
fc-cache -vf ~/.fonts

Now, reload the terminal:

source ~/.bashrc


An useful alias for the terminal

Many times you write something in the terminal and you forget to write the sudo at the beginning. Then you have to recall the line and add it to the beginning.

Well, with this alias, you just need to write dammit and then you will execute the last command with superuser powers. That’s pretty cool, isn’t it?

[UPDATE] It seems like WP changes the command, therefore, I will publish it in a screenshot. Anyone with a visual impairment,  write your contact details in the comments and I will send it for you by email.

The alias command. Give me your contact details if you have any visual impairment

Showing line and column in nano

Another missing feature in nano is showing the line (an also the column) while we are editing a file. There’s two possible solutions:

1.- Opening nano with the -c option

[codebox 1]

2.- … or modifying .nanorc:

[codebox 2]

And then add this line to the beginning:

[codebox 3]

Syntax highlighting in nano

We are used to some great pieces of software like Gedit, Notepad++, Brackets or Atom for writing our code. Among their multiple advantages, the syntax highlighting is one of their most useful, as it help us to quickly identify the blocks of our code.

However, sometimes we need to use the terminal, for example, for editing a file that is being through ssh.

Thanks to scopatz we can easily modify our nano to show our code in colours and highlight the syntax:

[codebox 1]

Screenshot from 2014-05-30 14:05:48

Take a look to his nanorc‘s github for more details.


If you are using a version of nano under 2.1.5, your .nanorc should look like this to avoid compatibility problems:

[codebox 2]

Pimp your Fedora

Although the use of Fedora is not as extended as Debian/Ubuntu/Linux Mint, it’s a robust distro and it’s really wide-distributed and easy to use. Unlike Ubuntu and Linux Mint, Fedora is not based on Debian, but on Red Hat, and it includes Gnome 3 as the default desktop.Guidelines-fedora-logo.jpg

If you are thinking about giving a chance to this great distro, for sure these utils are going to save a lot of time and effort:

Fedy: Installs codecs, software, repositories…

[codebox 1]

Gnome Tweak Tool: Customize advanced Gnome 3 options.

[codebox 2]

dConf Editor: Editor for low-level settings.

[codebox 3]

Gnome Extensions: add plugins and extra functions to your Gnome 3 desktop.

PostInstallerFedora: simplify and automatize the installation of a long list of available software.



Shortcut for change keyboard layout

Do you use different layouts in your keyboard? Here is how to change the layout of the keyboard with a simply combination of keys, instead of clicking in the icon:

  1. Go to Keyboard preferences.
    Screenshot-Control Centre
  2. Add a new layout.
    Screenshot-Keyboard Preferences-1
  3. Press Options…
  4. Search Keys to change layout and mark your preferred combination (or combinations).
    Screenshot-Keyboard Layout Options
  5. Press Close.

That’s all.

Open with… Adobe Acrobat

Let’s face it. Linux is (almost) free. Linux is Open Source. But if a company have a product and don’t want to share their technology, we can:

a) Wait until somebody figures up how to replicate their technology or…

b) Install closed and proprietary software.

Sometimes we have no alternative and we must choose the b) option. This happens sometimes with the PDFs. The built-in PDF reader in almost all distros come with a more-than-decent compatibility and is really complete. However, some things like formulas are not going to be shown properly. The solution is as easy as installing the official Adobe Acrobat Reader.

Nevertheless, due to a little bug, under some distros like Linux Mint, if you try to open a file with Acrobat Reader using the [Right Click] > Open With you will discover that… Open with Acrobat Reader is missing!!!

To solve it we need to edit the desktop file using the terminal:

[codebox 1]

Then, we find the line beginning with Exec= and we edit it to be like this:

[codebox 2]

We save the file and… Tada! Now we can find Adobe Acrobat under the [Right Click] > Open With menu. You can even set Adobe Acrobat as the default program for the PDFs.


Adobe PDF icon


MTP support in Linux Mint / Ubuntu / Debian

If you have a new Android device with internal storage (like Nexus 4) and you try to copy data from/to your computer, you probably will realize that you are not able to access. This is because you have not a proper MTP support in your Linux machine.

Solving it is as easy as run this from terminal:

[codebox 1]

If you want to revert the changes:

[codebox 2]

Source: Webupd8

Basic addons for a Linux clean install

Install basic apps for a clean installation of Linux with a simple terminal command:

[codebox 1]

(For Debian / Ubuntu / Linux Mint and derivatives)

This is what you will install:

  • Ubuntu restricted extras
  • Ubuntu restricted addons
  • Essential tools for compiling (needed for installing some apps)
  • Skype
  • Chromium + language pack
  • Aptitude
  • Mediainfo (useful to query info from multimedia files)
  • Opensource JDK 7 (Java)