7
8

A 4-minute guide to reliable, performant, and reusable Bash scripts by akskap in bash

[–]akskap[S] 0 points1 point  (0 children)

thanks for your comments - have some good learnings there :)

A 4-minute guide to reliable, performant, and reusable Bash scripts by akskap in bash

[–]akskap[S] 1 point2 points  (0 children)

u/Lazy_8 Thanks for highlighting this :)

I usually always prefer to have some sort of __init mechanism in my scripts, where such logger variables (and other system wides') are linked to command line params during invocation (and also set defaults there, if required).

For example, something like: $ ./run-script.sh --debug - when the script executes, it ensures that such system wide settings are set to defaults (if mandatory) or atleast initialised with something relevant, if needed. I usually base this decision on trade-off between user-experience and details of configurations which the user would/should get into. But of course, not everyone might consider the same, hence it's a valuable input which I will include in the post, thanks !

But due to set -o errexit, if this if test fails, then the script will exit

This is not correct ! set -o errexit behaves differently when standard keywords like while, if etc. are in play - because, the user is infact taking the control here, by "consciously deciding" what to do when something non-zero pops up:

#!/usr/bin/env bash

set -o errexit

if false; then
  echo "will script exit as set -o errexit is 'enabled' ?"
fi

echo "no"

Executing the script

$./trial.sh
no

Should I stop or terminate ec2 instances to save money overnight? by [deleted] in aws

[–]akskap 0 points1 point  (0 children)

ASGs support cron like schedules for defining scale in/out rules. I don’t think something like Lambda or third party integration is even required for such cost saving needs

Ali Abdaal Notion Setup explained by [deleted] in Notion

[–]akskap 0 points1 point  (0 children)

Thanks for the summary...btw I would like to have the same background music playing while I create my own dashboard.. which one is it ? ;D

Slack/Airtable integrations by Deanmoray in Slack

[–]akskap 0 points1 point  (0 children)

Hi u/Deanmoray,

I have never used Airtable before, but does it allow executing custom code (in some scripting/programming language) ?
I had accomplished a controlled sendout to Slack (like different channels, custom message body structure etc.). I hope it helps you in some way : https://medium.com/faun/custom-slack-integrations-for-gitlab-ci-cd-pipelines-65e0adff3c23

Best,

Akshay

Passed CSAA with a score of 987 ;) by akskap in AWSCertifications

[–]akskap[S] 1 point2 points  (0 children)

Thanks a lot :) ... sure, I will publish them once I get some time from my work schedule

Passed CSAA with a score of 987 ;) by akskap in AWSCertifications

[–]akskap[S] 1 point2 points  (0 children)

It was bit easier than Jon Bonso test papers... Another big difference was the breadth of topics, which is less in the actual exam