Skip to content

Instantly share code, notes, and snippets.

@azole
azole / upgrade-ssh.sh
Created July 2, 2024 08:34
upgrade ssh command
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
@azole
azole / default.conf
Created June 17, 2024 09:57
Hands-on 01
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;
}
services:
prometheus:
image: prom/prometheus:latest
container_name: prometheus
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
ports:
- "9090:9090"
@azole
azole / graylog.yaml
Last active June 25, 2024 07:58
to run graylog
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

@azole
azole / hash-argon2.js
Created September 3, 2022 05:10
Hash-Test
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);
const fs = require('fs');
const writeFile = async (data, fileName) => {
// 你要寫的部分
return new Promise((resolve, reject) => {
fs.writeFile(fileName, data, (err) => {
if (err) {
reject(err);
}
resolve();
@azole
azole / bash
Created November 16, 2021 05:38
Install drupal 8.9 with Nginx and php-fpm 7.4 in Ubuntu 20.04
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:
<?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,