XpandNotes

exploring the intersection of technology and creativity

線代 Chapter 1.1

Systems of Linear Equations

linear system 擁有 $n$ 個未知數的 linear equation (線性方程式) 表示為 \[a_1x_1+a_2x_2+ \cdots +a_nx_n=b\] 一個 $m \times n$ 的 linear system (線性系統),即擁有 $m$ 個方程式與 $n$ 個未知數的聯立方程組表示為 \[\begin{align*} & a_{11}x_...

DDOS 工具 TFN2K 教學

請使用自己的電腦測試,不要攻擊其他人或做犯罪行為 DDOS 簡介 「阻斷服務攻擊」(denial-of-service attack, DoS)亦稱洪水攻擊,是一種網路攻擊手法,主要的目的是讓目標電腦的網路或者系統資源耗盡,使其服務中斷且無法正常存取 使用兩個或以上的電腦為攻擊端作為「Zombies 殭屍」向特定「Victims 目標」發動阻斷式服務攻擊時,便稱為「分散式阻斷服務攻擊」...

在 Ubuntu 20.04 安裝 LibreNMS

此安裝流程是參考官網教學 https://docs.librenms.org/Installation/Install-LibreNMS/ 但是官網有兩處小細節沒有特別提到,在本篇文章會點出 Step 1: 下載所有相依套件 下載所有相依套件及 nginx 伺服器 $ sudo apt install software-properties-common $ sudo add-apt...

LDAP 安裝和設定

此為計算機網路管理課程的 lab11 安裝 參考這篇文章 https://magiclen.org/ubuntu-server-ldap/ 安裝時,照著 ldap 的類 GUI 提示設定 admin 密碼、將 nasa.imslab.org 設為 root dn $ sudo apt install slapd $ sudo dpkg-reconfigure slapd $ sudo...

使用 nginx 與 flask 架設 key-value storage 服務運行於 docker 容器

此為 2021 網路管理課程的 lab14,花了一整晚搞不定 php-fpm 在 docker 寫檔的問題 (已經調整過權限、目錄也 mount 了還是不行) 耗費五到六個小時,後來砍掉重練,改成用 python + redis 的記憶體儲存,兩個小時就幹完了,真是累死人。 以下只有 code,沒力氣打詳細解釋了…,共五個檔案 app.py 1 2 3 4 5 6 7 8 9 10 1...

從 0 開始學習 Docker、Dockerfile、Docker-Compose

1. 安裝 首先使用指令安裝 Docker $ curl -fsSL https://get.docker.com | sudo bash 安裝 Docker Compose $ sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(...

DNS 伺服器 bind9 的 zone file 設定

此為計算機網路管理課程的 lab12 設定 named 監聽埠 $ sudo apt install bind9 首先將預設的監聽埠由 53 改為 8053 (lab 要求,一般狀況不需要改監聽埠) $ sudo vim /etc/bind/named.conf.options 在 options{} 區塊裡加入 1 2 3 4 recursion yes; ...

Apache Tomcat 簡易安裝教學

安裝 java 8 $ sudo apt install openjdk-8-jdk 從官網下載 tomcat 的 release 版本,我選用 9.0.46,下載完成後解壓縮 apache-tomcat-9.0.46.tar.gz,然後撰寫一個 setenv.sh 用來存放 tomcat 所需的環境變數。 $ tar -xvf apache-tomcat-9.0.46.tar.gz...

Codility Lesson 3 FrogJmp, PermMissingElem, TapeEquilibrium

FrogJmp A small frog wants to get to the other side of the road. The frog is currently located at position X and wants to get to a position greater than or equal to Y. The small frog always jumps ...

Codility Lesson 2 CyclicRotation, OddOccurrencesInArray

CyclicRotation An array A consisting of N integers is given. Rotation of the array means that each element is shifted right by one index, and the last element of the array is moved to the first pl...