Category Archives: Packages

VIM buffer commands

Commands from vim buffers can take long to get into our brains. Practice will lead to perfection… eventually.

Here are some tips to get them into memory faster:

Editor commands:    
  :e filename - Edit a file an existing file in a new buffer
  :sp filename - Open a file in a new buffer and split window
  :vs or :vsp Open a file in a new buffer and split window vertically 
  ctrl+ws - Split window to work in two places of the same file
  ctrl+wv - Split window vertically (and work in the same file)

Navigation commands:
  :bnext (or :bn) - go to next buffer
  :bprev (of :bp) - go to previous buffer
  :bd - delete a buffer (close a file)
  ctrl+ww - switch between windows
  ctrl+wq - Quit a window

With pictures to decorate this post:


Open up a new file called ‘example1’


With ‘example1’ open, type in ‘:vs example2’ to vertically split the window and edit a new file ‘example2‘. It will open up a new buffer to the left of ‘example1’


From the ‘example2’ buffer, type in ‘:sp example3’ to horizontally split the screen and edit a new file ‘example3‘. It will open a new buffer above ‘example2’


All three buffers displayed. Use CTRL-W+W to cycle through them.




Fast search your project with ag – the silver searcher

“Ag” is a powerful search tool that can come in handy in many situations. Use it to replace your grep searches.

NOTE: some exploration is still to be made, so if you are a pro, share your knowledge with the peasants 😉

Ubuntu 16:
$ sudo apt install silversearcher-ag

Fedora 26:
$ sudo dnf install the_silver_search


$ ag -h


Recursively search for PATTERN in PATH.
 Like grep or ack, but faster.

 ag -i foo /bar/

If you give it a try, let us know


List gpg keys in your system

1.1. RPM based distros (RHEL, CentOS, Fedora)


$ sudo rpm --import repomd.xml.key


$ rpm -q gpg-pubkey|sort

Getting info:

rpm -qi  | grep Summary   

(or without the ‘grep’ part to view full info of the key package)

To remove:

sudo rpm -e --allmatches 


[root chip ~]# rpm -q gpg-pubkey|sort
[root chip ~]# rpm -e --allmatches gpg-pubkey-8df56d05-3e828977
[root chip ~]# rpm -q gpg-pubkey|sort

1.2 Debian / Ubuntu

$ gpg --list-keys user_ID


$ gpg --list-keys
pub   2048R/E5****A4 2015-01-12
uid                  IBM Software Development Kit for Linux on Power
sub   2048R/F2*****9 2015-01-12

pub   4096R/78C*****4 2016-02-11
uid                  IBM SDK for Linux on Power (The IBM Software Development Kit for Linux on Power is a free Eclipse-based Integrated Development Environment) <>
sub   4096R/B3*****0 2016-02-1

Add a gpg-key in your environment:

After you get the .gpg file, you need to 'add-apt-key' it into your keyring. Here:
$ sudo apt-key add .gpg

Don’t forget:
$ sudo apt-get update


Installing vim on Fedora 25

UPDATE: This issue does not seem to happen in Fedora 26.

I just booted a fresh Fedora 25 (server, ppc64le) and attempted to install vim (I do not like vi) and had the following error:

Error: Transaction check error:
 file /usr/share/man/man1/vim.1.gz from install of 
vim-common-2:8.0.133-2.fc25.ppc64le conflicts with 
file from package vim-minimal-2:7.4.1989-2.fc25.ppc64le

Cool, let’s remove vim-minimal:

$ sudo dnf remove vim-minimal

If you see what I saw, this will trigger the uninstall of a whole lot of packages, including sudo.Saying it will remove sudo can scare the bejesus out of many people, but this will not be a problem if you are logged as root. (sudo -s / sudo -su).

$ sudo -su

Now you can bravely go on: remove vim-minimal and then install vim-enhanced. You should be all good.


IPython (& ipdb) issue with python 2.7

If you ever wanted to use ipdb (from IPython) debugger when using Python 2.7, you might have faced an issue like this:

$ sudo pip install ipython
Downloading/unpacking ipython
  Downloading ipython-6.0.0.tar.gz (5.1MB): 5.1MB downloaded
  Running (path:/tmp/pip_build_root/ipython/ egg_info for package ipython
    IPython 6.0+ does not support Python 2.6, 2.7, 3.0, 3.1, or 3.2.
    When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
    Beginning with IPython 6.0, Python 3.3 and above is required.
Command python egg_info failed with error code 1 in /tmp/pip_build_root/ipython

So you gotta go ahead and install IPython==5.0, because it’s the last LTS version. Do:

#pip install IPython==5.0

And then you should get:

ImportError: No module named packaging.version

Hm, that was not expected. Installing setuptools or packaging did not work for me at this moment. To get away with this error I had to install pip3 and then upgrade pip:

  251  sudo apt-get install python3-pip
  252  sudo pip3 install --upgrade pip
  253  sudo pip install ipython==5.0
  254  sudo pip install ipdb

After that, both IPython and ipdb installed with no issues or errors and life was happy again.


If the above still does not fix the issue, or if pip and ipython are bound to python 3, you can try this, according described in the website:

  1. Download
  2. Run python [2] This will install or upgrade pip. Additionally, it will install setuptools and wheel if they’re not installed already.

Let me know if that worked for you too.

Good Luck!

[bash] How to enable git-completion on PS1 variable (fix __git_ps1 error)

A nicer bash prompt I use includes a git completion script that indicates the branch of a repository I may be into. Like this:


Green indicates “master” is clean and no modified files are present. Red indicates there is something new in that branch.

In order to configure that, I had to include some instructions on my .bashrc file. It looks like this:

# git completion – Linux
source /usr/share/git-core/contrib/completion/

# git completion – Mac OS
#source /usr/local/git/contrib/completion/


PS1='\[\e[01;30m\]\t`if [ $? = 0 ]; then echo "\[\e[32m\] ✔ "; else echo "\[\e[31m\] ✘ "; fi`\[\e[00;40;37m\]\u\[\e[01;37m\]:`[[ $(git status 2> /dev/null | head -n2 | tail -n1) != "# Changes to be committed:" ]] && echo "\[\e[31m\]" || echo "\[\e[33m\]"[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit, working directory clean" ]] || echo "\[\e[32m\]"`$(__git_ps1 "(%s)\[\e[00m\]")\[\e[01;34m\]\w\[\e[00m\]\$ '

Now, sometimes (in a new environment mostly), we may configure the .bashrc just the way we want it and then:


Boom! You see a big "__git_ps1: command not found"  message.

That is because you don’t have the file you included in the directory loaded at the top of you .bashrc file (the /usr/share/git-core/contrib/completion/

So in order to get rid of that, we need to include it. The file is available in contrib/completion/git-prompt.bash from the git repository git://

So after you clone it, you should simply copy the missing files to your system file system. In my case, I preferred to copy the whole “completion” dir to my file systems, as I did not have it. So:

$ sudo cp -r completion/ /usr/share/git-core/contrib/

NOTE: If you are using MacOS, the path should be /usr/local/git/contrib/. For more MacOS, please consider visiting this github page.

Now I have my git-completion.bash file in the correct place. Let’s see if that worked when running a new bash session:


Great! Worked like a charm.

Let me know if you have a different solution for it or if this did not solve your problem.

Thanks for reading.


Technically Speaking was used as a reference for this post.

Installing clang on RHEL/CentOS and Ubuntu

For RHEL and CentOS:

1) Install EPEL repository (read here on how to install it)

2) Install clang package:
$ sudo yum install clang

For Ubuntu 16.04:

1) Install clang packages:
$ sudo apt-get install clang libclang-dev

2) Create a symlink to libclang:
$ cd /usr/lib/-linux-gnu
$ sudo ln -s

$ cd /usr/lib/powerpc64le-linux-gnu
$ sudo ln -s