気象庁HP API

https://www.jma.go.jp/bosai/forecast/ エリア一覧 https://www.jma.go.jp/bosai/common/const/area.json https://www.jma.go.jp/bosai/forecast/const/forecast_area.json https://www.jma.go.jp/bosai/forecast/const/en_amedas.json 祝日一覧? https://www.jma.go.jp/bosai/forecast/const/anniversary.json 週間用エリアID一覧? https://www.jma.go.jp/bosai/forecast/const/week_area.json 枝番エリア一覧? https://www.jma.go.jp/bosai/forecast/const/week_area05.json https://www.jma.go.jp/bosai/forecast/const/week_area_name.json 天気予報 日間概況 https://www.jma.go.jp/bosai/forecast/data/overview_forecast/{ID}.json 東京地方ID: 130000 週間概況 https://www.jma.go.jp/bosai/forecast/data/overview_week/{ID}.json 天気予報(3日先まで、7日先まで) https://www.jma.go.jp/bosai/forecast/data/forecast/{ID}.json 日間警報 https://www.jma.go.jp/bosai/warning/data/warning/{ID}.json 定数を調べる: console.log(JSON.stringify(Forecast)) Pythonラッパー https://github.com/aoirint/aoirint_jmapy https://pypi.org/project/aoirint-jmapy/ 整形例 https://gist.github.com/aoirint/52c778ea00a9b1d080299eea2ced67b3

2022年5月22日 · aoirint

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