Running a Go binary as a systemd service on Ubuntu 16.04

This is a quick guide to run a go binary as a systemd service (daemon) on Ubuntu 16.04, which is the latest LTS version available.

This article will not talk about how to create golang services, cloud architecture, etc.

Creating gatomocho as systemd service

Create /lib/systemd/system/gatomocho.service with the content:

The absolute paths in ConditionPathExistsWorkingDirectory and ExecStart all need to be modified per your environment. Notice that we have instructed systemd to run the process as the user gatomocho, so we need to create that user as well:

The journal is stored as a binary file, so it cannot be tailed directly. But if we configure syslog, we have syslog forwarding enabled so that we can have our log sent to /var/log/gatomocho/.

What’s next?

The answer depends on how you configured your env. Few bullets to take care of:

  • Update firewall rules
  • Create a domain server on nginx
  • Enable SSL for your domain

Tomatoro: Pomodoro made easy

The last side project I was working on is Tomatoro.

At the office, I’m always thinking of how to make my work easier, how to be more productive and how to reduce distractions. One day, I found the pomodoro technique. I tried it with doubt: how working short time cycles might make me more productive?

Well, it did.

I tried with that technique for a week. I finished my daily duties in less than 4 hrs instead of 6 or 8.

How does Tomatoro work?

For each 25 mins of work or Tomatoros, take a 5 mins break. After completing 3 Tomatoros, take a longer 15 mins break. Repeat this cycle!

Perhaps the beginning is hard, the result worth the effort. You need to change how you work, because you need to focus on your task during 25 min. Some people start to “get in the zone” after 15-20 minutes. Taking a break after reaching that point sounds like a waste of time. But it is not. After the second or third cycle, you can concentrate on what matters more easily than before.

The main point of pomodoro technique is to have little breaks, so you might relax your mind and your eyes. It is important to avoid looking at your screen or your mobile device, because the stress in your eyes will quickly tire you. Get away from your work station and get fresh air, a coffee or go to the restroom, whatever you need.

Other cool thing about Tomatoro is that you can count how many working cycles you have done. If you write down that number, you can compare your daily results to figure out how much effort is taking a task or activity.

If you are interested on trying it, you can start right now using this link: Tomatoro. This project is open source, you can read the code and support it filling bugs you encounter or helping me to add new functionality!

Web page: https://tomatoro.com
Github: https://github.com/tonymtz/tomatoro

Sunday Working Meetings

This February I have been busy with my main job: software development. I haven’t had enough time to produce a new video game. However, I’m making little constant progress while trying a new dynamic.

I keep my sunday free of duties, so I can do my two hobbies freely: game development & play video games. If you are following me on any of my social networks, you should have noticed. Otherwise, I explain myself. I record my video game sessions for the lulz. I also upload videos showing any progress made on my video games, for the lulz as well.

Going back to the theme, the new dynamic I’ve been trying this month is to schedule a couple of hours to work on video games. And there’s more. I force myself to wake up early and to go to a coffee shop with food & decent internet access. I extend my invitation to the group of friends who are interested on the game development as well.

So far, it has worked!. This because two main reasons: I reserve a space in the week for this activity; and working with other people in similar stuff really increases your interest.

As Bob Ross once said, “talent is just a pursued interest”. If you surround yourself with people interested on game development, you’ll become in one of them (if you haven’t yet). Eventually you will be good at it. The trick is simple here.