hexo-related-popular-posts プラグイン
https://github.com/tea3/hexo-related-popular-postshexo-related-popular-posts プラグインは関連記事や人気の記事一覧を生成するHexo のプラグインです。freemind テーマで関連記事を表示してみました。Google Analytics API で収集した情報で人気の記事も表示してみました。
環境
WSL
nodejs v13.9.0
npm 6.13.7
hexo 4.2.0
hexo-theme-freemind
構築 - 関連記事インストール
hexo-related-popular-posts パッケージ$ npm install hexo-related-popular-posts --save
ga-analytics の修正
コールバック関数関連のエラーを修正./node_modules/ga-analytics/module.js8889//fs.writeFile(sessionFile, JSON.stringify(result));fs.writeFile(sessionFil ...
URL エンコード / デコード
URL エンコードされた文字列をデコードして使いたい時がありますよね。bash のfunction で書いてみました。csh ならalias で書けそうです。
環境
WSL (Ubuntu 18.04)
構築
nkf パッケージのインストール
$ sudo apt install nkf
function(関数)の定義
~/.bash_aliases# URL Encode / Decodefunction urlencode { echo $1 | nkf -WwMQ | tr = % | sed ':a;N;$!ba;s/%\n//g'}function urldecode { echo $1 | nkf -w --url-input}
実行
再ログインする
即時反映したい場合$ . ~/.bash_aliases
利用
URL エンコード (対象のURL文字列をダブルクォートで囲います)$ urlencode "https://ktkr3d.github.io/こんな URL/そんな階層/&qu ...
WireGuard
WireGuard でRasberry Pi 4B にVPN の環境を構築してみました。OpenVPN よりもシンプルらしいです。今後、管理用のGUIツールが充実していくと良いですね。
環境VPN サーバ
Raspberry Pi 4B
Ubuntu Server Focal 20.04 aarch64
wireguard 1.0.20200121
qrencode 4.0.2-2
ネットワーク
ホスト
WireGuard
LAN
VPN サーバ
10.0.0.1/24
192.168.11.107/24
VPN クライアント1
10.0.0.2/24
VPN クライアント2
10.0.0.3/24
LAN ホスト
192.128.11.2/24
LAN ホスト
192.128.11.106/24
構築パッケージのインストール $ sudo apt install wireguard qrencode
秘密鍵と公開鍵の生成
VPN サーバ用$ mkdir wgkeys; cd wg ...
Puppeteer on WSL
https://github.com/puppeteer/puppeteer/issues/1837
WSL のPuppeteer からWindows にインストールされたChrome(chrome.exe) を起動します。WSL 側にインストールするパッケージが少なくてすみそうです。
環境
WSL1(Ubuntu 18.04) on Windows 10
node v13.6.0
npm 6.13.4
puppeteer
構築node のインストール$ sudo apt update && sudo apt upgrade$ sudo apt install nodejs npm$ sudo npm clean all$ sudo npm install n$ sudo n latest$ sudo ln -sf /usr/local/bin/node /usr/bin/node$ sudo apt purge nodejs npm$ sudo apt clean all$ sudo apt autoremove
puppeteer のインストール$ npm ...
Hexo 4.2.0
https://hexo.io/news/2019/12/22/hexo-4.2_hexo-util-1-8_eslint-config-hexo-released/
https://hexo.io/news/2019/12/24/how-we-make-hexo-30-percent-faster/
Hexo 4.2 が速いらしいのでWSL1/WSL2 上に環境を構築してみました。確かに速い気がします。
環境
WSL1(Ubuntu 18.04) on Windows 10
WSL2(Ubuntu 18.04) on Windows 10
node v13.6.0
npm 6.13.4
git 2.17.1
hexo 4.2.0
構築node$ sudo apt update && sudo apt upgrade$ sudo apt install nodejs npm$ sudo npm clean all$ sudo npm install n$ sudo n latest$ sudo ln -sf /usr/local/bin/node / ...
Visual Studio Code Remote - SSH / aarch64
https://code.visualstudio.com/docs/remote/sshVisual Studio Code のRemote SSH でaarch64 がサポートされていたので、Rasperry Pi 4 のUbuntu focal aarch64 に接続してみました。
環境クライアント
Windows 10 Pro Insider Preview
WSL 2 (Ubuntu 18.04.3 x86_64)
Visual Studio Code 1.41.1
Remote Development 0.19.0
Remote SSH 0.48.0
サーバ
Raspberry Pi 4B
Ubuntu Focal(20.04) aarch64
構築SSH 接続の設定
WSL2 から鍵登録
$ ssh-copy-id -i /mnt/c/Users/hoge/.ssh/id_rsa.pub ubuntu@192.168.11.26
接続情報
C:\Users\hoge\.ssh\ssh_config# Read more about SSH config file ...
Raspberry Pi 4 IoT Edge Gateway
https://news.softpedia.com/news/you-can-now-turn-a-raspberry-pi-4-sbc-into-an-edge-gateway-with-ubuntu-19-10-528326.shtml
Raspbery Pi 4 をエッジゲートウェイにしてみました。どうやって使うんだろう。
環境
Raspberry Pi 4B
Ubuntu Server 19.10 aarch64
192.168.11.24
構築
Ubuntu Server 19.10 イメージのダウンロードhttps://ubuntu.com/download/raspberry-pi64-bit for Raspberry Pi 3 and 4
SD カードに書き込み
Raspberry Pi 4 起動
接続とパスワード更新$ ssh ubuntu@192.168.11.24
再接続とパッケージの更新$ ssh ubuntu@192.168.11.24pi4$ sudo apt updatepi4$ sudo apt upgrade
Edge Gateway のイン ...
RPi4 - Ubuntu Server 18.04.3 64bit
https://github.com/TheRemote/Ubuntu-Server-raspi4-unofficialRaspberry Pi 4B にUbuntu Server 18.04.3 LTS aarch64 環境を構築しました。Xfce デスクトップ環境もインストールしてみました。
環境
Raspberry Pi 4B
Ubuntu Server 18.04.3 aarch64
Xfce 4.12
構築Hostname$ sudo hostnamectl set-hostname pi4
Aliases$HOME/.bash_aliasesalias upd='sudo apt update && sudo apt dist-upgrade && sudo apt autoremove -y'alias en='export LC_ALL=en_US.UTF8'alias ja='export LC_ALL=ja_JP.UTF8'function sshu() { ...
RPi4 - Docker OpenProject CE
https://github.com/opf/openproject-ce
Raspberry Pi 4B 上のDocker でOpenProject CE の環境を構築してみました。
arm64 でビルドするためにスクリプトの一部を修正しました。
環境
Raspberry Pi 4B
Ubuntu Server 19.10 aarch64
Docker 18.09.8, build 0dd43dd87f
Docker Compose 1.21.0
構築
docker-compose.yml docker-compose.ymlversion: '3'services: web: build: context: openproject-ce depends_on: - postgres - memcached ports: - "30080:80" volumes: - pg-data:/var/lib/postgresql/data - ./data ...
RPi4 - Docker Redmine
RPi4 のDocker 上にRedmine の環境を構築しました。Portainer のApp Templates を利用しました。
Redmine コンテナの構築Portainer でRedmine コンテナを作成
Portainer を開く http://192.168.11.19:9000
App Templates からRedmine を選択
Name redmine を指定
+ show advanced options ボタンを押下
Port mapping 10080 を指定
Deploy the container ボタンを押下
コンテナへのログイン方法
Containers
redmine コンテナの>_(exec console)
Command /bin/bash
User redmine
Connect
コンテナの再起動方法
Containers
redmine コンテナをチェック
Restart
Redmine の環境設定Redmine へのログイン
Redmine を開くhttp://192.168.11.19:10080
admin & ...