Glimpses of a Vim configuration

It's been a while since I started tracking versions of my custom Vim configuration, and making it available as an open source software in Github. The best of this project is, in my opinion, to have it under version control, so I can track changes and releases.

Every once in a while, when I find a new setting, or a great new feature, I modify the configuration, so they will become available on the next release. Besides the features that are mentioned in the project, and the customizations made, I feel very comfortable with the colour scheme I made.

Read more...

Deleting commented out code

This is a rule I always encourage in software development. Moreover, I consider it to be something that has to be included in every coding guideline of a good project.

There are several reasons for this, but probably the best explanation can be found in the book "Clean Code"1 by uncle Bob, on which explains that the code, gets outdated (rotten) with the rest of the surrounding code, and hence it makes a place for confusion, leading to an error-prone spot.

Read more...

strncpy and strncat for copying strings in C

Recently, I've read an interesting article1, explaining why the strncpy function in C is not safer than strcpy. The post was very interesting, but what's more, it suggested an alternative idiom for copying strings in C, that might probably be the way to go.

Later, in another article2 that compared some functionality in C, Python and Go, one of the comments pointed out that very same idiom. That grabbed my attention, so I decided to try it in an example.

Read more...

Setting user permissions in KVM

In a previous article I mentioned how to install a library in Fedora, in order to make KVM virtualization easier, managing the NAT network configuration between the guest virtual machine and the host, by means of libvirt.

Besides that, while using KVM locally for development, I use virt-manager, a helpful application that manages the different virtual machines. This application, as well as the rest of the commands that interact with libvirt (virsh for example), require super user privileges, so it will prompt for the sudo password every time.

Read more...

Notas sobre la ArqConf 2015

Este es mi resumen sobre la ArqConf 2015, la conferencia sobre arquitectura de software que tuvo lugar en la UCA el 30 de Abril de 2015. La idea es sintetizar las principales ideas que me llevé y resaltar lo más importante.

Se presentan a continuación un listado de las ideas principales por charla con un breve listado de lo que más destaco por cada uno. Nótese que la lista no es de ninguna manera exhaustiva, y cada sección es en realidad un breve párrafo ilustrativo a modo de resumen muy a alto nivel.

Read more...

Running RabbitMQ server on Docker

If you use RabbitMQ for development frequently, sometimes you might have found it uses too much resources (it's normal while programming to have a lot of queues or tasks being queued and that makes the CPU usage to spike).

Having RabbitMQ installed on the OS seems the perfect approach for production, but on development I'd rather do something different, in order to isolate the process. I know I could bound it (for example order it not to start automatically as a dæmon), by means of systemd but a few weeks ago I decided to try docker and see how it results.

Read more...

Find Options

Among the core-utils, find is one of the most useful commands. Though I use the basic functions most of the time, find has a wide range of parameters, and it comes in handy not only for finding files, but also for operating a bunch of them at once. Here is a very simple example.

Imagine you have to move many files to a directory, but they all call different so a glob is no use, and manually moving all of them is not an option. A possible approach would be to locate the first of the batch (for example by running ls -lrth). Suppose the first one of the batch is called /tmp/checkpoint (for this example let's assume the files reside at /tmp).

Read more...

Checking Python files with Vim

Vim is an excellent editor, and mastering it leads to more productivity. Even though is very extensible and allows to be configured by many plug-ins I rather keep it as simple as possible, trying not to use many plug-ins (neither packagers like Vundle, etc.).

However, I do make use of an extension that checks Python files for errors, PEP8, among other things: flake8. Because I do not use plug-in platforms for Vim, I install just this one manually, by making the command flake8 available system-wide1.

Read more...

Alpine email client

Alpine is a software I definitely recommend for those who like minimalistic applications that go straight to the point in order to get the things done. It's an email client, with no GUI, which allows me to read emails better than by means of the web page1 without any distractions, focusing on what is just important. It is also great that shows only the text (the relevant part of the email) and it can follow the links by launching the default browser.

Read more...

Libvirt networking libraries

Fedora 21 workstation seems to come with a lot of virtualization features and most of the libvirt libraries installed. I only had to add the KVM virtual-manager which is the KVM application I am more familiar with. However, the new version of the libvirt* libraries have networking features that are great for the data centre environment, but maybe not the best option for a particular workstation, so I added the following packages in order to set up an easier network configuration for my local virtual machines.

Read more...