Skip to content

Instantly share code, notes, and snippets.

View wastemobile's full-sized avatar

wastemobile wastemobile

View GitHub Profile
@wastemobile
wastemobile / 0. Install WriteFreely.md
Last active November 21, 2022 08:05
Install WriteFreely

write freely

目前使用的是 algernon/writefreely,但這個映像檔亦不支援 ARM。

連線後立即出現清爽的文字首頁,但卻什麼都不能做?

因為預設雖是多人部落格,卻關閉了註冊頁面,此時處於一個無帳號、又無法註冊的尷尬局面,需要一個特殊步驟:

  1. docker exec -it writefreely sh(進入運行中的 writefreely 容器終端機介面)
  2. cd /data
@wastemobile
wastemobile / 0. Install microblogpub.md
Last active November 21, 2022 08:03
microblog.pub

microblog.pub

一個極簡、python 寫的 microblog,支援 ActivityPub 與大部分 IndieWeb 功能。

使用 docker compose 安裝,須將靜態目錄 volume 拉出來讓 Caddy 讀到。

遇到 /app/static/twemoji 空目錄的問題(編輯界面引用的圖示出不來), 查原始碼應該是 task.py 中一段下載 twemoji 倉儲檔案的部分沒執行,卻又完全找不到解決點, 最後⋯⋯只好暴力的在 mac 下載、scp 送上主機,暫時能用。

@wastemobile
wastemobile / 0. Install Misskey.md
Last active November 21, 2022 08:06
Install Misskey

Misskey

  1. 在已安裝好 docker 與 docker compose plugin 的 Ubuntu 22.04 LTS 主機上安裝 Misskey。
  2. 在家目錄新建 misskey 目錄。
  3. 建立 docker-compose.yml 檔案,這裡使用 Caddy 2 Server 在前端服務、反向代理。
  4. 建立 Caddyfile。
  5. 建立 config/ 目錄,並新增 default.yml 與 docker.env 兩個檔案,修改網域名稱、資料庫密碼等。
  6. 接著輸入 docker compose run --rm misskey yarn run init 讓 Misskey 容器建立資料庫。
  7. docker compose up -d 啟動。
  8. 稍等一下,前往 https://yourdomain.com 即可看到 Misskey,註冊第一名管理員用戶。
@wastemobile
wastemobile / Caddyfile
Created March 14, 2022 04:54
WordPress and Caddy 2 with Docker
{
your@email.com
}
www.site1.com {
redir https://site1.com{uri}
}
site1.com {
root * /usr/share/caddy/wordpress-site1
@wastemobile
wastemobile / Initial.md
Last active March 20, 2020 07:02
Ubuntu 18.04 on Linode Initial

由 Linode 後台介面新增主機時,會要求設置 root 密碼,也可以增加 SSH Key、讓 root 能使用 SSH Key 無密碼登入,由於後面會關閉 root 的登入權限,因此選擇不設置金鑰。

新增用戶

  1. ssh root@your_ip 以 root 身份登入乾淨的新創主機
  2. adduser new_user 建立例行登入使用的新用戶,設置密碼與必要資訊
  3. adduser new_user sudo 將新用戶加入 sudo 群組
  4. 先不要關閉 root 登入的終端機視窗,另開一個新視窗
  5. ssh-copy-id -i ~/.ssh/id_ed25519.pub new_user@your_ip 替新用戶增加公鑰
  6. ssh new_user@your_ip 確認新用戶能以金鑰模式登入無誤
@wastemobile
wastemobile / .env
Last active February 29, 2020 15:49
Django settings
# dev
SECRET_KEY=4(hf^my1$a*dwf^78^x0zl-z)*)p&)40z#o307o*)p_x2ker^v
DEBUG=True
ALLOWED_HOSTS=.localhost,127.0.0.1
# for PostgreSQL
# DATABASE_URL=postgres://dba:password@localhost:5432/db
# for Gmail
# EMAIL_BACKEND="django.core.mail.backends.console.EmailBackend"
@wastemobile
wastemobile / npmlist.md
Last active June 19, 2019 02:26
npm #node
/Users/xxx/.nvm/versions/node/v10.15.3/lib
├── @vue/cli@3.8.2
├── @vue/cli-init@3.8.0
├── autoprefixer@9.6.0
├── firebase-tools@4.2.1
├── ghost-cli@1.11.0
├── gulp-cli@2.2.0
├── mjml@4.3.1
├── npm@6.9.0
@wastemobile
wastemobile / prototype.md
Created June 12, 2019 15:09
Hugo prototype with Pipes #hugo
@wastemobile
wastemobile / dailyupdate
Last active February 12, 2019 01:39
Daily Update Script for Mac
#!/bin/bash
echo "Update Homebrew"
echo "brew update && brew upgrade --all"
brew update && brew upgrade
echo "brew cleanup"
brew cleanup -s
echo "Update NPM global"
@wastemobile
wastemobile / nginx_with_ssl.md
Last active May 13, 2018 20:01
Nginx + Let's Encrypt