Tag: bash
-
Switching to main/master branch easily
Have you ever had this problem, when trying to do git checkout master and receiving an error that such branch does not exist ? That's because some projects have switched to a new main branch and other projects are too old and nobody is moving them to main. Remembering which project…
-
Measuring elapsed time in milliseconds in bash
I was working on a Telemetry project in my company and I had to instrument some of our bash scripts with code that would measure elapsed time of script execution. You can easily achive this with the following code calculate_duration() { # Start time in nanoseconds start_time=$(date +%s%N)…
-
How to check with AWS cli if file exists in S3
Today i was working on adding history trends feature from Allure report to our Integration API Tests Framework and in order to do that i need to implement simple algorithm: Check if folder for specific group of tests history exists If it exists, copy this folder to allure-results folder Generate…
-
Get Notified when your command in Terminal has finished
Currently i'm working a lot on serverless projects and deploying a new service that has multiple lambda's or event a step function can be time consuming. In this case it was quite often for me to "forget" about the running deploy in the Terminal and get distracted by…
-
How to pretty print JSON in bash console
Recently i was playing with Swagger Codegen tool and i needed to look at available configuration fields for java language. You can do it easily by running : curl -X GET --header 'Accept: application/json' 'https://generator.swagger.io/api/gen/clients/java' But, as an output, you'll get this : {"…
-
Bash remote vulnerability fix for Mac Os users
As you may heard, there's a critical vulnerability found in bash recently. According to CSO A remotely exploitable vulnerability has been discovered by Stephane Chazelas in bash on Linux, and it is unpleasant. The vulnerability has the CVE identifier CVE-2014-6271. This affects Debian as well as other Linux distributions. The…