- Accupass
- 2024/7/9
- 小賴
- ashleylai58@gmail.com
- blog: https://azole.medium.com/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh -V | |
OpenSSH_8.9p1 Ubuntu-3ubuntu0.10, OpenSSL 3.0.2 15 Mar 2022 | |
wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.8p1.tar.gz | |
tar -zxvf openssh-9.8p1.tar.gz | |
cd openssh-9.8p1/ | |
sudo apt-get install -y build-essential |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 8080; | |
server_name localhost; | |
#access_log /var/log/nginx/host.access.log main; | |
location / { | |
root /usr/share/nginx/html; | |
index index.html index.htm; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
prometheus: | |
image: prom/prometheus:latest | |
container_name: prometheus | |
volumes: | |
- ./prometheus.yml:/etc/prometheus/prometheus.yml | |
- prometheus_data:/prometheus | |
ports: | |
- "9090:9090" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
mongo: | |
image: mongo:6.0 | |
container_name: mongo | |
networks: | |
- graylog | |
restart: unless-stopped | |
opensearch: | |
image: opensearchproject/opensearch:2.4.1 |
@azole 461 Followers 🕴 👉 Docker Container 基礎入門篇 1 👏 1883 👉 [WebConf2023] Docker 入門 101 👏 249 👉 從鐵人完賽到書籍書版 👏 140
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const argon2 = require('argon2'); | |
let plainPasswords = ['asdfwrwsdf', 'aserqwr&134sfasefr', 'asfw423d', 'asf8w4@w3423', 'qqsfw40#sjr#', 'PassW0rd', 'administartor']; | |
let len = plainPasswords.length; | |
let hashedPassword = []; | |
async function argon2Hash(count) { | |
console.time('argon2'); | |
for (let i = 0; i < count; i++) { | |
const hash = await argon2.hash(plainPasswords[i % len], 10); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const writeFile = async (data, fileName) => { | |
// 你要寫的部分 | |
return new Promise((resolve, reject) => { | |
fs.writeFile(fileName, data, (err) => { | |
if (err) { | |
reject(err); | |
} | |
resolve(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo apt-get install nginx -y | |
sudo apt-get install php7.4-fpm php7.4-cli php7.4-gd php7.4-mysql php7.4-xml php7.4-mbstring -y | |
# edit /etc/php/7.4/fpm/php.ini | |
sudo nano /etc/php/7.4/fpm/php.ini | |
# uncomment cgi.fix_pathinfo and set the value to "0" | |
sudo nano /etc/nginx/sites-available/default | |
# uncomment ~\.php section and modify as followed: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// 0.0.0.0 表示監聽所有 IP 地址 | |
$http = new Swoole\Http\Server('0.0.0.0', 9501); | |
$http->set([ | |
// 可以 host static files | |
// 但不建議這樣做,靜態檔案還是讓 nginx 來 | |
'enable_static_handler' => true, | |
// 'http_autoindex' => false, |
NewerOlder