Docker commands to clean unused images

If you use docker for some time, there will be a lot of trash images, volumes that is not used by any containers. Here’s how to remove them. (warning: not reversible)

Remove dangling images

Remove dangling volumes

As seen from above commands, you may guess the nested command within the $(…) is used to list dangling images/volumes

List dangling images

List dangling volumes

Check if two directory is identical with sha1sum

I want to share a little script I wrote that check if two directory is identical rather efficiently. First you may need to understand what sha1sum does.

The sha1sum tool

As the name may suggest, sha1sum compute the SHA-1 checksum of a particular file / text string.

You can see from the above example that sha1sum produce a hash of the content,  Continue reading “Check if two directory is identical with sha1sum”

Weird random MySQL crash solution

After moving one of my node from Linode to DigitalOcean, I have experienced strange crash that appears to be random. After I reboot the process it works for about a week and fails suddenly.

Tools for checking the data in the database

After some research, I think it could be caused by the data inside the database, since I moved all data from the old VPS to the new node and now I’m using a newer version of MySQL (Actually MariaDB). It could run into some compatibility problem.

I strongly recommand you to backup the database before running any checks, upgrade, repairs and optimize actions. You can do so with the command:

This would check the status of all databases in the DB:

This would repair the databases and tables if anything go wrong:

This would upgrade the data if you have upgraded the Mysql version:

Good Luck!