SQL Database Course

I’ve recently finished a great database course “Mastery with SQL” which I recommend to anyone interested in learning modern SQL as well as some specific PostgreSQL features.

It starts with the SQL fundamentals and builds up all the way to window functions, views and query performance optimizations.

Although it isn’t free, I’ve learned a lot from finishing this course and I consider it is well worth the money.

Book Review: Level Up! The Guide to Great Video Game Design, 2nd Edition

If you ever wanted to make a video game, it is pretty easy nowadays having game engines and game development environments such as Unity 3D and Unreal Engine being free. There are also a lot of tutorials and documentation on how to use them.

When it comes to game design, there aren’t as many resources. In my opinion, one of the best book to learn about game design is “Level Up! The Guide to Great Video Game Design, 2nd Edition” by Scott Rogers.

Continue reading →

How to investigate Ubuntu slow boot

Investigating why Ubuntu boots slowly can be difficult. There are a lot of things that can go wrong: a lingering service, a bad config file, a wrong disk uuid in fstab and others.

In my opinion the easiest way to start is by using “systemd-analyze” which is part of systemd.
Since version 15.04, Ubuntu has switched from upstart to systemd as the default system and service manager. Systemd is not something specific to Ubuntu, but rather an industry standard that other major distributions have adopted as well: Debian, Fedora and CentOS to name a few.
“systemd-analyze” gives us information about what programs are run on startup and how much time they need to start.

Continue reading →

Change swap size in Ubuntu 18.04 or newer

[Updated July 26, 2020]: Change swapfile permission; Set swapfile in /etc/fstab.

Swap is a special area on your computer, which the operating system can use as additional RAM.
Starting with Ubuntu 17.04, the swap partition was replaced by a swap file. The main advantage of the swap file is easy resizing.

In the following example, we’ll extend the swap space available in the /swapfile from 4 GB to 8 GB.

    1. Turn off all swap processes
      sudo swapoff -a
    2. Resize the swap
      sudo dd if=/dev/zero of=/swapfile bs=1G count=8

      if = input file
      of = output file
      bs = block size
      count = multiplier of blocks

    3. Change permission
      sudo chmod 600 /swapfile
    4. Make the file usable as swap
      sudo mkswap /swapfile
    5. Activate the swap file
      sudo swapon /swapfile
    6. Edit /etc/fstab and add the new swapfile if it isn’t already there
      /swapfile none swap sw 0 0
    7. Check the amount of swap available
      grep SwapTotal /proc/meminfo

Book review: SPA Design and Architecture: Understanding Single Page Web Applications

spa-design-and-architecture-book-coverSPA Design and Architecture: Understanding Single Page Web Applications” by  Emmit Scott is a hands-on approach to developing single page web applications with examples covering three frameworks: Angular, Knockout and Backbone.

I came across this book through a recommendation from one of my colleagues. I worked as a frontend developer on a single page web application, but I wasn’t quite involved in the architectural decisions made, so I found it interesting in this book to read about what is the proper way, or, what should I look at, when thinking about how to build a single page web application. Also, the fact that there are examples for three frameworks/libraries for some of the concepts presented in the book was a definitely plus for me.
Continue reading →

How to fix Facebook scraping error

I’ve spent a few days trying to solve the “Error parsing input URL, no data was scraped” Facebook scraping error, and finally found a solution which I’ll share with you through this post.

I wanted to make this blog more social, so I thought I could use some of the WordPress’s excellent social plugins. I’ve installed and setup the necessary plugins, and one of them was supposed to automatically post on my chosen social networks once a post got published.
Upon publishing my first post, it appeared on Twitter, but not on Facebook. Instead, when trying to share a post from this blog, the Facebook share box would display “404 Page not found” (in other cases it would say “Welcome to nginx!”) as the post preview.
Continue reading →