Akashic Engine

$ node -v v14.18.3 https://www.npmjs.com/package/@akashic/akashic-cli npm install -g @akashic/[email protected] https://akashic-games.github.io/guide/akashic-cli.html#init akashic init --type typescript width: 1280 height: 720 fps: 30 git init git commit -m "Initial Commit" --allow-empty git add . git commit -m "first" npm install npm start open http://localhost:3000/game/

2022年5月21日 · aoirint

GitHub Actions Tips

mainブランチにpushされたときに実行 on: push: branches: - main Releaseが作成されたときに実行 on: release: types: - created 三項演算子的なやつ ${{ env.VARIABLE }}の形式 ${{ condition && 'true_value' || 'false_value' }} ${{ github.event.release.tag_name != '' && github.event.release.tag_name || 'latest' }} 注意: true_valueがboolean的にfalseと解釈される値(空文字列)であってはならない。その場合、true_valueとfalse_valueを交換してconditionを反転させる。 文字列が空文字列の場合は空文字列、そうでなければ加工した文字列を変数に格納する、という方法で文字列を少しずつ加工していくと複雑な文字列が作りやすい 文字列の結合 フォーマット関数を使う :区切りで結合: ${{ format('{0}:{1}', env.VARIABLE_A, env.VARIABLE_B) }} 便利なAction 大抵の場合、READMEに用例が載っているのでコピペして使う 新しい機能、細かい機能、細かい挙動は載っていなかったりする。そのときはコードを読む Dockerイメージのビルド・プッシュ: https://github.com/docker/build-push-action Docker Hubにpushする場合、アカウントを作成し、アクセストークンを取得しておく(無料プランでは1つしか作成できないので注意) https://hub.docker.com/settings/security GitHub Pagesの公開: https://github.com/peaceiris/actions-gh-pages 同一リポジトリにpushする場合、トークンなどを特別に設定する必要はない(何もしなくても、自動でgithub_tokenという変数にトークンが格納されている) 別リポジトリにpushする場合、Personal Access Tokenはリポジトリのスコープを切れないので、SSH鍵を生成してDeploy keysに登録するのがおすすめ

2022年5月21日 · aoirint

Minecraft for Windows 10のワールドデータをDedicated Serverに移行する

※ 実験的なメモです。内容の保証はありません %LocalAppData%\Packages\Microsoft.MinecraftUWP_8wekyb3d8bbwe\LocalState\games\com.mojang\minecraftWorlds から、移行したいワールドのディレクトリをDedicated Serverのworldsディレクトリに移動する https://gaming.stackexchange.com/questions/330407/where-does-minecraft-for-windows-10-store-its-data ワールドのディレクトリ名をBedrock levelに変更する 接続認可リスト、権限リスト permissions.json 権限を設定したいユーザのxuidを記述する [{"permission": "operator", "xuid": "..."}] permissions.json 権限を設定したいユーザのゲーマータグを記述する。初回接続時にxuidが取得され自動追記される [{"ignoresPlayerLimit":false,"name":"GAMERTAG","xuid":"..."}] サーバを起動する

2022年5月19日 · aoirint

Minecraft for Windowsがフルスクリーンのとき、他のウインドウを触るとサーバーから切断してしまう問題

https://bugs.mojang.com/browse/MCPE-19393 MSのデバッグツールを使うとワークアラウンドとして防げるらしい Windows SDK(Windows Kits)をインストール済みの場合、 TBW

2022年5月15日 · aoirint

Minecraft for Windows 10の実行可能ファイルの場所

https://www.reddit.com/r/Steam/comments/a1j5m7/add_microsoft_store_apps_to_steam_tutorial/ なんかうまく起動できない(起動はするけど同時に起動できませんでしたエラーが出る) C:\Program Files\WindowsApps\Microsoft.MinecraftUWP_1.18.3104.0_x64__8wekyb3d8bbwe\Minecraft.Windows.exe Steamランチャーに登録するときなどに https://answers.microsoft.com/en-us/windows/forum/all/how-do-i-find-the-minecraft-windows-10-edition/3ddbedf5-9606-4d52-b0f9-01edc949d10d タスクマネージャのプロセス一覧から右クリック、プロパティで実行ファイルのプロパティ(パス)を確認できる

2022年5月15日 · aoirint

自宅サーバのWebサービスをVPSで中継するようにした

これまで自宅サーバへの外部からの接続には、 数年前から自宅のグローバルIPアドレスにフリーのドメインを紐づけて使っていたのですが、 3月末に更新を忘れてこのドメインを失効させてしまいました。 自宅サーバでは、主に個人用のWebサービスや身内用のゲームサーバが動いています。 同じドメインを再取得するには追加の料金がかかりますし、(若干用途が規約的に怪しいこともあり)新しくドメインを取り直す気にもなれなかったので、 以前から契約していたVPSをTCP/UDPプロキシとして使ってみることにしました。 この記事では、nginx.confのhttpディレクティブとstreamディレクティブそれぞれについて、拡張子でincludeを切り分けるようにする構成にしています。 基本的には、nginx.confに以下のように記述するイメージです。 http { include /etc/nginx/conf.d/*.http; } stream { include /etc/nginx/conf.d/*.stream; } 関連ツイート https://twitter.com/aoirint/status/1510309731642257408 https://twitter.com/aoirint/status/1511896279731040261 また、この記事の内容には関係ありませんが、envsubstでconfigファイルに環境変数を注入する、nginxのDocker Hub公式Dockerイメージのtemplate機能を使用しているため、 nginx設定ファイルの拡張子がtemplateになっています。 上のツイートに関連して、certbot --nginxで自動生成される/etc/letsencrypt/options-ssl-nginx.confを手動でnginx.confに統合しているので、 以下の設定ではコメントアウトされているincludeがあります。 構成 自宅サーバ側:systemd + autosshによる自動SSH接続&リモートポート転送 VPS側:nginxによるHTTPリバースプロキシ・UDPプロキシ 自宅サーバ側 ~/.ssh/config Host vps* HostName VPS_IPADDR Port VPS_SSH_PORT ServerAliveInterval 10 ServerAliveCountMax 5 TCPKeepAlive yes IdentitiesOnly yes IdentityFile ~/.ssh/vps Host vps-forwarding-homeserver # SERVICE1 RemoteForward 127.0.0.1:VPS_SERVICE1_PORT 127.0.0.1:LOCAL_SERVICE1_PORT # SERVICE2 RemoteForward 127.0.0.1:VPS_SERVICE2_PORT 127.0.0.1:LOCAL_SERVICE2_PORT /etc/systemd/system/autossh-vps.service [Unit] Description=AutoSSH VPS [Service] Type=simple Restart=always User=user Group=user WorkingDirectory=/home/user ExecStart=/usr/bin/autossh -N vps-forwarding-homeserver [Install] WantedBy=multi-user.target VPS側 HTTPリバースプロキシ(SSHポート転送使用): myservice.http.template server { server_name myservice.example.com; client_max_body_size 500M; add_header Strict-Transport-Security 'max-age=15552000; includeSubDomains; preload'; location / { #auth_basic "Auth required"; #auth_basic_user_file /secrets/myservice.htpasswd; proxy_pass http://127.0.0.1:VPS_MYSERVICE_PORT; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; send_timeout 3600s; proxy_connect_timeout 3600s; proxy_send_timeout 3600s; proxy_read_timeout 3600s; #proxy_max_temp_file_size 2048m; } location /.well-known/acme-challenge/ { root /letsencrypt-webroot; } listen 443 ssl; ssl_certificate /etc/letsencrypt/live/myservice.example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/myservice.example.com/privkey.pem; # include /etc/letsencrypt/options-ssl-nginx.conf; ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; } server { if ($host = myservice.example.com) { return 301 https://$host$request_uri; } server_name myservice.example.com; listen 80; return 404; } UDPポート転送(SSHポート転送不使用): myserviceudp.stream.template server { listen VPS_SERVICEUDP_PORT udp reuseport; proxy_pass HOME_IPADDR:HOME_SERVICEUDP_PORT; proxy_connect_timeout 3600s; proxy_timeout 3600s; #proxy_max_temp_file_size 2048m; }

2022年4月7日 · aoirint

KFCのフリー写真素材

https://twitter.com/kfcarabia/status/1491779797038428161 https://chickenstock.net/ KFC(ケンタッキー)のチキンやハンバーガーなどの写真が公開されている。 自社商品の販促のためにケンタッキーの商品写真を利用している店舗への牽制らしい。 Free of chargeで使える。

2022年3月30日 · aoirint

CDの取り込み

Ubuntu Rhythmboxで取り込む。 ogg形式に変更する。 EasyTagを使ってID3タグ、アルバムアートを設定する。 Windows Windows Media Playerで取り込む。 初期設定が低ビットレートのMP3になっているので、320kbpsのMP3に変更する。 MP3Tag 2.88aを使ってID3タグ、アルバムアートを設定する。 (Windows版EasyTag 2.4.3は日本語が文字化けしてID3タグの書き込みが動作しないことがある)

2022年3月30日 · aoirint

Windows 11 評価版を入手する

以下のリンクから、各仮想化ソフトウェア向けのVMを入手できる。 https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/

2022年3月18日 · aoirint

はてなブログから古い記事を移した

新しい記事 blog.aoirint.com へ投稿しつつ、 古い記事は aoirint.hatenablog.com に残っていましたが、 古い記事を blog.aoirint.com に移しました。 古い記事にはリダイレクトと移動先へのリンクを設置しています。 https://github.com/x-motemen/blogsync blogsyncで記事を取得したあと、以下のようなスクリプトでfrontmatterを変換しました。 以前の移行時の作業ミスでMarkdown記事がHTMLになってしまっていたので、 手動でMarkdownに書き戻しました。 import glob import yaml from datetime import datetime from pathlib import Path import frontmatter as FM for path in glob.glob('**/*.md', recursive=True): if path.startswith('output'): continue print(path) with open(path, 'r') as fp: frontmatter = FM.load(fp) # docs = yaml.safe_load_all(fp) # frontmatter = next(docs) # body = next(docs) body = frontmatter.content print(frontmatter) print(body) title = frontmatter['Title'] if title.startswith('(移動済)'): print(f'Skipped: {title}') continue print(f'Processing: {title}') original_url = frontmatter['URL'] date: datetime = frontmatter['Date'] draft = frontmatter.get('Draft', False) tags = frontmatter.get('Category') category = tags[0] if tags else None new_frontmatter = { 'title': title, 'date': date.strftime('%Y-%m-%d %H:%M:%S'), 'draft': draft, 'channel': '技術ノート', } if category: new_frontmatter['category'] = category if tags: new_frontmatter['tags'] = tags output = yaml.dump(new_frontmatter, default_flow_style=False, sort_keys=False, allow_unicode=True) output_lines = output.split('\n') output_lines.insert(0, f'---') output_lines.insert(1, f'# moved from {original_url}') output_lines.insert(-1, f'---') output = '\n'.join(output_lines) output += f'# {title}\n\n' + body + '\n' dest = Path('output', path) dest.parent.mkdir(parents=True, exist_ok=True) with open(dest, 'w') as fp: fp.write(output)

2022年2月22日 · aoirint