From 8dcf5be3582961b8168f9fbdb043828294777ac3 Mon Sep 17 00:00:00 2001 From: louiscklaw Date: Sat, 1 Feb 2025 02:04:33 +0800 Subject: [PATCH] update, --- .gitattributes | 31 ++++++++++++++++++++ .gitignore | 1 + gitUpdate.bat | 7 +++++ gitUpdate.sh | 16 ++++++++++ meta.md | 1 + task1-aws-proxy/2023-11-12_15-30.png | 3 ++ task1-aws-proxy/docker-compose.yml | 17 +++++++++++ task1-aws-proxy/image/2023-11-12_15-01.png | 3 ++ task1-aws-proxy/image/2023-11-12_15-01_1.png | 3 ++ task1-aws-proxy/install_docker.sh | 29 ++++++++++++++++++ task1-aws-proxy/install_docker_compose.sh | 13 ++++++++ task1-aws-proxy/landing.sh | 6 ++++ task1-aws-proxy/setup.sh | 17 +++++++++++ task1-aws-proxy/tinyproxy.conf | 4 +++ task1-aws-proxy/up.sh | 5 ++++ 15 files changed, 156 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 gitUpdate.bat create mode 100755 gitUpdate.sh create mode 100644 meta.md create mode 100644 task1-aws-proxy/2023-11-12_15-30.png create mode 100644 task1-aws-proxy/docker-compose.yml create mode 100644 task1-aws-proxy/image/2023-11-12_15-01.png create mode 100644 task1-aws-proxy/image/2023-11-12_15-01_1.png create mode 100644 task1-aws-proxy/install_docker.sh create mode 100644 task1-aws-proxy/install_docker_compose.sh create mode 100644 task1-aws-proxy/landing.sh create mode 100644 task1-aws-proxy/setup.sh create mode 100644 task1-aws-proxy/tinyproxy.conf create mode 100644 task1-aws-proxy/up.sh diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..d54c38a --- /dev/null +++ b/.gitattributes @@ -0,0 +1,31 @@ +*.mp4 filter=lfs diff=lfs merge=lfs +*.zip filter=lfs diff=lfs merge=lfs +*.7z filter=lfs diff=lfs merge=lfs +*.tar.gz filter=lfs diff=lfs merge=lfs +*.jpg filter=lfs diff=lfs merge=lfs +*.png filter=lfs diff=lfs merge=lfs +*.avif filter=lfs diff=lfs merge=lfs +*.webm filter=lfs diff=lfs merge=lfs +*.mkv filter=lfs diff=lfs merge=lfs + +# Documents +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain + +*.gif filter=lfs diff=lfs merge=lfs +*.GIF filter=lfs diff=lfs merge=lfs +*.bmp filter=lfs diff=lfs merge=lfs +*.BMP filter=lfs diff=lfs merge=lfs +*.tiff filter=lfs diff=lfs merge=lfs +*.TIFF filter=lfs diff=lfs merge=lfs +*.wav filter=lfs diff=lfs merge=lfs +*.WAV filter=lfs diff=lfs merge=lfs +*.log filter=lfs diff=lfs merge=lfs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..67a5a14 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +**/~*.* \ No newline at end of file diff --git a/gitUpdate.bat b/gitUpdate.bat new file mode 100644 index 0000000..b950230 --- /dev/null +++ b/gitUpdate.bat @@ -0,0 +1,7 @@ +git status . + +@pause + +git add . +git commit -m"update noknok11d," +start git push \ No newline at end of file diff --git a/gitUpdate.sh b/gitUpdate.sh new file mode 100755 index 0000000..c96734f --- /dev/null +++ b/gitUpdate.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +set -ex + +git config --global http.version HTTP/1.1 +git config --global lfs.allowincompletepush true +git config --global lfs.locksverify true +git config --global http.postBuffer 5368709120 + +git add . + +git commit -m 'update,' + +git push + +echo "done" diff --git a/meta.md b/meta.md new file mode 100644 index 0000000..43d64a0 --- /dev/null +++ b/meta.md @@ -0,0 +1 @@ +tags: [ ec2 ] diff --git a/task1-aws-proxy/2023-11-12_15-30.png b/task1-aws-proxy/2023-11-12_15-30.png new file mode 100644 index 0000000..879a283 --- /dev/null +++ b/task1-aws-proxy/2023-11-12_15-30.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eead63cd188fe100d5da0e484591468ba5f3d1bc61ee20128609a16982419fc4 +size 108794 diff --git a/task1-aws-proxy/docker-compose.yml b/task1-aws-proxy/docker-compose.yml new file mode 100644 index 0000000..0877319 --- /dev/null +++ b/task1-aws-proxy/docker-compose.yml @@ -0,0 +1,17 @@ +services: + tinyproxy: + # Specifies the Docker image to use for the tinyproxy service + image: vimagick/tinyproxy + + ports: + # Maps port 8888 inside the container to port 5354 on the host + - "5354:8888" + + volumes: + # Mounts the host directory './data' to '/etc/tinyproxy' inside the container + - ./data:/etc/tinyproxy + # Mounts the host file 'tinyproxy.conf' to the container's tinyproxy configuration file + - ./tinyproxy.conf:/etc/tinyproxy/tinyproxy.conf + + # Ensures the container always restarts unless manually stopped + restart: always diff --git a/task1-aws-proxy/image/2023-11-12_15-01.png b/task1-aws-proxy/image/2023-11-12_15-01.png new file mode 100644 index 0000000..89a3e6d --- /dev/null +++ b/task1-aws-proxy/image/2023-11-12_15-01.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:43df143cd03b085732a3f3f0a4797d068a55a4763a9b8fd69ca177130e30f801 +size 392113 diff --git a/task1-aws-proxy/image/2023-11-12_15-01_1.png b/task1-aws-proxy/image/2023-11-12_15-01_1.png new file mode 100644 index 0000000..46822d2 --- /dev/null +++ b/task1-aws-proxy/image/2023-11-12_15-01_1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e444d8fa27bcf66fe94e8d77c55b33d56590488bf587e1308cd7111e25d2fdf2 +size 217244 diff --git a/task1-aws-proxy/install_docker.sh b/task1-aws-proxy/install_docker.sh new file mode 100644 index 0000000..da5e2fe --- /dev/null +++ b/task1-aws-proxy/install_docker.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +set -x + +sudo apt update + +for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done + + +# Add Docker's official GPG key: +sudo apt-get update +sudo apt-get install ca-certificates curl gnupg +sudo install -m 0755 -d /etc/apt/keyrings +curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg +sudo chmod a+r /etc/apt/keyrings/docker.gpg + +# Add the repository to Apt sources: +echo \ + "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ + "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ + sudo tee /etc/apt/sources.list.d/docker.list > /dev/null +sudo apt-get update + + +sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin + +sudo service docker start +sudo docker run hello-world + diff --git a/task1-aws-proxy/install_docker_compose.sh b/task1-aws-proxy/install_docker_compose.sh new file mode 100644 index 0000000..803f815 --- /dev/null +++ b/task1-aws-proxy/install_docker_compose.sh @@ -0,0 +1,13 @@ +# /usr/bin/env bash + +set -x + +DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} +mkdir -p $DOCKER_CONFIG/cli-plugins +curl -SL https://github.com/docker/compose/releases/download/v2.23.0/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose + +chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose + +sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose + +docker compose version diff --git a/task1-aws-proxy/landing.sh b/task1-aws-proxy/landing.sh new file mode 100644 index 0000000..43192c4 --- /dev/null +++ b/task1-aws-proxy/landing.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +set -x + +sudp apt update +sudo apt install -y tmux diff --git a/task1-aws-proxy/setup.sh b/task1-aws-proxy/setup.sh new file mode 100644 index 0000000..5d5d657 --- /dev/null +++ b/task1-aws-proxy/setup.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +# 1. +./landing.sh + +# 2. +./install_docker.sh + +# 3. +./install_docker_compose.sh + +# 4. +# echo "add user ubuntu to docker group" +# sudo vi /etc/group + +# 5. +./up.sh diff --git a/task1-aws-proxy/tinyproxy.conf b/task1-aws-proxy/tinyproxy.conf new file mode 100644 index 0000000..051a3d8 --- /dev/null +++ b/task1-aws-proxy/tinyproxy.conf @@ -0,0 +1,4 @@ +# tinyproxy.conf +Port 8888 +Listen 0.0.0.0 +Timeout 600 \ No newline at end of file diff --git a/task1-aws-proxy/up.sh b/task1-aws-proxy/up.sh new file mode 100644 index 0000000..b92fb82 --- /dev/null +++ b/task1-aws-proxy/up.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +systemctl enable docker + +docker compose up -d