Category: tech
-
Power management and Archlinux for the Framework 13 AMD Laptop
The FW13 laptop equipped with a (yet) powerful AMD Ryzen 7 7840U gave me some trouble when running Archlinux. They dropped support for S3 suspend, for some obscure reasons that I won’t debate in this post, and left me only with a broken S2idle consuming over 8W/hour, thus depleting the whole battery in a (long)…
-
Rails/Devise authenticating using AWS/Cognito Identity
Background For a while now, I’m developing a sort of IoT controller with Rails 4. Until now, Devise was used to authenticate users locally using the Devise’s provided :database_authenticable module. Things changed recently, and I had to move some features of this IoT controller toward AWS. Authentication against AWS/Cognito Identity is one part of the project. “But Why?” you might…
-
Raspberry Pi 3 and bluetooth speaker setup [command line]
Streaming sound from a Raspberry Pi 3 to a bluetooth speaker was not as easy as it should. Internet is overloaded with outdated information about this issue. So I compiled a small tutorial for the latest Raspbian (at the date of writing). My setup is composed with the following elements: Raspberry Pi 3 (got bluetooth onboard)…
-
Let’s encrypt (il buono), rails (il brutto) and heroku (il cattivo)
This article is just paraphrasing this one with a bit more accuracy, corrections and cynicism. First step: Update your rails code on heroku The route /.well-known/acme-challenge/KEY should be added to your config/routes.rb file like so get ‘/.well-known/acme-challenge/:id’ => ‘CONTROLLER#letsencrypt’ where CONTROLLER is the controller of your choice, in which the method should look like this def letsencrypt…
-
Slow Query with “LIMIT 1” in Postgresql
Recently I had issues on a production database running slow on tables with more than 1M rows. This is a complex Ruby on Rails app connected to a Postgresql database, I went through the whole stack to figure out that it’s a simple index problem. Very few or no related doc was found about this…