philanderson888 / scripts

MIT License
0 stars 0 forks source link

Scripting #3

Open philanderson888 opened 2 months ago

philanderson888 commented 2 months ago

Latest script file from work done when away on holiday

I was trying to get it to report how long each way point was taking in seconds eg

install node ... 5 seconds install mongo db ... 3 seconds ...

etc

I have not yet fully completed this work ... the output at the moment is a bit verbose ... goal will be to trim this down ...

latest output file

https://github.com/philanderson888/scripts/blob/master/aws/awsWindows/script-out-put-2024-05-15.txt

latest master script file

https://github.com/philanderson888/scripts/blob/master/aws/awsWindows/scriptMasterWindows.sh

@Umesh-Phendarkar

philanderson888 commented 1 month ago

feel motivated to learn more scripting

philanderson888 commented 1 month ago

yesterday i tidied up my master script quite a bit so now it reports much better which stage in the script it has reached

i call it a script 'waypoint'

so i create an array of script 'waypoints'

which is

also i print out the list of waypoints during my script ... so i know

a) what has been installed b) how long each component of my script took to execute ... this will help me identify which parts are running fast and which parts are running slow which will become more and more useful, the longer my script gets!

so .. very very happy ...

typical output is ...

waypoint 0 at 0 s took 0 s - script start
waypoint 1 at 0 s took 7 s - installing aws and powershell
waypoint 2 at 7 s took 0 s - log in to azure
waypoint 3 at 7 s took 1 s - query azure
waypoint 4 at 8 s took 2 s - clean environment
waypoint 5 at 10 s took 1 s - create resource group
waypoint 6 at 11 s took 2 s - list resource groups
waypoint 7 at 13 s took 0 s - query vm templates
waypoint 8 at 13 s took 0 s - set vm type to be ubuntu
waypoint 9 at 13 s took 65 s - vm created
waypoint 10 at 78 s took 12 s - query vm using azure cli
waypoint 11 at 90 s took 0 s - query network security group performed
waypoint 12 at 90 s took 104 s - query linux
waypoint 13 at 194 s took 2 s - dnf install
waypoint 14 at 196 s took 7 s - os updated
waypoint 15 at 203 s took 0 s - deciding which services to install
waypoint 16 at 203 s took 17 s - zsh
waypoint 17 at 220 s took 2 s - install zsh oh-my-zsh
waypoint 18 at 222 s took 2 s - git
waypoint 19 at 224 s took 1 s - apache
waypoint 20 at 225 s took 79 s - node
waypoint 21 at 304 s took 31 s - express
waypoint 22 at 335 s took 42 s - test
waypoint 23 at 377 s took 2 s - install
philanderson888 commented 1 month ago

also tonight i worked on running the web servers

in order to do this i had to work out how to open a new terminal window

seems like the best option was with 'ttab' installed via npm or homebrew on the mac

https://github.com/mklement0/ttab?tab=readme-ov-file#installation-via-homebrew-macos-only

https://github.com/mklement0/ttab/blob/master/doc/ttab.md

https://stackoverflow.com/questions/7171725/open-new-terminal-tab-from-command-line-mac-os-x

https://npmtrends.com/ttab

philanderson888 commented 1 month ago

@Umesh-Phendarkar