1. General Download Script Link to heading

Example for downloading CUDA 12.2 toolkit

#!/bin/bash

# ๐ŸŽฏ Target download URL
URL="https://developer.download.nvidia.cn/compute/cuda/12.2.2/local_installers/cuda_12.2.2_535.104.05_linux.run"
# ๐Ÿ“‚ Filename
FILENAME=$(basename "$URL")

# ๐Ÿ” Infinite retry for download (supports resuming from interruption)
while true; do
    echo "๐Ÿš€ Starting download (will auto-resume if interrupted): $FILENAME"
    
    # Use wget -c to enable resuming
    wget -c "$URL"
    
    # โœ… Check if download was successful
    if [ $? -eq 0 ]; then
        echo "โœ… Download successful: $FILENAME"
        break
    else
        echo "โณ Download interrupted, retrying in 5 seconds..."
        sleep 5  # โณ Wait for 5 seconds before retrying to avoid network issues
    fi
done

2. DownloadVOC2007

Link to heading
#!/bin/bash

# ๐Ÿ“‚ Get the script's directory
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)

# ๐Ÿ“ Create directory to save data
TARGET_DIR="$SCRIPT_DIR/VOC2007"
mkdir -p "$TARGET_DIR"
cd "$TARGET_DIR"

# ๐ŸŒ Define download URLs
VOC_TRAINVAL_URL="http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtrainval_06-Nov-2007.tar"
VOC_TEST_URL="http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtest_06-Nov-2007.tar"
VOC_DEVKIT_URL="http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCdevkit_08-Jun-2007.tar"

# โฌ‡๏ธ Download files (supports resuming)
echo "๐Ÿš€ Downloading VOCtrainval_06-Nov-2007.tar..."
wget -c "$VOC_TRAINVAL_URL"

echo "๐Ÿš€ Downloading VOCtest_06-Nov-2007.tar..."
wget -c "$VOC_TEST_URL"

echo "๐Ÿš€ Downloading VOCdevkit_08-Jun-2007.tar..."
wget -c "$VOC_DEVKIT_URL"

# ๐Ÿ“ฆ Extract files
echo "๐Ÿ“‚ Extracting VOCtrainval_06-Nov-2007.tar..."
tar -xvf VOCtrainval_06-Nov-2007.tar
rm VOCtrainval_06-Nov-2007.tar  # ๐Ÿ—‘๏ธ Delete the tar file after extracting

echo "๐Ÿ“‚ Extracting VOCtest_06-Nov-2007.tar..."
tar -xvf VOCtest_06-Nov-2007.tar
rm VOCtest_06-Nov-2007.tar  # ๐Ÿ—‘๏ธ Delete the tar file after extracting

echo "๐Ÿ“‚ Extracting VOCdevkit_08-Jun-2007.tar..."
tar -xvf VOCdevkit_08-Jun-2007.tar
rm VOCdevkit_08-Jun-2007.tar  # ๐Ÿ—‘๏ธ Delete the tar file after extracting

# ๐ŸŽ‰ Print completion message
echo "โœ… VOC 2007 dataset download, extraction, and cleanup completed!"

โฌ…Return to Dataset Page๐Ÿ”—

3. DownloadCOCO

Link to heading
#!/bin/bash

# ๐Ÿ“‚ Create image data directory
mkdir -p images
cd images

# โฌ‡๏ธ Download COCO image data
echo "๐Ÿš€ Downloading COCO training set (train2017.zip)..."
wget -c http://images.cocodataset.org/zips/train2017.zip

echo "๐Ÿš€ Downloading COCO validation set (val2017.zip)..."
wget -c http://images.cocodataset.org/zips/val2017.zip

echo "๐Ÿš€ Downloading COCO test set (test2017.zip)..."
wget -c http://images.cocodataset.org/zips/test2017.zip

# ๐Ÿ“ฆ Extract COCO image data
echo "๐Ÿ“‚ Extracting train2017.zip..."
unzip train2017.zip && rm -f train2017.zip

echo "๐Ÿ“‚ Extracting val2017.zip..."
unzip val2017.zip && rm -f val2017.zip

echo "๐Ÿ“‚ Extracting test2017.zip..."
unzip test2017.zip && rm -f test2017.zip

# ๐Ÿ”– Download COCO annotation data
cd ..
mkdir -p annotations
cd annotations

echo "๐Ÿš€ Downloading COCO annotation data (annotations_trainval2017.zip)..."
wget -c http://images.cocodataset.org/annotations/annotations_trainval2017.zip

# ๐Ÿ“‚ Extract COCO annotation data
echo "๐Ÿ“‚ Extracting annotations_trainval2017.zip..."
unzip annotations_trainval2017.zip && rm -f annotations_trainval2017.zip

# โœ… Task completed
echo "๐ŸŽ‰ COCO2017 dataset download, extraction, and cleanup completed!"

โฌ…Return to Dataset Page๐Ÿ”—

4. Proxy Setup Script

Link to heading
#!/bin/bash

# Set proxy address
SOCKS5_PROXY="socks5://127.0.0.1:10808"
HTTP_PROXY="http://127.0.0.1:10809"
HTTPS_PROXY="http://127.0.0.1:10809"

# Set environment variables so all tools (curl, wget, apt, docker) use the proxy
export HTTP_PROXY=$HTTP_PROXY
export HTTPS_PROXY=$HTTPS_PROXY
export ALL_PROXY=$SOCKS5_PROXY
export http_proxy=$HTTP_PROXY
export https_proxy=$HTTPS_PROXY
export all_proxy=$SOCKS5_PROXY

echo "โœ… Proxy environment variables set"

# Configure Conda proxy
echo "๐Ÿ”ง Configuring Conda proxy..."
conda config --set proxy_servers.http $HTTP_PROXY
conda config --set proxy_servers.https $HTTPS_PROXY
echo "โœ… Conda proxy configured"

# Configure Pip proxy
echo "๐Ÿ”ง Configuring Pip proxy..."
pip config set global.proxy $HTTP_PROXY
echo "โœ… Pip proxy configured"

# Configure Git proxy
echo "๐Ÿ”ง Configuring Git proxy..."
git config --global http.proxy $HTTP_PROXY
git config --global https.proxy $HTTPS_PROXY
echo "โœ… Git proxy configured"

# Configure APT proxy
echo "๐Ÿ”ง Configuring APT proxy..."
cat <<EOF | tee /etc/apt/apt.conf.d/proxy.conf
Acquire::http::Proxy "$HTTP_PROXY";
Acquire::https::Proxy "$HTTPS_PROXY";
EOF
echo "โœ… APT proxy configured"

# Check proxy settings
echo "๐Ÿ” Verifying proxy settings..."
echo "๐Ÿ”น Conda proxy: $(conda config --show proxy_servers | grep proxy)"
echo "๐Ÿ”น Pip proxy: $(pip config list | grep proxy)"
echo "๐Ÿ”น Git proxy (HTTP): $(git config --global --get http.proxy)"
echo "๐Ÿ”น Git proxy (HTTPS): $(git config --global --get https.proxy)"
echo "๐Ÿ”น APT proxy: $(cat /etc/apt/apt.conf.d/proxy.conf)"

# Test proxy functionality
echo "๐ŸŒ Testing proxy access to Google..."
curl_test=$(curl -I https://www.google.com 2>/dev/null | head -n 1)

if [[ "$curl_test" =~ "200 OK" || "$curl_test" =~ "200 Connection established" ]]; then
    echo "โœ… Proxy set up successfully, network is working!"
    exit 0
else
    echo "โŒ Proxy setup failed, please check network or proxy server!"
    exit 1
fi

โฌ…Return to Proxy Page๐Ÿ”—

5. Proxy Setup in Container

Link to heading
#!/bin/bash

# Set proxy addresses
SOCKS5_PROXY="socks5://127.0.0.1:10808"
HTTP_PROXY="http://127.0.0.1:10809"
HTTPS_PROXY="http://127.0.0.1:10809"

echo "โœ… Proxy environment variables have been set"

# Configure Conda proxy
echo "๐Ÿ”ง Configuring Conda proxy..."
conda config --set proxy_servers.http $HTTP_PROXY
conda config --set proxy_servers.https $HTTPS_PROXY
echo "โœ… Conda proxy has been configured"

# Configure Pip proxy
echo "๐Ÿ”ง Configuring Pip proxy..."
pip config set global.proxy $HTTP_PROXY
echo "โœ… Pip proxy has been configured"

# Configure Git proxy
echo "๐Ÿ”ง Configuring Git proxy..."
git config --global http.proxy $HTTP_PROXY
git config --global https.proxy $HTTPS_PROXY
echo "โœ… Git proxy has been configured"

# Configure APT proxy
echo "๐Ÿ”ง Configuring APT proxy..."
cat <<EOF | tee /etc/apt/apt.conf.d/proxy.conf
Acquire::http::Proxy "$HTTP_PROXY";
Acquire::https::Proxy "$HTTPS_PROXY";
EOF
echo "โœ… APT proxy has been configured"

# Verify proxy settings
echo "๐Ÿ” Verifying proxy configuration..."
echo "๐Ÿ”น Conda proxy: $(conda config --show proxy_servers | grep proxy)"
echo "๐Ÿ”น Pip proxy: $(pip config list | grep proxy)"
echo "๐Ÿ”น Git proxy (HTTP): $(git config --global --get http.proxy)"
echo "๐Ÿ”น Git proxy (HTTPS): $(git config --global --get https.proxy)"
echo "๐Ÿ”น APT proxy: $(cat /etc/apt/apt.conf.d/proxy.conf)"

# Test if the proxy works
echo "๐ŸŒ Testing proxy access to Google..."
curl_test=$(curl -I https://www.google.com 2>/dev/null | head -n 1)

if [[ "$curl_test" =~ "200 OK" || "$curl_test" =~ "200 Connection established" ]]; then
    echo "โœ… Proxy setup successful, network is working!"
    exit 0
else
    echo "โŒ Proxy setup failed, please check network or proxy server!"
    exit 1
fi

โฌ…่ฟ”ๅ›žproxy้กต้ข๐Ÿ”—

6. Conda Environment Setup for MonoGS and 3DGS Link to heading

#!/bin/bash

# Define the environment name
ENV_NAME="MonoGS-3DGS"

# Create the Conda environment
echo "๐Ÿ”ง Creating Conda environment: $ENV_NAME"
conda create --name $ENV_NAME python=3.8 -y

# Activate the environment
echo "๐Ÿ”ง Activating Conda environment: $ENV_NAME"
conda activate $ENV_NAME

# Install the required dependencies
echo "๐Ÿ”ง Installing dependencies for MonoGS and 3DGS"
conda install -c conda-forge pytorch torchvision cudatoolkit=12.2 -y
conda install -c conda-forge opencv -y
conda install -c conda-forge matplotlib -y
conda install -c conda-forge scikit-learn -y

# Task completed
echo "โœ… Conda environment setup completed!"