How to define task dependencies in justfile

It has been more than 20+ years since I used Makefiles seriously. I did use them later, but they were very simple. Then I found and moved just task runner, which is supposed to be replacement for make My justfiles were also simple. and today, I needed to define a task that we dependent on another. Turns out, it is same as Makefile task1: @echo "Task1" task2: task1 @echo "Task2" In the above example, task2 depends on task1, and thus when we say just task2, task1 will get executed, as it is a dependency for task1

Interesting Netlify Build Problem

After build problems with my PKM site, today I ran into another problem with this site. What puzzled me was Deploy showed Build step failing but no useful error (other than exit code 2 - which does not help much) But in the process of debugging, I learnt 1 about the environment variable NETLIFY_BUILD_DEBUG (set to true when needed) It did not help 😞 I also upgraded hugo version (which is another environment variable) in the process.

Continue Reading »

Install LetsEncrypt certificate

Today I installed LetsEncrypt certificate on one of the production server. I can not believe it is so simple to secure a website running on an Ubuntu server sudo apt-get install certbot python-certbot-nginx sudo certbot --nginx -d mydomain.com -d www.mydomain.com It even configures nginx (or apache) server for you. To manually renew run the following: certbot renew --quiet But you don’t have to, cause certbot is so awesome that it automatically adds an entry into crontab so that certbot runs twice daily.

Continue Reading »

Configure `rsyslog`

Today, I configured rsyslog on Ubuntu server to collect logs from remote application server. syslog using UDP seems straight forward, but I wanted to set up using TCP (TCP being more reliable and all) At first, it did not work because I needed to tell SysLogHandler that we are using TCP using SOCK_STREAM as optional param. (Default is UDP) So in a standalone test script, remote logging worked. Turns out because of how TCP works, the logs are not flushed to the remote server till the application server closes the socket connection.

Continue Reading »