Thursday, November 01, 2018

Getting into Android coding, the annoying things

I finally gave in and started to work on my first ever Android app. I've done some small JavaME things in the past so it was not so bad after all. Not that there aren't plenty things that seems so backwards, silly, idiotic and overly complicated after working on apps for Maemo, Meego, Sailfish OS and BlackBerry 10. Qt, QtQuick and C++ is elegant. This mess with XML files and Java.. not so much.

But most of all, the Activity states. Like what the fuck where they thinking ?


Whoever is the idiot that came up with the idiotic Activity state things, do yourself a favor and hit yourself with stick and jump before a train or something.

Ever heard of multitasking ? Blody Windows 95 on a 486 can multitask better that this crap. Phones have gigabytes of memory, more cores than my home server and it seems impossible to do at simple task like this:
  1. Browse Facebook
  2. Open a post
  3. Open a link in the browser
  4. Go back to FACEBOOK AT THE EXACT PLACE WHERE I LEFT IT and the left browser load the page in the background (you now, multitask!)
  5. Nope, Facebook restarts and reloads a random post list, whatever I was reading is nowhere to be seen. And the browser does not load the page in the background as it was paused.
  6. Fuck I hate Android.

Wednesday, August 01, 2018

A quick and bad Raspberry Pi 3 32-bit & 64-bit OpenSSL speed test

I wanted to make a quick test if there is difference or not as the Pi people keeps telling us that there isn't or not large enough to support a native 64-bit userland.

And there seems to be, but, this test is very bad in multiple ways. Different versions of just about everything was used (glibc for 32-bit, musl for 64-bit, different gcc versions for building, etc) and also because raspbian is built for armv6 it will loose from the start.

These are just preliminary finds so take them with a grain of salt. Still, interesting...

OpenSSL

OpenSSL hmac(md5) speed test comparing 32-bit and 64-bit build

OpenSSL sha512 speed test comparing 32-bit and 64-bit builds

UnixBench test: 


whetstone-double
32-bit: MWIPS 1038.823
64-bit: MWIPS 1379.241


Tuesday, July 31, 2018

Text mode tools for Turku region public transport

Quite often when there is some nice API for something, the obvious application type seem to be a mobile application or somekind of web site/app. That is all quite nice and all but sometimes you just need a simple tool. Probably most Linux (or unix) user spend most of their time in a terminal so why not make some tiny command line utilities instead ? My latest little project is all about the command line.

Tools to query Turku Region public transport data from the command line, fast and much more efficient than opening a browser, finding the site and all that. For now there are two tools:
  • tkuftop: for the bike rental system showing real-time statistics about bike availability at the stations.
    It can also dump rack location the information as CSV and PostGIS SQL statements for easy import into any system. There is also support for relaying the information to an MQTT broker.
  • tkufstop: and one for real-time bus stop departure information.
These tools are simple and compact, written in C with a little help from curl and json-c.

tkufstop showing departues from stop T9

tkuftop showing bike rack availability information

 And of course everything is open source and available on github.


Wednesday, June 06, 2018

Grab H.264 video on Raspberry Pi with gstreamer

(More like a note to self this.)

Load Video4Linux driver:

sudo modprobe bcm2835-v4l2

Grab some video into Matroska container:

gst-launch-1.0 v4l2src ! video/x-h264,framerate=30/1 ! h264parse ! matroskamux ! filesink location=test.mkv

In Full HD:


gst-launch-1.0 v4l2src ! video/x-h264,width=1920,height=1080,framerate=30/1 ! h264parse ! matroskamux ! filesink location=test.mkv


Saturday, January 20, 2018

cannot verify ftp.drupal.org's certificate, issued by 'CN=GlobalSign Organization Validation CA - SHA256 - G2,O=GlobalSign nv-sa,C=BE'

So Drupal modules and releases are behind https these days. That is great for security!

But trying to download anything with wget leads to:
WARNING: cannot verify ftp.drupal.org's certificate, issued by 'CN=GlobalSign Organization Validation CA - SHA256 - G2,O=GlobalSign nv-sa,C=BE':
  Unable to locally verify the issuer's authority.


Unfortunately when, for reason or another, you are stuck with an older distribution that hasn't updated their CA certificates for a while you will hit the above when trying to download something with wget.

Annoying isn't it ?

And googling around about it leads to nothing. There is no Real(tm) upstream distribution of CAs and it is very poorly documented how you are supposed to do that manually, IMHO.

The problem is that you are missing "GlobalSign_Root_CA_-_R3.pem" and of course the relevant hash symlink to it "/etc/ssl/certs/062cdee6.0"

To fix the issues you can copy over the "GlobalSign_Root_CA_-_R3.pem" from a more up to date system (usually in /usr/share/ca-certificates or in /etc/ssl/certs) into /etc/ssl/certs/ and then run c_rehash and the you should have:

root@xxxxx:/etc/ssl/certs # ls -l /etc/ssl/certs/062cdee6.0
lrwxrwxrwx 1 root root 27 Jan 20 13:14 /etc/ssl/certs/062cdee6.0 -> GlobalSign_Root_CA_-_R3.pem

Now it should work!