爱编码的Farmer

  • 主页
  • 编程开发
  • 运营维护
  • 随心笔记
  • 留言页面
  • 打赏
爱编码的Farmer
我是Farmer,我为自己代言
  1. 首页
  2. 编程开发
  3. 工具分享
  4. 正文

iPad编程学习环境---vscode web版本搭建

2019年11月17日 11824点热度 5人点赞 1条评论

今天拿ipad看书的时候,想到之前看到的一个文章说可以在浏览器上使用vscode,而且看书的时候,牵扯到一些函数的参数和具体描述无法知道(难查文档),就想能不能整一个这样的环境,一边看书也可以一边去浅度的了解里面使用的方法,也可以写代码进行调试.

准备

一台服务器,我在 https://www.vultr.com/?ref=7107762 购买了一台服务器,准备作为环境。(感觉国外的好一点,对于拉包速度之类)

链接服务器的工具,我这里使用的putty,服务器系统是centos7

安装环境

官方说得好模糊....踩了好多坑,也许是我系统太干净的原因?

https://github.com/microsoft/vscode/wiki/How-to-Contribute

# 装好git curl 之类的必须品
yum install git curl gcc gcc-c++ libX11-devel.x86_64 libxkbfile-devel.x86_64 libsecret-devel sqlite-devel zlib-devel bzip2-devel
# 安装nodejs和yarn
curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
curl --silent --location https://rpm.nodesource.com/setup_10.x | bash -
sudo yum install -y nodejs
sudo yum install -y yarn
# 安装python27
wget https://www.python.org/ftp/python/2.7.17/Python-2.7.17.tgz
tar -zxvf Python-2.7.17.tgz
cd Python-2.7.17
./configure
make && make install
# 克隆vscode仓库
cd ..
git clone https://github.com/microsoft/vscode.git
cd vscode
firewall-cmd --zone=public --add-port=8080/tcp --permanent
systemctl restart firewalld
npm install -g node-gyp
# 按照官方的来的,但是好像有问题?有一些地址是localhost,而且文件打不开,可以看下面的方法
git checkout 1.40.1
yarn
yarn watch
yarn web

然后我就开始使用另外一个项目,命令和上面的一样,除了上面四行 https://github.com/cdr/code-server ,注意上方git checkout v1.40.1 要换成其它版本,如:git checkout v1.39.2 见:https://github.com/cdr/code-server/issues/1170 (可能以后会支持吧)

git checkout 1.39.2
yarn
git clone https://github.com/cdr/code-server src/vs/server
cd src/vs/server
yarn
yarn patch:apply
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
yarn watch
yarn start

(中间因为服务器太辣鸡了...build内存不够,然后分配了4g虚拟内存解决了...过程中非常卡,服务器都连不上)

完成之后访问 http://ip:8080 就可以用了,code-server会要你输入密码,yarn start会获得


感觉要台网络好的服务器比较好....(我然后装了bbr感觉好多了)

可以安装扩展,但是好像装一次扩展然后要重新加载(然后又等很久)

想像体验:

实际体验:
我枯了?,bug比较多,Terminal跑不起来,代码也不能运行,单单的平板操作很不好(是我需要外接键鼠么?).我觉得还不如用duet来分屏.

不过还是很期待以后的版本的.

标签: 暂无
最后更新:2019年11月17日

Farmer

不敢说什么

点赞
< 上一篇
下一篇 >

文章评论

  • 周海棠啦

    推荐你个项目,不用自己编译,省力
    https://github.com/cdr/code-server

    换个邮件呗
    ID:周海棠啦
    地址:https://www.wygdbb.com

    2020年4月7日
    回复
  • 取消回复

    此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据。

    COPYRIGHT © 2021 icodef.com. ALL RIGHTS RESERVED.

    Theme Kratos Made By Seaton Jiang

    湘ICP备19008073号