Category Archives: Software

Understanding Internals of Chaincode getState/putState calls

If we look at the ChaincodeStub class in $/hyperledger/fabric-chaincode-node/libraries/fabric-shim/lib/stub.js we can see following code The code for the handler (which is of type ChaincodeSupportClient) can be found in $/hyperledger/fabric-chaincode-node/libraries/fabric-shim/lib/handler.js and it looks like this handler is instantiated in $/hyperledger/fabric-chaincode-node/libraries/fabric-shim/lib/chaincode.js which … Continue reading

Posted in Software | Leave a comment

PHP Interactive Shell

I keep forgetting this so many times that I need to make a note of this. This is how you use it: Don’t forget the semicolons and remember PHP variables start with a $

Posted in Software | Leave a comment

Useful SO Queries

CDF of User Reputation https://data.stackexchange.com/stackoverflow/query/1265631/cdf-of-so-reputation#graph According to this, 71% of users have reputation <= 1. These are users who just created an account on the site. 74% of users have reputation <= 10 92% of users have reputation <= 100 … Continue reading

Posted in Software | Leave a comment

failed to create runc console socket: mkdir /tmp/pty064803763: no space left on device: unknown

Got this error today when trying to log into a docker container Then I tried which did not indicate any problem. /tmp is only 24% used. Above is showing all the inodes have been exhausted under /tmp. On listing /tmp … Continue reading

Posted in Software | Leave a comment

Understanding the internals of wordpress php-fpm-alpine image

This post describes the internals of wordpress:php7.4-fpm-alpine Docker image. The wordpress container does nothing but run the following command and wait for it to end which it never does as it spins up a server that listens for incoming connections … Continue reading

Posted in Software | Tagged | Leave a comment

Debugging File Upload Issues with WordPress

First make sure you have adequately increased the maximum file size that can be uploaded to wordpress. It is possible that uploads may still not work. On php-fpm-alpine image (and even on apache) wordpress runs under the credentials of www-data … Continue reading

Posted in Software | Tagged | Leave a comment

How to change the maximum file size you can upload to wordpress on nginx w/ php-fpm

Apache is a solid web server but my goto environment for wordpress has now changed to running it on Docker with NGINX + php7.4-fpm-alpine. To change the max file size you can upload to wordpress, you will need to make … Continue reading

Posted in Software | Tagged | Leave a comment

Complete guide to Azure AD Authentication in Node

There is a lot of documentation available on how to authenticate users against Azure AD. There are even libraries like MSAL.js that are supposed to do the job for you. Unfortunately, for me, I found the Microsoft documentation very noisy … Continue reading

Posted in Software | Tagged | Leave a comment

CloudFlare 522 Error. Server does not respond.

This is probably the longest time I have spent on debugging something (4 days) so its worth the effort to write about it. The problem: We built a wordpress site but got CloudFlare 522 error when trying to connect to … Continue reading

Posted in Software | Tagged | Leave a comment

Transactions and Locks in MySQL

Refer: https://stackoverflow.com/questions/61212438/why-do-we-need-to-lock-a-mysql-table-during-select-when-beginning-a-transaction/ TL;DR: MySQL docs are wrong Transactions act like a try-catch block. They don’t provide protection against concurrency. If something fails in a transaction, it can be rolled back to undo pending operations that were not committed. To handle … Continue reading

Posted in Software | Tagged | Leave a comment