Monday, February 18, 2019

Free Software for Web Analytics

This is a personal note. I've been looking for a Google Analytics replacement. These are alternatives to Google Analytics I came across today:

  • Nothing. Yes, nothing. Simply do not track anything, that may be the best way to go as it respects visitors' privacy.
  • AWStats: ugly for modern standards. Based on log files. I recall experimenting with this several years ago. It may be a fine solution to avoid adding JavaScript snippets to a site.
  • JavaScript-based and self-hosted:
    • Matomo (previously called Piwik): seems to be the best of its kind. Well maintained, full of features. Big focus on its commercial offering of hosted service. Matomo on GitHub.
    • Open Web Analytics (OWA): looks less fancy. Seems to be more community oriented, no business around. Open Web Analytics on GitHub.
    • Fathom: maybe the newest kid in the neighborhood. Built with Go and Preact (a smaller React-compatible JS library, first time I hear of it). Fathom on GitHub.
Other pieces of software might be worth a look. No software also deserves a lot of consideration.

See a list of web analytics software on Wikipedia for more.

Thursday, January 24, 2019

Installing Flutter and Android Studio on Fedora 29

Since neither Flutter nor Android Studio come as regular packaged applications, I am installing them under ~/opt/android. Android Studio installs the Android SDK at ~/Android/Sdk, and creates projects at ~/AndroidStudioProjects.

Download Flutter and Android Studio.

$ mkdir -p ~/opt/android

Android Studio installation

$ unzip ~/Downloads/android-studio-ide-182.5199772-linux.zip 'android-studio/*' -d ~/opt/android
$ cd ~/opt/android/android-studio/bin/
$ ./studio.sh

Follow the wizard accepting defaults.

Tools > Create Command-line Launcher, at ~/bin/studio.
Tools > Create Desktop Entry

I did not install the libraries that are said to be required (zlib.i686 ncurses-libs.i686 bzip2-libs.i686). So far they did not seem to be missed.

Set up the Android emulator. I added two virtual devices, both are Pixel 2 with API 28, Android 9.0 with Google Play. One is x86 and the other is x86_64. Not clear which one will give better performance.

Flutter installation

$ tar -C ~/opt/android -xf ~/Downloads/flutter_linux_v1.0.0-stable.tar.xz flutter
$ ln -s ~/opt/android/flutter/bin/flutter ~/bin/
$ flutter doctor
$ sudo dnf install libstdc++.i686

I am a bit puzzled and hesitant to accept licenses that flutter doctor --android-licenses says need to be accepted.

4 of 5 SDK package licenses not accepted

They are:
  • 1/4: License android-googletv-license
  • 2/4: License android-sdk-preview-license
  • 3/4: License google-gdk-license
  • 4/4: License mips-android-sysimage-license
I guess I'll need to surrender :-(

Now on Android Studio, install the Dart and Flutter plugins.

Let the Android hacking begin!

Wednesday, January 23, 2019

Lenovo X1 Carbon 6th Gen - personal notes

Personal notes configuring my Lenovo X1 Carbon 6th Generation laptop.
The computer was bought in July 2018, and at the time there were unfortunate power management issues on Linux, as described in the Arch Wiki.

This post is based on simple notes I took while setting things up.

BIOS configuration changes

  • Disable WoL and UEFI network stack
  • Disable Wake by Thunderbolt 3
  • Disable Card Reader and Fingerprint Reader
  • Disable Computrace module activation
  • Enable Intel TXT security feature
  • Disable AMT (ctrl-P)

Install Fedora 28

Tune GRUB2 timeout for faster boots: edit /etc/default/grub, TIMEOUT=1

Power management

Trying to counter the suspend issue that caused the battery to drain very quick, IIRC in about one or two hours, with the laptop warm when the lid was closed., I went on to install some tools:

dnf install powertop
dnf install tlp tlp-rdw


sudo dnf install akmod-tp_smapi akmod-acpi_call
sudo dnf install smartmontools

sudo vi /etc/defaults/tlp RESTORE_DEVICE_STATE_ON_STARTUP=1

I believe these are not necessary with newer kernels and newer BIOS firmware (currently on 1.34).

Other configuration

Configure name, and background and lock screen

$ hostnamectl --static set-hostname crater.local

Install RPM Fusion repos
Install Dropbox

To get the Dropbox icon on the top bar, install (K)StatusNotifierItem/AppIndicator Support

After about 6 months of usage

The few notes in this post baked for a long time. Now, about 6 months since I unboxed the laptop here's what happened:

  • I have used the laptop very lightly while travelling
  • Was very frustrated for not being able to suspend
  • Suspend issue was fixed by BIOS 1.30, got the upgrade through Gnome Software Center and LVFS
  • There was a growing discontent with Thunderbolt 3, it seemed that enabling it caused boot times and wake from sleep extremely slow, taking 30+ seconds in both cases
  • I have upgraded to Fedora 29
  • At around 20:48 UTC on Jan 6, 2019 the laptop produced its last log line and would not boot anymore
  • On the following day, Monday, I contacted the Lenovo support to claim my warranty, and started a lengthy process until I got my machine back from their repair center on Jan 22
  • They had to replace the motherboard, dead. The note said "reset problem"
  • I upgraded the BIOS on the new motherboard (was 1.27) to 1.34 and the Intel ME firmware (was to
  • Fine tuned BIOS settings, and thus far have not observed the slow boot/wake up like in the faulty motherboard:
    • Disable Wake On LAN
    • Disable UEFI Networks Stacks
    • Power > Sleep State = Linux
    • Thunderbolt BIOS Assist Mode = Disabled (not changed from factory, until I determine if enabling is really needed with the current firmware/kernel combination)
    • Disable Wake by Thunderbolt
    • Disable Intel AMT by pressing ctrl-p when the Lenovo logo shows up, then set a MEBx password and disable AMT management features (I so much wish Intel ME and all other features were not there in the first place...)
    • Enable Virtualization features
    • Disable ports: Ethernet LAN, Wireless WAN, Memory Card Slot, Fingerprint Reader
    • Disable Computrace
    • Keep Secure Boot disabled
    • Disable Intel SGX
    • Boot only using UEFI, disable CSM

I hope the system will survive more usage.