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/powerline.sh ]; then
  powerline-daemon -q
  POWERLINE_BASH_CONTINUATION=1
  POWERLINE_BASH_SELECT=1
  source /usr/share/powerline/bindings/bash/powerline.sh
fi

Sorting the fonts:

mkdir -p ~/.fonts
wget https://github.com/powerline/fonts/raw/master/LiberationMono/Literation%20Mono%20Powerline.ttf -O ~/.fonts/Liberation\ Mono\ Powerline.ttf
wget https://github.com/powerline/fonts/raw/master/LiberationMono/Literation%20Mono%20Powerline%20Bold.ttf -O ~/.fonts/Liberation\ Mono\ Powerline\ Bold.ttf
wget https://github.com/powerline/fonts/raw/master/LiberationMono/Literation%20Mono%20Powerline%20Italic.ttf -O ~/.fonts/Liberation\ Mono\ Powerline\ Italic.ttf
wget https://github.com/powerline/fonts/raw/master/LiberationMono/Literation%20Mono%20Powerline%20Bold%20Italic.ttf -O ~/.fonts/Liberation\ Mono\ Powerline\ Bold\ Italic.ttf
fc-cache -vf ~/.fonts

Now, reload the terminal:

source ~/.bashrc

Done!

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

nano -c file.name
									

2.- … or modifying .nanorc:

nano ~/.nanorc
									

And then add this line to the beginning:

set const
									

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:

git clone git@github.com:scopatz/nanorc.git ~/.nano
cat ~/.nano/nanorc >> ~/.nanorc
									

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

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

Note:

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

include ~/.nano/apacheconf.nanorc
include ~/.nano/asciidoc.nanorc
include ~/.nano/asm.nanorc
# include ~/.nano/awk.nanorc
include ~/.nano/c.nanorc
include ~/.nano/cmake.nanorc
# include ~/.nano/coffeescript.nanorc
include ~/.nano/colortest.nanorc
include ~/.nano/conf.nanorc
include ~/.nano/csharp.nanorc
include ~/.nano/css.nanorc
include ~/.nano/cython.nanorc
include ~/.nano/dot.nanorc
include ~/.nano/email.nanorc
include ~/.nano/fish.nanorc
include ~/.nano/fortran.nanorc
include ~/.nano/gentoo.nanorc
include ~/.nano/git.nanorc
include ~/.nano/gitcommit.nanorc
include ~/.nano/glsl.nanorc
include ~/.nano/go.nanorc
include ~/.nano/groff.nanorc
include ~/.nano/haml.nanorc
include ~/.nano/html.nanorc
# include ~/.nano/ini.nanorc
include ~/.nano/inputrc.nanorc
include ~/.nano/java.nanorc
include ~/.nano/javascript.nanorc
include ~/.nano/js.nanorc
# include ~/.nano/json.nanorc
include ~/.nano/keymap.nanorc
include ~/.nano/kickstart.nanorc
include ~/.nano/ledger.nanorc
include ~/.nano/lisp.nanorc
include ~/.nano/lua.nanorc
# include ~/.nano/makefile.nanorc
include ~/.nano/man.nanorc
include ~/.nano/markdown.nanorc
include ~/.nano/mpdconf.nanorc
include ~/.nano/mutt.nanorc
include ~/.nano/nanorc.nanorc
# include ~/.nano/nginx.nanorc
include ~/.nano/patch.nanorc
include ~/.nano/peg.nanorc
include ~/.nano/perl.nanorc
include ~/.nano/php.nanorc
include ~/.nano/pkg-config.nanorc
include ~/.nano/pkgbuild.nanorc
include ~/.nano/po.nanorc
include ~/.nano/pov.nanorc
include ~/.nano/privoxy.nanorc
include ~/.nano/python.nanorc
include ~/.nano/reST.nanorc
include ~/.nano/rpmspec.nanorc
include ~/.nano/ruby.nanorc
# include ~/.nano/sed.nanorc
include ~/.nano/sh.nanorc
include ~/.nano/sql.nanorc
# include ~/.nano/systemd.nanorc
include ~/.nano/tex.nanorc
include ~/.nano/vala.nanorc
include ~/.nano/vi.nanorc
include ~/.nano/xml.nanorc
include ~/.nano/xresources.nanorc
# include ~/.nano/yaml.nanorc
include ~/.nano/yum.nanorc
include ~/.nano/zshrc.nanorc

									

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…

su -c "curl https://satya164.github.io/fedy/fedy-installer -o fedy-installer && chmod +x fedy-installer && ./fedy-installer"
									

Gnome Tweak Tool: Customize advanced Gnome 3 options.

sudo yum install gnome-tweak-tool
									

dConf Editor: Editor for low-level settings.

sudo yum install dconf-editor
									

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.

 

 

Great to-do ideas after installing Linux Mint 16

http://debianhelp.wordpress.com/2013/11/30/to-do-list-after-installing-linux-mint-16/

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:

sudo gedit /usr/share/applications/AdobeReader.desktop
									

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

Exec=acroread %f
									

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.

Source: http://greycellsexpress.wordpress.com/2013/07/18/linux-mint-changing-default-application-when-not-listed-in-open-with/

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:

sudo apt-get update && sudo apt-get upgrade && sudo apt-get install ubuntu-restricted-extras ubuntu-restricted-addons build-essential skype chromium-browser linux-firmware-nonfree chromium-browser-l10n aptitude mediainfo openjdk-7-jre
									

(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)