Saturday, September 18, 2021

Unable to revert mtime: /Library/Fonts [Solved]

I was working on a python3 script on my macOS, and I came across this error:

% python3

Unable to revert mtime: /Library/Fonts

I got it solved by installing libmagic:

% brew install libmagic

Friday, September 17, 2021

NTRU in python3

  • NTRU – Nth Degree Truncated Polynomial Ring Units (or R = Z[X] / ( X^N-1 ))
  • NTRU is the first public-key cryptosystem not based on factorization or discrete logarithmic problems.
  • NTRU is a lattice-based alternative to RSA and ECC and is based on the shortest vector problem in a lattice.
  • NTRU is an open-source public-key cryptosystem that uses lattice-based cryptography to encrypt and decrypt data.
  • It consists of two algorithms: NTRUEncrypt, which is used for encryption, and NTRUSign, which is used for digital signatures.
  • Unlike other popular public-key cryptosystems, it is resistant to attacks using Shor's algorithm.
  • NTRUEncrypt was patented, but it was placed in the public domain in 2017. NTRUSign is patented, but it can be used by software under the GPL.

Example in Python3:

% python3 --version

Python 3.9.1

% pip3 install --user sympy

% pip3 install --user numpy

% pip3 install --user docopt

Wednesday, April 21, 2021

[How To] Save Space on Google Photos

Google Photos is a photo-sharing and storage service developed by Google. It was announced in May 2015 and separated from Google+, the company's former social network. In its free tier, Google Photos stores unlimited photos and videos up to 16 megapixels and 1080p resolution, respectively (anything larger gets down-scaled to these sizes). This free tier will end on June 1, 2021. Photos and videos uploaded after that date get counted towards the 15 GB free quota shared across the user's Google services. There are subscriptions offered for users wanting to store their photos and videos at their "original" quality and requiring more storage than the 15 GB offered free.

Storage (GB)Per Month (USD)Annual (USD)

You can check out how much storage you are using across Google services out of your quota of free 15 GB. Go to Google Drive and check the storage bar on the left side. Or you can click on the Setting button in Google Drive located on the Top Menu and click on the Storage option and check how much storage you are using. You can click on "View items taking up storage" and see which files occupy more space. If Google Photos is taking up space, then do the following to save some space.

Tuesday, March 30, 2021

[How To] Install Free SSL Certificate for WordPress

In this tutorial, I have installed a free SSL certificate from Let's Encrypt using the Certbot tool on Google Cloud Platform VM running Debian OS that hosts a WordPress site using Apache server. You can follow similar steps for other Cloud providers / OS distributions / CMS vendors / Web servers.

Part-1: Configure Virtual Host for your domain on Apache

cd /var/www/html

wp option update home ''

wp option update siteurl ''

sudo nano /etc/apache2/sites-available/

sudo apache2ctl configtest

sudo a2ensite

sudo systemctl reload apache2

Thursday, March 11, 2021

Random Number Generation in C++



//  main.cpp

//  VaultBox


//  Created by Devharsh Trivedi on 3/11/21.


#include <iostream>

#include <iomanip>

#include <string>

#include <map>

#include <random>

#include <cmath>

#include <vector>

int main(int argc, const char * argv[]) {

    std::random_device ranDev;

    unsigned int num_ranDev = ranDev();

    std::cout << num_ranDev << std::endl;

    std::mt19937 mtGen(num_ranDev);

    std::vector<unsigned long> indexes(10);


    iota(indexes.begin(), indexes.end(), 0);

    for(int i=0; i<10; i++) {

        std::cout << indexes[i] << "\t";


    std::cout << std::endl;