Just like .gitignore, there is another file that you can use in your git repos: The .gitattributes file. You typically place this in the root of your repo. It has lines of the form: pattern attr1 attr2 ... It essentially means that for files that satisfy the regex pattern, apply the attribute attr1, attr2 etc to them. Let’s see some examples. Let’s say our .gitattributes had the line below: *.png binary *.


Some of the books I have recently read. (Items marked with a 👍 are ones that I really enjoyed.) The War Below: Lithium, Copper, and the Global Battle to Power Our Lives - Ernest Scheyder - 06/2024 (👍) The Price We Pay - Marty Makary - 03/2024 (👍) The Lessons of History - Will & Ariel Durant - 01/2024 Recoding America - Jennifer Pahlka - 01/2024


My name is Jimmy and I am engineer / entrepreneur living and working in beautiful Berkeley, CA. I currently work on large scale distributed systems, MLOps, ML Infrastructure, Data Pipelines, Tooling and Platform services / operations / observability. My interests revolve around technology, health, philosophy/spirituality and learning. In a former life, I founded and sold CodeEval. This blog is created via the awesome Hugo framework. It is hosted by Netlify. All the code for this site is available on Github.


OneHumanRace Trade your time/knowledge/skills for contributions to a charity of your choice. BioHacks Utilities for bio chemists (or others) to play around with DNA sequences. GoCVE A command line client to query Common Vulnerabilities and Exposures (CVE). Text to Morse Code Converts text to morse code and vice-versa. Some characters like the quotation mark(“”) is not supported in this implementation.

Trap in bash scripts

You may be familiar with the “set -e” you typically see in bash scripts. It means that the script should exit on error (default behaviour of bash is to keep going) Recently I needed a script to do some cleanup action. i.e. I wanted the script to exit on error, but I also wanted some cleanup action to be performed. A use case might be that if something fails, then before exiting, ship log files to an S3 bucket for troubleshooting.

Adding multiple certs to an ALB

If you are using AWS and ALBs, you have the ability to add multiple certs to the ALB and terminate SSL there. While it is easy to do via the AWS console, their documentation is not that clear as to how to do it in an automated way. The following is the code snippet, written with troposphere, to show you how to do it. First create a HTTS listener with a certificate: def create_lb_listener_https(alb, default_target_group, param_cert_one): return Listener(‘LoadBalancerListenerHTTPS’, Port='443’,Protocol='HTTPS’, LoadBalancerArn=Ref(alb), DefaultActions=[Action(Type='forward’,TargetGroupArn=Ref(default_target_group))],# Note, only one cert ARN can be specified here, else you will get an errorCertificates=[Certificate(CertificateArn=Ref(param_cert_one)),])

Docker image tagging in ECR

AWS provides a docker repository called ECR. This is similar to Docker Hub, Artifactory etc and provides a convenient place to place docker images for later use e.g. deployment. ECR supports Docker Image Manifest V2, Schema 2, providing the ability to add multiple tags per image. I recently ran into an issue wherein I tagged an image with multiple tags at build time and then just pushed one tag, thinking all tags would appear on ECR.