What & How & Why

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
后一修订版
前一修订版
software_dev:env [2020/02/15 11:19] – [重置 Subsystem Ubuntu 密码] codingharesoftware_dev:env [2023/07/31 13:27] (当前版本) – [重置 Subsystem Ubuntu 密码] codinghare
行 1: 行 1:
 ======环境配置相关====== ======环境配置相关======
-本文记载了关于各种开发环境配置的一些 tips。\\ +关于各种开发环境配置的一些 tips。\\ 
-<wrap em>我的笔记均包含大量个人理解内容,存在一定偏差。如果您发现错误,请留言提出,谢谢!</wrap> +----
-===== =====+
  
 ====Windows==== ====Windows====
  
 ===Subsystem=== ===Subsystem===
-==win10下启用内嵌 Dash==+==win10下安装 wsl + ubuntu== 
 +启动 powershell, 以管理员方式输入以下命令: 
 +<code bash> 
 +wsl --install 
 +</code> 
 +安装完毕之后,查看当前可安装的发行版: 
 +<code bash> 
 +wsl -l -o 
 +</code> 
 +选择 ''Ubuntu'' 进行安装: 
 +<code bash> 
 +wsl --install -d Ubuntu 
 +</code>
  
-以前在 win7 环境中,要使用 GCC 调试 C 或者 C++ 都需要通过安装第三方环境(VS2015 太大)。而在 Win10 中,我们可以利用 Win10 内嵌// Bash on Ubuntu// 功能对 C++ 进行调试。该功能实际上就是在 win10 内部安装了一个 Ubuntu。 
-\\ 
-\\ 
-需要注意的是,该功能需要在 ''64'' 位操作系统下才能使用;并且,win10 在安装更新 ''rs1_release 14316'' 以后才会有上述功能。 
-\\ 
-具体安装步骤: 
-  - 打开 ''control panel'',找到 ''Turn Windows features on or off'',勾选上 ''Windows Subsystem for Linux (Beta)'',然后系统会要求重启。 
-  - 在 ''Settings'' 中的 ''Update & Security'' 栏目中找到 ''For developers'' 复选栏,选择 ''Developer mode'' 
-  -  按 ‘’Win+R‘’ 键,输入 ‘’bash‘’ 回车,根据提示下载和安装该程序。 
 ==重置 Subsystem Ubuntu 密码== ==重置 Subsystem Ubuntu 密码==
 首先通过快捷键 ''Super + X'', ''A'' 打开 powershell,并输入以下命令在 powershell 中登录 root: 首先通过快捷键 ''Super + X'', ''A'' 打开 powershell,并输入以下命令在 powershell 中登录 root:
-<code>+<code powershell>
 wsl --user root wsl --user root
 </code> </code>
 然后使用 ''passwd'' 命令修改密码即可。 然后使用 ''passwd'' 命令修改密码即可。
-===Sublime Text 3===+====Linux==== 
 +===Sublime Text=== 
 +==Sublime GDB layout config== 
 +<code bash> 
 +#layout 
 + 
 +"cols": [0.0, 0.5, 1.0 ], 
 +"rows": [0.0, 0.15, 0.6, 0.7, 0.8, 0.9, 1.0 ], 
 +"cells":  
 +    [ 
 +        [0,0,2,1], 
 +        [0,1,2,2], 
 +        [0,2,2,3], 
 +        [0,3,2,4], 
 +        [0,4,1,5], 
 +        [1,4,2,5], 
 +        [0,5,1,6], 
 +        [1,5,2,6], 
 +    ] 
 + 
 +#group  
 + 
 +"file_group": 0, 
 + 
 +    "session_group": 2, 
 +    "session_open": true, 
 + 
 +    "console_group": 3, 
 +    "console_open": true, 
 + 
 +    "variables_group": 4, 
 +    "variables_open": true, 
 + 
 +    "callstack_group": 5, 
 +    "callstack_open": true, 
 + 
 +    "registers_group": 3, 
 +    "registers_open": true, 
 + 
 +    "disassembly_group": 3, 
 +    "disassembly_open": true, 
 + 
 +    "disassembly_flavor": "intel", 
 + 
 +    "threads_group": 6, 
 +    "threads_open": true, 
 + 
 +    "breakpoints_group": 7, 
 +    "breakpoints_open": true, 
 +</code> 
 +==FileHeader== 
 +如果要简单的替换作者与修改者,在 ''user'' 配置中添加: 
 +<code bash> 
 +
 +    "Default":
 +        "author":"Codinghare", 
 +        "last_modified_by":"Codinghare" 
 +    } 
 +
 +</code> 
 +关联多个文件后缀到同一个模板: 
 +  - ''Preferences - Browse Packages - FileHeader'' 
 +  - 打开文件 ''FileHeader.py'' 
 +  - 找到对应的语言,比如 ''C++'',然后将需要识别的后缀与其关联,比如: 
 +<code bash> 
 +"cpp": "C++", 
 +"cc": "C++", 
 +"h": "C++", 
 +</code> 
 +===C++ === 
 +==安装 g++ 新版本== 
 +<code bash> 
 +#install g++ from developer toolset 
 +#enable the repository 
 +yum install centos-release-scl 
 + 
 +#install g++ 9 
 +yum install devtoolset-9-gcc devtoolset-9-gcc-c++ 
 + 
 +#enable g++ 9 
 +scl enable devtoolset-9 -- bash 
 + 
 +#permanently enable the g++ 9 
 +source scl_source enable devtoolset-9 
 +</code>