@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
SHA256:uNiVztksCsDhcc0u9e8BujQXVUpKZIDTMczCvj3tD2s.
Please contact your system administrator.
Add correct host key in ~/.ssh/known_hosts to get rid of this message.
Offending RSA key in ~/.ssh/known_hosts:1
remove with:
ssh-keygen -f "~/.ssh/known_hosts" -R "github.com"
RSA host key for github.com has changed and you have requested strict checking.
ローカルに保持している接続先情報と違うサーバーにつながったよ、とのこと。
中間者攻撃かもしれないと書かれており、ちょっとドキッとしますよね。。。
調べてみたところ、公式からアナウンスが出ていました。
GitHubサーバーの秘密鍵を、公開リポジトリに置いてしまったのとこと…
短時間ってどのくらいなんでしょうね…?
このセキュリティインシデントに対する措置として鍵を取り換えたということのようです。
新しい内容で接続できるように変更しておきます。
やることは特に難しくなく、古い情報を破棄して新しい情報に差し替えるだけです。
# 古い鍵情報の破棄
$ ssh-keygen -R github.com
/home/y-uchiida/.ssh/known_hosts updated.
Original contents retained as /home/y-uchiida/.ssh/known_hosts.old
# 新しい鍵情報を追加
$ ssh -T github.com
The authenticity of host 'github.com (20.27.177.113)' can't be established.
ECDSA key fingerprint is SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM. # 表示される鍵情報が正しいものか確認
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes # yes を入力
Warning: Permanently added 'github.com' (ECDSA) to the list of known hosts.
Hi y-uchiida! You've successfully authenticated, but GitHub does not provide shell access.
$ poetry add --group dev mypy
The --dev option is deprecated, use the `--group dev` notation instead.
Using version ^0.991 for mypy
Updating dependencies
Resolving dependencies... (0.3s)
Writing lock file
Package operations: 2 installs, 0 updates, 0 removals
• Installing typing-extensions (4.4.0)
• Installing mypy (0.991)
pip でインストールする場合は以下のようにコマンドを実行します。
$ pip install mypy
これだけで導入は完了です。
CLI からチェックを試す
ためしに、あえて型不整合があるスクリプトを書いて、それをチェックしてみます。
import datetime
var: datetime.datetime = "foo"
mypy でのチェックは、mypy <対象ファイル> で行います。
$ mypy mypy_test.py
mypy_test.py:3: error: Incompatible types in assignment (expression has type "str", variable has type "datetime") [assignment]
Found 1 error in 1 file (checked 1 source file)
# 1. インストール用のスクリプトを読み込んで実行
$ curl -sSL https://install.python-poetry.org | python3 -
Retrieving Poetry metadata
# Welcome to Poetry!
This will download and install the latest version of Poetry,
a dependency and package manager for Python.
It will add the `poetry` command to Poetry's bin directory, located at:
/home/y-uchiida/.local/bin
You can uninstall at any time by executing this script with the --uninstall option,
and these changes will be reverted.
Installing Poetry (1.2.2): Done
Poetry (1.2.2) is installed now. Great!
To get started you need Poetry's bin directory (/home/y-uchiida/.local/bin) in your `PATH`
environment variable.
Add `export PATH="/home/y-uchiida/.local/bin:$PATH"` to your shell configuration file.
Alternatively, you can call Poetry explicitly with `/home/y-uchiida/.local/bin/poetry`.
You can test that everything is set up by executing:
`poetry --version`
# 2. パスが通っていなければ、以下を追加
$ echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
# 3. poetry が実行できれば完了!
$ poetry --version
Poetry のアップデート
インストールした直後なので不要ですが、未来の自分のためにメモ。
poetry self update で更新します。
$ poetry self update
Updating Poetry version ...
Using version ^1.2.2 for poetry
Updating dependencies
Resolving dependencies... Downloading https://files.pythonhosted.org/packages/d1/20/4c2ea55d6547460a93dce9112599953be1c9Resolving dependencies... Downloading https://files.pythonhosted.org/packages/1d/38/fa96a426e0c0e68aabc68e896584b83ad1eeResolving dependencies... Downloading https://files.pythonhosted.org/packages/76/cb/6bbd2b10170ed991cf64e8c8b85e01f2fb38Resolving dependencies... (25.9s)
Writing lock file
No dependencies to install or update
$ npm init @eslint/config
✔ How would you like to use ESLint? · style
✔ What type of modules does your project use? · esm
✔ Which framework does your project use? · react
✔ Does your project use TypeScript? · No / Yes
✔ Where does your code run? · browser
✔ How would you like to define a style for your project? · guide
✔ Which style guide do you want to follow? · standard-with-typescript
✔ What format do you want your config file to be in? · JavaScript
Checking peerDependencies of eslint-config-standard-with-typescript@latest
Local ESLint installation not found.
The config that you've selected requires the following dependencies:
eslint-plugin-react@latest eslint-config-standard-with-typescript@latest @typescript-eslint/eslint-plugin@^5.0.0 eslint@^8.0.1 eslint-plugin-import@^2.25.2 eslint-plugin-n@^15.0.0 eslint-plugin-promise@^6.0.0 typescript@*
✔ Would you like to install them now? · No / Yes
A config file was generated, but the config file itself may not follow your linting rules.
Successfully created .eslintrc.cjs file in /home/y-uchiida/develop/eslint_airbnb_none
y-uchiida@LUMIERE:/test_clone$ git clone git@github.com:y-uchiida/my_test_repo.git
Cloning into 'my_test_repo'...
ssh: Could not resolve hostname github.com: Temporary failure in name resolution
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
$ curl -fsSL https://raw.githubusercontent.com/nodenv/nodenv-installer/master/bin/nodenv-installer | bash
Installing nodenv with git...
Initialized empty Git repository in /home/y-uchiida/.nodenv/.git/
# ...(中略)...
Running doctor script to verify installation...
Checking for `nodenv' in PATH: /home/y-uchiida/.nodenv/bin/nodenv
Checking for nodenv shims in PATH: OK
Checking `nodenv install' support: /home/y-uchiida/.nodenv/plugins/node-build/bin/nodenv-install (node-build 4.9.59)
Counting installed Node versions: none
There aren't any Node versions installed under `/home/y-uchiida/.nodenv/versions'.
You can install Node versions like so: nodenv install 2.2.4
Auditing installed plugins: OK
All done!
Note that this installer doesn't yet configure your shell startup files:
1. You'll want to ensure that `~/.nodenv/bin' is added to PATH.
2. Run `nodenv init' to see instructions how to configure nodenv for your shell.
3. Launch a new terminal window to verify that the configuration is correct.
# nodenvがインストールできているか、バージョンを確認
$ /home/y-uchiida/.nodenv/bin/nodenv -v
nodenv 1.4.0+3.631d0b6
最近のコメント