Some handy scripts to make your life easier.
Oh yeah! We will have some handy tips in our channel on Youtube
The scripts was designed thinking of a few baselines:
- Simplicity
- Reusability
- Meaningful reading
and the Unix concept of DOTADIW:
- Do One Thing And Do It Well
We designed a standard way for naming functions, which should start the function with the folder name, so, if the script is under the './domain' folder the function will start with 'domain_'. We try to be as much verbose as possible for better understanding "the function function".
All function's responses will be in capital letter and the most commom 'rule' will be to remove the wildcard word from the response, such as 'check', 'get' and 'put'.
Responses will be the function's name without the word 'check':
docker_check_container_is_running()
{
[...]
DOCKER_CONTAINER_IS_RUNNING=true
}
Responses will be the function's name without the word 'confirm' and '_RESPONSE' at the end of the string:
confirm_user_action()
{
[...]
USER_ACTION_RESPONSE=true
}
This was one of the first functions we created so, we will try to keep it simple next functions, but must keep that for compatibility purposes
***** GET FUNCTIONS AS WELL
ip_get_external_ipv4 example returns IP_EXTERNAL_IPV4
Every change should be non breakable, if it worked for you in some main version it should continue to work in all corrections and new functions.
Versioning: vX.Y
'X': main version
'Y': corrections / new functions
There will be a specific page for documentation and samples of every function in this repo.
Please check
If you find any security vulnerability, please DO NOT open an issue, send an email to [email protected].
- All scripts were desgined to run in bash. Hum... right, You might ask about shebang... yes I used absolute path in all scripts '/bin/bash'. Yes, there is discussions on that matter, but if you don't have bash, you probably know some tricks to update all files at once, right? If not I will provide you a way to do that, if you have sed at least.