Saturday, May 21, 2016

I've built

I've built and launched my travel blog in Clojure/Postgresql, it's available at It's not finished yet, but already functioning. 

Sunday, May 15, 2016

How I tried to deploy an Elixir/Phoenix framework web app and didn't manage to do that

Lately I've been trying to deploy a simple Elixir/Phoenix application-blog to a Digital Ocean server and it hasn't panned out. Over the course of a few days I hasn't managed to do that, although, I did feasibly deploy Haskell and Rust applications a little while ago and that took me less than a day and which I also was doing for 1st time.

With Phoenix it was different. I've had bunch of errors deploying my application with Exrm and if it wasn't one thing, it was another.  I'd fix the bugs but then others would pop up. Besides, the documentation on their official website and in the blogs is getting outdated fast.

The straw that broke the camel's back was a bug in a dependency which I got on a server but didn't have locally. Locally, however, the application worked.

Now I'm thinking of switching back to Clojure, Haskell or Rust for this project and returning to Elixir/Phoenix later when it becomes more mature because now, version 1.1.4, it's a disaster which catastrophic consequences. 

Tuesday, May 10, 2016

When working on some project, there's advice acquired by experience which I try to follow. I've mentioned it before. And it is: when there're multiple choices of how to implement something and you don't know which one is better, choose either the simplest one or, of they both are about the same, choose anyone without too much thinking.

Later you might change your mind and choose another option or improve what you've chosen or, possibly, get rid of it. And that's ok because what matters mostly is speed.

Monday, April 18, 2016

My REST API web service for WiFi access points

I've built It's a REST API web service which allows you to retrieve and submit the information about WiFi access points with their passwords. It's built in Haskell and uses PostgreSql.

At the moment it's in the alpha version. 

Saturday, April 9, 2016

My idea about creating strong passwords which can't be lost and are easily accessible.

Memorizing a long password isn't trivial. Changing a password is difficult also. My idea is that instead of memorizing a long, complicated password, what if we calculated a hash of a peace of text which is always available somewhere?

Say, we have a favorite or not necessarily favourite book, movie or song. It can be in English, Chinese or Spanish  regardless of what our native language is so long as we're comfortable in understanding it. We take one phrase from that book, movie or song and calculate SHA-3 from it. And Bob's your uncle, that's our password.

Note that we don't have to remember the whole phrase or phrases. We only need to remember which hash algorithm we've applied and where that peace of text is located: the name of the book or song or whether it be. Then when we need to restore a password, we go to the Internet or wherever it's stored, for example, on our usb-flash drive, take it and calculate a hash from it and the password is restored.

To make it more secure, we could:
  - Take a few sequential phrases and mix them or take them non-sequentially.
  - Add noise to it, for example, "@" in the beginning and "#" to the end and that'll completely change the hash or the password.


How is it better than memorizing a long password?
In this approach we don't have to memorize the whole string being the password.  We merely have to memorize where to get that peace of text and how to calculate the password from it. The bottom line is, even though we don't remember our password exactly, we always can calculate or restore it.

How can one calculate a hash of a peace of text?
In the terminal or in any programming language.

Will the password have to be calculated a few times each day manually?
Yes. But that can be automated.

At the moment this idea is rather raw, it should be improved.

Thursday, April 7, 2016

Multi-line strings in Haskell

When we have a very long string in Haskell, how can we break it into a multi-line one without calling any function on it to concatenate it back? It turns out that Haskell has special syntax for that. To do it we use a backslash at the end and beginning of a string:

 let longLine = "long_line1___\

-- => "long_line1___long_line2___long_line3"

Sublime Text 3 doesn't highlight it properly. Nonetheless, it's valid and compiles.