以下指令,可以列出目前資料夾的每一個目錄的容量。
du -sh ./*
承上,再依容量大小排序。
du -sh ./* | sort -h
在 Ubuntu 下使用 Docker 安裝 OpenVAS
參考來源: https://medium.com/@ma7moudsabra/install-gvm-vulnerability-scanner-on-ubuntu-24-04-using-containers-fd38935b7121
apt repository.# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] 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如果是使用 Linux Mint 22.1 的環境,上面的 $VERSION_CODENAME 這裡會不正確,手動改為 noble 就可以了。
2. Install the Docker and dependencies packages.
sudo apt-get install gnupg docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin3. Verify that the installation is successful by running the hello-world image:
sudo docker run hello-world
4. Manage Docker as a non-root user
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker5. Verify that you can run docker commands without sudo.
docker run hello-world6. For downloading the Greenbone Community Edition docker compose file, a destination directory should be created.
export DOWNLOAD_DIR=$HOME/greenbone-community-container && mkdir -p $DOWNLOAD_DIR7. Download the file
cd $DOWNLOAD_DIR && curl -f -L https://greenbone.github.io/docs/latest/_static/docker-compose-22.4.yml -o docker-compose.yml
8. To allow remote access to the Greenbone Web Interface, you need to modify the docker compose file to configure the web server (gsad) to listen on all network interfaces.
gsa:
image: greenbone/gsa:stable
restart: on-failure
ports:
- 127.0.0.1:9392:80 #before
volumes:
- gvmd_socket_vol:/run/gvmd
depends_on:
- gvmd
----
gsa:
image: greenbone/gsa:stable
restart: on-failure
ports:
- 9392:80 #After
volumes:
- gvmd_socket_vol:/run/gvmd
depends_on:
- gvmd9. Start the Greenbone Community Edition container.
docker compose -f $DOWNLOAD_DIR/docker-compose.yml -p greenbone-community-edition up -dOpenVAS is now installed and running on your Ubuntu 24.04 LTS system. To access the OpenVAS web interface:
1. Open a web browser and navigate to http://localhost:9392.
2. Log in using the default credentials:
參考這篇 https://medium.com/@lpramithamj/fixing-the-gpg-key-error-for-visual-studio-code-on-ubuntu-f29562a38182
How to Fix the GPG Key Error
Step 1: Download and Install the Microsoft GPG Key
wget -qO - https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor -o /usr/share/keyrings/microsoft.gpg
Step 2: Update the Microsoft Repository List
echo "deb [signed-by=/usr/share/keyrings/microsoft.gpg arch=amd64] https://packages.microsoft.com/repos/code stable main" | sudo tee /etc/apt/sources.list.d/vscode.list
Step 3: Update and Upgrade Packages
sudo apt update && sudo apt upgrade -y
以上動作應該就可以修正 VSCode 的問題。
sudo apt update
sudo apt upgrade
sudo apt install apache2 mariadb-server php8.3-fpm php8.3 libapache2-mod-php8.3 php8.3-common php8.3-mysql php8.3-xml php8.3-xmlrpc php8.3-curl php8.3-gd php8.3-imagick php8.3-cli php8.3-imap php8.3-mbstring php8.3-opcache php8.3-soap php8.3-zip php8.3-intl php8.3-bcmath unzip phpmyadmin python3-certbot-apache
sudo systemctl enable apache2
apache2 -v
sudo systemctl enable mariadb
sudo mysql_secure_installation
mariadb --version
sudo mysql -uroot -p
grant all on *.* to root@localhost identified by '123456';
sudo gedit /etc/php/8.1/apache2/php.ini
upload_max_filesize = 2000M
max_file_uploads = 2000
post_max_size = 2000M
max_execution_time = 600
max_input_time = 1000
max_input_vars = 3000
memory_limit = 1024M
session.gc_maxlifetime = 86400
# 清除現有規則
sudo iptables -F
# 設置預設策略為拒絕
sudo iptables -P INPUT DROP
sudo iptables -P FORWARD DROP
sudo iptables -P OUTPUT ACCEPT
# 允許回環接口
sudo iptables -A INPUT -i lo -j ACCEPT
# 允許已建立的連接
sudo iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# 允許HTTP和HTTPS流量
sudo iptables -A INPUT -p tcp -m multiport --dports 80,443 -j ACCEPT
# 保存以上的設定
service iptables save
在 Linux Mint 20.3 or Ubuntu 20.04 之前的版本,可以安裝 fcitx 和 fcitx-table-scj6 的方式,就可以安裝 快倉六 的輸入法,但是,在 fcitx5 之後,好像就沒那麼容易了!
處理的方式,參考如下:
sudo apt update
sudo apt install fcitx5 fcitx5-chinese-addons* fcitx5-rime
除了要安裝 fcitx5 之外,還要安裝 中州韻 輸入法,它的輸入法檔案是放在
/usr/share/rime-data
這個目錄裡,所以,我們先到
https://github.com/rime/rime-scj
下載檔案, 主要是 scj6.dict.yaml 和 scj6.schema.yaml 這二個檔案,將這二個檔案下載後,放到 /usr/share/rime-data 目錄下。
接下來,到
~/.local/share/fcitx5/rime
目錄下,建立 default.custom.yaml 檔案,檔案內容如下:
patch:
schema_list:
- schema: scj6
"menu/page_size": 9
若是要使用其他輸入法,也可以參考 /usr/share/rime-data 目錄下的檔案名稱,替換一下。
最後,重啟一下輸入法,應該就可以正常使用了!
先將 console 線接上。
ref: https://askubuntu.com/questions/1067698/how-to-take-a-serial-port-connection-via-usb-online
可先安裝 screen 套件。
sudo apt-get install screensudo screen /dev/ttyUSB09600
連線後,將 Fortigate 重新開機,在終端機上就會看到開機的訊息。在訊息裡會看到 FGT90XXXXXXXXX 之類的訊息,這就是這台設備的序號。
開機後,要注意一下時間,看到有網頁說要在 14秒之內登入,有的說在 30秒以內登入...
按 Enter 若出現 「 FGT90XXXXXXXXX login: 」就趕快登入。
帳號: maintainer
密碼: gcpbFGT90XXXXXXXXX
登入後,輸入以下指令:
config system admin
edit admin
set password 123456
end
就可以將密碼改為 123456 了。