Disabling IPv6 from Raspbian and RHEL

Quick tip on how to disable IPv6 from Raspberry Raspbian and RHEL-like distributions:


Open (or create) /boot/cmdline.txt file and add the following line:


Reboot your Rasp and it is done.

RHEL (RHEL, CentOS, Fedora, …)

Open /etc/default/grub file and add the ipv6.disable=1 parameter to the end of GRUB_CMDLINE_LINUX:

GRUB_CMDLINE_LINUX="rhgb quiet ipv6.disable=1"

Then you need to recreate the grub.cfg config file to reflect this new change.

If you are running on BIOS/Legacy mode:

$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg

If you are running on UEFI mode:

$ sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

Reboot your machine for this change to take effect.

Share Comments

JasperReports example

I have created a simple Maven/Spring Boot project to demonstrate how to generate a PDF report using JasperReport library. Although it is a simple example I decided to use Jasper sub-report approach, thus I give an example on how to build more complex reports.

I also chose to use a SQLite database to provide the report data. It is a very simple database containing only one table. Since the project is using the DAO design pattern, you can adapt it to use another database without much effort.

If you just want to run this example, you don’t need any IDE (Eclipse/Netbeans/IntelliJ). Assuming you are running Linux, you just need these following lines:

$ git clone https://github.com/sergiodurand/jasper-examples.git
$ cd jasper-examples
$ ./mvnw spring-boot:run
$ xdg-open /tmp/report.pdf

For more technical details about this project or if you want to get access to the source code, go the the jasper-examples Github repository.

Share Comments

How to solve a DHCP issue with Fedora

If you have problem with Fedora & DHCP maybe this post could be a “solution” for you.

The scenario: a network interface (Ethernet or Wireless, does not matter) keep trying to receive its configuration through DHCP with no success. The temporary workaround was to set the IP address, subnet mask and DNS statically, but it is not the ideal configuration.

There is a known bugs wiki page of Fedora 21 explaining why it happens, why it is not a Fedora fault and how to “solve” it.
A note about it: for me, this issue happens only with Fedora. I tested with other Linux distros (Mint, CentOS, openSUSE) and Windows 10 and it worked for all of them.
This issue was raised on Fedora 21. Today I am using Fedora 28 and it is still happening.

Here is the “solution” for the problem:

To work around the issue, create a file /etc/dhcp/dhclient.conf with the contents:

send dhcp-client-identifier = hardware;

You can find more information about this issue in the following links:

Bugzilla #1154200
Fedora 21 Common bugs

Share Comments

Xiaomi Mi Band 2 button problem

I have a Mi Band 2 device, a fitness monitor created by Xiaomi.

Unfortunately there are several consumers, including me, suffering with a problem with its capacitive button that is used to cycle between data like steps, calories, heart rate and so on. A simple Google search will return dozen of reports.

The first tap on the button shows the time, but if I tap it again to show steps, it does not work.

I have found the problem, but not a solution yet.
If you have any clue, you are welcome to share it in the comments.

For some reason, I don’t know if it is due hardware or software issue, each tap on the button behaves like a long press. After each tap the button remains ‘locked’ for about 6 seconds. After that time, it works again. But since the screen is turned off in 4 seconds, the next tap will just show the time again.

More precisely I have found that each tap behaves like a ‘long press’.
I could determinate the problem when I set an alarm with snooze mode enabled.
When the alarm goes off, you will see that a single tap is, in fact, a long press.

A common misunderstand is that the error is due a firmware update.
No, it isn’t.
I have used the Gadgetbridge to downgrade the firmware. I have tested several versions. None of them worked.

I have recored a short video to show exactly how it behaves:

It started to fail after an automatic firmware upgrade, around February 2017.

Since then, I have received other Mi Fit app updates, sometimes with new firmware, but the problem persists.
I have enabled “rotate wrist to switch info” as a temporary workaround.


Share Comments