Hey everyone, This is a post written to introduce a new tool I have been writing called hashmatch. Hashmatch is a simple cli tool written in Go which has the simple purpose to compare two files by a hashing algorithm of your choice be it md5sum, sha1, sha256 or crc32. The purpose of this CLI tool can be to check for file tampering or to quickly get the hash value of a given file for forensics. The tool is powered by the cobra library for building CLIs. It follows the simple approach of traversing a directory and returning an array of hashes for files present. Below is the core logic for computing the hashes.
Scope for improvement:
Add test cases 🙈
support different output formats csv, json etc. (json support was recently added)
add support to browse remote directories via ssh/ftp.
create a website explaining the tool in detail.
The cli tool was inspired by the popular inbuilt md5sum command, which doesn’t have the ability to traverse directories or perform matches. hashmatch provides the same performance with support for additional algorithms as well.
Welcome to my tech blog where I share stories of my experiences and lessons learned during my software development.
Lets get started by me introducing me DEV infrastructure that is where I run all my applications in their beta phase.
The environment consists of
Digital Ocean Droplet:
My digital ocean droplet is running Ubuntu 14.04 and acts as the provisioning server that binds all the other servers into a OpenVPN subnet. The reason I have chosen to use a digital ocean droplet can be explained easily with this screenshot. All new nodes in my environment must connect to this VPN in order to be accessible from other nodes.
EC2 t2.micro Instance: There an EC2 instance which is my api gateway used to access api resources within any environment. This server runs NGINX and reverse proxies incoming requests on a service based port/url mapping. This server runs amazon linux which is a custom distribution.
Raspberry Pi2/ Raspberry Pi3: I am the proud owner or 2 raspberry pis which are the core of my dev infrastructure. They are both running the raspbian 8.0 jessie operating system but are mainly used as docker container hosts to deploy applications on.
Overall Architecture diagram:
This is what the overall architecture of the system looks like there with there being only one public access point in the entire system. All other components are not publicly accessible except for my openvpn provisioning server. This architecture allows for load balancing between both the raspberry pi’s using my NGINX config.