The best programming blog.

Covering a wide array of programming topics.

Serve static assets with an efficient cache policy

If you are getting the following message Serve static assets with an efficient cache policy while using Lighthouse for youur site optimization, then you need to follow the following steps: Add the following settings to your site config file in Nginx. You can open it via: and paste the following text: Above, the expiry is set…More

How to enable GZip for CSS and JavaScript files on Nginx

Below are the steps to enable gzip for CSS and JavaScript files on Nginx. Run the following command on your Ubuntu’s terminal to open nginx.conf file: Scroll donw to Gzip Settings section in that file: Add the following line in that section: Hit CTRL + O and CTRL + ENTER to save the file. Run…More

Convert varchar column to int in MySQL

Following is the script to convert a varchar datatype column to int type: You can further verify the column data type with the help of this blog: Check column data type in mysqlMore

Check column data type in mysql

Using the DESCRIBE or SHOW COLUMNS command in MySQL, you may determine the data type of a column in a table. To get details about the columns in a table, use the DESCRIBE command. The command takes the table name as an argument and returns information such as the column name, data type, and other…More

How to generate JWT Key

You can use node to generate JWT key which further can be used for JWT authentication. In the terminal, on the machine where node is installed, run the following command: The output will be like this: You can use the generated key for your JWT authentication logic.More

Invalid RSA Private Key OpenSSL

The reason could be that the your private key doesn’t actually is a RSA Private key i.e not starting with Follow the following steps to fix the Invalid RSA Private Key issue: Download OpenSSL 1.1, can be done via HomeBrew. Run th following commands: Run the following command to generate rsa private key: The generated…More

Amazon CloudFront Create a trusted key pair group

Make sure OpenSSL is installed on your machine. Run the following command to generate Public and Private key pairs: The above commands will generate the private and public key pairs in the Downloads folder. You can change the path based on your needs. Open the public key in a text editor and paste it in…More

Uninstall mono from Ubuntu

Run the following commands to uninstall mono and mono complete from Ubuntu You can verify whether the package is uninstalled by running the following command and it will give you the following output: dpkg-query: no packages found matching mono-completeMore