Using git with tracking branches

As you probably know already, Git is a fully distributed version control system. This means that there is no master repository in Git as such, only repositories that you can pull information from or push information to in order to advance in the development of a given project. The former are known as upstream repositories whereas the latter are known as downstream repositories.

Despite being completely distributed, it is typical for all Git projects to have an upstream repository that contains the master copy of the project source code. This is where all the changes contributed by developers are integrated, typically making sure that the code is always functional using continuous integration tools (e.g. Travis or Jenkins).

Considering such approach to development, it is usually required to pull information from an upstream repository to a local repository (e.g. a folder in your computer), where you will merge and modify it as required and, afterwards, push it to your remote repository (e.g. the copy of your local repository hosted in GitHub or BitBucket). Once there it is also typical to make a pull request to get your changes integrated back into the master repository, but this is another story.

Focusing on pulling information from an upstream repository, the first step is adding the address of the upstream repository in your local Git repository by issuing the command “git remote add upstream git://github.com/user/repo.git“.

After that you need to fetch changes from the upstream repository and merge them into your local repository. To do that it is convenient to add the following lines to the .gitconfig file in your local repository:

[alias]
pu = !”git fetch origin -v; git fetch upstream -v; git merge upstream/master

This defines an alias that allows to do the fetch from the upstream repository and merge to the local repository in a single step by executing “git pu“. If Git is able to merge the changes in both repositories automatically all that will be left to do is push the changes back to your remote repository by issuing the “git push” command. If not you will need to integrate the changes manually and do the push afterwards.

Convert CR2 to JPEG with Ubuntu

I’ve just come back from Toronto, Canada, with a pile of pictures taken with my Canon G12 camera. Of course the pictures are taken in RAW format (CR2 extension) in order to maximize quality and enable digital post-processing. However, such format is not convenient in order to display the pictures in a TV. Thus, I have to automaticlly convert the RAW pictures to JPEG. How? Easy:

find . -type f -name “*.CR2” -exec ufraw-batch –out-type=jpeg ‘{}’ \;

In case the ufraw-batch command is not found, you need to install it using the common sudo apt-get install ufraw. And that’s all! Just sit back and relax meanwhile the pictures are converted.

Wireless button in HP Folio 9470m

The HP Folio 9470m has two physical buttons that allow to turn on/off the wireless communications and to mute/unmute the speakers. The button to mute/unmute the speakers works out of the box in Ubuntu 14.04 LTS, but the button to turn on/off the wireless communication does not. Despite the same effect can be achieved by software, e.g. through the control panel, it is much more convenient to use the physical button. After researching a bit, I found out that there is an easy hack that enables the on/off wireless button.

First, edit the /etc/default/grub file using your favorite editor, e.g. nano. Remember that you will need root privileges for that. Once there, modify the GRUB_CMDLINE_LINUX line as shown next:

GRUB_CMDLINE_LINUX=”acpi_osi=’!Windows 2012′”

Save the file and update the GRUB configuration by issuing:

sudo update-grub

After that, reboot your computer and enjoy!

HP Folio 9470m

I’ve been a GNU/Linux user since 2004 and a Mac user since 2007. My current computer is a Macbook Pro Mid 2009 with an Intel Core 2 Duo 2.53 GHz processor, 8 GB of DDR2 RAM, 250 GB of SSD and 15″ mate display. Despite being five years old, the computer was running great both on performance and battery lifetime. However, the weight of the computer and the charger together (~3 kg) was too much for daily usage. In addition, I want to switch back to a GNU/Linux and, as fas as I know, Apple products do not provide the best user experience, e.g. using rEFIt to bootup.

Said that, I have recently acquired an HP EliteBook Folio 9470m as depticted in the next picture. The laptop features an Intel Core i5 1.8GHz processor, 16 GB of DDR3 RAM, 250 GB of SSD, a 14″ mate display and, most importantly, it only weights 1.6 kg. The look and feel of the computer resembles a Macbook Pro, and the build construction and performance of the computer is amazing compared to the Core 2 Duo. There are however two minor improvements that could make it my perfect computer. First is the keyboard, which feels a little cheap compared to the Macbook Pro to which I am used to. Second is the screen, which is only 1368×768 pixels compared to 1680×1050 pixels from the MacBook, and does not allow to display many contents at once.

HP EliteBook Folio 9470m

Anyway, so far I have managed to install Ubuntu 14.04 64-bit, which came out this month and is a LTS (Long-Term Support), and I have to say that it runs great. In the following posts I will detail with precision what works out of the box, as well as, what does not and how it can be fixed (if possible). I will also create a list of the packages to install and how to install it in order to make it easy for me to recover the system in case I need to.

What is my IP?

Ever wondered how to know your public IP address from a terminal? This is specially useful when you are in a public Wi-Fi network and you need to know if your SSH tunnel to route HTTP traffic is working fine, e.g. your traffic is protected against evesdropping. The following command that does the trick:

wget -q -O – http://wgetip.com/

You can even include that as an alias in your BASH config file (.bashrc). For example, I have the following:

alias whatismyip=’wget -q -O – http://wgetip.com/’

Using that, I only need to type whatismyip from the terminal to know what my public IP address is. In the next post I will explain how to create an SSH tunnel to securely route your traffic.

Hello world!

Hello everyone and welcome to my personal blog! This is my first post and maybe, if I find enough time, there will be more. Keep tuned.

Pere