惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

阮一峰的网络日志
阮一峰的网络日志
D
Darknet – Hacking Tools, Hacker News & Cyber Security
S
Schneier on Security
The Last Watchdog
The Last Watchdog
Cyberwarzone
Cyberwarzone
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cyber Attacks, Cyber Crime and Cyber Security
L
Lohrmann on Cybersecurity
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 司徒正美
The Cloudflare Blog
V
V2EX
博客园_首页
博客园 - 聂微东
Vercel News
Vercel News
人人都是产品经理
人人都是产品经理
G
GRAHAM CLULEY
T
Tenable Blog
Last Week in AI
Last Week in AI
Y
Y Combinator Blog
L
LINUX DO - 最新话题
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
SecWiki News
SecWiki News
博客园 - 三生石上(FineUI控件)
S
Secure Thoughts
N
News | PayPal Newsroom
T
The Blog of Author Tim Ferriss
The GitHub Blog
The GitHub Blog
T
Troy Hunt's Blog
博客园 - 【当耐特】
Forbes - Security
Forbes - Security
H
Hacker News: Front Page
A
About on SuperTechFans
B
Blog RSS Feed
Engineering at Meta
Engineering at Meta
MongoDB | Blog
MongoDB | Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
罗磊的独立博客
D
DataBreaches.Net
P
Privacy & Cybersecurity Law Blog
Schneier on Security
Schneier on Security
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Google DeepMind News
Google DeepMind News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Jina AI
Jina AI
D
Docker
P
Proofpoint News Feed

Jia Yue Hua

完美转发不完美 闲散颂 adapting c++20 ranges algorithms for most metaprogramming 使用mpmcpipeline和jthread实现软流水 在其它线程周期回调函数 在当前线程周期回调函数 for_each cpo和tag_invoke transparent,为关联容器增加查找成员
Reproducible github Developer Environments
Jia Yue Hua · 2023-08-15 · via Jia Yue Hua

我們以 github上 jiayuehua/CMakeVcpkgManifest 代码库 爲例,说明如何在github上建立可重复的开发环境。

1. 增加devcontainer 配置文件

在visual stuido code中 C-S-P,选择CodeSpaces:add devcontainer configure files… 生成devcontainer配置文件和Dockerfile。

修改这两文件为和CMakeVcpkgManifest的内容完全一致,因为CMakeVcpkgManifest正确的配置了sshd和安装了X11 forwarding所需要的程序。将改动push到github。

2 . 添加codespace, 在github上添加codespace。

3 .本地使用ssh 连接codespace

在本地使用ssh 连接codespace,使用ssh -X 连接,可以使用X11 forwarding。

~> gh codespace list                                                                                                    14m 1s
NAME                          DISPLAY NAME    REPOSITORY                    BRANCH  STATE      CREATED AT
opulent-doodle-7p7xpx9wqw2j5  opulent doodle  jiayuehua/CMakeVcpkgManifest  master  Available  29m 

~> gh codespace ssh --config > ~/.ssh/codespaces 

~> cd .ssh                                                                                                                  5s
~/.ssh> ln id_rsa codespaces.auto
~/.ssh> ln id_rsa.pub codespaces.auto.pub
~/.ssh> ls                               
authorized_keys  codespaces  codespaces.auto  codespaces.auto.pub  config  id_rsa  id_rsa.pub  known_hosts  known_hosts.old
~/.ssh> cat config    
Match all
Include ~/.ssh/codespaces
~> ssh -X cs.opulent-doodle-7p7xpx9wqw2j5.master 
Welcome to Ubuntu 22.04.2 LTS (GNU/Linux 5.15.0-1042-azure x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

This system has been minimized by removing packages and content that are
not required on a system that users do not log into.

To restore this content, you can run the 'unminimize' command.
Last login: Tue Aug 15 07:25:11 2023 from 127.0.0.1

@jiayuehua ➜ /workspaces/CMakeVcpkgManifest (master) $ xeyes

可以看到xeyes在本地显示。这里假定你使用wslg安装了ubuntu,ubuntu里X11 server。这时我们便可以在本地使用visual studio code 对带图形界面的代码库进行调试了。

Posted 2023-08-15