Installing Vagrant on Windows 10

Published on: 29.12.2019

I am a fan of CLI packet managers (because they save me time).
On Windows Chocolatey
is the only option, so I tried to install Vagrant with VirtualBox as hypervisor with it.

How difficult can it be?
More then I expected.

Instalment of Vagrant and VirtualBox look easy:

Init and up:

Have we have first problems:

After googling, one possible solution is to set the provider explicitly, not a big problem, altho I like when tech just works.

Try again:

Then next again the problem:

Try my luck with older version 6.0 of VirtualBox:

Let try again:

Finally working.

As you can see now just vagrant up is working without the need to set provider.

Mock time in Python unit tests

Published on: 27.11.2019

From my point of view, unit tests are useful, especially for refactoring functions that have clearly defined inputs and outputs.

One thing that is impossible to test is anything regarding time/date code because whenever you run it is a different time 🙂 .

For example, if you have a function that calculates the number of days between two dates, the only way to test is to somehow mock current time/date.

in Python, there is FreezeGun.

It is implemented as a decorator, which is handy and readable in code.

So far I have not found any problem with FreezeGun.

qgrid is an interactive grid for Jupyter notebook

Published on: 01.10.2019

One useful tool for doing exploratory data analysis in Jupyter notebook is qgrid.

Qgrid is an interactive grid for sorting, filtering, and editing Pandas DataFrames in Jupyter notebooks.

When I first saw qgrid, I did not understand the use of it.
Everything that qgrid can do I can do in regular Pandas code.

When I started doing exploratory data analysis, after some time I notice that I spend most of my time sorting and filtering data to understand/find the connection between it, changing code, pressing SHIFT+ENTER and waiting for the result.

With qgrid changing code and pressing SHIFT+ENTER steps are removed, changing filters/sorting in qgrid requires less mental energy than writing code and it is less error-prone.

Qgrid makes the whole process less time and energy-consuming, basically, I am increasing productivity with qgrid.

If you do any exploratory data analysis my suggestion is to try it.

Qgrid offers much more than just interactive sort/filter for Pandas DataFrames, like events, for more information, there is a nice 1h video and documentation.

Less is more

Published on: 01.09.2019

In 2017 I was looking for an alternative to Evernote because in free version syncing is only available across two devices.

Generally, I do pay for software, but because I only use it for sharing plain text an not very often I decided to check alternatives.

Simplenote was free, could be used on the unlimited device and I am still using it.

After some time I have found that Simplenote is a superior product that Evernote for my use-case.

Simplenote superiority, for me, is due to a limitation that only plain text is allowed.

Only recently I have found out that Markdown is also available in Simplenote.

This limitation enables me to be more productive because the focus is on content and not on presentation.

Then an interesting idea came to mind, it is possible to make a successful product just by making cutdown version (without some additional features ) of already existing ones.

HTTP ping

Published on: 01.08.2019

ping is a great tool to check if some computer/server/router/camera (any IP addressable device) is online.

For me, it is useful when restarting the virtual machine and using ping with -t flag for constant checking when a machine is online so that I can check if everything is working as it should.

Just to get some context, at that time one of my responsibility was for 120 virtual machines in one organization.

Some virtual machine where web servers, although ping was useful for me to know when a machine is back online, but would be more useful is to know when the web-page is online.

That got me thing, that it would be great if I had some kind of ping for HTTP.

Luckily it exists and it is called httping.

If you use Chocolatey installation is easy with choco install httping.

From my experience httping is working fine, as expected.

Only issues that I have found is that often web server is online, even a few minutes before the web-page that I need is online.

This is not a problem of httping, normally web-server is online before the web-page, especially is web-page is some complex web application.

Next step would be to find some httping tool with grep capability.

I could build that toll myself probably in a few hours (with Python), but currently, there is no cost-benefit for my use-case.

If you know some tool with those features, feel free to leave a comment.

Problems with IT certification

Published on: 01.07.2019

Is IT certification useful?

IT certification should prove that the holder has skills and knowledge to do particular work.

Often skills and knowledge that you need to get particular certification are different (hopefully their union will not be empty set) from skills and knowledge that are needed in practice.

And this is a problem.

From the perspective of the employer, IT certification looks like a great thing, the solution to the problem of who to hire.

Just take the person with the highest certification.

IT certification is very similar to grades in school.

A person with the highest grades should be the most competent, but often it is not, because of a lack of real-life experience.

And because you can not do two things at the same time, you end up with one or the other.

Often certification is a hedge for management.

If employe/project fails, they are not responsible, they hired certified persons, otherwise, they could be liable.

Another issue with certification, that I have observed is that total beginners assume if they pass certification they will be experts and find work.

Certainly, a beginner who has CCNA knows more that person who never configured a network, but CCNA alone, without any other IT knowledge is almost useless.

I do not think that certification is totally useless, just that it is overrated due to misunderstanding.

Windows package manager

Published on: 01.06.2019

Chocolatey is a decent package manager for Windows OS, it is usable and has an updated list of packages.

Package manager provides a way to install/uninstall the software from CLI.

If you are not a CLI user, Chocolatey package manager is a good way to start using CLI.

What is the benefit of CLI package manager software?

For me personally, the benefit is in spending less time in operations of installing, updating and uninstalling software.

The traditional workflow of installing software is usually the following:

  1. open web a browser
  2. search for webpage from where the software can be downloaded (just this can take a long time)
  3. open the desired webpage and search for from where to download software
  4. then initial download
  5. after the download is completed, start the installation and do “Next-Next-Finish”
  6. delete the original installation file

As you can see there are 6 steps in the workflow minimally.

With CLI package manager all, I need to do in CLI is to type choco install SOFTWARE and everything else is done automatically.

This is more productive.

If you want GUI there is also a package for that.

The first thing to do before you start to write code

Published on: 01.05.2019

Let me start with a personal true story.

In 2014 I was working on a personal project of making IOS card game called Tablic, I spend more than 200 work hours on did 80% of the original plan and never finished it.

Do you know why?

Because of software scope creep.

Originally I had the idea to make a game with one player vs. computer.

As I was near completing that goal I started adding additional features: I could add 4 players, a user could select AI difficulty.

Each additional features meant more development time: new code and changes to an existing one.

And after all this, I decided to add multiplayer support over local WiFi and over the internet.

This last decision has truly killed the project completely.

In order to implement multiplayer, I had to write a lot of additional code and to change existing architecture, it was at least an additional 300 hours and after more than 200 hours already spend I decided to take a small break (like a week) but later never continued.

The reason why I did not want to release it without multiplayer was that I was thinking it is not good enough, other games had multiplayer, how can I make one without it.

I was always thinking that I will continue and finish it one day, but that day never came, today I am thinking that it is probably better to rewrite it to Unity than to continue in Objective-C (but that is a discussion for another time).

Years later when I was analyzing why I never finished that IOS game, I came to the conclusion that the original problem was because I did not have a specification of the first version.

By specification, I just mean a list of feature, with dependencies between them, basic UI scatch and time estimates.

As I was completing some features I continue adding new ones indefinitely.

I am pretty sure if I did implement multiplayer I would add some other features also.

Today I am wiser or I just think so.

Now I have a process for writing software.

Before I write code I decide what is MVP that I will make, without even thinking about additional features.

The reason why I do not even want to write addition features is that I have learned that even when I make software for myself, software what I make is not software that I need.

Define what kind of minimal features you need to have in your software, make dependencies between them and time estimates how long it will take to make them.

I do time estimates in pomodoros (25 minutes increments) but other time units can be used.

You can not understand the solution until you had the problem

Published on: 01.04.2019

I understand RESTful web services, or at least I think I do.

I agree that when you have huge teams and code base it makes sense to cut them in small independent pieces and connect them via queues and HTTP.

Collaboration on large software projects is hard and problems are increasing exponentially with a number of people added to the project.

The tradeoff is that the overall speed of your software will decrease (because of HTTP networks calls), but you will get software system that can be maintained and new features added without the need of understanding/changing/impacting whole system.

But I never found a use case for myself as somebody who is one man team working on his own projects.

Until one morning.

Architecture

I have a lot of (around 10) independent software programs that are running on daily (some even every hour) interval.

Most of them are doing some variation of web scraping, storing, analysis and reporting of results via email.

This was all fine until one morning I woke up and saw there where was no emails from my software.

I know that something was not right.

They all use yagmail for sending email, so I was thinking that there is some problem with that, because it is a single point of failure.

After an investigation, I found out that the problem was with Gmail itself it just stopped working, the next day it was fine, so they just had some issue that they need one day to resolve (I am not talking about Gmail web page, but with SMTP username/password authentication).

Why Gmail

Why do I use free Gmail for sending an email and not some more reliable service like SendGrid or Amazon SES?

That is a nice lecture in technical debt, in essence, what was a good idea for an initial requirement, as time progress and requirements or circumstances change, it is not so good idea anymore.

When I started with my first project in development as proof of concept Gmail was an excellent choice: easy to start and working fine.

As the project moved to deployment an additional projects where made it was easy to copy/paste the existing code than to refactor/redesign/rearchitect existing working solution.

REST solution

Emails did not work one day for me and after one day everything was back to normal.

I started to think about what can I do to avoid this problem in the future.

One solution would be to change from Gmail to something else. but here are a few issues that I do not like.

First issues

What if other solution (email provider) stops working in the future, I would again need to write new code for the third solution.

To fix this problem my idea is to use Gmail as primary providers for email sending if email sending fails I will just use a secondary email provider.

With this logic, I can add the third one also and so on, but I think that two are enough for the first version.

Second issues

Currently, I have around 10 apps (and this number will increase with new apps that I plan to do in future) that need email sending, each has a separate code base repository.

If I want to change something in email logic, even something simple ae username/password I need to do same change it in 10 different code bases.

One solution is to make one code base just for sending emails, this would solve the problem of the same changes in multiple apps.

But in order to work, I need to change the folder structure all my apps, update paths in the code bases, and I can use this only if all apps are in the same machine hosting.

If they are on separate machines it will not work.

REST to the rescue

After understanding all the difficulties, making RESTful web services just for email sending made total sense to me.

The only reason why it made sense to me is that I have a use case where REST is useful and look like the only solution.

The first version will just be adapter/facade around yagmail with REST API, but that is a story for another time.

Billable and non-billable hours

Published on: 15.03.2019

This is written by the consultant/freelancer point of view.

Amateurs are focused on billable hours.

What is your hourly rate?
50$ per hours.
That is not bad, 8h time 50$ is 400$ per day.
20 working days per month is 8000$ every month.
96000$ per year, not bad.

There are a lot of problems in real life with this logic.

First, there are no expenses (tax, equipment, rent, etc) mentioned, like they do not exist.

But I do not want to focus on expenses in this analysis.

Also, can you bill for 8h every day for a year?

If on an average day you sell only 2h than calculations are much different (and not in a good way).

What about all the work that you need to do to sell 1h of your time?

If you need to spend one addition 1h in order to sell 1h of your time then your hourly rate is cut in half.

If you work for somebody else and you are not a remote worker, then your commute time is an example of non-billable hours.

Different businesses have different portions of billable and non+billable hours, just be sure to calculate that in your equations.

In coding business, and by coding business I mean if you primarily write code, lots of non-billable hours are spent on keeping with technology (even if you are highly specialized).

If you are self-employed non-billable hours are also needed for finding clients/work, infrastructure maintenance, etc.

If you take all that in the account than 50$ per hour and minus expenses, does not look so go anymore.

And you come to the understanding of why it should be more.