echo "List of all files in the root folder ... "
cd vscode/Fastpages
ls

echo ""
echo "List of all files in the repository including all hidden files:"
cd vscode/Fastpages
ls -a
List of all files in the root folder:
2022-05-15-07-21-16.png	_config.yml		_sass
2022-05-15-07-24-25.png	_fastpages_docs		_word
2022-05-15-07-25-15.png	_includes		assets
Gemfile			_layouts		docker-compose.yml
LICENSE			_notebooks		images
Makefile		_pages			index.html
README.md		_plugins
_action_files		_posts

List of all files in the repository including all hidden files:
bash: cd: vscode/Fastpages: No such file or directory
.			2022-05-15-07-25-15.png	_pages
..			Gemfile			_plugins
.DS_Store		LICENSE			_posts
.devcontainer.json	Makefile		_sass
.git			README.md		_word
.gitattributes		_action_files		assets
.github			_config.yml		docker-compose.yml
.gitignore		_fastpages_docs		images
.vscode			_includes		index.html
2022-05-15-07-21-16.png	_layouts
2022-05-15-07-24-25.png	_notebooks

Hack 1 - Is there anything we use to verify tools we install?

echo "Checking versions and existence of python and java ... "
python3 --version
python2 --version
java --version
javac --version
Checking versions and existence of python and java:
Python 3.9.12
Python 2.7.18
java 11.0.12 2021-07-20 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.12+8-LTS-237)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.12+8-LTS-237, mixed mode)
javac 11.0.12

Hack 2 - Is there anything we could verify with Anaconda?

echo "Running checks with Anaconda ... "
conda --version
echo ""
conda list python
Running checks with Anaconda:
conda 4.13.0

# packages in environment at /Users/yash/opt/anaconda3:
#
# Name                    Version                   Build  Channel
ipython                   8.2.0            py39hecd8cb5_0  
ipython_genutils          0.2.0              pyhd3eb1b0_1  
msgpack-python            1.0.2            py39hf7b0b51_1  
python                    3.9.12               hdfd78df_0  
python-dateutil           2.8.2              pyhd3eb1b0_0  
python-fastjsonschema     2.15.1             pyhd3eb1b0_0  
python-libarchive-c       2.9                pyhd3eb1b0_1  
python-lsp-black          1.0.0              pyhd3eb1b0_0  
python-lsp-jsonrpc        1.0.0              pyhd3eb1b0_0  
python-lsp-server         1.2.4              pyhd3eb1b0_0  
python-slugify            5.0.2              pyhd3eb1b0_0  
python-snappy             0.6.0            py39h23ab428_3  
python.app                3                py39hca72f7f_0  

Hack 3 - How would you update a repository?

cd ~/vscode/Fastpages
git pull
Already up to date.

This is a small script to show understanding of BASH

echo ""
echo "This script will create a file in the _pages directory 
and will put all files inside including hidden files."

cd ~
echo ""
cd vscode/Fastpages/_pages
ls
touch 06_bash.md
cd ~ 
ls -al > vscode/Fastpages/_pages/06_bash.md
echo ""
echo "vscode/Fastpages/_pages/06_bash.md"
nl vscode/Fastpages/_pages/06_bash.md
This script will create a file in the _pages directory 
and will put all files inside including hidden files.

01_notes.md	03_about.md	05_tags.html	404.html
02_vocab.md	04_search.html	06_bash.md

vscode/Fastpages/_pages/06_bash.md
     1	total 208
     2	drwxr-xr-x+  55 yash  staff   1760 Aug 26 09:06 .
     3	drwxr-xr-x    6 root  admin    192 Aug 10 23:44 ..
     4	-r--------    1 yash  staff      7 Oct  2  2019 .CFUserTextEncoding
     5	-rw-r--r--@   1 yash  staff  14340 Aug 23 10:43 .DS_Store
     6	drwx------  183 yash  staff   5856 Aug 26 09:40 .Trash
     7	drwxr-xr-x    3 yash  staff     96 Oct 20  2021 .android
     8	-rw-------    1 yash  staff  12711 Aug 26 09:11 .bash_history
     9	-rw-r--r--    1 yash  staff   1331 Aug 18 08:54 .bash_profile
    10	-rw-r--r--    1 yash  staff    672 Oct  4  2021 .bash_profile.pysave
    11	drwx------   30 yash  staff    960 Aug 26 09:11 .bash_sessions
    12	drwxr-xr-x    3 yash  staff     96 Aug 18 22:40 .cache
    13	drwxrwsr-x    3 yash  staff     96 Aug 18 08:59 .conda
    14	drwxr-xr-x    6 yash  staff    192 Aug 21 23:39 .config
    15	drwx------    3 yash  staff     96 Jun  2  2020 .cups
    16	-rw-r--r--    1 yash  staff    208 Aug 26  2021 .gitconfig
    17	drwxr-xr-x    4 yash  staff    128 Sep 21  2021 .gradle
    18	drwxr-xr-x    5 yash  staff    160 May  1 19:15 .idlerc
    19	drwxr-xr-x    3 yash  staff     96 Mar  4 08:34 .ipython
    20	drwxr-xr-x    3 yash  staff     96 Aug 18 08:59 .jupyter
    21	drwxr-xr-x    3 yash  staff     96 Apr 12 10:14 .keras
    22	-rw-------    1 yash  staff     20 May  6 12:04 .lesshst
    23	drwxr-xr-x    3 yash  staff     96 Aug 19 14:15 .m2
    24	drwxr-xr-x    2 yash  staff     64 Mar  8 13:25 .matplotlib
    25	drwxr-xr-x    3 yash  staff     96 Aug 18 09:21 .node-gyp
    26	drwxr-xr-x    8 yash  staff    256 Aug 21 23:44 .npm
    27	drwxr-xr-x    3 yash  staff     96 Mar 26  2021 .oracle_jre_usage
    28	drwx------    3 yash  staff     96 Apr 12 11:25 .putty
    29	-rw-------    1 yash  staff     51 Aug 27  2021 .python_history
    30	drwxr-xr-x    3 yash  staff     96 Aug 19 08:42 .redhat
    31	drwx------    6 yash  staff    192 Aug 12 19:04 .ssh
    32	drwxr-xr-x    3 yash  staff     96 Aug 18 22:43 .sts4
    33	-rw-r--r--    1 yash  staff    314 Aug 18 08:54 .tcshrc
    34	-rw-------    1 yash  staff   1071 Aug 26  2021 .viminfo
    35	drwxr-xr-x    4 yash  staff    128 Feb 28 10:51 .vscode
    36	-rw-r--r--    1 yash  staff    165 Aug 18 09:23 .wget-hsts
    37	-rw-r--r--    1 yash  staff    597 Aug 18 08:54 .xonshrc
    38	-rw-r--r--    1 yash  staff    248 Aug 21 23:32 .zprofile
    39	-rw-------    1 yash  staff  18722 Aug 26 09:06 .zsh_history
    40	drwx------   68 yash  staff   2176 Aug 26 09:06 .zsh_sessions
    41	-rw-r--r--    1 yash  staff    490 Aug 18 08:54 .zshrc
    42	drwx------@   5 yash  staff    160 Nov 16  2021 Applications
    43	drwx------@   4 yash  staff    128 Aug 24 14:35 Creative Cloud Files
    44	drwx------@   7 yash  staff    224 Jul 11 21:15 Desktop
    45	drwx------@   8 yash  staff    256 May 11 10:34 Documents
    46	drwx------@  48 yash  staff   1536 Aug 25 22:44 Downloads
    47	drwx------@ 104 yash  staff   3328 Aug 24 14:19 Library
    48	drwx------+   9 yash  staff    288 Dec  8  2021 Movies
    49	drwx------+  10 yash  staff    320 May 11 10:09 Music
    50	drwx------+   7 yash  staff    224 Dec 14  2020 Pictures
    51	drwx---r-x+   4 yash  staff    128 Oct  2  2019 Public
    52	drwxr-xr-x    4 yash  staff    128 Mar  5  2021 Samsung
    53	drwxr-xr-x    5 yash  staff    160 May  5  2019 java
    54	drwxr-xr-x    3 yash  staff     96 Aug 18 08:41 opt
    55	drwxr-xr-x    8 yash  staff    256 Aug 25 08:55 vscode
    56	-rw-r--r--@   1 yash  staff    162 Feb 16  2021 ~$mes_Final.docx

Below is a script I developed to automate deployment

sudo apt update; sudo apt upgrade
sudo apt install default-jre
java --version
sudo apt install default-jdk
javac --version
sudo apt update
sudo apt upgrade
sudo apt install maven
mvn --version

# This segment of code clones the repository and goes into that directory after done cloning
cd ~
git clone https://github.com/guapbeast/Spring.git
cd ~/Spring

# Runs the maven wrapper package
./mvnw package

# This assigns the result of the previous command to RESULT
# Then runs an if/else statement
# Saying that if the previous commands result comes back as exit code 0
# Then to proceed with changing the directory
# If it does not work, then execute the following commands
RESULT=$?
if [[ $RESULT -eq 0 ]]
then
  cd ~/Spring
else
  sudo apt install -y dos2unix
  dos2unix ./mvnw
  chmod +x ./mvnw
fi

# ">" overrides whatever is already in the file and writes
# What is in the "echo"
echo '
# syntax=docker/dockerfile:1
FROM openjdk:16-alpine3.13
WORKDIR /app
RUN apk update && apk upgrade && \
  apk add --no-cache git maven
RUN git clone https://github.com/guapbeast/Spring.git /app
RUN ./mvnw package
CMD ["java", "-jar", "target/spring-0.0.1-SNAPSHOT.jar"]
# EXPOSE port that is defined in spring_portfolio.git application.properties
EXPOSE 8085' > Dockerfile

# ">" overrides whatever is already in the file and writes
# What is in the "echo"
echo '
version: "3"
services:
  web:
    image: java_springv1
    build: .
    ports:
      - "8085:8085"
    volumes:
      - persistent_volume:/app/volumes
volumes:
  persistent_volume:
    driver: local
    driver_opts:
      o: bind
      type: none
      device: /home/ubuntu/Spring/volumes' > docker-compose.yml

# Installs docker and docker-compose
sudo apt install docker-compose -y
sudo docker-compose up -d
sudo apt install nginx
cd /etc/nginx/sites-available
sudo touch Spring

# ">" overrides whatever is already in the file and writes
# What is in the "echo"
echo '
server {
    listen 80;
    listen [::]:80;
    server_name csarithwikh.live www.csarithwikh.live;

    location / {
        proxy_pass http://localhost:8085;
        # Simple requests
        if ($request_method ~* "(GET|POST)") {
                add_header "Access-Control-Allow-Origin"  *;
        }

        # Preflight requests
        if ($request_method = OPTIONS ) {
                add_header "Access-Control-Allow-Origin"  *;
                add_header "Access-Control-Allow-Methods" "GET, POST, OPTIONS, HEAD";
                add_header "Access-Control-Allow-Headers" "Authorization, Origin, X-Requested-With, Content-Type, Accept";
                return 200;
        }
    }
}' > Spring

sudo ln -s /etc/nginx/sites-available/Spring /etc/nginx/sites-enabled
sudo nginx -t

# This assigns the result of the previous command to RESULT
# Then runs an if/else statement
# Saying that if the previous commands result comes back as exit code 0
# Then to run the following code
# If it does not work, then execute the other commands
RESULT=$?
if [[ $RESULT -eq 0 ]]
then
  sudo systemctl restart nginx
else
  echo "Something went wrong!!!"
fi

# Transfers data to the address
curl http://localhost:8085;

sudo snap install core; sudo snap refresh core
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo certbot --nginx