Skip to content

Commit 5dcdfd2

Browse files
committed
first commit
0 parents  commit 5dcdfd2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+9179
-0
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
2+
# -----------------------------------------------------------------------------
3+
# GitHub Actions Workflow: Deploy MkDocs to GitHub Pages
4+
#
5+
# This workflow automates the process of building and deploying an MkDocs site
6+
# to GitHub Pages using the traditional mkdocs gh-deploy command.
7+
#
8+
# Main Steps:
9+
# 1. Checkout the repository with full history.
10+
# 2. Set up Python environment.
11+
# 3. Install dependencies from requirements.txt.
12+
# 4. Build and deploy the MkDocs documentation site to gh-pages branch.
13+
#
14+
# This approach uses the mkdocs gh-deploy command which handles the GitHub Pages
15+
# deployment automatically without requiring special permissions.
16+
# -----------------------------------------------------------------------------
17+
18+
name: Deploy GitHub Pages
19+
20+
# Event triggers for the workflow
21+
on:
22+
push:
23+
branches:
24+
- main
25+
- gh-pages
26+
workflow_dispatch:
27+
28+
# Workflow permissions
29+
permissions:
30+
contents: write
31+
32+
# Concurrency settings
33+
concurrency:
34+
cancel-in-progress: false
35+
group: "pages"
36+
37+
# The deployment job
38+
jobs:
39+
deploy:
40+
runs-on: ubuntu-latest
41+
steps:
42+
- name: Checkout repository
43+
uses: actions/checkout@v4
44+
with:
45+
fetch-depth: 0
46+
token: ${{ secrets.GITHUB_TOKEN }}
47+
48+
- name: Setup Python
49+
uses: actions/setup-python@v5
50+
with:
51+
cache: "pip"
52+
python-version: "3.11"
53+
54+
- name: Install dependencies
55+
run: |
56+
python -m pip install --upgrade pip
57+
pip install -r mkdocs/requirements.txt
58+
59+
- name: Configure Git
60+
run: |
61+
git config --global user.name "github-actions[bot]"
62+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
63+
64+
- name: Deploy to GitHub Pages
65+
run: |
66+
mkdocs gh-deploy --force

.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode
3+
# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode
4+
5+
### VisualStudioCode ###
6+
.vscode/*
7+
!.vscode/settings.json
8+
!.vscode/tasks.json
9+
!.vscode/launch.json
10+
!.vscode/extensions.json
11+
*.code-workspace
12+
13+
# Local History for Visual Studio Code
14+
.history/
15+
16+
### VisualStudioCode Patch ###
17+
# Ignore all local history of files
18+
.history
19+
.ionide
20+
21+
# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode
22+
# MkDocs
23+
mkdocs-site/
24+
.venv/
25+

Archive/awk.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
### Write the example file which we will use
4+
cat << EOF > file.txt
5+
Student-Id Name Major Grade
6+
1 John Biology 78
7+
2 George Literature 82
8+
3 Paul Music 94
9+
4 Ringo Music 89
10+
EOF
11+
12+
# Print out the example file
13+
#cat file.txt
14+
15+
16+
#### AWK examples:
17+
# Print the whole file
18+
awk '{print $0}' file.txt
19+
20+
# Print the 2nd and 3rd columns with tab between each row
21+
awk '{print $2 "\t" $3}' file.txt
22+
23+
# Print out all student whos majos is music (the whole line)
24+
awk '/Music/ {print $0}' file.txt
25+
26+
# Counting and Printing Matched Pattern
27+
awk '/Music/{++counter} END {print "Counter = " , counter}' file.txt

Archive/cut.sh

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
#!/bin/bash
2+
3+
export FILE_NAME=trace.log
4+
5+
### Write the example file which we will use
6+
cat << EOF > $FILE_NAME
7+
03/22 08:51:01 INFO :.main: *************** RSVP Agent started ***************
8+
03/22 08:51:01 INFO :...locate_configFile: Specified configuration file: /u/user10/rsvpd1.conf
9+
03/22 08:51:01 INFO :.main: Using log level 511
10+
03/22 08:51:01 INFO :..settcpimage: Get TCP images rc - EDC8112I Operation not supported on socket.
11+
03/22 08:51:01 INFO :..settcpimage: Associate with TCP/IP image name = TCPCS
12+
03/22 08:51:02 INFO :..reg_process: registering process with the system
13+
03/22 08:51:02 INFO :..reg_process: attempt OS/390 registration
14+
03/22 08:51:02 INFO :..reg_process: return from registration rc=0
15+
03/22 08:51:03 TRACE :...read_physical_netif: Home list entries returned = 7
16+
03/22 08:51:03 INFO :...read_physical_netif: index #0, interface VLINK1 has address 129.1.1.1, ifidx 0
17+
03/22 08:51:03 INFO :...read_physical_netif: index #1, interface TR1 has address 9.37.65.139, ifidx 1
18+
03/22 08:51:03 INFO :...read_physical_netif: index #2, interface LINK11 has address 9.67.100.1, ifidx 2
19+
03/22 08:51:03 INFO :...read_physical_netif: index #3, interface LINK12 has address 9.67.101.1, ifidx 3
20+
03/22 08:51:03 INFO :...read_physical_netif: index #4, interface CTCD0 has address 9.67.116.98, ifidx 4
21+
03/22 08:51:03 INFO :...read_physical_netif: index #5, interface CTCD2 has address 9.67.117.98, ifidx 5
22+
03/22 08:51:04 INFO :...read_physical_netif: index #6, interface LOOPBACK has address 127.0.0.1, ifidx 0
23+
03/22 08:51:04 INFO :....mailslot_create: creating mailslot for timer
24+
03/22 08:51:04 INFO :...mailbox_register: mailbox allocated for timer
25+
03/22 08:51:04 INFO :.....mailslot_create: creating mailslot for RSVP
26+
03/22 08:51:04 INFO :....mailbox_register: mailbox allocated for rsvp
27+
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
28+
03/22 08:51:06 WARNING :.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
29+
03/22 08:51:05 INFO :....mailbox_register: mailbox allocated for rsvp-udp
30+
03/22 08:51:05 TRACE :..entity_initialize: interface 129.1.1.1, entity for rsvp allocated and initialized
31+
03/22 08:51:05 INFO :.....mailslot_create: creating mailslot for RSVP
32+
03/22 08:51:05 INFO :....mailbox_register: mailbox allocated for rsvp
33+
03/22 08:51:05 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
34+
03/22 08:51:05 WARNING :.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
35+
03/22 08:51:05 INFO :....mailbox_register: mailbox allocated for rsvp-udp
36+
03/22 08:51:05 TRACE :..entity_initialize: interface 9.37.65.139, entity for rsvp allocated and initialized
37+
03/22 08:51:05 INFO :.....mailslot_create: creating mailslot for RSVP
38+
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
39+
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
40+
03/22 08:51:06 WARNING :.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
41+
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
42+
03/22 08:51:06 TRACE :..entity_initialize: interface 9.67.100.1, entity for rsvp allocated and initialized
43+
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
44+
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
45+
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
46+
03/22 08:51:07 WARNING :.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
47+
03/22 08:51:07 INFO :....mailbox_register: mailbox allocated for rsvp-udp
48+
03/22 08:51:07 TRACE :..entity_initialize: interface 9.67.101.1, entity for rsvp allocated and initialized
49+
03/22 08:51:07 INFO :.....mailslot_create: creating mailslot for RSVP
50+
03/22 08:51:07 INFO :....mailbox_register: mailbox allocated for rsvp
51+
03/22 08:51:07 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
52+
03/22 08:51:08 INFO :....mailbox_register: mailbox allocated for rsvp-udp
53+
03/22 08:51:08 TRACE :..entity_initialize: interface 9.67.116.98, entity for rsvp allocated and initialized
54+
03/22 08:51:08 INFO :.....mailslot_create: creating mailslot for RSVP
55+
03/22 08:51:08 INFO :....mailbox_register: mailbox allocated for rsvp
56+
03/22 08:51:08 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
57+
03/22 08:51:08 INFO :....mailbox_register: mailbox allocated for rsvp-udp
58+
03/22 08:51:08 TRACE :..entity_initialize: interface 9.67.117.98, entity for rsvp allocated and initialized
59+
EOF
60+
61+
62+
#### Cut examples:
63+
64+
# Extract only the 2nd & 3rd column (field) of each line time
65+
cut -d " " -f 2,3 $FILE_NAME
66+
67+
# Extract only the log trace levels and remove duplications
68+
cut -d " " -f 3 $FILE_NAME | sort | uniq
69+
70+
# Count the number of each log type
71+
# INFO = 41
72+
# TRACE = 7
73+
# WARNING = 4
74+
75+
# Simple solution:
76+
echo -e INFO = $(cut -d ' ' -f 3 $FILE_NAME | grep INFO | wc -l)
77+
echo -e TRACE = $(cut -d ' ' -f 3 $FILE_NAME | grep TRACE | wc -l)
78+
echo -e WARNING = $(cut -d ' ' -f 3 $FILE_NAME | grep WARNING | wc -l)
79+
80+
###
81+
### Advanced solution using dynamic for loop:
82+
###
83+
84+
### Extract the log levels
85+
LOG_LEVEL=$(cut -d " " -f 3 $FILE_NAME | sort | uniq)
86+
87+
### Loop over each log level and count entries
88+
for LEVEL in $LOG_LEVEL
89+
do
90+
echo -e $LEVEL = $(cut -d ' ' -f 3 $FILE_NAME | grep $LEVEL | wc -l)
91+
done
92+
93+
94+
### Extract IP addresses
95+
grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b" $FILE_NAME | sort | uniq

Archive/file.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Student-Id Name Major Grade
2+
1 John Biology 78
3+
2 George Literature 82
4+
3 Paul Music 94
5+
4 Ringo Music 89

Archive/test.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
function Greet() {
4+
str="Hello $name"
5+
echo $str
6+
}
7+
8+
echo "-> what's your name?"
9+
read name
10+
11+
val=$(Greet)
12+
echo -e "-> $val"

Archive/trace.log

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
03/22 08:51:01 INFO :.main: *************** RSVP Agent started ***************
2+
03/22 08:51:01 INFO :...locate_configFile: Specified configuration file: /u/user10/rsvpd1.conf
3+
03/22 08:51:01 INFO :.main: Using log level 511
4+
03/22 08:51:01 INFO :..settcpimage: Get TCP images rc - EDC8112I Operation not supported on socket.
5+
03/22 08:51:01 INFO :..settcpimage: Associate with TCP/IP image name = TCPCS
6+
03/22 08:51:02 INFO :..reg_process: registering process with the system
7+
03/22 08:51:02 INFO :..reg_process: attempt OS/390 registration
8+
03/22 08:51:02 INFO :..reg_process: return from registration rc=0
9+
03/22 08:51:03 TRACE :...read_physical_netif: Home list entries returned = 7
10+
03/22 08:51:03 INFO :...read_physical_netif: index #0, interface VLINK1 has address 129.1.1.1, ifidx 0
11+
03/22 08:51:03 INFO :...read_physical_netif: index #1, interface TR1 has address 9.37.65.139, ifidx 1
12+
03/22 08:51:03 INFO :...read_physical_netif: index #2, interface LINK11 has address 9.67.100.1, ifidx 2
13+
03/22 08:51:03 INFO :...read_physical_netif: index #3, interface LINK12 has address 9.67.101.1, ifidx 3
14+
03/22 08:51:03 INFO :...read_physical_netif: index #4, interface CTCD0 has address 9.67.116.98, ifidx 4
15+
03/22 08:51:03 INFO :...read_physical_netif: index #5, interface CTCD2 has address 9.67.117.98, ifidx 5
16+
03/22 08:51:04 INFO :...read_physical_netif: index #6, interface LOOPBACK has address 127.0.0.1, ifidx 0
17+
03/22 08:51:04 INFO :....mailslot_create: creating mailslot for timer
18+
03/22 08:51:04 INFO :...mailbox_register: mailbox allocated for timer
19+
03/22 08:51:04 INFO :.....mailslot_create: creating mailslot for RSVP
20+
03/22 08:51:04 INFO :....mailbox_register: mailbox allocated for rsvp
21+
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
22+
03/22 08:51:06 WARNING :.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
23+
03/22 08:51:05 INFO :....mailbox_register: mailbox allocated for rsvp-udp
24+
03/22 08:51:05 TRACE :..entity_initialize: interface 129.1.1.1, entity for rsvp allocated and initialized
25+
03/22 08:51:05 INFO :.....mailslot_create: creating mailslot for RSVP
26+
03/22 08:51:05 INFO :....mailbox_register: mailbox allocated for rsvp
27+
03/22 08:51:05 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
28+
03/22 08:51:05 WARNING :.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
29+
03/22 08:51:05 INFO :....mailbox_register: mailbox allocated for rsvp-udp
30+
03/22 08:51:05 TRACE :..entity_initialize: interface 9.37.65.139, entity for rsvp allocated and initialized
31+
03/22 08:51:05 INFO :.....mailslot_create: creating mailslot for RSVP
32+
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
33+
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
34+
03/22 08:51:06 WARNING :.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
35+
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp-udp
36+
03/22 08:51:06 TRACE :..entity_initialize: interface 9.67.100.1, entity for rsvp allocated and initialized
37+
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP
38+
03/22 08:51:06 INFO :....mailbox_register: mailbox allocated for rsvp
39+
03/22 08:51:06 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
40+
03/22 08:51:07 WARNING :.....mailslot_create: setsockopt(MCAST_ADD) failed - EDC8116I Address not available.
41+
03/22 08:51:07 INFO :....mailbox_register: mailbox allocated for rsvp-udp
42+
03/22 08:51:07 TRACE :..entity_initialize: interface 9.67.101.1, entity for rsvp allocated and initialized
43+
03/22 08:51:07 INFO :.....mailslot_create: creating mailslot for RSVP
44+
03/22 08:51:07 INFO :....mailbox_register: mailbox allocated for rsvp
45+
03/22 08:51:07 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
46+
03/22 08:51:08 INFO :....mailbox_register: mailbox allocated for rsvp-udp
47+
03/22 08:51:08 TRACE :..entity_initialize: interface 9.67.116.98, entity for rsvp allocated and initialized
48+
03/22 08:51:08 INFO :.....mailslot_create: creating mailslot for RSVP
49+
03/22 08:51:08 INFO :....mailbox_register: mailbox allocated for rsvp
50+
03/22 08:51:08 INFO :.....mailslot_create: creating mailslot for RSVP via UDP
51+
03/22 08:51:08 INFO :....mailbox_register: mailbox allocated for rsvp-udp
52+
03/22 08:51:08 TRACE :..entity_initialize: interface 9.67.117.98, entity for rsvp allocated and initialized

0 commit comments

Comments
 (0)