https://erwyn.piwany.com/https://erwyn.piwany.com/favicon.pngRetotaglibrohttps://erwyn.piwany.com/Ghost 2.14Sun, 03 Mar 2019 18:35:38 GMT60I recently acquired a Logitech bluetooth mouse and, although I was enjoying it a lot as always with Logitech, I was quite disappointed that I had to pair it again with my computer everytime it went to sleep or I would reboot it. So, after a small time of frustration,]]>https://erwyn.piwany.com/trust-your-bluetooth-mouse-on-linux/5c3079956a39d200017d44f1Wed, 16 Jan 2019 19:06:44 GMT

I recently acquired a Logitech bluetooth mouse and, although I was enjoying it a lot as always with Logitech, I was quite disappointed that I had to pair it again with my computer everytime it went to sleep or I would reboot it. So, after a small time of frustration, I decided to take a look on what was really going on, because the bluetooth keyboard was working like a charm, surviving reboots and so on.

The [Logitech m535](https://www.logitech.fr/fr-fr/product/bluetooth-mouse-m535?crid=7) is embarking Bluetooth 3.0 and my computer was powered with a Fedora 29 when this happened. The problem is that by default, because your device is not capable of inputting a PIN code like the keyboard could, it won't be trusted, thus needing a new pairing everytime the connexion is dropped. Thankfully, we can manually trust the device and get rid of this annoying ritual.

First of all, we need to completely remove the device from your bluetooth device list. In order to do so, you need to go in the bluetooth settings of Gnome, click on your device on the devices list and click the "Remove Device" button.

Remove Device Menu in Gnome - Fedora 29

Once this is done, shut off the mouse and the fun can start. What we will basically do is use the command-line client for bluetooth bluetoothctl and query manually with it.

So, first step is to launch it with bluetoothctl:

> $ bluetoothctl
Agent registered
[Keyboard K380]#

Now that this is done, we can launch the scanner with scan on and then turn on the mouse:

You see the line with [NEW] ? That's the one we are looking for. You can then turn off the scanner to reduce the noise with scan of, copy the MAC address, here XX:XX:XX:XX:XX:XX, and then ask for pairing with pair XX:XX:XX:XX:XX:XX:

Perfect! Now you can simply quit the command line utility with quit and you should be good to go. Try to restart your computer, your Bluetooth mouse should connect back automatically.

See you soon !

]]>I'm probably very very very late to the party as Borg is actually a fork of Attic, but I just discovered this backup tool randomly on the Internet and I have to say, I'm in love with it!

It's very simple simple to use, yet very powerful all thanks to

]]>https://erwyn.piwany.com/borg-backup-deduplicate-them-all/5ad26e171850e60001d2f618Sat, 14 Apr 2018 21:26:55 GMTI'm probably very very very late to the party as Borg is actually a fork of Attic, but I just discovered this backup tool randomly on the Internet and I have to say, I'm in love with it!

It's very simple simple to use, yet very powerful all thanks to the deduplication. So what is this deduplication? Here is what Borg says about it:

Deduplication based on content-defined chunking is used to reduce the number of bytes stored: each file is split into a number of variable length chunks and only chunks that have never been seen before are added to the repository.

A chunk is considered duplicate if its id_hash value is identical. A cryptographically strong hash or MAC function is used as id_hash, e.g. (hmac-)sha256.

To deduplicate, all the chunks in the same repository are considered, no matter whether they come from different machines, from previous backups, from the same backup or even from the same single file.

Compared to other deduplication approaches, this method does NOT depend on:

file/directory names staying the same: So you can move your stuff around without killing the deduplication, even between machines sharing a repo.

complete files or time stamps staying the same: If a big file changes a little, only a few new chunks need to be stored - this is great for VMs or raw disks.

The absolute position of a data chunk inside a file: Stuff may get shifted and will still be found by the deduplication algorithm.

So basically what it means is that only what has been REALLY changed will be considered by Borg. And that, added to the compression makes it space efficient.

How do I create a repository ?

It's quite simple. In my scenario, I want my backup to be stored through SSH on my remote server. Let's start by using ENV variables because it makes everything always easier. In my .zshrc file I added this line:

export BORG_REPO='erwyn@myserver.example:backup'

Now we can create the repository:

$ borg init -e repokey erwyn@myserver.example:backup

You'll be asked for a password to encrypt the data. Please note that Borg supports other authentication means.

How do I backup my stuff ?

First, let's add a .borgignore file containing all the files/directories (one per line) I don't want to back up, for instance my /Downloads folder.

]]>IoT has always been a very interesting subject to me as I'd love to work on a project on this thematic but most of the time I'm really not convinced by the connected devices I see out there. I'm a strong advocate of offline first when it comes to those]]>https://erwyn.piwany.com/the-internet-of-things-is-going-to-destroy-us-all/5a53440fd0471c0001617310Mon, 08 Jan 2018 17:30:00 GMTIoT has always been a very interesting subject to me as I'd love to work on a project on this thematic but most of the time I'm really not convinced by the connected devices I see out there. I'm a strong advocate of offline first when it comes to those appliances; In my opinion Internet or not, you should be able to use it as if it was the basic object, it should never fail you just because there is a bug in the software or your Internet has broken down. Most of the time the added value of having the object connected is already questionable, if it becomes useless just because your connection went south... Or maybe I just stop following the @InternetOfShit on Twitter.

Anyway, here is a presentation from Bryan Lunduke I found today titled "The Internet Of Things Is Going To Destroy Us All". This is of course a funny one as always with Bryan Lunduke, but it also raises quite some interesting questions about what we are doing and where we are going with IoT.

]]>Those days I'm mainly working with the Play! Framework for Java. We are in a microservices setup and thus we end up having some common code between the different services. We decided to make Play Modules that we would import in the different projects.

Creating the Module

Those days I'm mainly working with the Play! Framework for Java. We are in a microservices setup and thus we end up having some common code between the different services. We decided to make Play Modules that we would import in the different projects.

Creating the Module

In order to do so, we created a project with a few utility classes that we published using SBT and our own Nexus respository. The final configuration ended up being something like this:

And now you are all excited and you type in sbt clean update... And it fails miserably.

Now, the thing is, SBT is gonna try to find your module at https://my.url/repository/maven-snapshots/my/organization/some-module/1.0.0-SNAPSHOT/.... But if you look carefully in your Nexus the module is actually at /my/organization/some-module_2.12/1.0.0-SNAPSHOT/.... Notice this 2.12? This is your Scala version, and this is actually quite important. So now, you're left with 3 choices.