About this blog

tuxThis blog was created with the idea of collecting and linking information about Linux, Git, how to set things up, how to tweak the system here and there, in different architectures, in different distributions and different releases.

All the information presented here is available to public knowledge and can be found with one, two, or a few more Google searches if you persist. All of them were used at least once on productive activities.

Please share your experience and share your comments.

Hide .gitignore files in Atom Tree view

I have been using Atom as my coding editor for almost a year now. As a Python developer, the *.pyc files often bugged me whenever I ran my code.

Adding those files in the .gitgnore file did not prevent them to show up in the tree view and hiding them from the Atom menus was not as much intuitive as I would guess at first, so I had to dig a little further.

To hide all files included in the .gitignore file:

Image1: find the ‘tree-view’ package and press Settings to enter the preferences of the package.
Image2: Scroll down to see the preference options.
Image3: Check the “Hide VCS ignored files” checkbox.

You may now see your tree view free of unwanted files.

I hope it helps.


Git basics: create and delete branches remotely

To create a remote branch:

$ git checkout -b <branch-name>
$ git push -u origin <branch-name>

To delete a remote branch:

$ git push origin --delete <branch-name> 
$ git branch -d <branch-name>

If there are unmerged changes which you are confident of deleting:

$ git branch -D <branch-name>

And that is all.


Git diff between branches

There are several ways of displaying the differences between your git branches. The simplest ones being a little fuzzy and, if the diff is big enough, not very helpful. But thre are some tweaks we can make. The one I’ve been using mostly in the past weeks is:

$ git log --oneline --graph --all --decorate

Well, like always, when I see too big a command like this, I create an alias for it.
Anyway, this will print the current layout of all branches of your project, including the remote ones.

For example:


It produces a cool graph layout with the commit title only, and it’s a very useful way to understand where things are in your project. However, if it’s really a big project, it might be too overwhelming.

I created some new branches with new commits and got a little more elaborated tree, like this:


For the graph above, I created a new branch “bug883” from “develop” and “sample_branch” from “master”. None of them was pushed remotely, as we can tell by the output.

Well, give it a try and share what you think.


UPDATE: Many other ways of getting the diffs are discussed in this Stack Overflow post.

Merge two dictionaries in Python (2.7)

This matter is extent. There are a number of different ways to do the same thing. My goal is to have an easy-to-do shortcut at hand to use it when I need it. See a link below for the source article with more information and discussion on the topic.

Dictionaries to be merged into a third one, z:

>>> x = {'a': 1, 'b': 2}
>>> y = {'b': 3, 'c': 4}

To merge them:

>>> z = x.copy()
>>> z.update(y)

which returns:

>>> z
{'a': 1, 'b': 3, 'c': 4}

Note that the value of 'b' was the last one updated, coming from the y dictionary.

For further details on this topic, please visit the source article at Stack Overflow.


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) <iplsdk@linux.vnet.ibm.com>
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


dmidecode: Getting the serial number of your x86 system

The serial number of your system can be easily found on the bottom of your laptop in most of the systems. However, if you are working with a remote server and need to collect its info things get a little complicated. But fear not, for there is dmidecode to save your day.

From the man page:

dmidecode is a tool for dumping a computer's DMI (some say SMBIOS) table
 contents in a human-readable format. This table contains a description of
 the system's hardware components, as well as other useful pieces of informa‐
 tion such as serial numbers and BIOS revision.(...)

So, give it a try and see what a plethora of information types you can see using a single command.

As for the serial number, issue:

$ sudo dmidecode -s system-serial-number

In my system:

$ sudo dmidecode -s system-serial-number
[sudo] password for dbkreling: 


Installing vim on Fedora 25

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.