A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

nginx basics

How to serve up a directory on the web

  • sudo apt-get install nginx
  • vi /etc/nginx/nginx.conf # observe how the html { } section has: include /etc/nginx/sites-enabled/*;
  • vi /etc/nginx/sites-available/foo # build the server { } section


server {
    listen 80 default_server;
    root /var/www/html/foo;
    index index.html
    location / {
        autoindex on;
        auth_basic "Restricted";
        auth_basic_user_file /etc/nginx/.htpasswd;
    }
}


  • # build .htpasswd file
  • ln -s /etc/nginx/sites-available/foo /etc/nginx/sites-enabled/foo
  • service nginx restart


Easy/Hard vs Complex/Simple

This may help estimating your stories in agile:

Easy Hard
Simple Washing car Pushing car
Complex Driving car Building car

How to do authentication with Mojolicious

It's like this:


401 vs 403 HTTP codes

Explanation:

401 'Unauthorized' should actually be 401 'Unauthenticated'
It should be used for missing or bad authentication.

403 'Forbidden' is the server telling you, "I know who you are, and you don't have permission to access this resource".

(source)

Investigating Jira

They use Jira for issue tracking where I'm working.

Jira displays little coloured dots that seem to indicate the length of time an issue has spent in the column. If you hover over the dots it displays a tooltip telling you how long the issue has been in that column.

That would all be great except I don't know what the number and colour of the dots actually means, without hovering over them to see the tooltip. What's the point in even having coloured dots if the exact meaning of them is kept a mystery?

I don't like mysteries, so I set about trying to reverse engineer the meaning.

Yes I did try RTFM first, but the documentation is horrendously confusing and frankly quite disappointing for a popular application in 2019. I can't even see what version of Jira (Cloud?) I'm using - the about screen says "Jira 2c6be9a9" which looks like a version control commit ID. It also mentions "Jira Service Desk Application 3.3.0-OD" but that doesn't seem right because Wikipedia says the latest version of 7.13.0.

Investigation:

  • View source of Jira board, drill down to find the widget:
  • <span class="ghx-field">
    <div class="ghx-days more-then-5" data-tooltip="5 days in this column" original-title=""></div>
    </span>


  • Search for the "more-then-5" (sic) class across the CSS assets of the page, brings us to base.css and:


    I schlepped through all the page assets but I couldn't find the actual images used. Still at least we now know the "time taken" thresholds: 1, 2, 3, 5, 8, 12 and 20 days.

    Based on empirical observation, I would tentatively map as follows:
    • 1 day:    O
    • 2 days:   OO
    • 3 days:   OOX  (yellow)
    • 5 days:   OOOX (red)
    • 8 days:   OOXX (red)
    • 12 days:  OXXX (red)
    • 20+ days: XXXX (red)
    Key:
    O = grey
    X = colour