2020年5月26日 星期二

SSH AWS EC2 by your account with keypair without specify pem file

Assume you have the keypair file generated by AWS console

In your local machine and your account
> cat ~/.ssh/id_rsa.pub
# Copy the output

> ssh -i /path_to_key_pair/my-key-pair.pem ubuntu@your-ec2-ip-or-domain

In AWS EC2
ubuntu> sudo su your-account
# If you still don't have user account, create one by this instruction
# https://aws.amazon.com/premiumsupport/knowledge-center/new-user-accounts-linux-instance/

your-account>echo [The id_rsa.pub content you just copy] >> ~/.ssh/authorized_keys
your-account>exit
ubuntu>exit

In your local machine, connect to ec2 by
>ssh your-account@your-ec2-ip-or-domain

Voila



2020年5月25日 星期一

Visual Studio Code: 解決在Search中的Unknown encoding

當設定File: Encoding為非Unicode時,Search會出現Unknown encoding

請將File: Encoding設為utf8
將File: Auto Guess Encoding設為Enable,應該就可以搜尋,程式碼的編碼應該也可以正確。

(測試版本: Visual Studio Code 1.45.1)