Skip to content

Commit 059e304

Browse files
Refactor screenshots and add security analysis screenshot
1 parent 3a63b75 commit 059e304

File tree

9 files changed

+118
-69
lines changed

9 files changed

+118
-69
lines changed

src/docs/README.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
1-
## Product Screenshots 📸
1+
# Product Screenshots 📸
22

3-
### HomePage
3+
## Home Page
44

5-
![HomePage](/src/static/images/dashboard.png)
5+
![screenshot_002](/src/static/images/screenshot_002.png)
66

7-
### CPU Stats
7+
## Cpu Info
88

9-
![CPU Stats](/src/static/images/cpu.png)
9+
![screenshot_003](/src/static/images/screenshot_003.png)
1010

11-
### Memory Stats
11+
## Control Panel
1212

13-
![Memory Stats](/src/static/images/memory.png)
13+
![screenshot_004](/src/static/images/screenshot_004.png)
1414

15-
### Disk Stats
15+
## Network Statistics
1616

17-
![Disk Stats](/src/static/images/disk.png)
17+
![screenshot_005](/src/static/images/screenshot_005.png)
1818

19-
### Speed Test
19+
## Running Processes
2020

21-
![Speed Test](/src/static/images/speedtest.png)
21+
![screenshot_006](/src/static/images/screenshot_006.png)
22+
23+
## Security Analysis
24+
25+
![screenshot_007](/src/static/images/screenshot_007.png)

src/docs/installation.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,25 @@ chmod +x install_miniconda.sh && ./install_miniconda.sh
2323
```bash
2424
# debian based distros
2525
sudo apt-get update
26-
sudo apt-get install git curl wget unzip iptables jq
26+
sudo apt-get install git curl wget unzip iptables jq nmap
2727
```
2828

2929
```bash
3030
sudo dnf update -y
31-
sudo dnf install -y git curl wget unzip iptables jq
31+
sudo dnf install -y git curl wget unzip iptables jq namp
3232
```
3333

3434
```bash
3535
sudo yum update -y
36-
sudo yum install -y git curl wget unzip iptables jq
36+
sudo yum install -y git curl wget unzip iptables jq nmap
3737
```
3838

3939
- curl: For downloading files from the internet.
4040
- wget: For downloading files from the internet.
4141
- unzip: For extracting zip files.
4242
- iptables: For managing firewall rules.
4343
- jq: For processing JSON data.
44+
- nmap: For network scanning and monitoring.
4445

4546
2. Download and set up the SystemGuard installer:
4647

src/scripts/install_miniconda.sh

100755100644
Lines changed: 99 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,121 @@
11
#!/bin/bash
22

3-
LOG_FILE="/tmp/miniconda_installation.log"
4-
MINICONDA_SCRIPT_URL="https://raw.githubusercontent.com/codeperfectplus/HackScripts/main/setup/install_miniconda.sh"
5-
MINICONDA_SCRIPT_PATH="/tmp/install_miniconda.sh"
3+
# Script to set up Miniconda on a Linux system
4+
# Status: Tested
5+
# Published by: Deepak Raj
6+
# Published on: 2024-08-28
67

7-
log() {
8-
echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" | tee -a "$LOG_FILE"
9-
}
10-
11-
get_user_home() {
12-
if [ -n "$SUDO_USER" ]; then
13-
TARGET_USER="$SUDO_USER"
8+
# Function to determine the home directory of the target user
9+
get_user_name() {
10+
if [ "$(whoami)" = "root" ]; then
11+
LOGNAME_USER=$(logname 2>/dev/null) # Redirect any error output to /dev/null
12+
if [ $? -ne 0 ]; then # Check if the exit status of the last command is not 0
13+
echo "No login name found. Using fallback method."
14+
# use head -n 1 for native linux. tail -n 1 works with wsl.
15+
USER_NAME=$(cat /etc/passwd | grep '/home' | cut -d: -f1 | tail -n 1)
16+
else
17+
USER_NAME=$LOGNAME_USER
18+
fi
1419
else
15-
TARGET_USER="$LOGNAME"
20+
USER_NAME=$(whoami)
1621
fi
17-
USER_HOME=$(eval echo ~$TARGET_USER)
18-
echo "$USER_HOME"
22+
echo "$USER_NAME"
1923
}
2024

21-
USER_HOME=$(get_user_home)
22-
AUTO_CONFIRM=false
25+
USER_NAME=$(get_user_name)
26+
USER_HOME="/home/$USER_NAME"
27+
echo "User home directory: $USER_HOME"
28+
INSTALL_PATH="$USER_HOME/miniconda3"
29+
MINICONDA_INSTALLER="Miniconda3-latest-Linux-x86_64.sh"
30+
TMP_INSTALLER="/tmp/$MINICONDA_INSTALLER"
31+
MINICONDA_PAGE_URL="https://docs.anaconda.com/miniconda/"
2332

24-
install_miniconda() {
25-
log "Starting Miniconda installation process."
33+
# Function to extract the checksum from the Miniconda documentation page
34+
extract_checksum() {
35+
echo "Downloading Miniconda documentation page..."
36+
wget -q "$MINICONDA_PAGE_URL" -O /tmp/miniconda_page.html
2637

27-
if [ "$AUTO_CONFIRM" = false ]; then
28-
echo "Do you want to install Miniconda? (y/n)"
29-
read -r answer
30-
if [ ! "$answer" = "y" ]; then
31-
log "Miniconda installation skipped by user."
32-
return
33-
fi
34-
else
35-
log "Auto-confirmation enabled, proceeding with installation."
38+
if [ ! -f "/tmp/miniconda_page.html" ]; then
39+
echo "Failed to download Miniconda documentation page."
40+
return 1
3641
fi
3742

38-
log "Downloading Miniconda installation script to /tmp directory."
39-
if wget "$MINICONDA_SCRIPT_URL" -O "$MINICONDA_SCRIPT_PATH"; then
40-
log "Miniconda installation script downloaded successfully."
41-
else
42-
log "Failed to download Miniconda installation script."
43+
echo "Extracting checksum for $MINICONDA_INSTALLER..."
44+
CHECKSUM=$(grep -A 1 "$MINICONDA_INSTALLER" /tmp/miniconda_page.html | grep -oP '(?<=<span class="pre">)[a-f0-9]{64}(?=</span>)')
45+
46+
rm /tmp/miniconda_page.html
47+
48+
if [ -z "$CHECKSUM" ]; then
49+
echo "Checksum for $MINICONDA_INSTALLER not found."
4350
return 1
4451
fi
52+
}
4553

54+
# Download Miniconda installer if it doesn't already exist
55+
if [ -f "$TMP_INSTALLER" ]; then
56+
echo "Miniconda installer already exists in /tmp. Skipping download."
57+
else
58+
echo "Downloading Miniconda installer..."
59+
wget https://repo.anaconda.com/miniconda/$MINICONDA_INSTALLER -O $TMP_INSTALLER
60+
fi
4661

47-
chmod +x "$MINICONDA_SCRIPT_PATH"
48-
49-
log "Running Miniconda installation script."
50-
if "$MINICONDA_SCRIPT_PATH"; then
51-
log "Miniconda installation script executed successfully."
52-
else
53-
log "Miniconda installation script execution failed."
54-
return 1
62+
# Verify the Miniconda installer checksum
63+
echo "Verifying Miniconda installer..."
64+
extract_checksum
65+
66+
if [ $? -ne 0 ]; then
67+
echo "Failed to extract checksum. Exiting..."
68+
exit 1
69+
fi
70+
71+
DOWNLOAD_CHECKSUM=$(sha256sum $TMP_INSTALLER | awk '{print $1}')
72+
73+
echo "Checksum of downloaded file: $DOWNLOAD_CHECKSUM"
74+
echo "Checksum from documentation: $CHECKSUM"
75+
76+
if [ "$DOWNLOAD_CHECKSUM" != "$CHECKSUM" ]; then
77+
echo "Checksum verification failed. Exiting..."
78+
echo "Do you want to proceed with the installation anyway? (y/n): "
79+
read proceed
80+
if [ "$proceed" != "y" ]; then
81+
echo "Exiting..."
82+
exit 1
5583
fi
84+
fi
5685

57-
if [ -d "$USER_HOME/miniconda3" ]; then
58-
log "Miniconda installed successfully."
59-
else
60-
log "Miniconda installation failed."
61-
return 1
86+
echo "Checksum verification successful."
87+
88+
# Check if Miniconda is already installed
89+
echo $INSTALL_PATH
90+
91+
if [ -d "$INSTALL_PATH" ]; then
92+
echo "Miniconda is already installed at $INSTALL_PATH."
93+
read -p "Do you want to update Miniconda? (y/n): " update
94+
if [ "$update" != "y" ]; then
95+
echo "Exiting..."
96+
exit 0
6297
fi
98+
bash $TMP_INSTALLER -b -p $INSTALL_PATH -u
99+
else
100+
# Run the Miniconda installer
101+
echo "Running Miniconda installer..."
102+
bash $TMP_INSTALLER -b -p $INSTALL_PATH
103+
fi
63104

64-
log "Cleaning up installation files."
65-
rm "$MINICONDA_SCRIPT_PATH" || log "Failed to remove installation script."
105+
# Initialize Miniconda
106+
echo "Initializing Miniconda..."
107+
$INSTALL_PATH/bin/conda init
66108

67-
log "Miniconda installation process completed."
68-
}
109+
# Clean up the installer
110+
echo "Cleaning up..."
111+
rm $TMP_INSTALLER
112+
113+
# Optional: Update Conda to the latest version
114+
echo "Updating Conda..."
115+
$INSTALL_PATH/bin/conda update -n base -c defaults conda -y
69116

70-
while getopts "y" opt; do
71-
case $opt in
72-
y) AUTO_CONFIRM=true ;;
73-
*) echo "Usage: $0 [-y]"; exit 1 ;;
74-
esac
75-
done
117+
source ~/.bashrc
76118

77-
install_miniconda
119+
# Display final message
120+
echo "Miniconda installation completed!"
121+
echo "Miniconda is installed at $INSTALL_PATH"
263 KB
Loading
119 KB
Loading
90.7 KB
Loading
109 KB
Loading
95.2 KB
Loading
57.6 KB
Loading

0 commit comments

Comments
 (0)