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!

Friday, December 01, 2017

On Teosto and YouTube block in Finland

The whole of Finland was just about to strangle Teosto yesterday as YouTube blocked almost all music videos. Teosto is the umbrella copyright mafia here and collects money in different odd ways to the "starving" artists... (and collects a nice 4.2 Million for their own salaries...)

Anyway, what is interesting to think about is what artists are using YouTube for. They have their own channels for promoting their stuff, music videos. These days, as MTV is just playing reality TV and other shite, YouTube is probably the primary place to show these videos.

Now what is interesting is that YouTube is totally Free, anyone can create a channel and share their stuff. Good quality. Full HD. 4K. 60fps.

Seeing what I'm getting at ? They get a platform, for free, to distribute high bandwidth content that takes up plenty of space, plenty of bandwidth, power and servers in the thousands. For Free. For marketing their own content. For free.

Think about that for a second. Even some crappy Finnish artist video with 3-4 million views in Full HD, fully streamed, say a conservative 300MB/view takes a nice ~900TB on bandwidth. And they get this FOR FREE.

And the fuckers demand money ???!!

Right.

Tuesday, August 01, 2017

A couple of cheap Macintosh SE's

A friend found a bunch of Macintosh SE's at at recycling center a while ago (year?) and I was finally able to go and pick them up a couple of weeks ago.

Two Macintosh SE FDHD models and three dual DD floppy drive models.

One of the FDHD has been used as a server, and digging around the drive I was able to find out that they had been used at a school in Lahti in the 1990s.

Documents where dated around 1994 and some log files said 1996 so they have probably been unused for 20 years or so.

Apple Macintosh SE
I picked them up on the way to our summer cottage, so to be able to test them I grabbed, what I thought to be, a SCSI box with Mac System on it with me.

Unfortunately my memory had failed me and I took some other systems SCSI disk so I didn't have anything to boot from until I got back home. The server did boot up but directly into AppleShare. And obviously I didn't have any administrator password codes so I couldn't disable it.

Back home I got the right SCSI disk box connected and everything seems to work just fine.

You can see the price in the above picture, 10€ :) (And luckily for me I didn't need to pay anything for them, all free :)