keskiviikko 31. elokuuta 2016

Export restrictions


For some reason I keep hitting this wall these days. Some time ago I encountered dual use-restrictions when ordering a common MCU, and now I ran into same issue when trying to order a equally common Bluetooth module. In case of Bluetooth this is (my educated guess) because it uses frequency hopping, which actually would be valid reason - if the module wouldn't be fully integrated consumer level device.

Like so many "anti-communist" and "anti-terror" things originating from US (and UK), this would be friggin' hilarious if it weren't actually making my life so much more difficult, forcing me to try to find local sources for such components. And at the same time these same countries (semi-)publicly ship advanced weapons systems to nations known for practicing terrorism. Talk about hypocrisy...

Oh well, US has been out of my list for "places I plan to visit someday" for years now (to be more exact, ever since surrendering to terrorism, in form of Patriot act and other similar anti-freedom legislations during last 15 or so years.)  This is very unfortunate, but as long as their government keeps being hostile to everyone (their own citizensconsumers included), I'll visit damn North Korea first - at least they seems more hospitable place to visit.

Not that NK is very high on my "places to visit first" list either, mind you.



sunnuntai 28. elokuuta 2016

A small problem with bike


So this is how you refill the infamous blinker fluid...


That blinker was pretty much ruined by water. Replacements were a bit difficult to find, at least without risking having blinkers with grossly different shades of orange, so eventually I just ordered completely new set. Now I'm just waiting them to arrive so I could replace them.

And of course that broken blinker means that I couldn't even drive for few weeks (without risking fines for missing lights or my life for cars missing my intents, that is.)




torstai 25. elokuuta 2016

A Linux laptop


Some time ago I had to dig a bit deeper into Bluetooth protocol to figure out the issue with another device not being to connect to ours (problem ended up being their SDP driver that failed if device didn't provide UUID16, so substandard implementation there, shame on them.)  Kali linux, being essentially a custom-made tool for all kinds of analyzing and testing of this kind, proved to be very useful as it comes loaded with tools to see in detail what happens with Bluetooth connections.

I had to use my laptop to run Kali from a live CD and doing that I came to conclusion that I would need a dedicated Linux computer from now on - live images, while very handy, are just way too slow and bothersome for normal use (and a brief experiment with virtualized system indicated that it was just too unreliable - USB Bluetooth modules just didn't work properly)

So I decided to go and get a cheap-ish laptop I could install Linux to for future use. However, when I started to go through list of cheap laptops available I ran into a problem: essentially every single one of them were listed of having issues either with WIFI or Bluetooth drivers, or worst, both. Considering that Bluetooth was pretty high on my "need to do that" list, this was unacceptable.

So I shelved the idea for some time.

Later, however, I took a look at the laptop I originally ran the Kali in - both WLAN and Bluetooth ran fine with it (laptop was old(ish) Asus X550 series, by the way.)  So... Why wouldn't I install Linux to that?

So, I walked in a shop, got another Laptop for Windows use, moved everything over and installed Linux Mint Cinnammon to older laptop. And now I have nicely working laptop for Linux and newer one for doing legacy stuff in Windows. As a bonus, Linux laptop actually has full disk encryption I can trust, unlike windows one that wants to upload my encryption keys to their servers...



sunnuntai 21. elokuuta 2016

Banks and passwords


The situation with banks and their outright horrible password policies never ceases to amaze me, especially when those policies control such a huge amount of money or even worse - peoples' identities. Granted, the situation here isn't as bad as some horror stories I have heard from the other side of the pond (read: mainly from US, where username-and-bad-password without any second factor of authentication seems to be way too common), but it's still annoying here too.

Take my bank, for example (no, I won't name it). They have user name (random string of letters and numbers they assign for you) and password you can choose yourself. And on top of that, there is one-time password from printed list that they send to me. In general, pretty safe system, as that one-time password prevents you from doing anything with just user/pass combination (including, somewhat unfortunately, many credit card purchases from local web shops - I don't carry that list with me so that's a bit of an annoyance, especially when making travel arrangements for work)

But back to passwords. My chosen password originally had 9 characters. The password page says that maximum length is 8 characters but either that isn't enforced or the policy changed since I picked it. Change might've been when they did major system overhaul at one point due to SEPA - which is damn great, I can send money to anyone within SEPA-area with literally zero cost!
 
This same overhaul brought ability to use paytrail for online shopping. It essentially allows you to pay directly from your bank account with direct transfer, which is pretty nice since not all people have credit cards. Here things went wrong however.

To pay with paytrail you have to provide enter your banking credentials along with one-time code during checkout process. And for some f'ed up reason this will fail horribly if your password has more than 8 characters. And not in a good way - my payment ended in some kind of limbo where I couldn't tell what had happened, except that payment failed. At bank's end all was good; on recipient end however I used significant discount code that was used up although payment eventually wasn't successful. It took some time to straighten things out. But I wasn't exactly happy about this, and figuring out why things failed took a while longer as password problem wasn't exactly apparent - payment just failed with no apparent reason. And I could use the same password to log in to bank itself with no problems.

Eventually someone could point out the reason and I changed the password to 8 characters, no problems since, but really now, this is friggin' 2016. 8-character password is nothing to most password cracking tools. I'd expect the banking system to allow longer passwords - even if the account is protected by the one-time code on top of that.

As a tangential side note, banking situation in US is simply astonishing to me. People are still using checks? Oh, I vaguely do remember my parents using those, back in 80s. Damn things have been antiques for some three decades now. For just about anything that doesn't need face-to-face interaction national bank transfers have been so easy and free (yes, completely free) for ages now (and now, with SEPA, that's for most of Europe.)  Absolutely no one expects for example rent to be paid with anything else than bank transfers. Cashier's checks however I have used a few times, for things like buying a house or a  car (carrying massive amount in cash doesn't feel exactly safe, never mind the funny feeling of having suitcase full of cash), but personal checks... Come on now, this is 21st century, not medieval times!



sunnuntai 14. elokuuta 2016

Blueprints, blueprints everywhere...


I've been playing a bit with Unreal Engine 4 lately, and while I appreciate the idea of Blueprints (which, in context, for those that unfamiliar with UE4, are essentially visual programs, with lines connecting them in sequence, different lines connecting inputs to parameters and to outputs and so on - google them yourself if you are interested), they - at least to me - seem to become horribly complex mess very quickly as program complexity grows.

You can of course use C++ with UE4 too, but it seems to me that that side is horrible neglected nowadays - documentation is out of date (supposedly latest document pages suggesting using already deprecated functions), there either are no examples at all, or they are too few and often too simple for anything past "hello world!"-equivalent and so on.

But then, after wasting a few days (well, evenings) building something that should be just about the simplest thing in existence I start to see why this might be the case. The C++ build environment seems to fragile as hell. Even with vast prior experience with C++ things just don't make sense (granted, that's usual first impression when encountering new, huge code base), and even most innocent looking change will blow up the code (with all the macros and UE4's own preprocessor magic) in unexpected ways, as well as making any compiler error listing full of stuff cause by said preprocessor magic. Combine this with the fact that almost all the examples are worthless videos (give me properly explained text with code snippets any day!) where I can tell the "tutor" obviously doesn't really have a clue what he is doing ... Well, it gets frustrating very quickly.

Just recently Epic announced that UE4 apparently has something like 1,5 million developers. I have no idea how they calculate that number, but I suspect that vast majority of these developers never really do anything with it - people in schools, or who want to play with it for a while and so on. I am quite certain that huge number of those never get past the first hurdle of starting with C++ code.

No wonder people won't even try and go to blueprints.

With all that said, I don't plan giving up. Persistence manages. Eventually. And after grasping the ... quirks ... of the environment it very likely will get easier and I can start focusing on the real code.




torstai 11. elokuuta 2016

Some thoughts on world wars


I've been listening to Dan Carlin's WWI podcasts lately (Hardcore history; Blueprint for Armageddon) and it is quite fascinating. I get that he is no historian so those proverbial grains of salt are needed, but I'm even less historian (I've grown fond of historical topics only recently) so I am just accepting that his interpretation is fairly close to real events.

What has grown to bother me is how the initial setup of the war is described. There had not been a war between major powers since Napoleon's era - 100 years or so. There had been smaller conflicts - Russo-Japanese war (I'm typing these out from oral memory so there might be transliteration errors involved here) and Krimm war for example - but there had not been any wars between major powers for a long time.

Over that time killing power of technology had increased a lot - way, way more than people (including generals and other leaders) really expected. Machine guns and artillery were now a serious powers, but since they had not been used against opponents with similar capabilities their power was severely underestimated and the end result is that military leaders were forced to learn what was new as they went on - often by sacrificing thousands or tens of thousands of men for nothing but a lesson of 'that didn't work.'

Now, my speculation starts. Fast forward to this day. There has not been a major war between major powers since WWII. There has been many smaller conflicts, but most have been local or quite one-sided and wars generally are limited in nature. And technology has progressed massively.

Since no major wars have been fought lately, especially not total wars, so we do not really know what the capabilities there are exactly. Does this situation remind you of one world has already experienced, like the pre-WWI scenario above?

Granted, so far I don't see current situation as a powder keg like Europe was back then - I think that we've learned something and no one really wants that kind of war. Wait, no, I take that back - there are people who really do want that war to happen - they're ones that would supply either one or both or all sides with weapons - but they are minority (hopefully) and thus don't have that much power (hopefully) and so they don't get their way (again, hopefully). Unfortunately these people have lots of (bought and paid for) political power so it might not be that simple...

But still, this thought is enough to make me feel uneasy. Possibility is there, lurking in depths of political disagreements. Religion certainly is playing a role too there, but that at the moment it is restricted to "not a major power" status so I don't expect real war from there. And given mentioned technological advances, I really, really do not want to see how that war would be fought...




sunnuntai 7. elokuuta 2016

File save safety: the reason


Some time ago I wrote about saving a file in a way which wouldn't lose previously saved data if saving fails. I said that I don't know what actually happened to the phone then; everything behaved like disk was full but df indicated it wasn't; I still had about 3GB free on internal storage.

Well, yesterday it happened again, and I got message about it mentioning app registry. That was enough for me to chase the rabbit down the hole in search for answers. As it turns out, Jolla phone uses btrfs as main file system, and it seems that btrfs is .. fragile .. whenever disk gets more than halfway full (and getting catastrophically worse when getting nearer to full), especially when dealing with small-ish devices (like 16GB Jolla has as internal storage). Typical tools, like df - indicate plenty of space available but btrfs has its own internal mechanism for allocation and disk actually is "full", resulting inability to write new files. Well, fsck.

So, not exactly great choice for phone storage, as people tend to have their devices full of all kinds of things. No idea why that was chosen, really, as I haven't seen any explanation for that. But at least there is microSD slot that can be used as storage for media, which tends to be the biggest consumer of space anyway.

Fortunately there are tools to mitigate the situation (btrfs-balancer and others) already installed on phone. Unfortunately those need things to be done from command line. While Jolla has terminal built in, the problem is that I don't expect most people to be able to do that. Or even be willing to do that, really.

I guess there is some very good feature in btrfs that is the reason for developers choosing it over more typical filesystems, but at this point it would have to be some mind-blowingly great reason to counter failure of this kind. Not cool, Jolla devs, not cool at all.




torstai 4. elokuuta 2016

Should I invest in solar panels?


To be short, Betteridge's law of headlines says very explicitly: No. But damn if they don't it sound tempting.

And despite previous post critisizing current renewable energy situation I still feel very tempted. If, for nothing else then for my own curiosity's sake.

But to expand a bit, I have a summer home, with running municipal water. Since it gets very cold here in winters this means that I need to spend a lot of electricity to heat the cottage even when I'm not there - emptying the water system is pretty much impossible. This being a bit remote location means that this isn't cheap.

My dad however has been encouraging me to get a few panels, 5 or so maybe, to aid with heating there. I'm guessing he'd like to have few panels of his own, too, in same order. The problem is that I've done the math and it doesn't look good.

The main problem is insolation. The word essentially means the amount of solar energy that reaches the ground. I don't have the hard numbers of insolation around here ("here" being close to 65 degrees northern latitude), but I do have numbes for Helsinki (60 degrees north). Up here the numbers are certainly even worse. Unfortunately I don't know how much worse exactly but I've assumed 60% of Helsinki figures in calculations below during the darkest time of the year.

Assuming six panels, 0.91m², each with 140W nominal power the numbers come out as follows:

October: 379 kWh total over month
November: 89 kWh
December: 8.5 kWh (total over the entire month!)
January:  38 kWh
February: 255 kWh
March: 742 kWh

In other words, during the darkest and coldest period of the year the production is practically nothing. But for other months the figures start to look a bit better - during spring and fall there should be enough power to cover at least some of the heating - at least during sunny days.

During summer there is no need heating so savings there are close to zero, aside water heating (granted, that takes a fair bit of energy) and possibly refrigerator (no idea how well it would work during nights as sun doesn't really fully settle).

Now to the main problem again: energy storage. Grid-tie system is completely insane option here - I'd end up paying for each kWh I provide to the grid. So that's out immediately (and that isn't storage anyway, from broader perspective, it's just externalizing the storage problem to someone else).

Battery storage doesn't really make much sense in this situation either; a battery or a few could store enough energy for lights but not much else. So having batteries isn't actually worth the cost or trouble. But at least that would cut off one expensive part (batteries) from the system.

So let's say that I just use panels with inverter connected directly to them. Then there is the problem with brown-outs: I have no idea how inverter would work when usage is greater than what panels can provide. Not well, I fear. I've tried to find out that behavior conveniently seems to be left out from easily available documents.

On the other hand, at summer panels could provide more than 2000 kWh per month. The question is, then, what could I do with all that power. And unfortunately answer is pretty resounding "nothing". Some of that energy I could use when I'm there, but the remaining would pretty much go to waste, short of some ingenious personal fuel refinery gadget (no, those don't exist but man can dream, right?)

But still... It'd be a fun experiment, anyway, even if it wouldn't make any real economical sense.

And yes, I do realize that situation here is completely different than in south where air conditioning is major power hog. For that solar, even now, makes perfect sense. But even then there's still those 12 hours per day there without any solar power...