在任何地方的任何设备上使用Visual Studio代码

In today’s world, there’s a premium for being digital and portable. Developers need to create and maintain code from anywhere and on any device. Here is my setup for developing on any device anywhere. I have a high-end desktop for the majority of my programming and I also have an iPad which is very light, small, and affordable. I know what you’re thinking, you can’t possibly program on an iPad. It’s not powerful enough and it doesn’t have a good IDE or text editor. But that’s where you would be wrong. In my configuration, I use Visual Studio Code across all my devices, and on my iPad, I use a Bluetooth keyboard which makes it feel like my desktop.

在当今世界,数字化和便携式化是一项溢价。 开发人员需要在任何地方,任何设备上创建和维护代码。 这是我可以在任何地方的任何设备上进行开发的设置。 我有一个用于大部分编程的高端台式机,也有一个非常轻巧,小巧且价格合理的iPad。 我知道您在想什么,您可能无法在iPad上编程。 它不够强大,并且没有良好的IDE或文本编辑器。 但这就是你错的地方。 在我的配置中,我在所有设备上都使用Visual Studio Code,在我的iPad上,我使用了蓝牙键盘,这使它看起来像我的桌面。

This is the concept: Run Visual Studio Code on a Virtual Machine in the cloud, so you can access it anywhere.

这就是概念:在云中的虚拟机上运行Visual Studio Code,因此您可以在任何地方访问它。

使它工作的步骤 (Steps to Get It to Work)

1. Create (or Login Into) an Account on Google Cloud Platform (GCP). Currently, there is a promotion for a 12 month free trial with $300 USD credit to pay for your virtual machines.

1.在Google Cloud Platform(GCP)上创建(或登录)帐户。 目前,有一项12个月免费试用的促销活动,其中提供$ 300 USD的信用额来支付您的虚拟机。

Image for post
How to navigate to virtual machine compute
如何导航到虚拟机计算

2. Create a Virtual Machine(VM) on GCP by going to Compute Engine>VM instances>Create, this will create a computer virtually on the cloud.

2.转到Compute Engine> VM实例>创建,以在GCP上创建虚拟机(VM),这将虚拟地在云上创建计算机。

Image for post
Virtual Machine configuration
虚拟机配置

3. Configure your Virtual machine. Your configuration needs to have at least two CPU’s, 7.5GB of memory, and running the latest version of Ubuntu (for me it’s 16.04 LTS).

3.配置您的虚拟机。 您的配置至少需要有两个CPU,7.5GB的内存,并运行最新版本的Ubuntu(对我来说是16.04 LTS)。

Image for post
SSH navigation
SSH导航

4. Connect to the Virtual Machine by clicking the SSH button to the right of your External IP.

4.单击外部IP右侧的SSH按钮连接到虚拟机。

5. Download Visual Studio Code 3.3.1-Linux from Coders Github. Coder is a company that helps people save time configuring, securing developer environments. This is what we will be doing to setup Visual Studio Code. Copy this link and paste it in your terminal to start downloading Coder (this link is not the newest version of Visual Studio Code but it should still work perfectly for what we will need it for).

5.从Coders Github下载Visual Studio Code 3.3.1-Linux。 Coder是一家帮助人们节省配置时间,保护开发人员环境的时间的公司。 这就是我们将要设置Visual Studio Code的工作。 复制此链接并将其粘贴到您的终端中,以开始下载Coder(此链接不是Visual Studio Code的最新版本,但对于我们需要的它仍然应该可以正常使用)。

wget https://github.com/cdr/codeserver/releases/download/v3.3.1/code-server-3.3.1-linux-x86_64.tar.gz

6. Extract the files with this tar command:

6.使用此tar命令解压缩文件:

 – tar -vzfx  code-server-3.3.1-linux-x86_64.tar.gz

7. To access Coder remember to change the directory by typing in the following:

7.要访问Coder,请记住通过输入以下内容来更改目录:

cd code-server-3.3.1-linux-x86_64 

8. Start Visual Studio Code by typing in the following.

8.通过键入以下内容启动Visual Studio代码。

sudo ./code-server  

Once you’ve entered this command it should output a port and a password

输入此命令后,它应该输出端口和密码

Tip: you can disable the password by adding:– – auth none .

提示:您可以通过添加以下内容来禁用密码: – – auth none

To change the port you could add: – – port {any port number} .

要更改端口,您可以添加: – – port {any port number}

9. Access Visual Studio Code. To access Visual Studio Code you need to first find your external IP. To find it, go to the GCP website and navigate to the Compute Engine>VM instances, there you will find your external IP address. After that go to any locally hosted browsers and type this command in the browser:

9.访问Visual Studio代码。 要访问Visual Studio Code,您需要首先找到您的外部IP。 要找到它,请访问GCP网站并导航到Compute Engine> VM实例,您将在其中找到您的外部IP地址。 之后,转到所有本地托管的浏览器,然后在浏览器中键入以下命令:

http://{external IP}:{port number} 

Tip: If you want to rerun Visual Studio Code (if you’ve closed the application) and you’ve already finished the installation of Coder, just open your terminal and skip to step seven.

提示:如果要重新运行Visual Studio Code(如果已关闭该应用程序)并且已经完成了Coder的安装,则只需打开终端并跳至步骤7。

Now you can program in Visual Studio Code at a beach, a park, or even a plane, you can program anywhere with access to the internet.

现在,您可以在海滩,公园甚至飞机上使用Visual Studio Code进行编程,您可以在任何可以访问Internet的地方进行编程。

翻译自: https://medium.com/better-programming/use-visual-studio-code-on-any-device-anywhere-79387de95296

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值