Using Konva.js to annotate image with bounding boxes

References: Konva Tutorials Konva API Docs Drawing Labels on Image with canvas HTML5 Canvas Export to High Quality Image Tutorial Resolving “Tainted canvases may not be exported” with Konva First up, a working demo below. Click on “Set image” button first. Click “Add box” button to create a new bounding box. Each time the box …

Uploading a folder via HTML form or cURL

References: Upload directory doesn’t send folder name with file Upload files with CURL Multipart formposts How to upload folder using HTML and PHP VGG Image Annotator: Issue 270 – Using Webkitdirectory to import multiple directories and maintain directory hierarchy Contents of folder to be uploaded (drawn using tree –charset unicode –dirsfirst -a -n in bash): …

Bash command to check directory recursively and count average line count and average chars per line in files

Bash command: find . -type f | xargs wc -lc | sort -n | awk ‘{prev=curr; curr=$1″ “$3} NR==1{print “Min lines:”, $1, $3} END{print “Max lines:”, prev; print “Total of”, $1, “lines in”, (NR – 1), “files”; print “Avg line count:”, ($1 / (NR – 1)); print “Avg chars per line:”, ($2 / $1)}’; Breakdown …

4 tips for writing documentation – Discoverable, Accessible, Searchable, Handleable (DASH)

Skipping the usual background rant 😛 For me, the purpose of documentation is to save time, not at the point of writing it, but in the future when you use it. When onboarding a new hire or answering a colleague’s questions on my code, I would usually first refer them to the README.md file in …

Renewing SSL certificate on Apache Solr server

References: Enabling SSL for Solr Taking Solr to Production Steps: SSH into the server. Upload the private key for the renewed SSL certificate as well as the updated certificate chain (just the primary certificate for the domain will not do), e.g. STAR_example_com.key and STAR_example_com_fullchain.pem. If you are unsure, check out my earlier article on Things …

Fixing Sectigo/Comodo SSL certificate expiry error on Ubuntu servers and Docker containers

Was alerted this morning to server applications failing due to an expired SSL certificate, with logs showing cURL errors. The weird thing was there was still half a month to go before the expiry date. Also, this problem does not affect browsers as the major browsers have already been updated. Importing the renewed SSL certificate …

Guidelines to protect developer time for meetings and sprints

Just came up with some guidelines which I feel would help in protecting developer time with regards to meetings and sprints, mainly by putting in some kind of structure. Disclaimer: These guidelines may not be applicable to everyone or every company 😛 Do read Paul Graham’s article on Maker’s Schedule, Managers Schedule which clearly explains …