Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
Binary file added devopsDoc/Devops.pptx
Binary file not shown.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions doclab/dock1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM debian:stable
LABEL authors="sunil"
RUN apt-get update && apt-get install -y --force-yes apache2
EXPOSE 80
4 changes: 4 additions & 0 deletions doclab/dockerfileadd
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM ubuntu:latest
WORKDIR /app
COPY file.txt /app/
ADD https://github.com/amitopenwriteup/my_proj/blob/master/k8s-setup.txt /app/i
Empty file added doclab/file.txt
Empty file.
4 changes: 4 additions & 0 deletions doclab/test/date.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
echo `date` $@ >> log.txt;
cat log.txt;
#save date.sh script
2 changes: 2 additions & 0 deletions doclab/test/log.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Sun Sep 22 08:33:19 AM UTC 2024
Sun Sep 22 08:33:23 AM UTC 2024
3 changes: 3 additions & 0 deletions doclab/test/mydockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM alpine
ADD date.sh /
RUN ["/date.sh", "image created"]
Empty file added git_practise/mycode
Empty file.
Empty file added git_practise/mycode2
Empty file.
1 change: 1 addition & 0 deletions git_practise/mycode2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
first line of mycode2
2 changes: 2 additions & 0 deletions script.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Script started at Sun Sep 15 01:29:09 PM UTC 2024
Script finished at Sun Sep 15 01:29:09 PM UTC 2024
3 changes: 3 additions & 0 deletions script2.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Script started at Sun Sep 15 01:31:39 PM UTC 2024
Script finished at Sun Sep 15 01:31:39 PM UTC 2024
sunil is author of this file
17 changes: 17 additions & 0 deletions shellscripting/checkWebsiteStatus.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

check_website() {
url="$1"
response=$(curl -s -o /dev/null -w "%{http_code}" "$url")

if [ "$response" == "200" ]; then

echo "website $url is up and running"

else
echo "website $url is down!"

fi
}
check_website "https://www.google.com"

22 changes: 22 additions & 0 deletions shellscripting/checkgitrepo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

echo "enter directory"

read directory

cd "/"$directory

echo "current directory is:"; pwd

output=$(git status)
exp_output ="fatal: not a git repository (or any of the parent directories): .git"

if ["$output" == "$exp_output"];
then
echo "directory is not git enabled"

else
echo "directory is git enabled"

fi

12 changes: 12 additions & 0 deletions shellscripting/cpuutil.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

cpu_usage=$(top -bn1 | grep "Cpu(S)" | awk '{print $2 + $4}')

if (( $(echo "$cpu_usage > 10" | bc -1) )); then

echo "Alert: CPU Usage is high ($cpu_usage%)"

else

echo "Everything is good : CPU Usage is normal ($cpu_usage%)"
fi
12 changes: 12 additions & 0 deletions shellscripting/findword.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
search_word="Error"
search_file=/var/log/syslog

if grep -q "$search_word" "$search_file";
then
echo "found '$search_word' in '$search_file"
else
echo "No '$search_word' found in '$search_file"

fi

3 changes: 3 additions & 0 deletions shellscripting/ipfind.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

ip addr show ens33 | grep "inet" | awk '{print $2}' | cut -d'/' -f1
9 changes: 9 additions & 0 deletions shellscripting/lab3_shell.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

log_file="script2.log"
# Redirect stdout and stderr to a log file
exec > "$log_file" 2>&1
echo "Script started at $(date)"
# Your script logic here
echo "Script finished at $(date)"
echo "sunil is author of this file"
Empty file modified shellscripting/lab4_shell.txt
100644 → 100755
Empty file.
3 changes: 3 additions & 0 deletions shellscripting/lab5_shell.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

top -bn1 | grep "Cpu(s)" | awk '{print $2 + $4}'