Repository: lewagon/setup
Branch: master
Commit: 674ae5a5d758
Files: 247
Total size: 723.7 KB
Directory structure:
gitextract__mav3zdv/
├── .github/
│ └── workflows/
│ └── build.yml
├── .gitignore
├── .ruby-version
├── Gemfile
├── LICENSE
├── README.cn.md
├── README.es.md
├── README.fr.md
├── README.md
├── README.pt.md
├── _partials/
│ ├── checkup.md
│ ├── cli_tools.md
│ ├── cn/
│ │ ├── checkup.md
│ │ ├── cli_tools.md
│ │ ├── conclusion.md
│ │ ├── dotfiles.md
│ │ ├── gh_cli.md
│ │ ├── github.md
│ │ ├── intro.md
│ │ ├── kitt.md
│ │ ├── macos_apple_silicon.md
│ │ ├── macos_command_line_tools.md
│ │ ├── macos_homebrew.md
│ │ ├── macos_postgresql.md
│ │ ├── macos_rbenv.md
│ │ ├── macos_settings.md
│ │ ├── macos_slack.md
│ │ ├── macos_sqlite.md
│ │ ├── macos_terminal.md
│ │ ├── macos_vscode.md
│ │ ├── nvm.md
│ │ ├── oh_my_zsh.md
│ │ ├── rbenv.md
│ │ ├── ruby.md
│ │ ├── slack_settings.md
│ │ ├── sqlite.md
│ │ ├── ssh_agent.md
│ │ ├── ubuntu_postgresql.md
│ │ ├── ubuntu_settings.md
│ │ ├── ubuntu_slack.md
│ │ ├── ubuntu_vscode.md
│ │ ├── vscode_extensions.md
│ │ ├── vscode_liveshare.md
│ │ ├── windows_browser.md
│ │ ├── windows_postgresql.md
│ │ ├── windows_settings.md
│ │ ├── windows_slack.md
│ │ ├── windows_terminal.md
│ │ ├── windows_ubuntu.md
│ │ ├── windows_version.md
│ │ ├── windows_virtualization.md
│ │ ├── windows_vscode.md
│ │ ├── windows_wsl.md
│ │ └── yarn.md
│ ├── conclusion.md
│ ├── dotfiles.md
│ ├── es/
│ │ ├── checkup.md
│ │ ├── cli_tools.md
│ │ ├── conclusion.md
│ │ ├── dotfiles.md
│ │ ├── gh_cli.md
│ │ ├── github.md
│ │ ├── intro.md
│ │ ├── kitt.md
│ │ ├── macos_apple_silicon.md
│ │ ├── macos_command_line_tools.md
│ │ ├── macos_homebrew.md
│ │ ├── macos_postgresql.md
│ │ ├── macos_rbenv.md
│ │ ├── macos_settings.md
│ │ ├── macos_slack.md
│ │ ├── macos_sqlite.md
│ │ ├── macos_terminal.md
│ │ ├── macos_vscode.md
│ │ ├── nvm.md
│ │ ├── oh_my_zsh.md
│ │ ├── rbenv.md
│ │ ├── ruby.md
│ │ ├── slack_settings.md
│ │ ├── sqlite.md
│ │ ├── ssh_agent.md
│ │ ├── ubuntu_postgresql.md
│ │ ├── ubuntu_settings.md
│ │ ├── ubuntu_slack.md
│ │ ├── ubuntu_vscode.md
│ │ ├── vscode_aifeatures.md
│ │ ├── vscode_extensions.md
│ │ ├── vscode_liveshare.md
│ │ ├── windows_browser.md
│ │ ├── windows_postgresql.md
│ │ ├── windows_settings.md
│ │ ├── windows_slack.md
│ │ ├── windows_terminal.md
│ │ ├── windows_ubuntu.md
│ │ ├── windows_version.md
│ │ ├── windows_virtualization.md
│ │ ├── windows_vscode.md
│ │ ├── windows_wsl.md
│ │ └── yarn.md
│ ├── fr/
│ │ ├── checkup.md
│ │ ├── cli_tools.md
│ │ ├── conclusion.md
│ │ ├── dotfiles.md
│ │ ├── gh_cli.md
│ │ ├── github.md
│ │ ├── intro.md
│ │ ├── kitt.md
│ │ ├── macos_apple_silicon.md
│ │ ├── macos_command_line_tools.md
│ │ ├── macos_homebrew.md
│ │ ├── macos_postgresql.md
│ │ ├── macos_rbenv.md
│ │ ├── macos_settings.md
│ │ ├── macos_slack.md
│ │ ├── macos_sqlite.md
│ │ ├── macos_terminal.md
│ │ ├── macos_vscode.md
│ │ ├── nvm.md
│ │ ├── oh_my_zsh.md
│ │ ├── rbenv.md
│ │ ├── ruby.md
│ │ ├── slack_settings.md
│ │ ├── sqlite.md
│ │ ├── ssh_agent.md
│ │ ├── ubuntu_postgresql.md
│ │ ├── ubuntu_settings.md
│ │ ├── ubuntu_slack.md
│ │ ├── ubuntu_vscode.md
│ │ ├── vscode_aifeatures.md
│ │ ├── vscode_extensions.md
│ │ ├── vscode_liveshare.md
│ │ ├── windows_browser.md
│ │ ├── windows_postgresql.md
│ │ ├── windows_settings.md
│ │ ├── windows_slack.md
│ │ ├── windows_terminal.md
│ │ ├── windows_ubuntu.md
│ │ ├── windows_version.md
│ │ ├── windows_virtualization.md
│ │ ├── windows_vscode.md
│ │ ├── windows_wsl.md
│ │ └── yarn.md
│ ├── gh_cli.md
│ ├── github.md
│ ├── intro.md
│ ├── kitt.md
│ ├── macos_apple_silicon.md
│ ├── macos_command_line_tools.md
│ ├── macos_homebrew.md
│ ├── macos_postgresql.md
│ ├── macos_rbenv.md
│ ├── macos_settings.md
│ ├── macos_slack.md
│ ├── macos_sqlite.md
│ ├── macos_terminal.md
│ ├── macos_vscode.md
│ ├── nvm.md
│ ├── oh_my_zsh.md
│ ├── pt/
│ │ ├── checkup.md
│ │ ├── cli_tools.md
│ │ ├── conclusion.md
│ │ ├── dotfiles.md
│ │ ├── gh_cli.md
│ │ ├── github.md
│ │ ├── intro.md
│ │ ├── kitt.md
│ │ ├── macos_apple_silicon.md
│ │ ├── macos_command_line_tools.md
│ │ ├── macos_homebrew.md
│ │ ├── macos_postgresql.md
│ │ ├── macos_rbenv.md
│ │ ├── macos_settings.md
│ │ ├── macos_slack.md
│ │ ├── macos_sqlite.md
│ │ ├── macos_terminal.md
│ │ ├── macos_vscode.md
│ │ ├── nvm.md
│ │ ├── oh_my_zsh.md
│ │ ├── rbenv.md
│ │ ├── ruby.md
│ │ ├── slack_settings.md
│ │ ├── sqlite.md
│ │ ├── ssh_agent.md
│ │ ├── ubuntu_postgresql.md
│ │ ├── ubuntu_settings.md
│ │ ├── ubuntu_slack.md
│ │ ├── ubuntu_vscode.md
│ │ ├── vscode_aifeatures.md
│ │ ├── vscode_extensions.md
│ │ ├── vscode_liveshare.md
│ │ ├── windows_browser.md
│ │ ├── windows_postgresql.md
│ │ ├── windows_settings.md
│ │ ├── windows_slack.md
│ │ ├── windows_terminal.md
│ │ ├── windows_ubuntu.md
│ │ ├── windows_version.md
│ │ ├── windows_virtualization.md
│ │ ├── windows_vscode.md
│ │ ├── windows_wsl.md
│ │ └── yarn.md
│ ├── rbenv.md
│ ├── ruby.md
│ ├── slack_settings.md
│ ├── sqlite.md
│ ├── ssh_agent.md
│ ├── ubuntu_postgresql.md
│ ├── ubuntu_settings.md
│ ├── ubuntu_slack.md
│ ├── ubuntu_vscode.md
│ ├── vscode_aifeatures.md
│ ├── vscode_extensions.md
│ ├── vscode_liveshare.md
│ ├── windows_browser.md
│ ├── windows_postgresql.md
│ ├── windows_settings.md
│ ├── windows_slack.md
│ ├── windows_terminal.md
│ ├── windows_ubuntu.md
│ ├── windows_version.md
│ ├── windows_virtualization.md
│ ├── windows_vscode.md
│ ├── windows_wsl.md
│ └── yarn.md
├── build.rb
├── check.rb
├── docs/
│ ├── macos_cheatsheet.md
│ ├── pull_request_template.md
│ ├── ubuntu_cheatsheet.md
│ └── windows_cheatsheet.md
├── macos.cn.md
├── macos.es.md
├── macos.fr.md
├── macos.md
├── macos.pt.md
├── ubuntu.cn.md
├── ubuntu.es.md
├── ubuntu.fr.md
├── ubuntu.md
├── ubuntu.pt.md
├── utils/
│ ├── macos_list_processor_type.sh
│ └── turn_off_fast_startup.bat
├── windows.cn.md
├── windows.es.md
├── windows.fr.md
├── windows.md
└── windows.pt.md
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/workflows/build.yml
================================================
name: Build setup guides
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build
run: |
git config user.name github-actions
git config user.email github-actions@github.com
ruby build.rb
if ! git diff --exit-code
then
git add .
git commit -m "setup guides generated"
git push
fi
================================================
FILE: .gitignore
================================================
.DS_Store
================================================
FILE: .ruby-version
================================================
3.3.5
================================================
FILE: Gemfile
================================================
gem "rspec"
gem "rubocop"
gem "pry"
gem "pry-byebug"
gem "colored"
gem "http"
================================================
FILE: LICENSE
================================================
© 2023 La Loco SAS, head of Le Wagon Group - All rights reserved
================================================
FILE: README.cn.md
================================================
## 新同学
### 你在中国吗?
开始设置之前,:point_down: 你可能会需要用到 VPN,所以保证你有 VPN,或者让老师为你提供一个。
### 全球
[Le Wagon](https://www.lewagon.com)的设置指南。请选择你电脑的操作系统(OS):
================================================
FILE: README.es.md
================================================
## ¿En Español?
Guías de configuración para el curso de AI Software Development de [Le Wagon](https://www.lewagon.com). Elige tu sistema operativo (OS):
================================================
FILE: README.fr.md
================================================
## En Français
Guides de configuration pour la formation AI Software Development du [Wagon](https://www.lewagon.com). Choisis ton système d’exploitation (OS):
================================================
FILE: README.md
================================================
## In Chinese?
如果你在参加中文课程,请打开中文设置指南
## ¿En Español?
Haga clic en este enlace para acceder a la versión en español de la configuración.
## Em Português?
Clique neste link para acessar a versão em português da configuração.
## En Français ?
Clique sur ce lien pour accéder à la version française du setup.
## In English
Setup guides for [Le Wagon](https://www.lewagon.com) AI Software Development course. Please choose your operating system (OS):
================================================
FILE: README.pt.md
================================================
## Em Português?
Guias de configuração para o curso de AI Software Development [Le Wagon](https://www.lewagon.com). Escolha seu sistema operacional (SO):
================================================
FILE: _partials/checkup.md
================================================
## Check-up
Let's check if you successfully installed everything.
In you terminal, run the following command:
```bash
exec zsh
```
Then run:
```bash
curl -Ls https://raw.githubusercontent.com/lewagon/setup/master/check.rb > _.rb && ruby _.rb && rm _.rb || rm _.rb
```
:heavy_check_mark: If you get a green `Awesome! Your computer is now ready!`, then you're good :+1:
:x: If not, **contact a teacher**.
================================================
FILE: _partials/cli_tools.md
================================================
## Command line tools
### Check the locale
The locale is a mechanism allowing to customize programs to your language and country.
Let's verify that the default locale is set to English, please type this in the Ubuntu terminal:
```bash
locale
```
If the output does not contain `LANG=en_US.UTF-8`, run the following command in a Ubuntu terminal to install the english locale:
```bash
sudo locale-gen en_US.UTF-8
```
If after, you receive a warning (`bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf-8)`) in your terminal, please do the following:
Generate locale
Please, run this lines in your terminal.
```bash
sudo update-locale LANG=en_US.UTF8
sudo apt-get update
sudo apt-get install language-pack-en language-pack-en-base manpages
```
### Zsh & Git
Instead of using the default `bash` [shell](https://en.wikipedia.org/wiki/Shell_(computing)), we will use `zsh`.
We will also use [`git`](https://git-scm.com/), a command line software used for version control.
Let's install them, along with other useful tools:
- Open an **Ubuntu terminal**
- Copy and paste the following commands:
```bash
sudo apt update
```
```bash
sudo apt install -y curl git imagemagick jq unzip vim zsh tree
```
These commands will ask for your password: type it in.
:warning: When you type your password, nothing will show up on the screen, **that's normal**. This is a security feature to mask not only your password as a whole but also its length. Just type in your password and when you're done, press `Enter`.
### GitHub CLI installation
Let's now install [GitHub official CLI](https://cli.github.com) (Command Line Interface). It's a software used to interact with your GitHub account via the command line.
In your terminal, copy-paste the following commands and type in your password if asked:
```bash
sudo apt remove -y gitsome # gh command can conflict with gitsome if already installed
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
```
```bash
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
```
```bash
sudo apt update
```
```bash
sudo apt install -y gh
```
To check that `gh` has been successfully installed on your machine, you can run:
```bash
gh --version
```
:heavy_check_mark: If you see `gh version X.Y.Z (YYYY-MM-DD)`, you're good to go :+1:
:x: Otherwise, please **contact a teacher**
================================================
FILE: _partials/cn/checkup.md
================================================
## 最后检查
让我们来看看你是否已经成功安装好了所有软件。
在终端,运行下面两行命令:
```bash
exec zsh
curl -Ls https://web-dev-challenge-lewagon-image.oss-cn-shanghai.aliyuncs.com/setup/check.rb > _.rb && ruby _.rb || rm _.rb
```
:heavy_check_mark: 如果出现了一个绿色的`Awesome! Your computer is now ready!`,那么你的工作台已经设置好了 :+1:
如果没有的话,问一下你的老师。
================================================
FILE: _partials/cn/cli_tools.md
================================================
## Command line tools
### Zsh & Git
我们将使用`zsh`来代替默认的`bash` [shell](https://zh.wikipedia.org/zh-cn/殼層)。
我们也会使用[`git`](https://git-scm.com/),它是一个用来进行版本控制的命令行软件。
下面来安装这些工具吧:
- 打开终端
- 复制粘贴下面的命令:
```bash
sudo apt update
```
```bash
sudo apt install -y curl git imagemagick jq unzip vim zsh
```
这些指令会问你的密码:输入你的密码。
:warning: 当你输入你的密码的时候,屏幕上不会有任何的显示,**这是正常的**。这是一个安全保护的设置,来隐藏你整个密码,包括它的长度。你可以放心的输入你的密码,结束后按下`Enter`就可以了。
### 安装GitHub CLI
现在我们来安装GitHub[官方命令行界面(CLI)](https://cli.github.com) (Command Line Interface)。这是一个用来在终端里和你的GitHub账户交互的一个软件。
在你的终端里,复制粘贴以下代码,并在需要的时候,输入你的密码:
```bash
sudo apt remove -y gitsome # gh command can conflict with gitsome if already installed
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install -y gh
```
你可以运行以下的命令,来检查`gh`是否成功安装了:
```bash
gh --version
```
:heavy_check_mark: 如果你看到了`gh version X.Y.Z (YYYY-MM-DD)`,你就可以继续下一步啦!:+1:
:x: 如果没有看到话,**问问老师**。
================================================
FILE: _partials/cn/conclusion.md
================================================
## 设置完成啦!
现在你的电脑已经完成[Le Wagon网页开发课程](https://www.lewagon.com/web-development-course/full-time)的设置啦 :muscle: :clap:
享受你的编程之旅,你会掌握它的! :rocket:
================================================
FILE: _partials/cn/dotfiles.md
================================================
## Dotfiles (标准配置)
黑客很喜欢把他们的shell和工具变得很酷炫。
让我们用Le Wagon提供的一个超棒的默认配置文件来开始吧:[`lewagon/dotfiles`](http://github.com/lewagon/dotfiles).
因为你的配置是私人的,所以你需要保存在**自己**的代码库里(repository/repo)。
Fork的意思是:在你的GitHub账号上建一个新的代码库,和原始的那一个是一模一样的(可以想象成你在复制粘贴这个代码库)。这样,你在你的GitHub上就会有一个新的代码库: `$GITHUB_USERNAME/dotfiles`。我们需要fork,因为每个人都需要在那些文件里加上一些**特定**信息(比如你的名字)。
打开终端,运行下面的命令:
```bash
export GITHUB_USERNAME=`gh api user | jq -r '.login'`
echo $GITHUB_USERNAME
```
:heavy_check_mark: 你应该能看到你的GitHub用户名在终端里显示出来了。
:x: 如果没有的话,现在就**停下**,找老师帮忙。看起来之前的步骤(`gh auth`)有一些问题。
现在就可以fork代码库(repo),然后克隆到你自己的电脑上了:
```bash
mkdir -p ~/code/$GITHUB_USERNAME && cd $_
gh repo fork lewagon/dotfiles --clone
```
### Dotfiles安装器
运行`dotfiles`安装器:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles && zsh install.sh
```
用下面的命令检查一下你GitHub账号录入的电子邮箱。你需要在其中选一个(如果你有好几个的话),然后再进入下一个步骤:
```bash
gh api user/emails | jq -r '.[].email'
```
:heavy_check_mark: 如果你看到了你的注册邮箱列表,你就可以继续下一步啦:+1:
:x: 如果没有的话,请在运行上面:point_up: 这个指令之前,[重新授权GitHub](https://github.com/lewagon/setup/blob/master/#github-cli)。
### git安装器
运行git安装器:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh
```
:point_up: 这会**提示**填写你的全名(`FirstName LastName`)和你的邮箱。
:warning: 注意啦,你**需要**填`gh api ...`命令列出的其中一个电子邮箱。不然,Kitt就没办法跟进你的学习进程。 你选择的电子邮件将**公开**显示在互联网上。💡 如果您不希望您的电子邮件出现在您可能会贡献的公共存储库中,请选择 `@users.noreply.github.com` 地址。
现在运行下面的命令来**重置**你的终端:
```bash
exec zsh
```
================================================
FILE: _partials/cn/gh_cli.md
================================================
## GitHub CLI
CLI是[Command-line Interface(命令行界面)](https://baike.baidu.com/item/%E5%91%BD%E4%BB%A4%E8%A1%8C%E7%95%8C%E9%9D%A2/9910197?fr=aladdin)的首字母缩写。
在这一章节里面,我们会安装[GitHub CLI](https://cli.github.com/)。这样我们就可以直接在终端和Github互动。
你之前执行的命令应该已经安装了GitHub CLI。
首先你需要**登陆**。复制粘贴下面的命令到终端,敲击回车:
:warning: **不要更改下面指令中的`email`**
```bash
gh auth login -s 'user:email' -w --git-protocol ssh
```
`gh`会问你几个问题:
- `Generate a new SSH key to add to your GitHub account?(生成新的SSH密钥,然后添加到Github账号上?)` 敲击回车,让gh帮你生成。
如果你以前生成过SSH密钥,那你就会看到这个问题`Upload your SSH public key to your GitHub account?(上传公共密钥到Github账户上上吗?)` 上下移动箭头`>`,让它停在你想选的SSH公钥前面,然后敲击回车。
- `Enter a passphrase for your new SSH key (Optional)(输入新的SSH密钥的密码(非必填))`. 输入一个密码,然后写下来或者记住它。这是保护你本地私钥的密码。然后敲击回车。
- `Title for your SSH key`。你可以把它留在建议的 "GitHub CLI",按`Enter`。
然后你会看到下面的文字输出:
```bash
! First copy your one-time code: 0EF9-D015
- Press Enter to open github.com in your browser...
```
复制那段验证码(code)(在上面的例子中是`0EF9-D015` ),然后敲击`Enter`。
你的浏览器就会打开一个页面让你授权GitHub CLI使用你的GitHub账号。同意,并等待一会儿。
回到终端,再次敲击`回车`,然后就应该好啦:tada:
检查一下你有没有链接好:
```bash
gh auth status
```
如果你看到`Logged in to github.com as <你的GitHub用户名> `,那就可以了。
:x: 如果没有,**问问老师**。
================================================
FILE: _partials/cn/github.md
================================================
## GitHub账户
你有注册好GitHub账户嘛?如果还没有,[现在注册](https://github.com/join)。
:point_right: **[上传一张照片](https://github.com/settings/profile)** 并在你的GitHub账户中设置你的名称。这一步很重要,因为我们将使用一个带有你头像的内部dashboard。请**现在**立即做这一步,然后再去继续下面的步骤。

**[启用双因素认证(2FA)](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication#configuring-two-factor-authentication-using-text-messages)**。当您尝试登录时,GitHub将向您发送带有代码的短信。这对于安全性很重要,也很快将成为贡献GitHub上的代码的必要条件。
================================================
FILE: _partials/cn/intro.md
================================================
# 电脑设置教程
以下的教程将会帮助你为接下来在[Le Wagon AI Software Development course](https://www.lewagon.com/web-development-course/full-time)全栈开发训练营中做好准备:
请**仔细阅读并按顺序执行指令**。如果你在哪一步卡住了,不用犹豫,可以举手咨询老师:raising_hand:
让我们开始吧 :rocket:
================================================
FILE: _partials/cn/kitt.md
================================================
## Kitt
:warning: 如果你已经收到了一封来自Le Wagon邀请你去注册Kitt(我们的学习平台)的邮件并且你也注册完成了的话,你可以安全的跳过这一章节。如果你还没有注册完成的话,请跟随邮件里的教程,完成注册。
如果你不确定你要做什么,可以查看[这个链接](https://kitt.lewagon.com/)。如果你已经登录了的话,你可以跳过这个章节。如果你没有登录的话,你需要点击`Enter Kitt as a Student`。如果你可以成功的登录,你也可以安全的跳过这一步。不然的话,你可以询问一下老师你是否有收到过相关的邮件,或者直接跟着执行下面的教程。
前往[kitt.lewagon.com/onboarding](http://kitt.lewagon.com/onboarding),注册成为Le Wagon的一名校友。选择你的batch,用gitHub账户登录并填写你的信息。
你的老师将会验证你的确属于这个batch。你可以在完成了注册表单后去询问老师去做验证。
当你的老师验证成功后,请前往你的邮箱收件箱。你应该会有两封邮件:
- 一封来自Slack,邀请你加入Le Wagon Alumni Slack社群(在这儿你可以与你的伙伴和所有之前的学员交流)。点击**Join**并填写相应的个人信息。
- 一封来自GitHub,要求你加入`lewagon`团队。**接受它**,不然的话你将没有办法看到有关讲座和课程的文件。
================================================
FILE: _partials/cn/macos_apple_silicon.md
================================================
## Apple M1芯片
如果你是在2020下半年买的电脑,它更有可能是Apple Silicon而不是Intel处理器。让我们来查看查看...
你可以从Applications > Utilities或者在[Spotlight](https://support.apple.com/en-gb/HT204014)里面搜索:

复制粘贴以下的指令到终端里并按`Enter`来执行这段指令。
``` bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/setup/master/utils/macos_list_processor_type.sh)"
```
☝️执行完这段代码之后将会表明你的电脑是否使用的是Apple Silicon。
如果你的电脑使用的是Apple Silicon,展开下面的段落并进行阅读。如果不是的话,请忽略它。
👉 Setup for Apple Silicon 👈
### 卸载Homebrew
我们需要卸载Homebrew以防本地已经安装了一个版本。
在终端中执行以下代码:
``` bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
```
如果brew如果没有被安装,你将会得到以下消息`brew: command not found!`
### 为Rosetta配置终端
打开访达Finder(或者在[Spotlight](https://support.apple.com/en-gb/HT204014)里搜索它)。
前往Applications > Utilities.
复制终端应用(选择它, 然后`Cmd` + `C`, `Cmd` + `V`),并将它的复制重命名为Terminal Rosetta。
在Terminal Rosetta软件上按`Cmd` + `I`, 然后勾选”使用Rosetta打开(Open using Rosetta)“.
⚠️ 从此以后在训练营中,每当你需要打开终端的时候,你将需要打开**Terminal Rosetta**应用。
================================================
FILE: _partials/cn/macos_command_line_tools.md
================================================
## 一个有关在mac上跳出应用程序的小贴士
在mac上点击应用程序窗口左上方的小红叉**并不是真正的退出了它**,他只是关闭了一个活跃窗口。如果想要 _真正_ 的退出应用程序,你需要在应用活跃的时候按`Cmd + Q`,或者在你的菜单栏里前往`APP_NAME` -> 点击`Quit`

在这个设置教程中,你将会被要求**退出并重启**应用程序很多次,请确保你可以正确的退出重启 :pray:
## 命令行工具
打开一个新的终端窗口,复制粘贴以下指令到你的终端并按下`Enter`来执行指令:
```bash
xcode-select --install
```
如果你收到了以下消息,你可以直接就跳过这一步并前往下一步。
```bash
# command line tools are already installed, use "Software Update" to install updates
```
不然的话,他将会打开一个窗口询问你是否想要下载一些软件: 点击“Install”(安装)并等待。

:heavy_check_mark: 当你看到"The software was installed"这条消息的时候,你就可以继续下一步了 :+1:
:x: 如果`xcode-select --install` 指令失败了,再重新试着运行一次:有时候Apple服务器会过载。
:x: 如果你看到"Xcode is not currently available from the Software Update server",你就需要更新你的软件系统:
```bash
sudo softwareupdate --clear-catalog
```
这个执行结束之后,你可以尝试再一次安装(复制粘贴以下指令并按下Enter)。
================================================
FILE: _partials/cn/macos_homebrew.md
================================================
## Homebrew
[Homebrew](http://brew.sh/),一个包管理工具:这是一个帮助你在命令行中安装其他软件的软件。让我们一起安装它!
想要安装,你需要打开终端并执行:
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```
这将会询问你的确认(按下`Enter`)并输入你的**macOS用户账户密码**(那个当你重启你Macbook时,用来[登入](https://support.apple.com/en-gb/HT202860) 的密码)。
:warning: 当你输入你的密码的时候,屏幕上不会有任何的显示,**这是正常的**。这是一个安全保护的设置,来隐藏你整个密码,包括它的长度。你可以放心的输入你的密码,结束后按下`Enter`就可以了。
:warning: 如果你看到了下面的警告:point_down:,运行`Next steps`下面的两个命令把Homebrew加到你的PATH里。

```bash
# ⚠️ Only execute these commands if you saw this warning ☝
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
```
如果你已经有了Homebrew,终端会告诉你的。那么一切正常,你可以继续接下来的步骤。
接下来,让我们安装一些有用的软件:
```bash
brew update
```
如果你得到了`/usr/local must be writable`的报错,直接运行以下指令:
```bash
sudo chown -R $USER:admin /usr/local
brew update
```
无论是否有这行报错,继续执行下方的指令(你可以一次性直接复制/粘贴下方所有行)
```bash
brew upgrade git || brew install git
brew upgrade gh || brew install gh
brew upgrade wget || brew install wget
brew upgrade imagemagick || brew install imagemagick
brew upgrade jq || brew install jq
brew upgrade openssl || brew install openssl
```
================================================
FILE: _partials/cn/macos_postgresql.md
================================================
## PostgreSQL
有的时候,SQLite功能会不够用。这个时候我们就需要使用一个更高级的工具,叫做[PostgreSQL](https://www.postgresql.org/)。这是一个开源的、强大的、生产环境可用的数据库系统。
让我们现在一起安装它。
运行下方指令:
```bash
brew install postgresql@15 libpq
brew link --force libpq
```
```bash
brew services start postgresql@15
```
当你结束了上方的指令之后,让我们一起来核查一下它是否安装成功了:
```bash
psql -d postgres
```
如果你进入到了一个像下方这个,一个新的输入框的话,那么说明你的PostgreSQL已经安装好啦!
```bash
psql (15.2)
Type "help" for help.
postgres=#
```
如果想要退出它的话,输入`\q`然后按下`Enter`。
================================================
FILE: _partials/cn/macos_rbenv.md
================================================
## rbenv
让我们来安装[rbenv](https://github.com/sstephenson/rbenv),一个帮助我们安装并管理`ruby`环境的软件。
首先,我们需要先清理我们之前可能安装过的Ruby:
```bash
rvm implode && sudo rm -rf ~/.rvm
# 如果出现"zsh: command not found: rvm"报错, 继续后续的步骤. 这是指你的电脑上没有安装`rvm`
# 这是我们想要的!
sudo rm -rf $HOME/.rbenv /usr/local/rbenv /opt/rbenv /usr/local/opt/rbenv
```
:warning: 这条指令会需要你输入你的密码。
:warning: 当你输入你的密码的时候,屏幕上不会有任何的显示,**这是正常的**。这是一个安全保护的设置,来隐藏你整个密码,包括它的长度。你可以放心的输入你的密码,结束后按下`Enter`就可以了。
在终端里运行:
```bash
brew uninstall --force rbenv ruby-build
```
然后运行:
```bash
exec zsh
brew install rbenv libyaml
```
================================================
FILE: _partials/cn/macos_settings.md
================================================
## macOS设置
### 安全
你必须使用密码来保护你的电脑。如果你还没有设置过密码的话,请前往`>系统偏好设置>用户和组`并更改您的帐户密码。您还应该前往`>系统偏好设置>安全性>通用`。睡眠或屏幕保护程序启动的`5秒`后,您应该要求输入密码。
您也可以前往` > 系统偏好设置 > 任务控制`,然后单击左下角的`Hot Corners`按钮。选择右下角以启动屏幕保护程序。这样,当您离开办公桌时,可以通过将鼠标置于右下角来快速锁定屏幕。5秒钟后,您的Macbook将被锁定,并要求输入密码以恢复。
### 键盘
当你成为了一名程序员的时候,你将明白离开键盘去操作将会耗费大量的时间,所以你将会想最大化的减少花费在触控盘和鼠标的时间。以下是一些在macOS上的小技巧可以帮助你做到这些。
#### 键盘速度
前往 > 系统偏好设置 > 键盘。设置`Key Repeat`到最快的位置(最右边)并将`Delay Until Repeat`移到最短的位置(最右边)。
#### 黑客的macOS
[阅读这个脚本](https://github.com/mathiasbynens/dotfiles/blob/master/.macos)然后挑选一些你认为适合你的指令。例如,您可以在终端中输入以下内容:
```bash
# 默认情况下扩展保存面板
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
# 将截屏保存到桌面(或其他位置)
defaults write com.apple.screencapture location "${HOME}/Desktop"
# etc..
```
### 将应用程序固定在你的Dock上
你将会经常使用今天安装的大部分应用程序。所以让我们把这些应用程序固定在Dock上,这样我们就很容易打开他们啦!
我们需要启动程序,右键点击,打开菜单栏并选择“选项”(Options),然后选择“保留在Dock上”(Keep in Dock)。

你一定要固定以下应用程序:
- 你的终端
- 你的文件资源管理器
- VS Code
- 你的浏览器
- Slack
================================================
FILE: _partials/cn/macos_slack.md
================================================
## Slack
[Slack](https://slack.com/)是一个在技术领域里非常流行的一个交流平台。
### 安装
[下载Slack应用程序](https://itunes.apple.com/fr/app/slack/id803453959?mt=12)并安装它。
:warning: 如果你已经在你的浏览器里使用Slack了,请还是下载并安装功能更全面的**Slack桌面应用程序**。
================================================
FILE: _partials/cn/macos_sqlite.md
================================================
## SQLite
几周后,我们就会开始学习数据库和SQL. [SQLite](https://sqlite.org/index.html)是一个数据库引擎,它可以在单文件数据库上执行SQL查询。现在来安装它吧:
在终端,执行下面的命令:
```bash
brew install sqlite
```
然后执行下面的命令:
```bash
sqlite3 -version
```
:heavy_check_mark: 如果你看到了版本号,那你就可以继续下一步了 :+1:
:x: 如果没有,**问问老师吧**!
================================================
FILE: _partials/cn/macos_terminal.md
================================================
## macOS Terminal Theme
在Mac上,打开`Terminal > Preferences`并在`Profiles`中将“Pro”主题设置为默认。

**退出**并重启终端。它现在会有一个好看的黑色背景,对眼睛会更友好。
================================================
FILE: _partials/cn/macos_vscode.md
================================================
## Visual Studio Code (VS Code)
### 安装
让我们一起安装[Visual Studio Code](https://code.visualstudio.com)代码编辑器。
复制(`CMD` + `C`)下面的指令,并粘贴(`CMD` + `V`)到终端Terminal里:
```bash
brew install --cask visual-studio-code
```
然后在终端使用下方指令启动VS Code:
```bash
code
```
:heavy_check_mark: 如果一个VS Code窗口被打开,那么你就准备好继续下一步了:+1:
:x: 如果没有成功打开的话,**请联系你的老师**
================================================
FILE: _partials/cn/nvm.md
================================================
## Node.js
[Node.js](https://nodejs.org/en/)是一个JavaScript运行环境以在终端运行JavaScript代码。让我们一起用[nvm](https://github.com/nvm-sh/nvm),一个Node.js的版本管理器,来安装Node.js。
在终端里,运行以下指令:
```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v/install.sh | zsh
```
重启你的终端并执行下方指令:
```bash
nvm -v
```
你应该会看到你的nvm的版本。如果没有的话,问一下你的老师。
现在,让我们来安装node:
```bash
nvm install
```
当这个指令执行结束之后,运行:
```bash
node -v
```
如果看到`v`,那么你安装成功了:heavy_check_mark: 然后,你就可以运行下面这个命令了:
```bash
nvm cache clear
```
:x: 如果没有看到版本的话,**问一下你的老师**。
================================================
FILE: _partials/cn/oh_my_zsh.md
================================================
## Oh-my-zsh
让我们一起安装`zsh`插件[Oh My Zsh](https://ohmyz.sh/).
在终端terminal里执行以下指令:
```bash
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```
如果终端里出现询问"Do you want to change your default shell to zsh?", 可以输入`Y`
在你的终端的最后,你会看到以下内容:

:heavy_check_mark: 如果你的终端成功显示了上面,你就可以继续下一步了:+1:
:x: 如果安装失败的话,请询问**你的老师**
================================================
FILE: _partials/cn/rbenv.md
================================================
## rbenv
让我们安装[`rbenv`](https://github.com/sstephenson/rbenv),一个帮助我们安装和管理`ruby`环境的软件。
首先,我们需要清理你可能已经安装过的Ruby:
```bash
rvm implode && sudo rm -rf ~/.rvm
# If you got "zsh: command not found: rvm", carry on.
# It means `rvm` is not on your computer, that's what we want!
rm -rf ~/.rbenv
```
然后在终端里运行:
```bash
sudo apt install -y build-essential tklib zlib1g-dev libssl-dev libffi-dev libxml2 libxml2-dev libxslt1-dev libreadline-dev libyaml-dev
```
```bash
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
```
```bash
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
exec zsh
```
================================================
FILE: _partials/cn/ruby.md
================================================
## Ruby
### 安装
现在,你已经准备好了去安装最新[ruby](https://www.ruby-lang.org/en/)版本并把它设置为默认版本。
运行下方这个指令,它会**花费一些时间(5-10分钟)**
```bash
rbenv install
```
当Ruby安装好后,运行下面这个指令来告诉系统使用这个版本作为默认版本。
```bash
rbenv global
```
然后**重置**你的终端,然后检查Ruby版本:
```bash
exec zsh
ruby -v
```
:heavy_check_mark: 如果你有看到`ruby `,那么你可以继续下一步+1:
:x: 如果没有的话,**询问一下老师**。
### 安装一些gems
点击这里,如果你在 :cn: 中国的话
:warning: 如果你在中国的话,你应该使用以下命令来安装gem。
```bash
# China only!
gem sources --remove https://rubygems.org/
gem sources -a https://gems.ruby-china.com/
gem sources -l
# *** CURRENT SOURCES ***
# https://gems.ruby-china.com/
# Ruby-china.com must be in the list now
```
在ruby的世界里,我们将外部的库称之为`gems`:他们是一些你可以下载并在你的电脑上运行的ruby代码。让我们一起安装一些!
首先,我们将更新`bundler`,它是用于安装 gem 的工具:
```bash
gem update bundler
```
在你的终端里,复制粘贴下面的指令:
```bash
gem install
```
:heavy_check_mark: 如果你看到 `xx gems installed`,那么一切正常 :+1:
:x: 如果你遇到了以下的报错:
```bash
ERROR: While executing gem ... (TypeError)
incompatible marshal file format (can't be read)
format version 4.8 required; 60.33 given
```
运行以下的指令:
```bash
rm -rf ~/.gemrc
```
然后,重新运行安装gems的指令。
:warning: **永远不要**使用`sudo gem install`来安装一个gem!即使你偶然发现了一个网络上的答案(或者终端提示)叫你这么做。
================================================
FILE: _partials/cn/slack_settings.md
================================================
### 设置
打开Slack应用程序并登入`lewagon-alumni`组织。
确保你已经**上传了你的头像照片** :point_down:

之后你可以全天开着Slack,这样你可以在上面分享有用的链接/寻求帮助/决定去那儿吃饭/...
为了确保视频电话可以正常工作,让我们一起测试摄像头和麦克风:
- 打开Slack应用程序。
- 点击右上方的个人照片。
- 从菜单中选择 `首选项(Preferences)`。
- 点击左侧栏中的 `音频和视频(Audio & video)`。
- 在 `故障排除(Troubleshooting)`下面,点击 `运行音频、视频和屏幕共享测试(Run an audio, video and screensharing test)`。该测试将在一个新窗口中打开。
- 检查你使用的扬声器、麦克风和摄像机设备是否出现在选项中,然后点击 `开始测试(Start test)`。

:heavy_check_mark: 当测试结束以后,你应该会看到你的摄像头和麦克风有绿色的"Succeed"信息。:+1:
:x: 如果测试失败的话,**请联系你的老师**.
你也可以在手机上安装Slack应用并登入`lewagon-alumni`!
================================================
FILE: _partials/cn/sqlite.md
================================================
## SQLite
几周后,我们就会开始学习数据库和SQL. [SQLite](https://sqlite.org/index.html)是一个数据库引擎,它可以在单文件数据库上执行SQL查询。现在来安装它吧:
在终端,执行下面的命令:
```bash
sudo apt-get install sqlite3 libsqlite3-dev pkg-config
```
然后执行下面的命令:
```bash
sqlite3 -version
```
:heavy_check_mark: 如果你看到了版本号,那你就可以继续下一步了 :+1:
:x: 如果没有,**问问老师吧**!
================================================
FILE: _partials/cn/ssh_agent.md
================================================
## 禁用SSH密码输入
每次跟远程的代码库交流的时候都问你要密码是件很烦的事。所以呀,你需要给`oh my zsh`加上一个`ssh-agent`插件:
首先,打开`.zshrc`文件:
```bash
code ~/.zshrc
```
然后:
- 找到`plugins=`开始的这一行
- 在插件(plugin)列表里加上`ssh-agent`
这个列表现在看起来应该是这样的:
```
plugins=(gitfast last-working-dir common-aliases zsh-syntax-highlighting history-substring-search pyenv ssh-agent)
```
:heavy_check_mark: 按下`Ctrl` + `S` 保存`.zshrc`文件,然后关掉你的代码编辑器。
================================================
FILE: _partials/cn/ubuntu_postgresql.md
================================================
## PostgreSQL
有的时候,SQLite功能会不够用。这个时候我们就需要使用一个更高级的工具,叫做[PostgreSQL](https://www.postgresql.org/)。这是一个开源的、强大的、生产环境可用的数据库系统。
让我们现在一起安装它。
运行下方指令:
```bash
sudo apt install -y postgresql postgresql-contrib libpq-dev build-essential
```
```bash
sudo -u postgres psql --command "CREATE ROLE \"`whoami`\" LOGIN createdb superuser;"
```
================================================
FILE: _partials/cn/ubuntu_settings.md
================================================
## Ubuntu settings
### Install video codec H264
On our pedagogical platform (Kitt, you'll soon discover it!), we have some videos. By default Firefox on Linux cannot play them as they use an unsupported codec (H264). To get those videos working for you, you need to run this:
```bash
sudo apt install libavcodec-extra -y
```
### Install useful terminal tools
`tree` is a nice tool to visualize a directory tree inside the terminal:
`ncdu` is a text-based interface disk utility.
`htop` is an interactive process viewer.
`tig` is a text-mode interface for `git`.
```bash
sudo apt install tree ncdu htop tig
```
### Ubuntu inotify
Ubuntu is always tracking changes in your folders and to do this it uses inotify.
By default the Ubuntu limit is set to 8192 files monitored.
As programming involves a lot of files, we need to raise this limit.
In your terminal run:
```bash
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
```
### Pin apps to your dock
You are going to use most of the apps you've installed today really often. So let's pin them to your dock so that they are just one click away!
To pin an app to your dock, launch the app, right-click on the icon in the dock to bring up the context menu and choose "Add to Favorites".

You must pin:
- Your terminal
- Your file explorer
- VS Code
- Your Internet browser
- Slack
================================================
FILE: _partials/cn/ubuntu_slack.md
================================================
## Slack
[Install Slack for Linux (beta)](https://get.slack.help/hc/en-us/articles/212924728-Slack-for-Linux-beta-).
Launch the app and sign in to `lewagon-alumni` organization.
Make sure you upload a picture there.
You can also sign in to Slack on your iPhone or Android device!
The idea is that you'll have Slack open all day, so that you can share useful links / ask for help / decide where to go to lunch / etc.
In case of remote tickets, you will use Slack audio or video call to get help. To ensure that everything is working fine, launch the Slack app on your computer, then [follow this procedure](https://slack.com/intl/en-gb/help/articles/115003538426-Troubleshoot-Slack-Calls#run-our-calls-test) (tl;dr type `/call --test` then the `Enter` key in any channel).
After the test are finished, you should have green "All clear" messages at least for your microphone and camera. If not, ask a teacher.

================================================
FILE: _partials/cn/ubuntu_vscode.md
================================================
## Visual Studio Code
### 安装
让我们一起安装[Visual Studio Code](https://code.visualstudio.com)代码编辑器。
复制(`Ctrl` + `C`)下面的指令,并粘贴(`Ctrl` + `Shift` + `v`)到终端里:
```bash
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
rm -f packages.microsoft.gpg
sudo apt update
sudo apt install -y code
```
这些命令需要你输入密码的时候,请输入!
:warning: 你输入密码的时候,屏幕上不会显示你在输入任何东西,**这是正常的**。这是一个安全措施,保证别人不会看到你的密码内容以及长度。所以输入完成后,敲击回车键(`Enter`)即可。
### 用终端打开VS Code(Visual Studio Code)
现在我们来**从终端**打开VS Code吧:
```bash
code
```
:heavy_check_mark: 如果VS Code窗口打开了,就没什么问题,进入下一步吧 :+1:
:x: 如果没有的话,**请向老师求助**。
================================================
FILE: _partials/cn/vscode_extensions.md
================================================
## VS Code 插件
### 安装
现在我们来给 VS Code 安装一些有用的插件吧。
复制粘贴下面的命令到终端:
```bash
code --install-extension ms-vscode.sublime-keybindings
code --install-extension emmanuelbeziat.vscode-great-icons
code --install-extension MS-vsliveshare.vsliveshare
code --install-extension shopify.ruby-lsp
code --install-extension dbaeumer.vscode-eslint
code --install-extension Rubymaniac.vscode-paste-and-indent
code --install-extension alexcvzz.vscode-sqlite
code --install-extension anteprimorac.html-end-tag-labels
code --install-extension marcoroth.herb-lsp
code --install-extension rayhanw.erb-helpers
```
你安装的就是下面这些插件:
- [Sublime Text Keymap and Settings Importer](https://marketplace.visualstudio.com/items?itemName=ms-vscode.sublime-keybindings)
- [VSCode Great Icons](https://marketplace.visualstudio.com/items?itemName=emmanuelbeziat.vscode-great-icons)
- [Live Share](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare)
- [Ruby](https://marketplace.visualstudio.com/items?itemName=shopify.ruby-lsp)
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [Paste and Indent](https://marketplace.visualstudio.com/items?itemName=Rubymaniac.vscode-paste-and-indent)
- [SQLite](https://marketplace.visualstudio.com/items?itemName=alexcvzz.vscode-sqlite)
================================================
FILE: _partials/cn/vscode_liveshare.md
================================================
================================================
FILE: _partials/cn/windows_browser.md
================================================
## 把你的默认浏览器链接到Ubuntu
为了保证你可以在Ubuntu终端和浏览器进行交互,你需要设置你的默认浏览器。
⚠️ 你需要执行下面的至少一组命令:
用Google Chrome作为默认浏览器
运行下面的命令:
```bash
ls /mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe
```
如果你看到了错误信息,比如`ls: cannot access...` 那就运行下面的命令:
```bash
echo "export BROWSER=\"/mnt/c/Program Files/Google/Chrome/Application/chrome.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files/Google/Chrome/Application/chrome.exe'\"" >> ~/.zshrc
```
如果没有错误信息,就运行下面这一行:
```bash
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe'\"" >> ~/.zshrc
```
用Mozilla Firefox作为默认浏览器
运行下面的命令:
```bash
ls /mnt/c/Program\ Files\ \(x86\)/Mozilla\ Firefox/firefox.exe
```
如果你看到了错误信息,比如`ls: cannot access...` 那就运行下面的命令:
```bash
echo "export BROWSER=\"/mnt/c/Program Files/Mozilla Firefox/firefox.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files/Mozilla Firefox/firefox.exe'\"" >> ~/.zshrc
```
如果没有错误信息,就运行下面这一行:
```bash
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Mozilla Firefox/firefox.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Mozilla Firefox/firefox.exe'\"" >> ~/.zshrc
```
用Microsoft Edge作为默认浏览器
运行下面的命令:
```bash
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe'\"" >> ~/.zshrc
```
重启你的终端。
然后请保证在终端运行下面这行命令后,会返回"Browser defined 👌"这句话:
```bash
[ -z "$BROWSER" ] && echo "ERROR: please define a BROWSER environment variable ⚠️" || echo "Browser defined 👌"
```
如果没有返回这句话,那在上面的列表中选一个浏览器,然后运行对应的命令。
如果没有的话,
:heavy_check_mark: 如果你看到那条信息,你就可以继续 :+1:
:x: 如果没有,那在上面的列表中选一个浏览器,然后运行对应的命令。然后别忘记重置你的终端:
```bash
exec zsh
```
有问题的话,别犹豫**问老师**。
================================================
FILE: _partials/cn/windows_postgresql.md
================================================
## PostgreSQL
有的时候,SQLite功能会不够用。这个时候我们就需要使用一个更高级的工具,叫做[PostgreSQL](https://www.postgresql.org/)。这是一个开源的、强大的、生产环境可用的数据库系统。
让我们现在安装它。
运行下方指令:
```bash
sudo apt install -y postgresql postgresql-contrib libpq-dev build-essential
```
```bash
sudo /etc/init.d/postgresql start
```
```bash
sudo -u postgres psql --command "CREATE ROLE \"`whoami`\" LOGIN createdb superuser;"
```
你可以把PostgreSQL配置成自动启动,这样每次你打开新的终端时,你就不需要执行`sudo /etc/init.d/postgresql start`:
```bash
sudo echo "`whoami` ALL=NOPASSWD:/etc/init.d/postgresql start" | sudo tee /etc/sudoers.d/postgresql
```
```bash
sudo chmod 440 /etc/sudoers.d/postgresql
```
```bash
echo "sudo /etc/init.d/postgresql start" >> ~/.zshrc
```
打开一个新的终端。
:heavy_check_mark: 如果你看到一行字说`* Starting postgresql (via systemctl): postgresql.service`还是`* Starting PostgreSQL 14 database server`,那你就可以进行下一步了 :+1:
:x: 如果没有的话, **请让老师来帮助你**。
================================================
FILE: _partials/cn/windows_settings.md
================================================
## Ubuntu文件系统
### 在Windows和Ubuntu之间交换文件
我们需要一个简单的方法在Windows和Ubuntu之间交换文件。
想这样的话,你需要建一些可以从Windows的**File Explorer**访问Ubuntu文件目录的快捷键。

你需要做下面这些步骤:
- 打开Ubuntu终端
- 打开Windows File Explorer (或者使用快捷键Win + E)
- 在地址栏,输入`\\wsl$\`(如果不行的话,就输入`\\wsl$\Ubuntu`)
- 现在你就有Ubuntu文件系统的访问权限了
- 看一下Ubuntu的文件系统,看看有哪些目录是你会想用的
- 拖拽想要的文件夹到地址栏,就可以创建快捷键了

### 从Ubuntu终端打开Windows File Explorer
另一个交换文件的方法是从Ubuntu终端打开Windows**File Explorer**。
你需要做下面这些步骤:
- 打开Ubuntu终端
- 进入你想看的目录
- 运行`explorer.exe .`命令(或者,使用`wslview .`)
- 如果你看到一条输入输出的报错,那就在Windows PowerShell运行`wsl --shutdown`然后再重新打开Ubuntu终端

### 在Ubuntu文件系统里找到方向
你可能想搞清楚Ubuntu文件系统里的Windows目录到底在哪儿。或者Windows文件系统里的Ubuntu目录在哪儿。
要把一个Windows路径变成Ubuntu路径(或者反过来),你需要做:
- 打开Ubuntu终端
- 使用`wslpath "C:\Program Files"`命令来把Windows路径变成Ubuntu路径
- 使用`wslpath -w "/home"`命令来把Ubuntu路径变成Windows路径
- 还有,`wslpath -w $(pwd)`命令会返回当前Ubuntu路径的Windows路径

================================================
FILE: _partials/cn/windows_slack.md
================================================
## Slack
从[slack.com](https://slack.com/downloads/windows)上下载Slack的本地应用。
启动程序并注册进入`lewagon-alumni`的组织。
确保你在上面上传了照片。
你也可以在你的iPhone或者Android设备上登录Slack!
这么做的意义是,你可以一直开着Slack,于是你就可以分享有用的链接/寻求帮助/决定哪儿里吃饭/等等。
至于远程的ticket,你将可以用Slack语音或者视频电话来获取帮助。为了确保所有都可以正常工作,在你的电脑上启动Slack应用程序,然后[跟着这里的步骤](https://slack.com/intl/en-gb/help/articles/115003538426-Troubleshoot-Slack-Calls#run-our-calls-test)(tl;dr 输入`/call --test`然后在任何的channel里按下`Enter`键)。
等测试结束之后,你应该至少会在麦克风和相机处,看到绿色“All clear”消息。如果没有的话,问一下你的老师。

================================================
FILE: _partials/cn/windows_terminal.md
================================================
## Windows终端
### 安装
:information_source: 接下来的步骤是要看你的Windows系统版本的。
如果你是Windows 11,那么你的Windows终端已经装好了。直接进入下一步吧:point_down:
如果你是Windows 10,那我们来装Windows终端吧,一个真正的现代终端:
- 点击`Start`
- 输入`Microsoft Store`
- 点击列表上的``Mircosoft Store`
- 搜索`Windows Terminal`
- **选择Windows Terminal"**
- 点击`安装`
:warning: 不要安装**Windows Terminal Preview**,安装**Windows Terminal**就好了!
卸载错误版本的Windows Terminal
要下载错误版本的Windows Terminal的话,你需要去到Windows 10的已装软件列表:
- 按下`Windows` + `R`
- 输入`ms-settings:appsfeatures`
- 按下`Enter`
找到需要卸载的软件,然后点击卸载(uninstall)按钮。
当安装完成之后,`安装(Install)` 按钮就会变成`启动(Launch)`按钮:点击这个按钮吧!
### Ubuntu作为默认终端
让我们把Ubuntu变成Windows终端应用的默认终端吧!
点击`Ctrl` + `,`
它会打开设置:

- 把默认的profile改成"Ubuntu"
- 点击"Save"
- 点击"Open JSON file"
你需要改动的是被红色圈起来的部分:

首先,我们要让Ubuntu从Ubuntu主目录启动,而不是Windows的主目录:
- 找到`"name": "Ubuntu",`
- 把下面这行加在后面:
```bash
"commandline": "wsl.exe ~",
```
:warning: 别忘了这行最后有个逗号哟!
然后,我们把Windows和Ubuntu之间复制粘贴的警告禁用了吧:
- 找到`"defaultProfile": "{2c4de342-...}"`这行
- 在它后面加上这行:
```bash
"warning.multiLinePaste": false,
```
:warning: 别忘了这行最后有个逗号哟!
现在按这两个键`Ctrl` + `S`保存一下。
:heavy_check_mark: 好咯, 你的**Windows终端**就设置好了!:+1:
这个终端有标签页的功能:你可以通过点击当前标签页旁边的**+**来打开一个新的标签页。
**从现在开始,每次我们说终端的时候,就是在指这个终端。**不用使用其他的terminal了。
================================================
FILE: _partials/cn/windows_ubuntu.md
================================================
## Ubuntu
### 安装
:information_source: 接下来的步骤是要看你的Windows系统版本的。请执行你的版本对应的步骤:point_down:
#### Windows 11
如果你是Windows 11,那重启你的电脑后,你就应该能看到一个终端窗口告诉你说WSL正在恢复Ubuntu的安装过程。结束后,Ubuntu就会打开。
#### Windows 10
如果你是Windows 10,那我们在Microsoft商店安装Ubuntu吧:
- 点击`Start`
- 输入`Microsoft Store`
- 点击列表中的微软的Windows商店
- 在搜索栏里搜索`Ubuntu`
- **选择没有数字的版本,就只是一个单词"Ubuntu"**
- 点击`安装`
:warning: 不要安装**Ubuntu 18.04 LTS**或者**Ubuntu 20.04**!
卸载不正确版本的Ubuntu
要卸载不正确的版本,你只需要打开Windows 10的已安装软件的列表:
- 按下`Windows` + `R`
- 输入`ms-settings:appsfeatures`
- 按下`Enter`
找到那个软件,然后点击卸载按钮。
旦安装完成了,`安装`按钮就会变成`启动`按钮:点击`启动`。
### 第一次启动
第一次启动的时候,你会需要填写一些信息:
- 选择一个**用户名**:
- 一个词
- 全小写
- 不要特殊字符
- 举个例子: `lewagon`或者你的`firstname`
- 选择一个**密码**
- 确认你的密码
:warning: 你输入密码的时候,屏幕上不会显示你在输入任何东西,**这是正常的**。这是一个安全措施,保证别人不会看到你的密码内容以及长度。所以输入完成后,敲击回车键(`Enter`)即可。
现在安装好了,你就可以关掉Ubuntu窗口了。
### 检查Ubuntu的WSL version
- 按下`Windows` + `R`
- 输入`cmd`
- 按下`Enter`
输入下面的命令:
```bash
wsl -l -v
```
:heavy_check_mark: 如果Ubuntu WSL版本是2,你就可以进入下一步了:+1:
:x: 如果Ubuntu WSL的版本是1,你需要把它换成2。
把Ubuntu WSL V1换成V2
在命令提示字元窗口,输入:
```bash
wsl --set-version Ubuntu 2
```
:heavy_check_mark: 几秒之后,你应该会收到这条转换完成的信息:`The conversion is complete`.
:x: 如果不行的话,我们就需要检查并确保Ubuntu文件没有被压缩。
检查没有被压缩的文件
- 按下`Windows` + `R`
- 输入`%localappdata%\Packages`
- 按下`Enter`
- 打开这个文件夹`CanonicalGroupLimited.UbuntuonWindows...`
- 右击`LocalState`文件夹
- 点击`Properties`(属性)
- 点击`Advanced`(高级)
- 确保`Compress content`(压缩内容)选项**没有**被选,然后点击`Ok`。
只对这个文件夹应用修改,然后再试试换Ubuntu WSL的版本。
:x: 如果转换还是不行,**叫老师来帮忙**。
你现在可以关掉这个终端窗口了。
================================================
FILE: _partials/cn/windows_version.md
================================================
## 开始设置的条件
在开始之前,很重要的一件事是先看看你的电脑设置有没有满足这些条件!这样才能保证配置成功。请花点时间仔细阅读所有的文字。如果有问题,不要犹豫向老师提问哦。
### Windows 10 或者 Windows 11
你的电脑必须是 **Windows 10 或者 Windows 11**才可以开始配置。
检查windows版本的方式:
- 按下 `Windows` + `R`
- 输入 `winver`
- 按下 `Enter`
:heavy_check_mark: 如果窗口里的前几个词就是**Windows 10 或者 Windows 11**的话,你可以直接到下一步了!:+1:
:x: 如果你的电脑没有提示**Windows 10 或者 Windows 11**,那你现在就需要更新到Windows 10:point_down:
更新到Windows 10
- 从[Microsoft](https://www.microsoft.com/software-download/windows10ISO)下载Windows 10
- 下载后就可以安装它。应该会花掉差不多1小时的时间,这取决于你的电脑。
- 安装结束后,运行上面的命令:point_up:来检查你有没有**Windows 10**。
:information_source: [Windows 11更新正在滚动](https://www.microsoft.com/en-us/windows/get-windows-11),意思就是有些电脑可能还不能更新到11。
:warning: **如果Windows 10已经装好了,你不需要更新到11来继续配置**。
### 最近的更新
确认好你的电脑是Windows 10或者11之后,你就可以安装最近的更新了。
打开Windows更新:
- 按下 `Windows` + `R`
- 输入 `ms-settings:windowsupdate`
- 按下 `Enter`
- 点击 `检查更新`(`Check updates`)
:heavy_check_mark: 如果你看到一个绿色的勾勾,然后还有一条“You're up to date(已经是最新版本)”的信息,那你就可以继续下一步了:+1:
:warning: 如果你看到一个红色的感叹号,然后还有一条“Update available(有可更新版本)”,那就请安装它,然后重复以上步骤直到电脑提示你所有的东西都是最新版本:loop:
:x: 如果出现关于无法更新的错误提示,**叫老师**来看看。
启用Windows Update Service(Windows更新服务)来修复更新
有些软件可能会禁用我们想用的更新服务。所以更新的时候你的电脑就会报错。可以这样修复它!(如果你的电脑系统语言是中文,你可以找到下面英文按键的对应中文按键。如果找不到,可以问问老师!)
- 按下 `Windows` + `R`
- 输入 `services.msc`
- 按下 `Enter`
- 双击 `Windows Update Service`
- 把它从 `Startup` 改成 `Automatic`
- 点击 `Start`
- 点击 `Ok`
现在,我们再来试试更新吧!
### 最低版本需求
有些我们需要的工具已经在Windows 10的`1903`或**之后**的版本中发布了。所以请保证你最少要这个版本!
- 按下 `Windows` + `R`
- 输入 `winver`
- 按下 `Enter`
检查**版本号**:
:heavy_check_mark: 如果你是`1903`或以上的版本, 你就可以继续下一步了:+1:
:x: 如果低于`1903`, 请**问老师**。
================================================
FILE: _partials/cn/windows_virtualization.md
================================================
### 虚拟化
我们需要保证你电脑的虚拟化选项是激活的。
对于大多数电脑来说,这个选项已经被激活了。不过还是检查一下吧:
- 按下 `Windows` + `R`
- 输入 `taskmgr`
- 按下 `Enter`
>
>
- 点击 `Performance`
- 点击 `CPU`

:x: 如果这一行没有出现,或者显示禁用了,请**让老师来帮你激活虚拟化**。
:heavy_check_mark: 如果被激活了的话,那在图表下方会显示状态 "Virtualization: Enabled"。
---
#### :wrench: 可能的解决方案
激活虚拟化
要激活它,我们需要访问电脑的 BIOS / UEFI。
- 按下 `Windows + R`
- 输入 `shutdown.exe /r /o /t 1`
- 按下 `Enter`
>
>
- 等待电脑关机
>
>
- 点击 `Troubleshoot`
- 点击 `Advanced Options`
- 点击 `UEFI Firmware Settings`
- 点击 `Restart`
在这儿,你需要激活你处理器的虚拟化选项:
- 大多数时候,在高级设置里面,CPU设置,或者北桥(Northbridge)设置里面
- 电脑不一样,选项的名称可能也不一样:
- 因特尔(Intel): `Intel VT-x`, `Intel Virtualization Technology`, `Virtualization Extensions`, `Vanderpool`...
- AMD: `SVM Mode` 或者 `AMD-V`
- 在激活后请保存,然后重启电脑
---
================================================
FILE: _partials/cn/windows_vscode.md
================================================
## Visual Studio Code
在Windows上,我们会用Visual Code Studio来编辑代码,因为它和Ubuntu终端配合得很好~
想让它们一体化的话,你需要卸载其他的代码编辑器,比如SublimeText,因为它们会干扰VSCoed和WSL的一体化。
### 安装
- 打开[Visual Studio Code page](https://code.visualstudio.com/download)
- 选择Windows版本的VS Code
然后,就会开始自动下载了。
- 打开你刚下载的文件。
- 安装它的时候需要改变一下选项:
- 把VS Code注册成一个支持文件类型的编辑器
- 其他选项不用变

### 链接VS Code和Ubuntu
- 首次启动VS Code之后:
- 把它加在你的任务栏上;你会经常用到它!
- 在VS Code的右下角,应该有一个框框提示你它检测到了WSL
- 接受VS Code WSL插件的安装
:warning: 要用VS Code,这个插件必须要安装!
================================================
FILE: _partials/cn/windows_wsl.md
================================================
## Windows的Linux子系统
WSL是一个用来运行Ubuntu的开发环境。你可以在[这儿](https://docs.microsoft.com/en-us/windows/wsl/faq)了解更多关于WSL的信息。
:information_source: 接下来的步骤是要看你的Windows系统版本的。请执行你对应系统版本的步骤哦:point_down:
### Windows 11
如果你是Windows 11,我们就在Windows终端用一个命令来安装WSL 2和Ubuntu。
:warning: 在下面的步骤中,请使用 `Ctrl` + `Shift` + `Enter`来用管理员权限执行**Windows终端**,而不是只点击 `Ok`或者敲击`Enter`。
- 按下 `Windows` + `R`
- 输入 `powershell`
- 按下 **`Ctrl` + `Shift` + `Enter`**
:warning: 在这一步,你可能需要确认UAC权限升级。
一个蓝色的终端窗口会出现:
- 复制下面的命令(`Ctrl` + `C`)
- 单击右键把它们复制到PowerShell窗口(`Ctrl` + `V` 不能再这里使用)
- 按下`Enter`执行这些命令
```powershell
wsl --install
```
:heavy_check_mark: 如果这个命令执行好后没有任何错误,那就重启电脑然后继续下面步骤:+1:
:x: 如果你看到了错误信息(或者你在窗口里看到红色的字),请**叫老师来帮忙**。
### Windows 10
#### 安装WSL 1
如果你是Windows 10,你首先要用PowerShell终端来安装WSL 1。
:warning: 在下面的步骤中,请使用 `Ctrl` + `Shift` + `Enter`来用管理员权限执行**Windows终端**,而不是只点击 `Ok`或者敲击`Enter`。
- 按下 `Windows` + `R`
- 输入 `powershell`
- 按下 **`Ctrl` + `Shift` + `Enter`**
:warning: 在这一步,你可能需要确认UAC权限升级。
一个蓝色的终端窗口会出现:
- 复制下面的命令(`Ctrl` + `C`)
- 单击右键把它们复制到PowerShell窗口(`Ctrl` + `V` 不能再这里使用)
- 按下`Enter`执行这些命令
```powershell
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
```
```powershell
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
```
```powershell
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
```
:heavy_check_mark: 如果这个命令执行好后没有任何错误,那就重启电脑然后继续下面步骤:+1:
:x: 如果你看到了错误信息(或者你在窗口里看到红色的字),请**叫老师来帮忙**。
#### 升级到WSL 2
如果你是Windows 10,你需要把WSL升级到2。
等你的电脑重启好,你就可以下载WSL2安装包。
- 打开[下载页面](https://aka.ms/wsl2kernel)
- 下载安装包"WSL2 Linux kernel update package"
- 点击`Next`(下一步)
- 点击`Finish`(完成)

:heavy_check_mark: 如果没有错误提示的话,那你现在就可以使用WSL 2了!
:x: 如果出现了这个错误:`This update only applies to machines with the Windows Subsystem for Linux`, 那就在软件上**右击**,然后选择`uninstall`(卸载); 然后你再安装一次,这次应该可以正常地安装。
#### 把WSL 2设置成Windows默认的Linux子系统
如果你用的是Windows 10的话,我们就需要把WSL默认版本设成2。
现在WSL 2已经安装好了,那就把它设置成默认的WSL吧:
- 按下 `Windows` + `R`
- 输入 `cmd`
- 按下 `Enter`
在弹出的窗口里面,输入:
```bash
wsl --set-default-version 2
```
:heavy_check_mark: 如果你看到“The operation completed successfully(成功完成设置)”,那你就可以关掉这个终端,然后继续跟着下面的指示:+1:
:x: 如果出现了关于虚拟化的信息,请**叫老师来帮忙**。
激活Windows虚拟机平台功能
完成[这些](https://www.configserverfirewall.com/windows-10/please-enable-the-virtual-machine-platform-windows-feature-and-ensure-virtualization-is-enabled-in-the-bios/#:~:text=To%20enable%20WSL%202,%20Open,Windows%20feature%20on%20or%20off.&text=Ensure%20that%20the%20Virtual%20Machine,Windows%20will%20enable%20WSL%202)步骤,然后确保最后你激活了虚拟机平台和Windows的Linux子系统。
激活Windows的Hyper-V功能
完成[这些](https://winaero.com/enable-use-hyper-v-windows-10/)步骤,然后确保你激活了Hyper-V。
:information_source: 如果你的电脑是Windows 10 **Home edition**,那你的操作系统上就没有Hyper-V的功能。这不会妨碍什么,你继续下面的步骤就好:ok_hand:
================================================
FILE: _partials/cn/yarn.md
================================================
## yarn
让我们一起来安装[`yarn`](https://classic.yarnpkg.com/en/docs/install):
```bash
corepack enable
yarn set version stable
```
```bash
exec zsh
```
⚠️ 如果你看到任何错误信息,请尝试运行 `npm install -g corepack` 然后再次运行上面的命令。
重启终端并运行:
```bash
yarn -v
```
你应该会看到你yarn的版本。如果没有的话,问一下你的老师。
================================================
FILE: _partials/conclusion.md
================================================
## Setup completed!
Your computer is now all set for [Le Wagon AI Software Development course](https://www.lewagon.com/web-development-course/full-time) :muscle: :clap:
Enjoy the bootcamp, you will nail it :rocket:
================================================
FILE: _partials/dotfiles.md
================================================
## Dotfiles (Standard configuration)
Hackers love to refine and polish their shell and tools.
We'll start with a great default configuration provided by Le Wagon: [`lewagon/dotfiles`](https://github.com/lewagon/dotfiles).
As your configuration is personal, you need your **own** repository storing it. So you will **fork** Le Wagon repository.
Forking means that you will create a new repo in your own GitHub account `$GITHUB_USERNAME/dotfiles`, identical to the original Le Wagon one that you will be able to modify at will.
Open your terminal and set a variable for your GitHub username:
```bash
export GITHUB_USERNAME=`gh api user | jq -r '.login'`
```
```bash
echo $GITHUB_USERNAME
```
:heavy_check_mark: You should see your GitHub username printed.
:x: If not, **stop here** and ask for help. There may be a problem with the previous step (`gh auth`).
:warning: Please note that this variable is only set for the time your terminal is open. If you close it before or during the next steps, you need to set it again with the two steps above!
Time to fork the repo and clone it on your computer:
```bash
mkdir -p ~/code/$GITHUB_USERNAME && cd $_
```
```bash
gh repo fork lewagon/dotfiles --clone
```
### Dotfiles installer
Run the `dotfiles` installer:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles
```
```bash
zsh install.sh
```
Check the emails registered with your GitHub Account. You'll need to pick one at the next step:
```bash
gh api user/emails | jq -r '.[].email'
```
:heavy_check_mark: If you see the list of your registered emails, you can proceed :+1:
:x: If not, please [reauthenticate to GitHub](https://github.com/lewagon/setup/blob/master/#github-cli) before running this command :point_up: again.
### git installer
Run the `git` installer:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh
```
:point_up: This will **prompt** you for your name (`FirstName LastName`) and your email.
:warning: You **need** to put one of the emails listed above thanks to the previous `gh api ...` command. If you don't do that, Kitt won't be able to track your progress. 💡 Select the `@users.noreply.github.com` address if you don't want your email to appear in public repositories you may contribute to.
Please now **reset** your terminal by running:
```bash
exec zsh
```
================================================
FILE: _partials/es/checkup.md
================================================
## Chequeo
Verifiquemos si has instalado todo bien.
Ejecuta el siguiente comando en tu terminal:
```bash
exec zsh
```
Luego ejecuta lo siguiente:
```bash
curl -Ls https://raw.githubusercontent.com/lewagon/setup/master/check.rb > _.rb && ruby _.rb && rm _.rb || rm _.rb
```
:heavy_check_mark: Si obtienes un mensaje verde diciendo `Awesome! Your computer is now ready!`, significa que tu computadora está lista y que todo está bien :+1:
:x: De lo contrario, **habla con tu profesor**.
================================================
FILE: _partials/es/cli_tools.md
================================================
## Herramientas de línea de comando
### Comprueba la configuración regional (locale)
La "locale" es un mecanismo que permite adaptar los programas a su idioma y país.
Comprobemos que la configuración regional por defecto es el inglés:
```bash
locale
```
Si la salida no contiene `LANG=en_US.UTF-8`, ejecute el siguiente comando en un Ubuntu terminal para instalar la locale inglesa:
```bash
sudo locale-gen en_US.UTF-8
```
Si después, recibes una advertencia (`bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf-8)`) en tu terminal, por favor haz lo siguiente:
Generar la configuración regional<>/summary>
Por favor, ejecuta estas líneas en tu terminal.
```bash
sudo update-locale LANG=en_US.UTF8
sudo apt-get update
sudo apt-get install language-pack-en language-pack-en-base manpages
```
### Zsh & Git
En lugar de usar el `bash` [shell](https://en.wikipedia.org/wiki/Shell_(computing)) predeterminado, usaremos `zsh`.
También utilizaremos [`git`](https://git-scm.com/), un programa de línea de comando para control de versiones.
Vamos a instalarlos, junto con otros programas útiles:
- Abre una **terminal de Ubuntu**
- Copia y pega los siguientes comandos:
```bash
sudo apt update
```
```bash
sudo apt install -y curl git imagemagick jq unzip vim zsh
```
Estos comandos te pedirán tu contraseña: escríbela.
:warning: Cuando escribas tu contraseña no verás nada en la pantalla. **Esto es normal**. Es una herramienta de seguridad para ocultar tanto el contenido de tu contraseña como su longitud. Simplemente escribe tu contraseña y presiona `Enter` al terminar.
### Instalación de la CLI de GitHub
Instalemos la [CLI oficial de GitHub](https://cli.github.com) (Interfaz de Línea de Comando). Es un programa que se usa para interactuar con tu cuenta GitHub por medio de la línea de comando.
En tu terminal, copia y pega los siguientes comandos y escribe tu contraseña si te la piden:
```bash
sudo apt remove -y gitsome # gh command can conflict with gitsome if already installed
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install -y gh
```
Ejecuta el comando que te mostramos a continuación para verificar que `gh` se haya instalado correctamente en tu máquina:
```bash
gh --version
```
:heavy_check_mark: Si ves esta versión `gh version X.Y.Z (YYYY-MM-DD)`, puedes continuar trabajando :+1:
:x: Si no es el caso, por favor **contacta a un profesor**
================================================
FILE: _partials/es/conclusion.md
================================================
## ¡Fin de la configuración!
Tu computadora está lista para el [curso de AI Software Development de Le Wagon](https://www.lewagon.com/web-development-course/full-time) :muscle: :clap:
Disfrútalo, sabemos que te va a ir genial :rocket:
================================================
FILE: _partials/es/dotfiles.md
================================================
## Dotfiles (configuración estándar)
Los hackers aman mejorar sus shells y sus herramientas.
Comenzaremos con una configuración predeterminada proporcionada por Le Wagon: [`lewagon/dotfiles`](https://github.com/lewagon/dotfiles).
Tu configuración es personal, así que necesitas tu **propio** repositorio para almacenarla. Haz el **fork** del repositorio de Le Wagon.
Hacer un fork significa crear un nuevo repositorio en tu propia cuenta GitHub `$GITHUB_USERNAME/dotfiles` el cual es idéntico al original de Le Wagon y que podrás modificar como quieras.
Abre tu terminal y ejecuta los siguientes comandos:
```bash
export GITHUB_USERNAME=`gh api user | jq -r '.login'`
echo $GITHUB_USERNAME
```
:heavy_check_mark: Deberías ver tu usuario GitHub en la pantalla.
:x: Si no es el caso, **no des un paso más** y pide ayuda. Es posible que haya un problema con el paso anterior (`gh auth`).
Es hora de hacer el fork del repositorio y clonarlo en tu computadora:
```bash
mkdir -p ~/code/$GITHUB_USERNAME && cd $_
gh repo fork lewagon/dotfiles --clone
```
### Instalación de Dotfiles
Ejecuta el instalador de `dotfiles`:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles
zsh install.sh
```
Verifica los emails registrados en tu cuenta GitHub. Deberás seleccionar uno en el paso siguiente:
```bash
gh api user/emails | jq -r '.[].email'
```
:heavy_check_mark: Si ves una lista de tus emails registrados, puedes continuar :+1:
:x: De lo contrario, por favor haz la [autenticación en GitHub](https://github.com/lewagon/setup/blob/master/#github-cli) nuevamente antes de ejecutar este comando :point_up: again.
### Instalación de git
Ejecuta el instalador de `git`:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh
```
:point_up: Esto te **pedirá** tu nombre (`FirstName LastName`) y tu email. Cualquier correo que elijas se mostrará **públicamente** en internet. 💡 Selecciona la dirección `@users.noreply.github.com` si no quieres que tu correo electrónico aparezca en los repositorios públicos a los que puedas contribuir.
:warning: **Necesitas** poner uno de los emails que aparecen arriba gracias al comando anterior `gh api ...`. De lo contrario, Kitt no podrá hacerle seguimiento a tu progreso.
Ahora **resetea** tu terminal ejecutando lo siguiente:
```bash
exec zsh
```
================================================
FILE: _partials/es/gh_cli.md
================================================
## GitHub CLI
CLI es una abreviación de [Command-line Interface](https://en.wikipedia.org/wiki/Command-line_interface) que significa interfaz de línea de comando.
En esta sección usaremos [GitHub CLI](https://cli.github.com/) para interactuar directamente con GitHub desde la terminal.
Usaremos la GitHub CLI (`gh`) para conectarnos a GitHub utilizando *SSH*, un protocolo para iniciar la sesión utilizando claves SSH en lugar de la famosa pareja nombre de usuario y contraseña.
Ya debería haberse instalado en tu computadora con los comandos que ejecutaste anteriormente.
Lo primero que hay que hacer para **iniciar sesión** es copiar y pegar el comando siguiente en tu terminal:
:warning: **NO edites el `email`**
```bash
gh auth login -s 'user:email' -w --git-protocol ssh
```
`gh` le hará algunas preguntas:
- `Generate a new SSH key to add to your GitHub account?` Presiona `Enter` para pedirle a gh que genere las claves SSH por ti.
Si ya tienes claves SSH, verás en su lugar `Upload your SSH public key to your GitHub account?`Con las flechas, selecciona la ruta de tu archivo de clave pública y pulsa `Intro`.
- `Enter a passphrase for your new SSH key (Optional)`. Pon algo que quieras y que recuerdes. Es una contraseña para proteger tu private key que está almacenada en tu disco duro. Luego presiona `Enter`.
- `Title for your SSH key`. Puede dejarlo en la propuesta "GitHub CLI", presiona `Enter`.
Obtendrás el siguiente resultado:
```bash
! First copy your one-time code: 0EF9-D015
- Press Enter to open github.com in your browser...
```
Selecciona y copia el código (`0EF9-D015` en el ejemplo) y luego presiona `Enter`.
Tu navegador se abrirá y te pedirá que autorices GitHub CLI para usar tu cuenta GitHub. Acepta y espera un poco.
Regresa a la terminal, presiona `Enter` nuevamente y listo. Eso es todo.
Para verificar que están conectado correctamente, escribe lo siguiente:
```bash
gh auth status
```
:heavy_check_mark: Si obtienes este mensaje: `Logged in to github.com as `, significa que todo está bien :+1:
:x: De lo contrario, **contacta a un profesor**.
================================================
FILE: _partials/es/github.md
================================================
## Cuenta GitHub
¿Ya tienes una cuenta GitHub? Si no es el caso, [ábrela ya](https://github.com/join).
:point_right: **[Sube una foto](https://github.com/settings/profile)** y escribe tu nombre correctamente en tu cuenta GitHub. Esto es importante porque nosotros usaremos un tablero de comando interno con tu avatar. Por favor hazlo **ahora** antes de dar un paso más en esta guía.

:point_right: **[Habilita la Autenticación de Dos Factores (2FA)](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication#configuring-two-factor-authentication-using-text-messages)**. GitHub te enviará mensajes de texto con un código cuando intentes iniciar sesión. Esto es importante para la seguridad y también pronto será necesario para contribuir código en GitHub.
================================================
FILE: _partials/es/intro.md
================================================
# Instrucciones de la configuración
Aquí abajo encontrarás las instrucciones para la configuración que tu computadora necesita para el [curso de AI Software Development de Le Wagon](https://www.lewagon.com/web-development-course/full-time).
Por favor, **léelas cuidadosamente y ejecuta todos los comandos en el orden indicado**. Si tienes algún problema, no dudes en pedirle ayuda a tu profesor :raising_hand:
¡Comencemos! :rocket:
================================================
FILE: _partials/es/kitt.md
================================================
## Kitt
:warning: Si recibiste una invitación por email de Le Wagon para crear una cuenta en Kitt (nuestra plataforma de aprendizaje), ignora este paso y sigue las instrucciones en el email si es que todavía no lo has hecho.
Si no sabes que hacer, haz clic en [este enlace](https://kitt.lewagon.com/). Si ya iniciaste sesión, puedes omitir esta sección. Si no, haz clic en `Enter Kitt as a Student`. Esto significa iniciar sesión como estudiante. Si no tienes problemas para iniciar sesión, puedes omitir este paso. De lo contrario pídele a un profesor que te confirme si debiste haber recibido o si debes seguir las instrucciones de aquí abajo.
Registrate como alumni de Le Wagon yendo a [kitt.lewagon.com/onboarding](http://kitt.lewagon.com/onboarding). Selecciona tu batch, inicia sesión con GitHub y completa toda la información que te piden.
Ahora tu profesor podrá validar que realmente eres parte del batch. Pídele que lo haga justo después de que hayas completado el formulario de registro.
Cuando el profesor haya aprobado tu perfil, ve a la bandeja de entrada de tu email. Deberías tener 2 nuevos emails:
- Uno de Slack, invitándote a la comunidad de los alumni de Le Wagon en slack (donde podrás chatear con tus compañeros y todos los demás alumni). Haz clic en **Join** y completa la información que te piden.
- Otro de GitHub, invitándote a `lewagon` team. **Acéptala**, de lo contrario no podrás acceder a las diapositivas de las clases.
================================================
FILE: _partials/es/macos_apple_silicon.md
================================================
## Chips de Apple Silicon
Si compraste tu computadora a finales del 2020, es posible que tenga un nuevo chip llamado Apple silicon en lugar de un procesador Intel: averigüémoslo.
Abre una nueva ventana de tu terminal desde Applications > Utilities o búscala con [Spotlight](https://support.apple.com/en-gb/HT204014):

Copia y pega el siguiente comando en la terminal y presiona `Enter` para ejecutarlo.
``` bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/setup/master/utils/macos_list_processor_type.sh)"
```
☝️ El resultado de ese comando debería indicarte si tu computadora tiene Apple Silicon.
Si tu computadora usa Apple Silicon, expande el párrafo de abajo y léelo. Si no es el caso, ignóralo.
👉 Configuración para Apple Silicon 👈
### Desinstalación de Homebrew
Debemos desinstalar homebrew en caso de que una versión nativa ya haya sido instalada.
Ejecuta este comando en la terminal:
``` bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
```
Si brew no fue instalado, obtendrás el mensaje `brew: command not found!`
### Configuración de la Terminal para Rosetta
Abre la aplicación Finder (o búscala con [Spotlight](https://support.apple.com/en-gb/HT204014)).
Ve a Applications > Utilities.
Duplica la app de la terminal (selecciónala y luego presiona `Cmd` + `C`, `Cmd` + `V`) y cámbiale el nombre a la copia por Terminal Rosetta.
Presiona `Cmd` + `I` en la aplicación Terminal Rosetta y luego selecciona la casilla "Open using Rosetta".
⚠️ De ahora en adelante durante el bootcamp cuando te pidan que abras una Terminal, abrirás la aplicación **Terminal Rosetta**.
================================================
FILE: _partials/es/macos_command_line_tools.md
================================================
## Cómo cerrar aplicaciones en una Mac correctamente
Hacer clic en círculo rojo en la esquina superior izquierda de la ventana de la aplicación en Mac **no la termina el proceso**, solo cierra una ventana activa. Hay dos alternativas para cerrar la aplicación _realmente_. Puedes presionar `Cmd + Q` cuando la misma está activa. La otra opción es ir a `APP_NAME` -> `Quit` en la barra del menú.

Durante esta configuración, se te pedirá **cerrar y abrir nuevamente** aplicaciones varias veces. Por favor asegúrate de hacerlo correctamente :pray:
## Herramientas de la Línea de Comando
Abre una nueva terminal, copia y pega el comando siguiente y presiona `Enter`:
```bash
xcode-select --install
```
Si obtienes el mensaje que te mostramos a continuación, puedes ignorar este paso e ir al siguiente.
```bash
# command line tools are already installed, use "Software Update" to install updates
```
Este mensaje significa que las herramientas de la línea de comando ya están instaladas y te pide que uses "Software Update" para instalar las actualizaciones. Si no recibes este mensaje, se abrirá una ventana preguntándote si quieres instalar algún programa: haz clic en "Install" y espera.

:heavy_check_mark: Si ves el mensaje "The software was installed", lo que significa que el programa se ha instalado, entonces todo está bien :+1:
:x: Si falla el comando `xcode-select --install` , intenta nuevamente: algunas veces los servidores de Apple se sobrecargan.
:x: Si ves el mensaje "Xcode is not currently available from the Software Update server", debes actualizar el catálogo de actualización de programas:
```bash
sudo softwareupdate --clear-catalog
```
Cuando termines eso, puedes intentar hacer la instalación nuevamente.
================================================
FILE: _partials/es/macos_homebrew.md
================================================
## Homebrew
[Homebrew](http://brew.sh/) es un gestionador de paquetes: es un programa que se usa para instalar otros programas desde la línea de comando. ¡Vamos a instalarlo!
Abre la terminal y ejecuta lo siguiente:
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```
Te pedirá que confirmes (presionando `Enter`) y también te pedirá la **contraseña de tu cuenta de usuario macOS** (la que usas para [iniciar sesión](https://support.apple.com/en-gb/HT202860) cuando reinicias tu Macbook).
:warning: Cuando escribas tu contraseña no verás nada en la pantalla. **Esto es normal**. Es una herramienta de seguridad para ocultar tanto el contenido de tu contraseña como su longitud. Simplemente escribe tu contraseña y presiona `Enter` al terminar.
:warning: Si ves esta advertencia :point_down:, ejecuta los dos comandos de la sección `Next steps` para añadir Homebrew a tu PATH:

```bash
# ⚠️ Only execute these commands if you saw this warning ☝
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
```
Si ya tienes Homebrew instalado, el sistema te lo dirá y puedes continuar.
Luego instala algunos programas útiles:
```bash
brew update
```
Si obtienes un error como este: `/usr/local must be writable`, ejecuta el código que te mostramos a continuación:
```bash
sudo chown -R $USER:admin /usr/local
brew update
```
Ejecuta el siguiente código en tu terminal (puedes copiar y pegar todas las líneas de código al mismo tiempo):
```bash
brew upgrade git || brew install git
brew upgrade gh || brew install gh
brew upgrade wget || brew install wget
brew upgrade imagemagick || brew install imagemagick
brew upgrade jq || brew install jq
brew upgrade openssl || brew install openssl
```
================================================
FILE: _partials/es/macos_postgresql.md
================================================
## PostgreSQL
A veces SQLite no es suficiente y necesitaremos una herramienta más avanzada llamada [PostgreSQL](https://www.postgresql.org/). Esta es un sistema para bases de datos de código abierto y listo para usar en producción.
Vamos a instalarlo ahora.
Ejecuta los siguientes comandos:
```bash
brew install postgresql@15 libpq
brew link --force libpq
```
```bash
brew services start postgresql@15
```
Cuando termines, verifica que funcione:
```bash
psql -d postgres
```
Deberías ver un nuevo mensaje como este :point_down:
```bash
psql (15.2)
Type "help" for help.
postgres=#
```
:heavy_check_mark: Si es asi, escribe `\q` y luego presiona `Enter` para cerrar el programa. Puede continuar :+1:
:x: Si no, **pídele ayuda a un profesor**
================================================
FILE: _partials/es/macos_rbenv.md
================================================
## rbenv
Instala [`rbenv`](https://github.com/sstephenson/rbenv), un programa para instalar y gestionar entornos `ruby`.
Primero debemos limpiar cualquier instalación previa de Ruby que tengas en tu computadora:
```bash
rvm implode && sudo rm -rf ~/.rvm
# If you got "zsh: command not found: rvm", carry on. It means `rvm` is not
# on your computer, that's what we want!
sudo rm -rf $HOME/.rbenv /usr/local/rbenv /opt/rbenv /usr/local/opt/rbenv
```
:warning: Este comando te puede pedir tu contraseña.
:warning: Cuando escribas tu contraseña no verás nada en la pantalla. **Esto es normal**. Es una herramienta de seguridad para ocultar tanto el contenido de tu contraseña como su longitud. Simplemente escribe tu contraseña y presiona `Enter` al terminar.
Ejecuta lo siguiente en tu terminal:
```bash
brew uninstall --force rbenv ruby-build
exec zsh
```
Luego ejecuta esto:
```bash
brew install rbenv libyaml
```
================================================
FILE: _partials/es/macos_settings.md
================================================
## Parámetros de macOS
### Seguridad
Es imperativo proteger tu sesión con una contraseña. Si todavía no es el caso, ve a ` > System Settings... > Users & Groups` y cambia la contraseña de tu computadora. Luego ve a ` > System Settings... > Lock Screen`. Configura el sistema para que pida la contraseña cada `5 seconds` después de regresar de la opción suspender y cuando se active el protector de pantalla.
También puedes ir a ` > System Settings... > Desktop & Dock` y hacer clic en el botón `Hot Corners...` abajo a la izquierda. Selecciona la opción donde al hacer clic en la esquina inferior derecha se active el protector de pantalla. De esa manera al dejar tu escritorio podrás bloquear tu pantalla rápidamente poniendo el cursor del ratón en la esquina inferior derecha. En 5 segundos tu Macbook se bloqueará y te pedirá la contraseña para volver a tu sesión.
### Teclado
A medida que te vayas convirtiendo en programador, entenderás que pierdes tiempo cuando quitas las manos del teclado para usar otra herramienta. Por esa razón es importante aprender a minimizar el uso del trackpad o del ratón. Aquí te mostramos algunos trucos para que lo hagas en macOS.
#### Velocidad del teclado
Ve a ` > System Settings... > Keyboard`. Coloca a `Key repeat rate` en la posición más rápida (a la derecha) y a `Delay until repeat` en la posición más corta (a la derecha).
#### macOS para hackers
[Lee este script](https://github.com/mathiasbynens/dotfiles/blob/master/.macos) y selecciona algunas cosas que creas que serán útiles para ti. Por ejemplo, puedes escribir lo siguiente en la terminal:
```bash
# Expanding the save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
# Save screenshots to the Desktop (or elsewhere)
defaults write com.apple.screencapture location "${HOME}/Desktop"
# etc..
```
### Anclaje de aplicaciones a tu dock
Usarás frecuentemente casi todas las aplicaciones que has instalado hoy. ¡Anclémoslas a tu dock para que estén a solo un clic de ti!
Para ello, inicia la aplicación. Haz clic derecho en el ícono de la barra de tareas para hacer que aparezca el menú contextual (también llamado emergente) y selecciona "Options" y después "Keep in Dock".

Ancla lo siguiente:
- Tu terminal
- Tu explorador de archivos
- VS Code
- Tu navegador de Internet
- Slack
================================================
FILE: _partials/es/macos_slack.md
================================================
## Slack
[Slack](https://slack.com/) es una plataforma de comunicación popular en la industria tech.
### Instalación
[Descarga la aplicación Slack](https://itunes.apple.com/fr/app/slack/id803453959?mt=12) e instálala.
:warning: Si ya estás usando Slack en tu navegador, por favor descarga e instala **la aplicación de escritorio** la cual tiene todas las funciones.
================================================
FILE: _partials/es/macos_sqlite.md
================================================
## SQLite
En algunas semanas hablaremos de bases de datos y de SQL. [SQLite](https://sqlite.org/index.html) es un sistema utilizado en bases de datos para ejecutar consultas SQL en bases de datos de un solo archivo. Vamos a instalarlo:
En un terminal, ejecuta los siguientes comandos:
```bash
brew install sqlite
```
A continuación, ejecuta el siguiente comando:
```bash
sqlite3 -version
```
:heavy_check_mark: Si ves una versión, puedes continuar :+1:
:x: Si no, **pídele ayuda a un profesor**
================================================
FILE: _partials/es/macos_terminal.md
================================================
## Tema de la Terminal en macOS
Abre una terminal. Haz clic en `Terminal > Preferences` y coloca el tema llamado "Pro" como perfil predeterminado.

En la pestaña "Ventana", configura también tu **Tamaño de la ventana** a Columnas: 200, Filas: 50
**Cierra y reinicia** tu terminal: ahora debería tener un fondo negro que no te cansa tanto la vista.
================================================
FILE: _partials/es/macos_vscode.md
================================================
## Visual Studio Code
### Instalación
Instala el editor de texto [Visual Studio Code](https://code.visualstudio.com).
Copia (presionando `Cmd` + `C`) el comando de aquí abajo y luego pégalo en tu terminal (con `Cmd` + `V`):
```bash
brew install --cask visual-studio-code
```
Luego abre VS Code ejecutando el siguiente comando en tu terminal:
```bash
code
```
:heavy_check_mark: Si se acaba de abrir una ventana de VS Code, todo está bien y puedes continuar :+1:
:x: De lo contrario, por favor **contacta a un profesor**.
================================================
FILE: _partials/es/nvm.md
================================================
## Node.js
[Node.js](https://nodejs.org/en/) es un JavaScript runtime para ejecutar código JavaScript en la terminal. Instálalo con [nvm](https://github.com/nvm-sh/nvm), aun gestionador de versiones para Node.js.
En una terminal, ejecuta estos comandos:
```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v/install.sh | zsh
exec zsh
```
Luego corre el siguiente comando:
```bash
nvm -v
```
Deberías ver una versión. Si no, pídele ayuda a tu profesor.
Ahora instala node:
```bash
nvm install
```
Cuando termine la instalación, corre lo siguiente:
```bash
node -v
```
Si ves `v`, the installation succeeded :heavy_check_mark: entonces ahora puedes ejecutar lo siguiente:
```bash
nvm cache clear
```
:x: De lo contrario, **contacta a un profesor**.
================================================
FILE: _partials/es/oh_my_zsh.md
================================================
## Oh-my-zsh
Instalemos el plugin `zsh` [Oh My Zsh](https://ohmyz.sh/).
Ejecuta este comando en la terminal:
```bash
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```
Si te preguntan "Do you want to change your default shell to zsh?", presiona `Y`
Cuando termines, tu terminal debería lucir así:

:heavy_check_mark: Si es el caso, puedes continuar :+1:
:x: Si no, por favor **pídele ayuda a un profesor**.
================================================
FILE: _partials/es/rbenv.md
================================================
## rbenv
Instala [`rbenv`](https://github.com/sstephenson/rbenv), un programa para instalar y gestionar entornos `ruby`.
Primero debemos limpiar cualquier instalación previa de Ruby que tengas en tu computadora:
```bash
rvm implode && sudo rm -rf ~/.rvm
# If you got "zsh: command not found: rvm", carry on.
# It means `rvm` is not on your computer, that's what we want!
rm -rf ~/.rbenv
```
Luego ejecuta lo siguiente en tu terminal:
```bash
sudo apt install -y build-essential tklib zlib1g-dev libssl-dev libffi-dev libxml2 libxml2-dev libxslt1-dev libreadline-dev libyaml-dev
```
```bash
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
```
```bash
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
exec zsh
```
================================================
FILE: _partials/es/ruby.md
================================================
## Ruby
### Instalación
Ahora estás listo para instalar la última versión de [ruby](https://www.ruby-lang.org/en/) y ponerla como la versión predeterminada.
Corre este comando, **tomará un tiempo (5-10 minutos)**
```bash
rbenv install
```
Cuando la instalación de ruby termine, corre este comando para decirle al sistema que use la versión por defecto.
```bash
rbenv global
```
**Reinicia** tu terminal y chequea tu versión Ruby:
```bash
exec zsh
```
Luego ejecuta esto:
```bash
ruby -v
```
:heavy_check_mark: Si ves algo que comience por `ruby `, entonces puedes continuar +1:
:x: Si no es el caso, **pídele ayuda a un profesor**.
### Instalación de algunas gemas
Si estás en China 🇨🇳 haga clic aquí
:warning: Si estás en China, deberías actualizar la forma de instalar las gemas con los siguientes comandos.
```bash
# China only!
gem sources --remove https://rubygems.org/
gem sources -a https://gems.ruby-china.com/
gem sources -l
# *** CURRENT SOURCES ***
# https://gems.ruby-china.com/
# Ruby-china.com must be in the list now
```
**Todos, todas, en China o no**, continúen aquí para instalar gemas.
En el universo de ruby, a las librerías externas se les llama `gems`: son pedazos de código ruby que puedes descargar y ejecutar en tu computadora. ¡Instalemos algunas!
Primero, vamos a actualizar `bundler`, que es lo que nos permite instalar gemas:
```bash
gem update bundler
```
En tu terminal, copia y pega el siguiente comando:
```bash
gem install
```
:heavy_check_mark: Si obtienes `xx gems installed`, entonces todo está bien :+1:
:x: Si obtienes el siguiente error:
```bash
ERROR: While executing gem ... (TypeError)
incompatible marshal file format (can't be read)
format version 4.8 required; 60.33 given
```
Ejecuta el siguiente comando:
```bash
rm -rf ~/.gemrc
```
Ejecuta el comando nuevamente para instalar las gemas.
:warning: ¡**NUNCA** instales una gema con `sudo gem install`! Incluso si encuentras una solución en Stackoverflow (o la terminal) diciéndote que lo hagas.
================================================
FILE: _partials/es/slack_settings.md
================================================
### Parámetros
Abre la aplicación e inicia sesión en `lewagon-alumni`.
Asegúrate de **subir una foto para tu perfil** :point_down:

La idea es tener Slack abierto todo el día para compartir enlaces útiles / pedir ayuda / decidir dónde almorzar / etc.
Para asegurarte de que todo lo relacionado a videollamadas funcione bien, prueba tu cámara y tu micrófono:
- Abre la aplicación Slack
- Haz clic en tu foto de perfil en la esquina superior derecha
- Selecciona "Preferencias" en el menú.
- Haz clic en "Audio y vídeo" en la columna de la izquierda.
- Debajo de "Solución de problemas", haz clic en "Ejecutar una prueba de audio, vídeo y pantalla compartida". La prueba se abrirá en una nueva ventana.
- Comprueba que tus dispositivos preferidos de altavoz, micrófono y cámara aparecen en los menús desplegables y haz clic en "Iniciar prueba"
- Haz clic en el botón verde "Start test"

:heavy_check_mark: Cuando termine el test deberías ver mensajes de "Succeed" en verde por lo menos para tu micrófono y tu cámara. :+1:
:x: Si no es el caso, **contacta a un profesor**.
¡También puedes instalar la aplicación Slack en tu smartphone e iniciar sesión en `lewagon-alumni`!
================================================
FILE: _partials/es/sqlite.md
================================================
## SQLite
En algunas semanas hablaremos de bases de datos y de SQL. [SQLite](https://sqlite.org/index.html) es un sistema utilizado en bases de datos para ejecutar consultas SQL en bases de datos de un solo archivo. Vamos a instalarlo:
En un terminal, ejecuta los siguientes comandos:
```bash
sudo apt-get install sqlite3 libsqlite3-dev pkg-config
```
A continuación, ejecuta el siguiente comando:
```bash
sqlite3 -version
```
:heavy_check_mark: Si ves una versión, puedes continuar :+1:
:x: Si no, **pídele ayuda a un profesor**
================================================
FILE: _partials/es/ssh_agent.md
================================================
## Desahilitación de la solicitud de SSH passphrase
No vas a querer que te pidan tu passphrase cada vez que te comuniques con un repositorio remoto. Por eso debes agregarle plugin `ssh-agent` a `oh my zsh`:
Primero abre el archivo `.zshrc`:
```bash
code ~/.zshrc
```
Luego:
- Identifica la línea que comienza por `plugins=`
- Agrega `ssh-agent` al final de la lista de plugins
La lista debería verse de la siguiente manera:
```bash
plugins=(gitfast last-working-dir common-aliases zsh-syntax-highlighting history-substring-search pyenv ssh-agent)
```
:heavy_check_mark: Guarda el archivo `.zshrc` con `Ctrl` + `S` y cierra tu editor de texto.
================================================
FILE: _partials/es/ubuntu_postgresql.md
================================================
## PostgreSQL
A veces SQLite no es suficiente y necesitaremos una herramienta más avanzada llamada [PostgreSQL](https://www.postgresql.org/). Esta es un sistema para bases de datos de código abierto y listo para usar en producción.
Instálalo ejecutando los siguientes comandos:
```bash
sudo apt install -y postgresql postgresql-contrib libpq-dev build-essential
```
```bash
sudo -u postgres psql --command "CREATE ROLE \"`whoami`\" LOGIN createdb superuser;"
```
================================================
FILE: _partials/es/ubuntu_settings.md
================================================
## Parámetros de Ubuntu
### Instala video codec H264
Tenemos algunos videos en nuestra plataforma pedagógica (Kitt. ¡La descubrirás pronto!). La configuración predeterminada de Firefox en Linux no permite reproducirlos ya que usan un codec (H264) que no está soportado. Para que funcionen los videos debes ejecutar lo siguiente:
```bash
sudo apt install libavcodec-extra -y
```
### Instalación de herramientas útiles de terminal
`tree` es buena para visualizar un árbol de directorio dentro de la terminal:
`ncdu` es para discos con interfaz en modo texto.
`htop` nos muestra procesos de forma interactiva.
`tig` es una interfaz en modo texto para `git`.
```bash
sudo apt install tree ncdu htop tig
```
### Ubuntu inotify
Ubuntu siempre le hace seguimiento a los cambios en tus carpetas para eso usa inotify.
El límite predeterminado de monitoreo de Ubuntu es 8192 archivos.
Necesitamos aumentar este límite ya que la programación requiere de muchos archivos.
Ejecuta lo siguiente en tu terminal:
```bash
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
```
### Anclaje de aplicaciones a tu dock
Usarás frecuentemente casi todas las aplicaciones que has instalado hoy. ¡Anclémoslas a tu dock para que estén a solo un clic de ti!
Para ello, abre la aplicación. Haz clic derecho en el ícono de la barra de tareas para hacer que aparezca el menú contextual (también llamado emergente). Selecciona "Options" y después "Keep in Dock".

Ancla lo siguiente:
- Tu terminal
- Tu explorador de archivos
- VS Code
- Tu navegador de Internet
- Slack
================================================
FILE: _partials/es/ubuntu_slack.md
================================================
## Slack
[Slack](https://slack.com/) es una plataforma de comunicación popular en la industria tech.
### Instalación
[Descarga la aplicación Slack](https://get.slack.help/hc/en-us/articles/212924728-Slack-for-Linux-beta-) e instálala.
:warning: Si ya estás usando Slack en tu navegador, por favor descarga e instala **la aplicación de escritorio** la cual tiene todas las funciones.
================================================
FILE: _partials/es/ubuntu_vscode.md
================================================
## Visual Studio Code
### Instalación
Instala el editor de texto [Visual Studio Code](https://code.visualstudio.com).
Copia (presionando `Cmd` + `C`) el comando de aquí abajo y luego pégalo en tu terminal (`Ctrl` + `Shift` + `v`):
```bash
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
rm -f packages.microsoft.gpg
sudo apt update
sudo apt install -y code
```
Escribe tu contraseña cuando estos comandos te la pidan.
:warning: Cuando escribas tu contraseña no verás nada en la pantalla. **Esto es normal**. Es una herramienta de seguridad para ocultar tanto el contenido de tu contraseña como su longitud. Simplemente escribe tu contraseña y presiona `Enter` al terminar.
### Abrir desde la terminal
Ahora abre VS Code desde **la terminal**:
```bash
code
```
:heavy_check_mark: Si se acaba de abrir una ventana de VS Code, entonces todo está bien :+1:
:x: Si no es el caso, por favor **pídele ayuda a un profesor**.
================================================
FILE: _partials/es/vscode_aifeatures.md
================================================
### Funciones de IA en VS Code
VS Code incluye muchas y potentes **funciones de IA**, que son una gran herramienta una vez que ya sabes programar.
Dicho esto, depender de la IA demasiado pronto puede ocultar conceptos importantes y dificultar la comprensión de la depuración. Una vez que estés cómodo con los fundamentos, sabrás cuándo y cómo usar la IA de forma eficaz —sin dejar que haga el trabajo por ti.
Para el inicio del bootcamp, desactivaremos estas funciones. Llegado el momento apropiado en el curso, las volveremos a habilitar para que puedas utilizarlas bien.
En **VS Code**:
1. Abramos la "Paleta de comandos" de VS Code: escribe `Ctrl-Shift-P` (Windows / Linux) o `Cmd-Shift-P` (macOS).
1. Se abrirá la Paleta de comandos: una pequeña caja de texto en la parte superior de la pantalla. Empieza a escribir `aifeatures` hasta que veas "Chat: Learn How to Hide AI features". Haz clic en ella.

1. Esto abrirá la configuración y te mostrará la opción "Disable and hide built-in AI features ...". Marca la casilla delante de esa opción.

Más adelante, si quieres **volver a habilitar** las funciones de IA, puedes seguir las mismas instrucciones para desmarcar la casilla.
================================================
FILE: _partials/es/vscode_extensions.md
================================================
## Extensiones de VS Code
### Instalación
Vamos a instalar algunas extensiones útiles de VS Code.
Copia y pega los siguientes comandos en tu terminal:
```bash
code --install-extension ms-vscode.sublime-keybindings
code --install-extension emmanuelbeziat.vscode-great-icons
code --install-extension github.github-vscode-theme
code --install-extension MS-vsliveshare.vsliveshare
code --install-extension shopify.ruby-lsp
code --install-extension dbaeumer.vscode-eslint
code --install-extension Rubymaniac.vscode-paste-and-indent
code --install-extension alexcvzz.vscode-sqlite
code --install-extension anteprimorac.html-end-tag-labels
code --install-extension marcoroth.herb-lsp
code --install-extension rayhanw.erb-helpers
```
Aquí está la lista de las extensiones que estás instalando:
- [Sublime Text Keymap and Settings Importer](https://marketplace.visualstudio.com/items?itemName=ms-vscode.sublime-keybindings)
- [VSCode Great Icons](https://marketplace.visualstudio.com/items?itemName=emmanuelbeziat.vscode-great-icons)
- [Live Share](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare)
- [Ruby](https://marketplace.visualstudio.com/items?itemName=shopify.ruby-lsp)
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [Paste and Indent](https://marketplace.visualstudio.com/items?itemName=Rubymaniac.vscode-paste-and-indent)
- [SQLite](https://marketplace.visualstudio.com/items?itemName=alexcvzz.vscode-sqlite)
================================================
FILE: _partials/es/vscode_liveshare.md
================================================
### Configuración de Live Share
[Visual Studio Live Share](https://visualstudio.microsoft.com/services/live-share/) es una extensión de VS Code que te permite compartir el código en tu editor de texto para debugging y pair-programming: ¡Instalémoslo!
Abre VS Code desde tu terminal escribiendo `code` y presionando `Enter`.
Haz clic en la pequeña flecha de la parte inferior de la barra de la izquierda:

- Haz clic en el botón "Share". Luego en "GitHub (Inicia sesión usando tu cuenta GitHub)".
- Va a aparecer una ventana emergente pidiéndote que inicies sesión con GitHub: Haz clic en "Allow".
- Te redireccionarán a una página GitHub en tu navegador pidiéndote que autorices Visual Studio Code: Haz clic en "Continue" y luego en "Authorize github".
- Es posible que VS Code muestre más ventanas emergentess: Ciérralas haciendo clic en "OK".
Eso es todo. ¡Ya puedes continuar!
================================================
FILE: _partials/es/windows_browser.md
================================================
## Conexión de tu navegador predeterminado con Ubuntu
Para asegurarnos de que puedas interactuar desde la terminal de Ubuntu con el navegador que tienes instalado en Windows, debemos definirlo como tu navegador predeterminado aquí.
:warning: Tienes que ejecutar al menos uno de los siguientes comandos:
Google Chrome como tu navegador predeterminado
Ejecuta este comando:
```bash
ls /mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe
```
Si obtienes un error como este `ls: cannot access...` corre el siguiente comandos:
```bash
echo "export BROWSER=\"/mnt/c/Program Files/Google/Chrome/Application/chrome.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files/Google/Chrome/Application/chrome.exe'\"" >> ~/.zshrc
```
Si no es el caso, ejecuta lo siguiente:
```bash
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe'\"" >> ~/.zshrc
```
Mozilla Firefox como tu navegador predeterminado
Ejecuta el siguiente comando:
```bash
ls /mnt/c/Program\ Files\ \(x86\)/Mozilla\ Firefox/firefox.exe
```
Si obtienes un error como este `ls: cannot access...` corre el siguiente comandos:
```bash
echo "export BROWSER=\"/mnt/c/Program Files/Mozilla Firefox/firefox.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files/Mozilla Firefox/firefox.exe'\"" >> ~/.zshrc
```
Si no es el caso, ejecuta lo siguiente:
```bash
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Mozilla Firefox/firefox.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Mozilla Firefox/firefox.exe'\"" >> ~/.zshrc
```
Microsoft Edge como tu navegador predeterminado
Ejecuta el siguiente comandos:
```bash
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe'\"" >> ~/.zshrc
```
Reinicia tu terminal.
Luego asegúrate de que el siguiente comando devuelva "Browser defined 👌":
```bash
[ -z "$BROWSER" ] && echo "ERROR: please define a BROWSER environment variable ⚠️" || echo "Browser defined 👌"
```
Si no lo hace pero
:heavy_check_mark: sí obtienes este mensaje, puedes continuar :+1:
:x: De lo contrario, escoge un navegador de la lista de arriba y ejecuta el comando correspondiente. Luego no olvides reiniciar tu terminal:
```bash
exec zsh
```
No dudes en **pedirle ayuda a tu profesor**.
================================================
FILE: _partials/es/windows_postgresql.md
================================================
## PostgreSQL
A veces SQLite no es suficiente y necesitaremos una herramienta más avanzada llamada [PostgreSQL](https://www.postgresql.org/). Esta es un sistema para bases de datos de código abierto y listo para usar en producción.
Vamos a instalarlo ahora.
Ejecuta los siguientes comandos:
```bash
sudo apt install -y postgresql postgresql-contrib libpq-dev build-essential
```
```bash
sudo /etc/init.d/postgresql start
```
```bash
sudo -u postgres psql --command "CREATE ROLE `whoami` LOGIN createdb superuser;"
```
Puedes configurar PostgreSQL para que inicie automáticamente para no tener que ejecutar el comando `sudo /etc/init.d/postgresql start` cada vez que abras una nueva terminal:
```bash
sudo echo "`whoami` ALL=NOPASSWD:/etc/init.d/postgresql start" | sudo tee /etc/sudoers.d/postgresql
```
```bash
sudo chmod 440 /etc/sudoers.d/postgresql
```
```bash
echo "sudo /etc/init.d/postgresql start" >> ~/.zshrc
```
Abre una nueva terminal.
:heavy_check_mark: Si ves un mensaje `* Starting postgresql (via systemctl): postgresql.service` O `* Starting PostgreSQL 14 database server`, entonces todo está bien y puedes continuar :+1:
:x: Si no es el caso, **contacta a un profesor**.
================================================
FILE: _partials/es/windows_settings.md
================================================
## Parámetros de Windows
### Intercambio de archivos entre Windows y Ubuntu
Necesitamos una manera fácil de transferir archivos de Windows a Ubuntu y viceversa.
Para ello, vamos a crear atajos a directorios Ubuntu en el **Explorador de Archivos** de Windows:
- Abre el Explorador de Archivos de Windows (o usa el atajo `WIN` + `E`)
- En la Barra de Direcciones, coloca `\\wsl$\` (o `\\wsl$\Ubuntu` si eso no funciona)
- Ahora tienes acceso al sistema de archivos de Ubuntu
- Navega por el sistema de archivos de Ubuntu para encontrar los directorios que te interesen
- Arrastra las carpetas que te interesen a la Barra de Direcciones para crear atajos

### Abre el Explorador de Archivos de Windows desde la terminal de Ubuntu
Otra opción para mover archivos es abrir el **Explorador de Archivos** de Windows desde la terminal de Ubuntu:
- Abre una terminal de Ubuntu
- Ve al directorio que quieres explorar
- Ejecuta el comando `explorer.exe .` (Otra alternativa es usar `wslview .`)
- Si obtienes un mensaje de input output error, ejecuta `wsl --shutdown` en una PowerShell de Windows y abre la terminal de Ubuntu nuevamente

### Uso del Sistema de Archivos de Ubuntu
Es posible que quieras averiguar la localización exacta de un directorio en Windows en el sistema de archivos de Ubuntu o viceversa.
Para convertir una ruta Windows a una Ubuntu y viceversa:
- Abre una terminal de Ubuntu
- Usa el comando `wslpath "C:\Program Files"` para traducir la ruta Windows a una Ubuntu
- Usa el comando `wslpath -w "/home"` para traducir una ruta Ubuntu a una Windows
- El comando `wslpath -w $(pwd)` devuelve la ruta Windows del directorio Ubuntu actual

### Anclaje de aplicaciones a tu barra de tareas
Usarás frecuentemente casi todas las aplicaciones que has instalado hoy. ¡Anclémoslas a tu barra de tareas para que estén a solo un clic de ti!
Para ello, abre la aplicación. Haz clic derecho en el ícono de la barra de tareas para hacer que aparezca el menú contextual (también llamado emergente) y selecciona "Pin to taskbar".

Ancla lo siguiente:
- Tu terminal
- Tu explorador de archivos
- VS Code
- Tu navegador de Internet
- Slack
================================================
FILE: _partials/es/windows_slack.md
================================================
## Slack
[Slack](https://slack.com/) es una plataforma de comunicación popular en la industria tech.
### Instalación
[Descarga la aplicación Slack](https://slack.com/downloads/windows) e instálala.
:warning: Si ya estás usando Slack en tu navegador, por favor descarga e instala **la aplicación de escritorio** la cual tiene todas las funciones.
================================================
FILE: _partials/es/windows_terminal.md
================================================
## Terminal de Windows
### Instalación
:information_source: Las instrucciones que verás a continuación dependen de la versión de Windows que tengas.
Si estás utilizando Windows 11, la terminal de Windows ya está instalada y puedes ir a la siguiente sección :point_down:
Si tienes Windows 10, instala la terminal de Windows. Verás que es una terminal moderna.
**Windows 10**: Instalar Windows Terminal
- Haz clic en `Start`
- Escribe `Microsoft Store`
- Haz clic en `Microsoft Store` en la lista
- Busca `Windows Terminal` en la barra de búsqueda
- **Selecciona Windows Terminal"**
- Haz clic en `Install`
:warning: ¡NO instales **Windows Terminal Preview**, solo instala **Windows Terminal**!
Desinstala la versión incorrecta de la terminal de Windows
Para desinstalar la versión incorrecta la terminal de Windows, solamente tienes que ir a la lista de programas instalados de Windows 10:
- Presiona `Windows` + `R`
- EScribe `ms-settings:appsfeatures`
- Presiona `Enter`
Busca el programa que quieres desinstalar y haz clic en el botón de desinstalación.
Cuando termine la instalación, el botón `Install` se transformará en un botón `Launch`: haz clic en él.
### Ubuntu como terminal predeterminada
Hagamos que Ubuntu sea la terminal predeterminada de tu aplicación Windows terminal.
Presiona `Ctrl` + `,`
Debería abrir los parámetros de la terminal:

- Cambia el perfil predeterminado a "Ubuntu"
- Haz clic en "Save"
- Haz clic en "Open JSON file"
Verás la parte a cambiar en un círculo rojo:

Primero pídele a Ubuntu que inicie directamente dentro de tu Ubuntu Home Directory en vez de hacerlo desde Windows:
- Localiza el `"name": "Ubuntu",`
- Agrega la siguiente línea debajo de eso:
```bash
"commandline": "wsl.exe ~",
```
:warning: ¡Que no se te olvide la coma al final de la línea!
Luego deshabilita el warning para copiar y pegar comandos entre Windows y Ubuntu:
- Localiza la línea `"defaultProfile": "{2c4de342-...}"`
- Agrega la siguiente línea debajo de eso:
```bash
"warning.multiLinePaste": false,
```
:warning: ¡No olvides la coma al final de la línea!
Puedes guardar estos cambios presionando `Ctrl` + `S`
:heavy_check_mark: Tu **Windows Terminal** ya está configurada :+1:
Esta terminal tiene pestañas: puedes escoger abrir una terminal en una nueva pestaña haciendo clic en el **+** al lado de la pestaña actual.
**De ahora en adelante, cada vez que hablemos de la terminal o la consola, nos referiremos a esta.** NUNCA más uses otra.
================================================
FILE: _partials/es/windows_ubuntu.md
================================================
## Ubuntu
### Instalación
Después de reiniciar tu computadora, deberías ver una ventana de terminal diciendo WSL está retomando el proceso de instalación de Ubuntu. Cuando termine, iniciará Ubuntu.
Solución de problemas para Windows 10 (solo si es necesario, consulta con un profesor)
Si la instalación de Ubuntu no se reanudó, primero intenta nuevamente: abre Powershell o el Símbolo del sistema y ejecuta `wsl --install` otra vez.
Si tienes Windows 10, instala la terminal de Windows por medio de la Microsoft Store:
- Haz clic en `Start`
- Escribe `Microsoft Store`
- Haz clic en `Microsoft Store` en la lista
- Busca `Ubuntu` en la barra de búsqueda
- **Selecciona la versión sin nombre, simplemente "Ubuntu"**
- Haz clic en `Get`
:warning: ¡NO instales **Ubuntu 18.04 LTS** ni **Ubuntu 20.04**!
Desinstala las versiones incorrectas de Ubuntu
Para desinstalar las versiones incorrectas de Ubuntu, solo tienes que ir a la Lista de Programas Instalados de Windows 10:
- Presiona `Windows` + `R`
- Escribe `ms-settings:appsfeatures`
- Preiona `Enter`
Busca el programa que desees desinstalar y haz clic en el botón de desinstalación.
Cuando termine la instalación, el botón `Get` se transformará en un botón `Open`: Haz clic en él.
### Primer uso
La primera vez que lo abras, te pedirán que:
- Escojas un **username** de:
- una palabra
- minúscula
- sin caracteres especiales
- por ejemplo: `lewagon` o tu `firstname`, es decir, tu primer nombre
- Escoge un **password**
- Confírmalo
:warning: Cuando escribas tu contraseña no verás nada en la pantalla. **Esto es normal**. Es una herramienta de seguridad para ocultar tanto el contenido de tu contraseña como su longitud. Simplemente escribe tu contraseña y presiona `Enter` al terminar.
### Chequea la versión WSL de Ubuntu
- Presiona `Windows` + `R`
- Escribe `cmd`
- Presiona `Enter`
Escribe el siguiente comando:
```bash
wsl -l -v
```
:heavy_check_mark: Si la versión de WSL de Ubuntu es 2, entonces todo está bien y puedes continuar :+1:
:x: Si la versión de WSL de Ubuntu es 1, tendremos que pasarla a la versión 2.
Conversión de WSL de Ubuntu V1 a V2
Escribe esto en la ventana de Entrada de Comandos:
```bash
wsl --set-version Ubuntu 2
```
:heavy_check_mark: Deberías obtener el siguiente mensaje en algunos segundos: `The conversion is complete`. Esto significa que la conversión ha sido completada.
:x: Si no funciona, tendremos que asegurarnos de que los archivos de Ubuntu no estén comprimidos.
Chequea si los archivos no están comprimidos
- Presiona `Windows` + `R`
- Escribe `%localappdata%\Packages`
- Presiona `Enter`
- Abre la carpeta `CanonicalGroupLimited.UbuntuonWindows...`
- Haz clic derecho en la carpeta `LocalState`
- Haz clic en `Properties`
- Haz clic en `Advanced`
- Asegúrate de que la opción `Compress content` **no** esté seleccionada. Luego haz clic en `Ok`.
Aplícale cambios a esta carpeta solamente y trata de convertir la versión de WSL de Ubuntu nuevamente.
:x: Si la conversión aún no funciona, por favor **contacta a un profesor**.
Ya puedes cerrar la ventana de la terminal.
### Comprueba tu nombre de usuario
Escribe esto en la terminal de Ubuntu:
```bash
whoami
```
Debería devolver el nombre de usuario que elegiste anteriormente.
:x: Si dice `root`, **contacta a un profesor** antes de continuar.
================================================
FILE: _partials/es/windows_version.md
================================================
## La versión de Windows
Antes de comenzar, necesitamos verificar que la versión de Windows instalada en tu computadora sea compatible con estas instrucciones de configuración.
### Windows 10 o Windows 11
> :warning: **Nota sobre Windows 10 y seguridad**
>
> La configuración del bootcamp de Le Wagon funciona en Windows 10. Dicho esto, recomendamos encarecidamente actualizar a Windows 11. Desde el 14 de octubre de 2025 Microsoft finalizó el soporte para Windows 10, lo que significa que ya no recibirá actualizaciones de seguridad y podría poner tu equipo en riesgo. Para más detalles, consulta la [guía de Microsoft](https://support.microsoft.com/en-us/windows/windows-10-support-has-ended-on-october-14-2025-2ca8b313-1946-43d3-b55c-2b95b107f281). Si tu equipo no puede ejecutar Windows 11, considera cambiar a Ubuntu.
Para poder configurar tu computadora, necesitas tener **Windows 10 o Windows 11** instalado.
Para chequear la versión de tu Windows:
- Presiona `Windows` + `R`
- Escribe `winver`
- Presiona `Enter`
:heavy_check_mark: Si las primeras palabras de esta ventana son **Windows 11**, entonces todo está bien y puedes continuar trabajando en la configuración :+1:
:heavy_check_mark: Si las primeras palabras de esta ventana son **Windows 10**, verifica el **número de la versión**:
- :heavy_check_mark: Si dice al menos `2004`, entonces todo está bien :+1:
- :x: Si es inferior a `2004`, debes actualizar tu versión.
-
Cómo instalar las últimas actualizaciones?
Abre Windows Update:
- Presiona `Windows` + `R`
- Escribe `ms-settings:windowsupdate`
- Presiona `Enter`
- Haz clic en `Check updates`
:heavy_check_mark: Si tienes una marca verde y el siguiente mensaje "You're up to date", entonces todo está bien :+1:
:warning: Si obtienes una exclamación roja y el siguiente mensaje "Update available", por favor instala las actualizaciones y repite el proceso hasta que diga que todo está actualizado :loop:
:x: Si obtienes un mensaje de error diciendo que Windows no puede aplicar las actualizaciones, por favor **contacta a un profesor**.
Activa Windows Update Service para resolver las Actualizaciones
Algunos antivirus y programas deshabilitan las actualizaciones que necesitamos y luego se muestra un error. ¡Solucionemos esto!
- Presiona `Windows` + `R`
- Escribe `services.msc`
- Presiona `Enter`
- Haz doble clic en `Windows Update Service`
- Coloca su `Startup` en `Automatic`
- Haz clic en `Start`
- Haz clic en `Ok`
¡Ahora intenta instalar las actualizaciones nuevamente!
Verifica el número de la versión:
- Presiona `Windows` + `R`
- Escribe `winver`
- Presiona `Enter`
:heavy_check_mark: Si dice al menos `2004`, entonces todo está bien :+1:
:x: Si es inferior a `2004`, por favor **contacta a un profesor**.
================================================
FILE: _partials/es/windows_virtualization.md
================================================
## Virtualización
Tenemos que asegurarnos de que las opciones de Virtualización estén habilitadas en el BIOS de tu computadora.
Normalmente ya es el caso en muchas computadoras. Verifiquemos:
- Presiona `Windows` + `R`
- Escribe `taskmgr`
- Presiona `Enter`
- Haz clic en la pestaña `Performance`
- Haz clic en `CPU`

:heavy_check_mark: Si ves "Virtualization: Enabled", entonces todo está bien :+1:
:x: Si falta la línea o si la virtualización está desactivada, por favor **contacta a un profesor antes de intentar activar la Virtualización por tu cuenta**
Activa la Virtualización
Debemos acceder al BIOS / UEFI de la computadora para activarla.
- Presiona `Windows + R`
- Escribe `shutdown.exe /r /o /t 1`
- Presiona `Enter`
- Espera a que la computadora se apague
- Haz clic en `Troubleshoot`
- Haz clic en `Advanced Options`
- Haz clic en `UEFI Firmware Settings`
- Haz clic en `Restart`
Debes activar la opción de la virtualización para tu procesador aquí:
- La mayoría de las veces se hace en los parámetros avanzados, los parámetros del CPU o los parámetros de Northbridge
- El nombre de la opción puede variar de una computadora a otra:
- Intel: `Intel VT-x`, `Intel Virtualization Technology`, `Virtualization Extensions`, `Vanderpool`...
- AMD: `SVM Mode` o `AMD-V`
- Guarda los cambios después de la activación y reinicia la computadora con las opciones correspondientes
================================================
FILE: _partials/es/windows_vscode.md
================================================
## Visual Studio Code
### Instalación
Instala el editor de texto [Visual Studio Code](https://code.visualstudio.com).
- Ve a [la página de descarga de Visual Studio Code](https://code.visualstudio.com/download).
- Haz clic en el botón "Windows"
- Abre el archivo que acabas de descargar.
- Instálalo con pocas opciones:

Abre VS Code cuando termine la instalación.
### Conexión de VS Code con Ubuntu
Instala la extensión de VS Code llamada [Remote - WSL](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) para hacer que VS Code interactúe adecuadamente con Ubuntu.
Abre tu **terminal Ubuntu**.
Copia y pega los siguientes comandos en la terminal:
```bash
code --install-extension ms-vscode-remote.remote-wsl
```
Luego abre VS Code desde la terminal:
```bash
code .
```
:heavy_check_mark: Si ves `WSL: Ubuntu` en la esquina inferior izquierda de la ventana de VS Code, entonces todo está bien y puedes continuar :+1:

:x: Si no es el caso, por favor **pídele ayuda a un profesor**.
================================================
FILE: _partials/es/windows_wsl.md
================================================
## Subsistema de Windows para Linux (WSL)
WSL es el ambiente de entorno que estamos usando para usar Ubuntu. Puedes aprender más sobre WSL [aquí](https://docs.microsoft.com/en-us/windows/wsl/faq).
Instalaremos WSL 2 y Ubuntu con un comando a través de la Windows Command Prompt.
:warning: en esta instrucción, utiliza el atajo `Ctrl` + `Shift` + `Enter` para usar la **Windows Command Prompt** con privilegios de administrador en lugar de simplemente hacer clic en `Ok` o presionar `Enter`.
- Presiona `Windows` + `R`
- Escribe `cmd`
- Presiona **`Ctrl` + `Shift` + `Enter`**
:warning: tal vez tengas que aceptar la confirmación UAC sobre el cambio en los privilegios.
Un ventana de terminal aparecerá:
- Copia el siguiente comando (`Ctrl` + `C`)
- Pégalo en la ventana de la terminal (`Ctrl` + `V` o haciendo clic derecho en la ventana)
- Ejecútalo presionado `Enter`
```powershell
wsl --install
```
:heavy_check_mark: Si el comando se ejecutó sin ningún error, por favor reinicia tu computadora y continúa con las siguientes instrucciones aquí abajo :+1:
:x: Si obtienes un mensaje de error (o si ves algún texto en rojo en la ventana), por favor **contacta a un profesor**
Solución de problemas para Windows 10 (solo si es necesario, consulta con un profesor)
#### Para Windows 10 < 2004: instala primero WSL 1
:warning: en esta instrucción, utiliza el atajo `Ctrl` + `Shift` + `Enter` para usar **Windows PowerShell** con privilegios de administrador en lugar de hacer clic en `Ok` o presionar `Enter`.
- Presiona `Windows` + `R`
- Escribe `powershell`
- Presiona **`Ctrl` + `Shift` + `Enter`**
:warning: tal vez tengas que aceptar la confirmación UAC sobre el cambio en los privilegios.
Un ventana de terminal azul aparecerá:
- Copia los siguiente comandos uno por uno (`Ctrl` + `C`)
- Pégalos en la ventana de Powershell (`Ctrl` + `V` o haciendo clic derecho en la ventana)
- Ejecútalos presionado `Enter`
```powershell
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
```
```powershell
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
```
```powershell
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
```
:heavy_check_mark: Si los tres comandos se ejecutaron sin ningún error, por favor reinicia tu computadora y continúa con las instrucciones de aquí abajo :+1:
:x: Si obtienes un mensaje de error (o si ves algún texto en rojo en la ventada), por favor **contacta a un profesor**
#### Para Windows 10 con WSL 1: Actualización a WSL 2
Si tienes Windows 10, actualizaremos WSL a la versión 2.
Cuando se reinicie tu computadora, descarga el instalador de WSL2.
- Ve a la [página de descarga](https://aka.ms/wsl2kernel)
- Descarga "el paquete de actualización de WSL2 Linux kernel"
- Abre el archivo que acabas de descargar
- Haz clic en `Next`
- Haz clic en `Finish`

:heavy_check_mark: Si no obtuviste ningún mensaje de error, entonces puedes continuar :+1:
:x: Si obtienes el siguiente error "This update only applies to machines with the Windows Subsystem for Linux", **haz clic derecho** en el programa y selecciona `uninstall`; esta vez deberías poder instalarlo sin problemas.
#### Para Windows 10 con WSL 1: Coloca WSL 2 como el Subsistema Windows por defecto para Linux
Si tienes Windows 10, pondremos la versión predeterminada de WSL en 2.
Ahora coloca WSL 2 como la versión predeterminada. Esto lo podemos hacer porque ya está instalado:
- Presiona `Windows` + `R`
- Escribe `cmd`
- Presiona `Enter`
Escribe lo siguiente en la ventana que aparecerá:
```bash
wsl --set-default-version 2
```
:heavy_check_mark: Si ves este mensaje "The operation completed successfully", puedes cerrar esta terminal y continuar con las siguientes instrucciones aquí abajo :+1:
:x: Si el mensaje que obtienes es sobre virtualización, por favor **contacta a un profesor**
Habilita de la feature de la Virtual Machine Platform en Windows
Sigue los pasos [siguientes](https://www.configserverfirewall.com/windows-10/please-enable-the-virtual-machine-platform-windows-feature-and-ensure-virtualization-is-enabled-in-the-bios/#:~:text=To%20enable%20WSL%202,%20Open,Windows%20feature%20on%20or%20off.&text=Ensure%20that%20the%20Virtual%20Machine,Windows%20will%20enable%20WSL%202) hasta que hayas habilitado la Virtual Machine Platform y el Subsistema de Windows para Linux
Habilita la feature de Windows Hyper-V
Sigue los pasos [siguientes](https://winaero.com/enable-use-hyper-v-windows-10/) hasta que hayas habilitado el grupo Hyper-V
:information_source: Si tienes Windows 10 **Home edition**, la feature Hyper-V no está disponible para su sistema operativo. No es un bloqueo y puedes continuar con las siguientes instrucciones aquí abajo :ok_hand:
================================================
FILE: _partials/es/yarn.md
================================================
## yarn
[`yarn`](https://yarnpkg.com/) es un gestor de paquetes para instalar librerías JavaScript. Instálalo:
En una terminal, ejecuta los siguientes comandos:
```bash
corepack enable
yarn set version stable
```
```bash
exec zsh
```
⚠️ Si ves algún mensaje de error, intenta ejecutar `npm install -g corepack` y luego vuelve a ejecutar los comandos anteriores.
Luego ejecuta este comando:
```bash
yarn -v
```
:heavy_check_mark: si ves una versión, entonces todo está bien :+1:
:x: Si no es el caso, **pídele ayuda a un profesor**
================================================
FILE: _partials/fr/checkup.md
================================================
## Vérification
On va maintenant vérifier que tu as tout installé correctement.
Dans ton terminal, exécute la commande suivante :
```bash
exec zsh
```
Puis exécute :
```bash
curl -Ls https://raw.githubusercontent.com/lewagon/setup/master/check.rb > _.rb && ruby _.rb && rm _.rb || rm _.rb
```
:heavy_check_mark: Si tu vois apparaître en vert `Awesome! Your computer is now ready!`, c’est bon :+1:
:x: Sinon, **demande au prof**.
================================================
FILE: _partials/fr/cli_tools.md
================================================
## Outils en ligne de commande
### Vérifier la locale
Le concept de "locale" permet de personnaliser les programms en fonction de ta langue et ton pays.
Vérifions que la locale est bien en **anglais** dans le terminal :
```bash
locale
```
Si la commande ne renvoie pas quelque chose qui contient `LANG=en_US.UTF-8`, lance ceci dans un terminal Ubuntu :
```bash
sudo locale-gen en_US.UTF-8
```
Si après, tu reçois un avertissement (`bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf-8)`) dans ton terminal, veuillez faire ce qui suit :
Générer la localisation
Veuillez exécuter ces lignes dans ton terminal.
```bash
sudo update-locale LANG=en_US.UTF8
sudo apt-get update
sudo apt-get install language-pack-en language-pack-en-base manpages
```
### Zsh & Git
Au lieu d’utiliser le [shell](https://fr.wikipedia.org/wiki/Interface_syst%C3%A8me) `bash` par défaut, nous utiliserons `zsh`.
Nous utiliserons aussi [`git`](https://git-scm.com/), un logiciel en ligne de commande utilisé pour la gestion de versions.
Installons-les, avec d'autres outils utiles :
- Ouvre un terminal
- Copie-colle les commandes suivantes :
```bash
sudo apt update
```
```bash
sudo apt install -y curl git imagemagick jq unzip vim zsh
```
Ces commandes te demanderont ton mot de passe ; saisis-le.
:warning: Lorsque tu saisiras ton mot de passe, rien ne s’affichera à l’écran ; **c’est normal**. Il s’agit d’une mesure de sécurité permettant de masquer ton mot de passe et sa longueur. Saisis simplement ton mot de passe, puis appuie sur `Enter`.
### Installation de GitHub CLI
On va maintenant installer la [CLI officielle de GitHub](https://cli.github.com) (Command Line Interface, interface en ligne de commande). Il s’agit d’un logiciel qui te permet d’interagir avec ton compte GitHub via la ligne de commande.
Copie-colle les commandes suivantes dans ton terminal et saisis ton mot de passe s’il t’est demandé :
```bash
sudo apt remove -y gitsome # gh command can conflict with gitsome if already installed
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install -y gh
```
Pour vérifier que `gh` a bien été installé sur ta machine, tu peux exécuter :
```bash
gh --version
```
:heavy_check_mark: Si tu vois apparaître `gh version X.Y.Z (YYYY-MM-DD)`, c’est bon :+1:
:x: Sinon, **demande au la prof**.
================================================
FILE: _partials/fr/conclusion.md
================================================
## La configuration est terminée !
Ton ordinateur est prêt pour [la formation AI Software Development du Wagon](https://www.lewagon.com/web-development-course/full-time) :muscle: :clap:
Profite du bootcamp, tu vas assurer :rocket:
================================================
FILE: _partials/fr/dotfiles.md
================================================
## Dotfiles (configuration standard)
Les hackers adorent perfectionner leur shell et leurs outils.
On va commencer avec une super configuration par défaut fournie par Le Wagon : [`lewagon/dotfiles`](https://github.com/lewagon/dotfiles).
Ta configuration est personnelle ; tu as donc besoin de ton **propre** dépôt de code (repository) pour la sauvegarder. Tu vas donc faire un fork, c’est-à-dire une copie, du dépôt Le Wagon.
Faire un fork consiste à créer un nouveau dépôt dans ton compte GitHub personnel `$GITHUB_USERNAME/dotfiles`, identique au dépôt Le Wagon d’origine et que tu pourras modifier librement.
Ouvre ton terminal et exécute les commandes suivantes :
```bash
export GITHUB_USERNAME=`gh api user | jq -r '.login'`
echo $GITHUB_USERNAME
```
:heavy\_check\_mark: Tu devrais voir apparaître ton nom d’utilisateur GitHub.
:x: Si ce n’est pas le cas, **arrête-toi ici** et demande de l’aide. Il se peut que tu aies rencontré un problème à l’étape précédente (`gh auth`).
Il est temps de faire un fork du dépôt et de le cloner sur ton ordinateur :
```bash
mkdir -p ~/code/$GITHUB_USERNAME && cd $_
gh repo fork lewagon/dotfiles --clone
```
### Programme d'installation des Dotfiles
Exécute le programme d’installation `dotfiles` :
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles
zsh install.sh
```
Vérifie les adresses e-mail associées à ton compte GitHub. Tu devras en choisir une à l’étape suivante :
```bash
gh api user/emails | jq -r '.[].email'
```
:heavy_check_mark: Si tu vois la liste de tes adresses e-mail enregistrées, tu peux continuer :+1:
:x: Sinon, [reconnecte-toi à GitHub](https://github.com/lewagon/setup/blob/master/#github-cli) avant d'exécuter cette commande à nouveau :point_up:.
### Programme d'installation git
Exécute le programme d’installation de `git` :
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh
```
:point_up: On te **demandera** de fournir ton nom (`FirstName LastName`) et ton adresse e-mail.
:warning: Tu **dois** saisir l’une des adresses e-mail indiquées ci-dessus avec la commande `gh api ...` précédente. Sinon, Kitt ne pourra pas suivre tes progrès. 💡 Sélectionnez l'adresse `@users.noreply.github.com` si vous ne souhaitez pas que votre adresse e-mail apparaisse dans les dépôts publics auxquels vous pourriez contribuer.
**Réinitialise** ton terminal en exécutant :
```bash
exec zsh
```
================================================
FILE: _partials/fr/gh_cli.md
================================================
## GitHub CLI
CLI est l’acronyme de [Command-line Interface](https://en.wikipedia.org/wiki/Command-line_interface), interface en ligne de commande.
Dans cette section, tu vas installer [GitHub CLI](https://cli.github.com/) pour interagir avec GitHub directement depuis le terminal.
Nous allons utiliser GitHub CLI (`gh`) pour nous connecter à GitHub en utilisant *SSH*, un protocole pour s'authentifier en utilisant des clés SSH au lieu de la fameuse paire nom d'utilisateur et mot de passe.
Elle doit déjà être installée sur ton ordinateur grâce aux commandes précédentes.
Pour **te connecter**, commence par copier-coller la commande suivante dans ton terminal :
:warning: **NE modifie PAS `email`**
```bash
gh auth login -s 'user:email' -w --git-protocol ssh
```
`gh` va te poser quelques questions :
- `Generate a new SSH key to add to your GitHub account?` Appuie sur `Enter` pour demander à gh de générer les clés SSH pour toi.
Si tu as déjà des clés SSH, tu verras à la place `Upload your SSH public key to your GitHub account?` Avec les flèches, sélectionne le chemain de ta clé publique et appuie sur `Enter`.
- `Enter a passphrase for your new SSH key (Optional)`. Saisis un mot de passe dont tu te souviendras. Ce mot de passe sert à protéger ta clé privée enregistrée sur ton disque sur. Ensuite, appuie sur `Enter`.
- `Title for your SSH key`. Tu peux laisser ce qui est proposé par défaut, à savoir "GitHub CLI", appuie sur `Enter`.
Tu obtiendras le résultat suivant :
```bash
! First copy your one-time code: 0EF9-D015
- Press Enter to open github.com in your browser...
```
Sélectionne et copie le code (`0EF9-D015` dans l’exemple), puis appuie sur `Enter`.
Ton navigateur s’ouvrira et te demandera d’autoriser GitHub CLI à utiliser ton compte GitHub. Accepte et patiente un instant.
Reviens au terminal, appuie à nouveau sur `Enter` et voilà.
Pour vérifier que tu es bien connecté, saisis :
```bash
gh auth status
```
:heavy_check_mark: Si tu vois apparaître `Logged in to github.com as `, alors c’est bon :+1:
:x: Sinon, **demande au prof**.
================================================
FILE: _partials/fr/github.md
================================================
## Compte GitHub
Est-ce que tu as déjà un compte GitHub ? Si ce n’est pas le cas, [inscris-toi maintenant](https://github.com/join).
:point_right: **[Télécharge une photo](https://github.com/settings/profile)** et indique correctement ton nom sur ton compte GitHub. C’est important, car notre tableau de bord interne utilise ton avatar. Fais-le **maintenant** avant de poursuivre la configuration de ton ordinateur.

:point_right: **[Activez l'authentification à deux facteurs (2FA)](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication#configuring-two-factor-authentication-using-text-messages)**. GitHub vous enverra des messages texte avec un code lorsque vous essayez de vous connecter. C'est important pour la sécurité et cela sera bientôt obligatoire pour contribuer du code sur GitHub.
================================================
FILE: _partials/fr/intro.md
================================================
# Instructions de configuration
Les instructions ci-dessous vont te permettre de configurer ton ordinateur pour [la formation AI Software Development du Wagon](https://www.lewagon.com/web-development-course/full-time).
**Lis-les attentivement et exécute toutes les commandes dans l’ordre suivant**. En cas de blocage, n’hésite pas à demander au prof :raising_hand:
C’est parti :rocket:
================================================
FILE: _partials/fr/kitt.md
================================================
## Kitt
:warning: Si tu as reçu un e-mail du Wagon t’invitant à t’inscrire sur Kitt (notre plateforme pédagogique), tu peux passer cette étape. Suis plutôt les instructions contenues dans l’e-mail que tu as reçu, si tu ne l’as pas déjà fait.
Si tu n’es pas certain de ce que tu dois faire, suis [ce lien](https://kitt.lewagon.com/). Si tu es déjà connecté, tu peux passer cette section. Si tu n’es pas connecté, clique sur `Enter Kitt as a Student`. Si tu réussis à te connecter, tu peux passer cette étape. Sinon, demande au prof si tu aurais dû recevoir un e-mail ou si tu dois suivre les instructions ci-dessous.
Inscris-toi en tant qu’alumni du Wagon sur [kitt.lewagon.com/onboarding](http://kitt.lewagon.com/onboarding). Sélectionne ton batch, connecte-toi avec GitHub et renseigne toutes tes informations.
Le prof vérifiera ensuite avec toi que tu fais bien partie de ce batch. Tu peux lui demander de vérifier dès que tu as fini de remplir le formulaire d’inscription.
Une fois que le prof a vérifié ton profil, consulte ta messagerie. Tu devrais avoir reçu 2 e-mails :
- un de Slack, t’invitant à rejoindre la communauté Slack des anciens étudiants du Wagon (où tu pourras discuter avec tes amis et tous les anciens élèves). Clique sur **Devenir membre** et renseigne toutes les informations ;
- un de GitHub, t’invitant à rejoindre l’équipe `lewagon`. **Accepte** pour accéder aux cours.
================================================
FILE: _partials/fr/macos_apple_silicon.md
================================================
## Processeurs Apple Silicon
Si tu as acheté ton ordinateur après fin 2020, il est probable qu’il soit équipé d’un nouveau processeur Apple Silicon au lieu de l’ancien processeur Intel : vérifions ça ensemble.
Ouvre une nouvelle fenêtre de terminal depuis Applications > Utilitaires ou fais une recherche avec [Spotlight](https://support.apple.com/fr-fr/HT204014) :

Copie-colle la commande suivante dans le terminal et appuie sur `Enter` pour l’exécuter.
``` bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/setup/master/utils/macos_list_processor_type.sh)"
```
☝️ Le résultat de la commande devrait t’indiquer si ton ordinateur utilise Apple Silicon.
Si ton ordinateur utilise Apple Silicon, affiche et lis le paragraphe ci-dessous. Sinon, n’en tiens pas compte.
👉 Setup pour Apple Silicon 👈
### Désinstaller Homebrew
Si une version native de Homebrew est installée sur ton ordinateur, tu dois la désinstaller.
Exécute la commande suivante dans le terminal :
``` bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
```
Si brew n’est pas installé, tu verras apparaître le message suivant : `brew: command not found!`
### Configurer le terminal pour Rosetta
Ouvre le Finder (ou fais une recherche avec [Spotlight](https://support.apple.com/fr-fr/HT204014).
Va dans Applications > Utilitaires.
Duplique l’application Terminal (sélectionne-la, puis `Cmd` + `C`, `Cmd` + `V`) et renomme la copie Terminal Rosetta.
Appuie sur `Cmd` + `I` sur l’application Terminal Rosetta, puis coche la case « Ouvrir avec Rosetta ».
⚠️ À partir de maintenant, et pendant tout le bootcamp, quand on te demandera d’ouvrir un terminal, il faudra utiliser l’application **Terminal Rosetta**.
================================================
FILE: _partials/fr/macos_command_line_tools.md
================================================
## Comment quitter des applications sur un Mac
Cliquer sur la petite croix rouge dans le coin supérieur gauche de la fenêtre d’une application sur un Mac **ne permet pas vraiment de quitter l’application**, mais seulement de fermer une fenêtre active. Pour *vraiment* quitter une application, appuie sur `Cmd + Q` lorsque l’application est active, ou clique sur `APP_NAME` -\> `Quitter` dans la barre de menu.

Pendant le processus de configuration, on te demandera de **quitter et rouvrir** des applications plusieurs fois ; assure-toi de le faire correctement :pray:
## Outils de ligne de commande
Ouvre un nouveau terminal, copie-colle la commande suivante et appuie sur `Enter` :
```bash
xcode-select --install
```
Si tu vois apparaître le message suivant, passe directement à l’étape suivante.
```bash
# command line tools are already installed, use "Software Update" to install updates
```
Sinon, une nouvelle fenêtre s’ouvrira, te demandant si tu souhaites installer certains logiciels : clique sur « Installer » et patiente.

:heavy_check_mark: Si tu vois apparaître le message « Le logiciel a été installé », alors c’est bon :+1:
:x: Si la commande `xcode-select --install` échoue, réessaie. Les serveurs Apple sont parfois saturés.
:x: Si tu vois apparaître le message « Xcode is not currently available from the Software Update server », tu dois mettre à jour le catalogue de mise à jour de logiciels :
```bash
sudo softwareupdate --clear-catalog
```
Une fois la mise à jour effectuée, réessaie d’installer le logiciel.
================================================
FILE: _partials/fr/macos_homebrew.md
================================================
## Homebrew
[Homebrew](http://brew.sh/) est un gestionnaire de paquets : un logiciel servant à installer d’autres logiciels à partir de la ligne de commande. Installons-le !
Ouvre un terminal et exécute :
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```
On te demandera de confirmer (appuie sur `Enter`) et de saisir ton **mot de passe de compte utilisateur macOS** (celui que tu utilises pour [te connecter](https://support.apple.com/en-gb/HT202860) lorsque tu redémarres ton MacBook).
:warning: Lorsque tu saisiras ton mot de passe, rien ne s’affichera à l’écran ; **c’est normal**. Il s’agit d’une mesure de sécurité permettant de masquer ton mot de passe et sa longueur. Saisis simplement ton mot de passe, puis appuie sur `Enter`.
:warning: Si tu vois cet avertissement :point_down:, exécute les deux commandes de la section `Next steps` pour ajouter Homebrew à ton PATH

```bash
# ⚠️ Only execute these commands if you saw this warning ☝
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
```
Si tu as déjà Homebrew, le système te l’indiquera. Continue.
Installe ensuite quelques logiciels utiles :
```bash
brew update
```
Si tu vois apparaître une erreur `/usr/local must be writable`, exécute simplement :
```bash
sudo chown -R $USER:admin /usr/local
brew update
```
Exécute les commandes suivantes dans le terminal (tu peux copier-coller toutes les lignes en une seule fois):
```bash
brew upgrade git || brew install git
brew upgrade gh || brew install gh
brew upgrade wget || brew install wget
brew upgrade imagemagick || brew install imagemagick
brew upgrade jq || brew install jq
brew upgrade openssl || brew install openssl
```
================================================
FILE: _partials/fr/macos_postgresql.md
================================================
## PostgreSQL
Parfois, SQLite n'est pas suffisant et nous aurons besoin d'un outil plus avancé appelé [PostgreSQL](https://www.postgresql.org/), un système de gestion de base de données adapté à la production, puissant et open source.
Installons-le maintenant.
Exécute les commandes suivantes :
```bash
brew install postgresql@15 libpq
brew link --force libpq
```
```bash
brew services start postgresql@15
```
Une fois que c’est fait, on va vérifier que tout a bien fonctionné :
```bash
psql -d postgres
```
Tu devrais voir apparaître un nouveau message comme celui-ci :point_down:
```bash
psql (15.2)
Type "help" for help.
postgres=#
```
:heavy_check_mark: Si c'est le cas, saisis `\q` puis `Enter` pour quitter ce programme. Tu peux poursuivre :+1:
:x: Sinon, **demande au prof**
================================================
FILE: _partials/fr/macos_rbenv.md
================================================
## rbenv
On va maintenant installer [`rbenv`](https://github.com/sstephenson/rbenv), un logiciel qui permet d’installer et de gérer des environnements `ruby`.
Pour commencer, tu dois nettoyer toute installation antérieure éventuelle de Ruby :
```bash
rvm implode && sudo rm -rf ~/.rvm
# Si tu vois apparaître « zsh: command not found: rvm », continue. Cela signifie que `rvm` n’est pas installé
# sur ton ordinateur, et c’est qu’on veut !
sudo rm -rf $HOME/.rbenv /usr/local/rbenv /opt/rbenv /usr/local/opt/rbenv
```
:warning: Cette commande est susceptible de te demander ton mot de passe.
:warning: Lorsque tu saisiras ton mot de passe, rien ne s’affichera à l’écran ; **c’est normal**. Il s’agit d’une mesure de sécurité permettant de masquer ton mot de passe et sa longueur. Saisis simplement ton mot de passe, puis appuie sur `Enter`.
Dans le terminal, exécute :
```bash
brew uninstall --force rbenv ruby-build
exec zsh
```
Puis exécute ensuite :
```bash
brew install rbenv libyaml
```
================================================
FILE: _partials/fr/macos_settings.md
================================================
## Paramètres de macOS
### Sécurité
Tu dois obligatoirement protéger ta session avec un mot de passe. Si ce n’est pas déjà le cas, va dans ` > Réglages Système > Utilisateurs & groupes` et modifie le mot de passe de ton compte. Va aussi dans ` > Réglages Système > Sécurité > Général` et configure la sécurité de façon à ce que ton mot de passe te soit demandé `5 secondes` après la mise en veille ou le démarrage de l’économiseur d’écran.
Tu peux également aller dans ` > Réglages Système > Bureau et Dock` et cliquer sur le bouton `coins actifs (Hot Corners)` en bas à gauche. Choisis le coin inférieur droit pour démarrer l’économiseur d’écran. De cette façon, lorsque tu quitteras ton bureau, tu pourras rapidement verrouiller ton écran en plaçant ta souris dans le coin inférieur droit. Cinq secondes plus tard, ton Mac sera verrouillé et tu devras fournir ton mot de passe pour accéder à ta session.
### Clavier
Au fur et à mesure de ta formation de programmeur, tu comprendras que quitter le clavier fait perdre beaucoup de temps ; tu vas donc chercher à limiter ton utilisation du pavé tactile ou de la souris. Voici quelques astuces macOS pour t’aider.
#### Vitesse du clavier
Va dans ` > Réglages Système > Clavier`. Définis `Vitesse de répétition des touches` sur la position la plus rapide (à droite) et `Pause avant répétition` sur la position la plus courte (à droite).
#### macOS pour les hackers
[Lis ce script](https://github.com/mathiasbynens/dotfiles/blob/master/.macos) et sélectionne ce qui t’intéresse. Par exemple, tu peux saisir ce qui suit dans le terminal :
```bash
# Agrandir la fenêtre de sauvegarde par défaut
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
# Enregistrer les captures d’écran sur le bureau (ou ailleurs)
defaults write com.apple.screencapture location "${HOME}/Desktop"
# etc..
```
### Épingler des applications à ton Dock
Tu utiliseras très souvent la plupart des applications que tu as installées aujourd’hui. Épingle-les à ton Dock pour y accéder en un seul clic !
Pour épingler une application à ton Dock, lance l’application, fais un clic droit sur l’icône dans la barre des tâches pour faire apparaître le menu contextuel et choisis « Options », puis « Garder dans le Dock ».

Tu dois épingler :
- ton terminal
- ton explorateur de fichiers
- VS Code
- ton navigateur Internet
- Slack
================================================
FILE: _partials/fr/macos_slack.md
================================================
## Slack
[Slack](https://slack.com/) est une plateforme de communication assez populaire dans le secteur de la technologie.
### Installation
[Télécharge l’application Slack](https://itunes.apple.com/fr/app/slack/id803453959?mt=12) et installe-la.
:warning: Si tu utilises déjà Slack dans ton navigateur, télécharge et installe **l'application de bureau**, qui comprend toutes les fonctionnalités.
================================================
FILE: _partials/fr/macos_sqlite.md
================================================
## SQLite
Dans quelques semaines, on abordera les bases de données et le SQL. [SQLite](https://sqlite.org/index.html) est un système de gestion de base de données utilisé pour exécuter des requêtes SQL sur des bases de données d'un seul fichier. Installons-le :
Dans un terminal, exécute la commande suivante :
```bash
brew install sqlite
```
Puis exécute celle-ci :
```bash
sqlite3 -version
```
:heavy_check_mark: Si tu vois une version s'afficher, c'est tout bon :+1:
:x: If not, **demande au prof**
================================================
FILE: _partials/fr/macos_terminal.md
================================================
## Thème du terminal macOS
Lance un terminal, clique sur `Terminal > Preferences`, puis sélectionne le thème « Pro » comme profil par défaut.

**Quitte et redémarre** ton terminal ; tu devrais maintenant voir apparaître un fond noir, plus agréable à l’œil.
================================================
FILE: _partials/fr/macos_vscode.md
================================================
## Visual Studio Code
### Installation
On va maintenant installer l’éditeur de texte [Visual Studio Code](https://code.visualstudio.com).
Copie (`Cmd` + `C`) la commande ci-dessous, puis colle-la dans ton terminal (`Cmd` + `V`) :
```bash
brew install --cask visual-studio-code
```
Puis lance VS Code en exécutant la commande suivante dans ton terminal :
```bash
code
```
:heavy_check_mark: Si une fenêtre VS Code s’ouvre, c’est bon. :+1:
:x: Sinon, **demande au prof**.
================================================
FILE: _partials/fr/nvm.md
================================================
## Node.js
[Node.js](https://nodejs.org/en/) est un programme d’exécution JavaScript qui permet d’exécuter du code JavaScript dans le terminal. On va l’installer avec [nvm](https://github.com/nvm-sh/nvm), un gestionnaire de versions pour Node.js.
Exécute les commandes suivantes dans ton terminal :
```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v/install.sh | zsh
exec zsh
```
Puis exécute la commande suivante :
```bash
nvm -v
```
Tu devrais voir apparaître une version. Sinon, demande au prof.
On va maintenant installer node :
```bash
nvm install
```
Une fois l’installation terminée, exécute :
```bash
node -v
```
Si tu vois apparaître `v`, l'installation a réussi :heavy_check_mark: Tu peux alors exécuter :
```bash
nvm cache clear
```
:x: Sinon, **demande au prof**
================================================
FILE: _partials/fr/oh_my_zsh.md
================================================
## Oh-my-zsh
On va maintenant installer le plug-in `zsh` [Oh My Zsh](https://ohmyz.sh/).
Exécute la commande suivante dans un terminal :
```bash
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```
Si tu vois apparaître la question « Do you want to change your default shell to zsh? ? », appuie sur `Y`
À la fin, ton terminal devrait ressembler à ceci :

:heavy_check_mark: Si c’est le cas, tu peux continuer :+1:
:x: Sinon, **demande au prof**
================================================
FILE: _partials/fr/rbenv.md
================================================
## rbenv
On va maintenant installer [`rbenv`](https://github.com/sstephenson/rbenv), un logiciel qui permet d’installer et de gérer des environnements `ruby`.
Pour commencer, tu dois nettoyer toute installation antérieure éventuelle de Ruby :
```bash
rvm implode && sudo rm -rf ~/.rvm
# If you got "zsh: command not found: rvm", carry on.
# It means `rvm` is not on your computer, that's what we want!
rm -rf ~/.rbenv
```
Puis dans le terminal, exécute :
```bash
sudo apt install -y build-essential tklib zlib1g-dev libssl-dev libffi-dev libxml2 libxml2-dev libxslt1-dev libreadline-dev libyaml-dev
```
```bash
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
```
```bash
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
exec zsh
```
================================================
FILE: _partials/fr/ruby.md
================================================
## Ruby
### Installation
Tu peux maintenant installer la dernière version de [ruby](https://www.ruby-lang.org/en/) et en faire la version par défaut.
Exécute cette commande ; cela **peut prendre un moment (5-10 minutes)**
```bash
rbenv install
```
Une fois que l’installation de Ruby est terminée, exécute cette commande pour indiquer au système
d’utiliser la version par défaut.
```bash
rbenv global
```
**Réinitialise** ton ton terminal et vérifie ta version de Ruby :
```bash
exec zsh
```
Puis exécute :
```bash
ruby -v
```
:heavy_check_mark: Si tu vois apparaître un message commençant par `ruby `, tu peux continuer :+1:
:x: Sinon, **demande au prof**
### Installer des gems
Si tu es en Chine 🇨🇳 clique ici
:warning: Si tu es en Chine, mets à jour la procédure d’installation des gems avec les commandes suivantes.
```bash
# En Chine seulement !
gem sources --remove https://rubygems.org/
gem sources -a https://gems.ruby-china.com/
gem sources -l
# *** SOURCES ACTUELLES ***
# https://gems.ruby-china.com/
# Ruby-china.com doit maintenant figurer dans la liste
```
**Que tu sois en Chine ou non**, continue ici pour installer les gems.
Dans l’environnement ruby, les bibliothèques externes sont appelées des `gems` : ce sont des bouts de code ruby, que tu peux télécharger et exécuter sur ton ordinateur. On va en installer quelques-unes.
Tout d'abord, nous allons mettre à jour `bundler`, ce qui nous permet d'installer des gemmes :
```bash
gem update bundler
```
Copie-colle la commande suivante dans ton terminal :
```bash
gem install
```
:heavy_check_mark: Si tu vois apparaître `xx gems installed`, c’est bon :+1:
:x: Si tu obtiens l’erreur suivante :
```bash
ERROR: While executing gem ... (TypeError)
incompatible marshal file format (can't be read)
format version 4.8 required; 60.33 given
```
Exécute la commande suivante :
```bash
rm -rf ~/.gemrc
```
Exécute à nouveau la commande pour installer les gems.
:warning: N’installe **JAMAIS** une gem avec `sudo gem install` ! Et ce même si tu tombes sur une réponse de Stack Overflow (ou du terminal) t’invitant à le faire.
================================================
FILE: _partials/fr/slack_settings.md
================================================
### Paramètres
Lance l’application et connecte-toi à l’organisation `lewagon-alumni`.
Pense à **télécharger une photo de profil** :point_down:

L’idée est de laisser Slack ouvert toute la journée pour partager des liens utiles / demander de l’aide / décider où aller manger, etc.
On va vérifier que tout fonctionne correctement ; pour cela, on va tester ta caméra et ton microphone :
- Ouvre l’application Slack
- Clique sur ta photo de profil en haut à droite
- Clique sur `Preferences` depuis le menu
- Séléctionne `Audio & video` dans la colonne de gauche
- En dessous de `Troubleshooting`, clique sur `Run an audio, video and screensharing test`. Le test va s’ouvrir dans une nouvelle fenêtre
- Vérifie que ton microphone, caméra, et enceintes soient bien séléctionnés, puis clique sur `Start test`

:heavy_check_mark: Une fois le test terminé, tu devrais voir apparaître des messages de succès en vert, au moins pour ton microphone et ta caméra. :+1:
:x: Sinon, **demande au prof**.
Tu peux également installer l’application Slack sur ton téléphone et te connecter à `lewagon-alumni` !
================================================
FILE: _partials/fr/sqlite.md
================================================
## SQLite
Dans quelques semaines, on abordera les bases de données et le SQL. [SQLite](https://sqlite.org/index.html) est un système de gestion de base de données utilisé pour exécuter des requêtes SQL sur des bases de données d'un seul fichier. Installons-le :
Dans un terminal, exécute la commande suivante :
```bash
sudo apt-get install sqlite3 libsqlite3-dev pkg-config
```
Puis exécute celle-ci :
```bash
sqlite3 -version
```
:heavy_check_mark: Si tu vois une version s'afficher, c'est tout bon :+1:
:x: If not, **demande au prof**
================================================
FILE: _partials/fr/ssh_agent.md
================================================
## Désactiver l’invite de phrase secrète SSH
Tu veux éviter d’avoir à fournir ta phrase secrète chaque fois que tu communiques avec un dépôt de code distant. Pour cela, tu as besoin d’ajouter le plug-in `ssh-agent` à `oh my zsh` :
Commence par ouvrir le fichier `.zshrc` :
```bash
code ~/.zshrc
```
Puis :
- Localise la ligne commençant par `plugins=`
- Ajoute `ssh-agent` à la fin de la liste des plug-ins
La liste doit ressembler à ça :
```bash
plugins=(gitfast last-working-dir common-aliases zsh-syntax-highlighting history-substring-search pyenv ssh-agent)
```
:heavy_check_mark: Enregistre le fichier `.zshrc` à l’aide des touches `Ctrl` + `S` et ferme ton éditeur de texte.
================================================
FILE: _partials/fr/ubuntu_postgresql.md
================================================
## PostgreSQL
Parfois, SQLite n'est pas suffisant et nous aurons besoin d'un outil plus avancé appelé [PostgreSQL](https://www.postgresql.org/), un système de gestion de base de données adapté à la production, puissant et open source.
Installons-le maintenant.
Exécute les commandes suivantes :
```bash
sudo apt install -y postgresql postgresql-contrib libpq-dev build-essential
```
```bash
sudo -u postgres psql --command "CREATE ROLE \"`whoami`\" LOGIN createdb superuser;"
```
================================================
FILE: _partials/fr/ubuntu_settings.md
================================================
## Paramètres Ubuntu
### Installer le codec vidéo H264
Sur notre plateforme pédagogique (Kitt, que tu découvriras bientôt), on propose des vidéos. Par défaut, Firefox sur Linux ne peut pas les lire, car elles utilisent un codec qui n’est pas pris en charge (H264). Pour pouvoir lire ces vidéos, tu dois exécuter la commande suivante :
```bash
sudo apt install libavcodec-extra -y
```
### Installer des outils de terminal utiles
`tree` est un outil pratique qui permet de visualiser une arborescence de dossiers à l’intérieur du terminal.
`ncdu` est un utilitaire de disque à interface texte.
`htop` est un visualiseur de processus interactif.
`tig` est une interface en mode texte pour `git`.
```bash
sudo apt install tree ncdu htop tig
```
### inotify Ubuntu
Ubuntu surveille toutes les modifications apportées à tes dossiers ; pour cela, il utilise inotify.
Par défaut, la limite Ubuntu est fixée à 8 192 fichiers surveillés.
La programmation implique de travailler avec un grand nombre de fichiers ; on doit donc relever cette limite.
Dans ton terminal, exécute :
```bash
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
```
### Épingler des applications à ton Dock
Tu utiliseras très souvent la plupart des applications que tu as installées aujourd’hui. Épingle-les pour y accéder en un seul clic !
Pour épingler une application à ton Dock, lance l’application, fais un clic droit sur l’icône dans le Dock pour faire apparaître le menu contextuel et choisis « Ajouter aux favoris ».

Tu dois épingler :
- ton terminal
- ton explorateur de fichiers
- VS Code
- ton navigateur Internet
- Slack
================================================
FILE: _partials/fr/ubuntu_slack.md
================================================
## Slack
[Slack](https://slack.com/) est une plateforme de communication assez populaire dans le secteur de la technologie.
### Installation
[Télécharge l’application Slack](https://slack.com/intl/fr-fr/help/articles/212924728-T%C3%A9l%C3%A9charger-Slack-pour-Linux--version-b%C3%AAta-) et installe-la.
:warning: Si tu utilises déjà Slack dans ton navigateur, télécharge et installe **l'application de bureau**, qui comprend toutes les fonctionnalités.
================================================
FILE: _partials/fr/ubuntu_vscode.md
================================================
## Visual Studio Code
### Installation
On va maintenant installer l’éditeur de texte [Visual Studio Code](https://code.visualstudio.com).
Copie (`Ctrl` + `C`) les commandes ci-dessous, puis colle-les dans ton terminal (`Ctrl` + `Shift` + `v`) :
```bash
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
rm -f packages.microsoft.gpg
sudo apt update
sudo apt install -y code
```
Ces commandes te demanderont ton mot de passe ; saisis-le.
:warning: Lorsque tu saisiras ton mot de passe, rien ne s’affichera à l’écran ; **c’est normal**. Il s’agit d’une mesure de sécurité permettant de masquer ton mot de passe et sa longueur. Saisis simplement ton mot de passe, puis appuie sur `Enter`.
### Lancement depuis le terminal
On va maintenant lancer VS Code depuis **le terminal** :
```bash
code
```
:heavy_check_mark: Si une fenêtre VS Code s’ouvre, c’est bon. :+1:
:x: Sinon, **demande au prof**.
================================================
FILE: _partials/fr/vscode_aifeatures.md
================================================
### Fonctionnalités IA de VS Code
VS Code inclut de nombreuses **fonctionnalités d'IA** puissantes, qui sont un excellent outil une fois que vous savez déjà coder.
Cela dit, s'appuyer sur l'IA trop tôt peut masquer des concepts importants et rendre le débogage plus difficile à comprendre. Une fois à l'aise avec les fondamentaux, vous saurez quand et comment utiliser l'IA efficacement — sans lui laisser faire la réflexion à votre place.
Pour le début du bootcamp, nous allons désactiver ces fonctionnalités. Au bon moment du cours, nous les réactiverons afin que vous puissiez les utiliser à bon escient.
Dans **VS Code** :
1. Ouvrez la "Palette de commandes" de VS Code : tapez `Ctrl-Shift-P` (Windows / Linux) ou `Cmd-Shift-P` (macOS).
1. La Palette de commandes s'ouvrira : une petite zone de texte en haut de l'écran. Commencez à taper `aifeatures` jusqu'à voir "Chat: Learn How to Hide AI features". Cliquez dessus.

1. Cela ouvrira les paramètres et affichera l'option "Disable and hide built-in AI features ...". Cochez la case devant cette option.

Plus tard, si vous souhaitez **réactiver** les fonctionnalités d'IA, vous pouvez suivre les mêmes instructions pour décocher la case.
================================================
FILE: _partials/fr/vscode_extensions.md
================================================
## Extensions VS Code
### Installation
On va maintenant installer quelques extensions utiles à VS Code.
Copie-colle les commandes suivantes dans le terminal :
```bash
code --install-extension ms-vscode.sublime-keybindings
code --install-extension emmanuelbeziat.vscode-great-icons
code --install-extension MS-vsliveshare.vsliveshare
code --install-extension shopify.ruby-lsp
code --install-extension dbaeumer.vscode-eslint
code --install-extension Rubymaniac.vscode-paste-and-indent
code --install-extension alexcvzz.vscode-sqlite
code --install-extension anteprimorac.html-end-tag-labels
code --install-extension marcoroth.herb-lsp
code --install-extension rayhanw.erb-helpers
```
Voici la liste des extensions que tu es en train d'installer :
- [Sublime Text Keymap and Settings Importer](https://marketplace.visualstudio.com/items?itemName=ms-vscode.sublime-keybindings)
- [VSCode Great Icons](https://marketplace.visualstudio.com/items?itemName=emmanuelbeziat.vscode-great-icons)
- [Live Share](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare)
- [Ruby](https://marketplace.visualstudio.com/items?itemName=shopify.ruby-lsp)
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [Paste and Indent](https://marketplace.visualstudio.com/items?itemName=Rubymaniac.vscode-paste-and-indent)
- [SQLite](https://marketplace.visualstudio.com/items?itemName=alexcvzz.vscode-sqlite)
================================================
FILE: _partials/fr/vscode_liveshare.md
================================================
### Configuration de Live Share
[Visual Studio Live Share](https://visualstudio.microsoft.com/services/live-share/) est une extension de VS Code, qui te permet de partager du code dans ton éditeur de texte pour débugger et faire de la programmation en binôme. Configurons-le !
Lance VS Code depuis ton terminal en saisissant `code` et en appuyant sur `Enter`.
Clique sur la petite flèche en bas de la barre de gauche :point_down:

- Clique sur le bouton « Partager », puis sur « GitHub (connecte-toi avec ton compte GitHub) ».
- Une popup t’invitant à te connecter avec GitHub apparaît. Clique sur « Autoriser ».
- Tu arriveras alors sur une page GitHub dans ton navigateur, où on te demandera d’autoriser Visual Studio Code ; clique sur « Continuer », puis « Autoriser GitHub ».
- Il se peut que VS Code affiche d’autres popups ; ferme-les en cliquant sur « OK ».
C’est bon !
================================================
FILE: _partials/fr/windows_browser.md
================================================
## Associer ton navigateur par défaut à Ubuntu
Pour que tu puisses interagir avec le navigateur installé sous Windows depuis ton terminal Ubuntu, on doit le définir comme navigateur par défaut.
:warning: Tu dois exécuter au moins une des commandes ci-dessous :
Google Chrome est ton navigateur par défaut
Exécute la commandes :
```bash
ls /mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe
```
Si tu obtiens une erreur du type `ls: cannot access...`, exécute la commande suivante :
```bash
echo "export BROWSER=\"/mnt/c/Program Files/Google/Chrome/Application/chrome.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files/Google/Chrome/Application/chrome.exe'\"" >> ~/.zshrc
```
Sinon, exécute :
```bash
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe'\"" >> ~/.zshrc
```
Mozilla Firefox est ton navigateur par défaut
Exécute la commandes :
```bash
ls /mnt/c/Program\ Files\ \(x86\)/Mozilla\ Firefox/firefox.exe
```
Si tu obtiens une erreur du type `ls: cannot access...`, exécute la commande suivante :
```bash
echo "export BROWSER=\"/mnt/c/Program Files/Mozilla Firefox/firefox.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files/Mozilla Firefox/firefox.exe'\"" >> ~/.zshrc
```
Sinon, exécute :
```bash
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Mozilla Firefox/firefox.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Mozilla Firefox/firefox.exe'\"" >> ~/.zshrc
```
Microsoft Edge est ton navigateur par défaut
Exécute la commandes :
```bash
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe'\"" >> ~/.zshrc
```
Redémarre ton terminal.
Puis vérifie que la commande suivante renvoie « Browser defined 👌 » :
```bash
[ -z "$BROWSER" ] && echo "ERROR: please define a BROWSER environment variable ⚠️" || echo "Browser defined 👌"
```
Si ce n’est pas le cas,
:heavy_check_mark: Si tu vois apparaître ce message, tu peux continuer :+1:
:x: Sinon, choisis un navigateur dans la liste ci-dessus et exécute la commande correspondante. Puis n’oublie pas de réinitialiser ton terminal :
```bash
exec zsh
```
N’hésite pas à **demander au prof**.
================================================
FILE: _partials/fr/windows_postgresql.md
================================================
## PostgreSQL
Parfois, SQLite n'est pas suffisant et nous aurons besoin d'un outil plus avancé appelé [PostgreSQL](https://www.postgresql.org/), un système de gestion de base de données adapté à la production, puissant et open source.
Installons-le maintenant.
Exécute les commandes suivantes :
```bash
sudo apt install -y postgresql postgresql-contrib libpq-dev build-essential
```
```bash
sudo /etc/init.d/postgresql start
```
```bash
sudo -u postgres psql --command "CREATE ROLE \"`whoami`\" LOGIN createdb superuser;"
```
Tu peux configurer le démarrage automatique de PostgreSQL afin de ne pas avoir à exécuter `sudo /etc/init.d/postgresql start` chaque fois que tu ouvres un nouveau terminal :
```bash
sudo echo "`whoami` ALL=NOPASSWD:/etc/init.d/postgresql start" | sudo tee /etc/sudoers.d/postgresql
```
```bash
sudo chmod 440 /etc/sudoers.d/postgresql
```
```bash
echo "sudo /etc/init.d/postgresql start" >> ~/.zshrc
```
Ouvre un nouveau terminal.
:heavy_check_mark: Si tu vois apparaître le message `* Starting postgresql (via systemctl): postgresql.service` OU `* Starting PostgreSQL 14 database server`, c’est bon :+1:
:x: Sinon, **demande au prof**.
================================================
FILE: _partials/fr/windows_settings.md
================================================
## Paramètres Windows
### Échanger des fichiers entre Windows et Ubuntu
On a besoin d’un moyen simple pour transférer des fichiers de Windows à Ubuntu et inversement.
Pour cela, on va créer des raccourcis vers les répertoires Ubuntu dans l’**explorateur de fichiers** Windows :
- Ouvre l’explorateur de fichiers Windows (ou utilise le raccourci `WIN` + `E`)
- Dans la barre d’adresse, saisis `\\wsl$\` (ou `\\wsl$\Ubuntu` si la première option ne fonctionne pas)
- Tu as désormais accès au système de fichiers Ubuntu
- Parcours le système de fichiers Ubuntu à la recherche des répertoires qui t’intéressent
- Fais glisser les répertoires souhaités dans la barre d’adresse pour créer des raccourcis

### Ouvrir l’explorateur de fichiers Windows à partir du terminal Ubuntu
Un autre moyen pour déplacer les fichiers consiste à ouvrir l’**explorateur de fichiers Windows** à partir du terminal Ubuntu :
- Ouvre un terminal Ubuntu
- Va dans le répertoire que tu souhaites parcourir
- Exécute la commande `explorer.exe .` (ou `wslview .`)
- Si tu obtiens un message d’erreur, exécute `wsl --shutdown` dans un Windows PowerShell et rouvre un terminal Ubuntu

### Trouver ton chemin dans le système de fichiers Ubuntu
Il se peut que tu aies besoin de connaître l’emplacement exact d’un répertoire Windows dans le système de fichiers Ubuntu ou l’inverse.
Pour convertir un chemin Windows en chemin Ubuntu et inversement :
- Ouvre un terminal Ubuntu
- Utilise la commande `wslpath "C:\Program Files"` pour traduire un chemin Windows en chemin Ubuntu
- Utilise la commande `wslpath -w "/home"` pour traduire un chemin Ubuntu en chemin Windows
- La commande `wslpath -w $(pwd)` renvoie le chemin Windows vers le répertoire Ubuntu actuel

### Épingler des applications à ta barre des tâches
Tu utiliseras très souvent la plupart des applications que tu as installées aujourd’hui. Épingle-les à ta barre des tâches pour y accéder en un seul clic !
Pour épingler une application à ta barre des tâches, lance l’application, fais un clic droit sur l’icône dans la barre des tâches pour faire apparaître le menu contextuel et sélectionne « Épingler à la barre des tâches ».

Tu dois épingler :
- ton terminal
- ton explorateur de fichiers
- VS Code
- ton navigateur Internet
- Slack
================================================
FILE: _partials/fr/windows_slack.md
================================================
## Slack
[Slack](https://slack.com/) est une plateforme de communication assez populaire dans le secteur de la technologie.
### Installation
[Télécharge l’application Slack](https://slack.com/downloads/windows) et installe-la.
:warning: Si tu utilises déjà Slack dans ton navigateur, télécharge et installe **l'application de bureau**, qui comprend toutes les fonctionnalités.
================================================
FILE: _partials/fr/windows_terminal.md
================================================
## Windows Terminal
### Installation
:information_source: Les instructions suivantes dépendent de ta version de Windows.
Si tu as Windows 11, le Windows Terminal est déjà installé et tu peux passer à la section suivante :point_down:
Si tu as Windows 10, nous allons installer le Windows Terminal, un terminal vraiment moderne.
Windows 10: Installer le Windows Terminal
- Clique sur `Démarrer`
- Saisis `Microsoft Store`
- Clique sur `Microsoft Store` dans la liste
- Recherche `Windows Terminal` dans la barre de recherche
- **Sélectionne Windows Terminal**
- Clique sur `Installer`
:warning: N’installe PAS **Windows Terminal Preview**, uniquement **Windows Terminal** !
Désinstaller la mauvaise version de Windows Terminal
Pour désinstaller une mauvaise version de Windows Terminal, il te suffit d’aller dans la liste des programmes installés de Windows 10 :
- Appuie sur `Windows` + `R`
- Saisis `ms-settings:appsfeatures`
- Appuie sur `Enter`
Trouve le logiciel à désinstaller et clique sur le bouton de désinstallation.
Une fois l’installation terminée, le bouton « Installer » se transforme en bouton « Lancer » ; clique dessus.
### Définir Ubuntu comme terminal par défaut
On va définir Ubuntu comme terminal par défaut de ton application Windows Terminal.
Appuie sur `Ctrl` + `,`
pour ouvrir les paramètres du terminal :

- Remplace le profil par défaut par « Ubuntu »
- Clique sur « Enregistrer »
- Clique sur « Ouvrir le fichier JSON »
La partie à modifier est entourée en rouge :
[Fichier de paramètres JSON de Windows Terminal](images/windows\_terminal\_settings\_json.png)
On va commencer par demander à Ubuntu de démarrer directement dans ton répertoire personnel Ubuntu au lieu du répertoire Windows :
- Recherche `"name": "Ubuntu",`
- Ajoute la ligne suivante après :
```bash
"commandline": "wsl.exe ~",
```
:warning: N’oublie pas la virgule à la fin de la ligne !
On va ensuite désactiver les avertissements pour les commandes de copier-coller entre Windows et Ubuntu :
- Recherche la ligne `"defaultProfile": "{2c4de342-...}"`
- Ajoute la ligne suivante après :
```bash
"warning.multiLinePaste": false,
```
:warning: N’oublie pas la virgule à la fin de la ligne !
Tu peux enregistrer ces modifications en appuyant sur `Ctrl` + `S`
:heavy_check_mark: Ton **Windows Terminal** est maintenant configuré :+1:
Ce terminal a des onglets ; tu peux choisir d’ouvrir un nouvel onglet de terminal en cliquant sur **+** à côté de l’onglet actuel.
**Désormais, chaque fois que l'on fera référence au terminal ou à la console, il s’agira de celui-ci.** N’utilise PLUS aucun autre terminal.
================================================
FILE: _partials/fr/windows_ubuntu.md
================================================
## Ubuntu
### Installation
Si tu as Windows 11, après avoir redémarré ton ordinateur, tu devrais voir une fenêtre de terminal indiquant que WSL poursuit le processus d'installation d'Ubuntu. Lorsque c'est terminé, Ubuntu va se lancer.
Résolution des problèmes pour Windows 10 (uniquement si nécessaire, vérifie avec un TA)
Si l'installation d'Ubuntu ne reprend pas, essaye d'abord à nouveau : relance Powershell ou l'Invite de commandes et exécute la commande `wsl --install` une nouvelle fois.
Si tu as Windows 10, installons Ubuntu via le Microsoft Store :
- Clique sur `Start`
- Saisis `Microsoft Store`
- Clique sur `Microsoft Store` dans la liste
- Recherche `Ubuntu` dans la barre de recherche
- **Sélectionne la version nommée « Ubuntu » sans aucun chiffre**
- Clique sur `Installer`
:warning: N’installe pas **Ubuntu 18.04 LTS** ni **Ubuntu 20.04** !
Désinstaller les mauvaises versions d’Ubuntu
Pour désinstaller une mauvaise version d’Ubuntu, il te suffit d’aller dans la liste des programmes installés de Windows 10 :
- Appuie sur `Windows` + `R`
- Saisis `ms-settings:appsfeatures`
- Appuie sur `Enter`
Trouve le logiciel à désinstaller et clique sur le bouton de désinstallation.
Une fois l’installation terminée, le bouton « Installer » se transforme en bouton « Lancer » ; clique dessus.
### Premier lancement
Au premier lancement, on te demandera de fournir des informations :
- Choisis un **nom d’utilisateur** :
- un mot
- en minuscules
- sans caractères spéciaux
- par exemple : `lewagon` ou ton `prenom`
- Choisis un **mot de passe**
- Confirme ton mot de passe
:warning: Lorsque tu saisiras ton mot de passe, rien ne s’affichera à l’écran ; **c’est normal**. Il s’agit d’une mesure de sécurité permettant de masquer ton mot de passe et sa longueur. Saisis simplement ton mot de passe, puis appuie sur `Enter`.
Tu peux fermer la fenêtre Ubuntu maintenant qu’elle est installée sur ton ordinateur.
### Vérifier la version de WSL sous Ubuntu
- Appuie sur `Windows` + `R`
- Saisis `cmd`
- Appuie sur `Enter`
Saisis la commande suivante :
```bash
wsl -l -v
```
:heavy_check_mark: Si la version de WSL sous Ubuntu est la 2, c’est bon. :+1:
:x: Si la version de WSL sous Ubuntu est la 1, il va falloir passer à la version 2.
Passer de la version 1 à la version 2 de WSL sous Ubuntu
Dans la fenêtre d’invite de commande, saisis :
```bash
wsl --set-version Ubuntu 2
```
:heavy_check_mark: Au bout de quelques secondes, tu devrais voir apparaître le message suivant : `The conversion is complete`.
:x: Si ce n’est pas le cas, il faut vérifier que les fichiers Ubuntu ne sont pas compressés.
Vérifier que les fichiers sont décompressés
- Appuie sur `Windows` + `R`
- Saisis `%localappdata%\Packages`
- Appuie sur `Enter`
- Ouvre le dossier nommé `CanonicalGroupLimited.UbuntuonWindows...`
- Fais un clic droit sur le dossier `LocalState`
- Clique sur `Properties`
- Clique sur `Advanced`
- Vérifie que l’option `Compresser le contenu` n’est **pas** cochée, puis clique sur `Ok`.
Applique les modifications à ce dossier uniquement et réessaie de convertir la version de WSL sous Ubuntu.
:x: Si la conversion ne fonctionne pas, **demande au prof**.
Tu peux maintenant fermer cette fenêtre de terminal.
### Vérifier ton nom d'utilisateur
Tape cette commande dans le terminal Ubuntu :
```bash
whoami
```
Cela devrait renvoyer le nom d'utilisateur que tu as choisi précédemment.
:x: Si cela affiche `root`, **contacte un TA** avant de continuer !
================================================
FILE: _partials/fr/windows_version.md
================================================
## Version de Windows
Avant de commencer, on va vérifier que la version de Windows installée sur ton ordinateur est compatible avec ces instructions de configuration.
### Windows 10 ou Windows 11
> :warning: **Note sur Windows 10 et la sécurité**
>
> La configuration du bootcamp Le Wagon fonctionne sur Windows 10. Cela dit, on recommande fortement de passer à Windows 11. Depuis le 14 octobre 2025, Microsoft a mis fin au support de Windows 10 : il ne reçoit plus de mises à jour de sécurité, ce qui peut exposer ta machine. Pour plus de détails, consulte le [guide de Microsoft](https://support.microsoft.com/en-us/windows/windows-10-support-has-ended-on-october-14-2025-2ca8b313-1946-43d3-b55c-2b95b107f281). Si ton ordinateur ne peut pas exécuter Windows 11, envisage de passer à Ubuntu.
Pour pouvoir configurer ton ordinateur, **Windows 10 ou Windows 11** doit être installé dessus.
Pour connaître ta version de Windows :
- Appuie sur `Windows` + `R`
- Saisis `winver`
- Appuie sur `Enter`
:heavy_check_mark: Si les premiers mots qui apparaissent dans cette fenêtre sont **Windows 11**, c’est bon :+1:
Si les premiers mots qui apparaissent dans cette fenêtre sont **Windows 10**, vérifie le numéro de version:
- :heavy_check_mark: Si la version indique au moins `2004`, c’est bon :+1:
- :x: Sinon, il faut que tu mettes à jour ton Windows.
-
Comment installer les dernières mises à jour
Ouvre Windows Update :
- Appuie sur `Windows` + `R`
- Saisis `ms-settings:windowsupdate`
- Appuie sur `Enter`
- Clique sur « Rechercher les mises à jour »
:heavy_check_mark: Si tu vois apparaître une coche verte et le message « Vous êtes à jour », c’est bon :+1:
:warning: Si tu vois apparaître un point d’exclamation rouge et le message « Mise à jour disponible », installe-la et recommence jusqu’à ce que le message « Vous êtes à jour » apparaisse :loop:
:x: Si tu vois apparaître un message d’erreur indiquant que Windows ne peut pas appliquer les mises à jour, **demande au prof**.
Activer le service Windows Update pour corriger les mises à jour
Certains antivirus et logiciels désactivent le service de mise à jour dont on a besoin, entraînant l’erreur que tu vois apparaître. On va corriger ça !
- Appuie sur `Windows` + `R`
- Saisis `services.msc`
- Appuie sur `Enter`
- Double-clique sur `Windows Update Service`
- Définis `Startup` sur `Automatic`
- Clique sur `Start`
- Clique sur `Ok`
On va maintenant réessayer d’effectuer les mises à jour.
Vérifie le numéro de version :
- Appuie sur `Windows` + `R`
- Saisis `winver`
- Appuie sur `Enter`
:heavy_check_mark: Si la version indique au moins `1903`, c’est bon :+1:
:x: S’il s’agit d’une version antérieure, **demande au prof**.
================================================
FILE: _partials/fr/windows_virtualization.md
================================================
## Virtualisation
On doit vérifier que les options de virtualisation sont activées dans le BIOS de ton ordinateur.
C’est déjà le cas sur de nombreux ordinateurs. Vérifions-le :
- Appuie sur `Windows` + `R`
- Saisis `taskmgr`
- Appuie sur `Enter`
- Clique sur l’onglet `Performance`
- Clique sur `CPU`

:heavy_check_mark: Si tu vois « Virtualisation : activée », c’est bon :+1:
:x: Si la ligne est manquante ou si la virtualisation est désactivée, **demande au prof avant d’essayer d’activer la virtualisation**
Activer la virtualisation
On a besoin d’accéder au BIOS / à l’UEFI de l’ordinateur pour activer la virtualisation.
- Appuie sur `Windows + R`
- Saisis `shutdown.exe /r /o /t 1`
- Appuie sur `Enter`
- Attends que l’ordinateur s’arrête
- Clique sur `Troubleshoot`
- Clique sur `Advanced Options`
- Clique sur `UEFI Firmware Settings`
- Clique sur `Restart`
Tu dois activer l’option de virtualisation de ton processeur ici :
- La plupart du temps, dans les paramètres avancés, les paramètres du processeur ou les paramètres Northbridge
- L’option peut avoir un nom différent en fonction de ton ordinateur :
- Intel : `Intel VT-x`, `Intel Virtualization Technology`, `Virtualization Extensions`, `Vanderpool`...
- AMD : `SVM Mode` ou `AMD-V`
- Enregistre les modifications après activation et redémarre l’ordinateur en utilisant l’option correspondante
================================================
FILE: _partials/fr/windows_vscode.md
================================================
## Visual Studio Code
### Installation
On va maintenant installer l’éditeur de texte [Visual Studio Code](https://code.visualstudio.com).
- Va sur la [page de téléchargement de Visual Studio Code](https://code.visualstudio.com/download).
- Clique sur le bouton « Windows »
- Ouvre le fichier que tu viens de télécharger.
- Installe-le avec quelques options :

Une fois l’installation terminée, lance VS Code.
### Connecter VS Code à Ubuntu
Tu devrais voir un cadre dans le coin inférieur droit de VS Code indiquant qu’il détecte WSL. Accepte l’installation de l’extension de WSL pour VS Code.
:warning: Cette extension est obligatoire pour utiliser VS Code !
```bash
code --install-extension ms-vscode-remote.remote-wsl
```
Then open VS Code from your terminal:
```bash
code .
```
:heavy_check_mark: Si tu vois `WSL: Ubuntu` dans le coin inférieur gauche de la fenêtre VS Code, c'est tout bon :+1:

:x: Sinon, **demande au prof**
================================================
FILE: _partials/fr/windows_wsl.md
================================================
## Sous-système Windows pour Linux (WSL)
WSL est l’environnement de développement que l’on utilise pour exécuter Ubuntu. Pour en savoir plus sur WSL, [consulte cette page](https://docs.microsoft.com/fr-fr/windows/wsl/faq).
Nous allons installer WSL 2 et Ubuntu en une seule commande via le Windows Command Prompt.
:warning: Dans les instructions suivantes, utilise la combinaison de touches `Ctrl` + `Shift` + `Enter` pour exécuter **Windows Command Prompt** en tant qu’administrateur au lieu de cliquer simplement sur `Ok` ou d’appuyer sur `Enter`.
- Appuie sur `Windows` + `R`
- Saisis `cmd`
- Appuie sur **`Ctrl` + `Shift` + `Enter`**
:warning: Tu devras peut-être accepter la confirmation UAC concernant l’octroi des droits d’administrateur.
Une fenêtre de terminal apparaîtra :
- Copie la commande suivante (`Ctrl` + `C`)
- Colle-la dans la fenêtre du terminal (`Ctrl` + `V` ou en faisant un clic droit dans la fenêtre)
- Exécute-les en appuyant sur `Enter`
```powershell
wsl --install
```
:heavy_check_mark: Si la commande s’exécute sans erreur, redémarre ton ordinateur et suis les instructions ci-dessous :+1:
:x: Si tu obtiens un message d’erreur (ou si tu vois apparaître du texte en rouge dans la fenêtre), **demande au prof**.
Dépannage pour Windows 10 (uniquement si nécessaire, vérifie avec un professeur)
#### Pour Windows 10 < 2004 : installer d'abord WSL 1
:warning: Dans les instructions suivantes, utilise la combinaison de touches `Ctrl` + `Shift` + `Enter` pour exécuter **Windows PowerShell** en tant qu’administrateur au lieu de cliquer simplement sur `Ok` ou d’appuyer sur `Enter`.
- Appuie sur `Windows` + `R`
- Saisis `powershell`
- Appuie sur **`Ctrl` + `Shift` + `Enter`**
:warning: Tu devras peut-être accepter la confirmation UAC concernant l’octroi des droits d’administrateur.
Une fenêtre de terminal bleue apparaîtra :
- Copie les commandes suivantes une par une (`Ctrl` + `C`)
- Colle-les dans la fenêtre PowerShell (`Ctrl` + `V` ou en faisant un clic droit dans la fenêtre)
- Exécute-les en appuyant sur `Enter`
```powershell
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
```
```powershell
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
```
```powershell
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
```
:heavy_check_mark: Si les trois commandes s’exécutent sans erreur, redémarre ton ordinateur et suis les instructions ci-dessous :+1:
:x: Si tu obtiens un message d’erreur (ou si tu vois apparaître du texte en rouge dans la fenêtre), **demande au prof**
#### Pour Windows 10 avec WSL 1 : Mise à niveau vers WSL 2
Si tu as Windows 10, on va maintenant mettre à jour WSL à la version 2.
Une fois que ton ordinateur a redémarré, on doit télécharger le programme d’installation de WSL 2.
- Va sur la [page de téléchargement](https://aka.ms/wsl2kernel)
- Télécharge le « WSL2 Linux kernel update package 2 »
- Ouvre le fichier que tu viens de télécharger
- Clique sur `Suivant`
- Clique sur `Terminer`

:heavy_check_mark: Si tu ne rencontres aucun message d’erreur, c’est bon :+1:
:x: Si tu obtiens l’erreur « Cette mise à jour s’applique seulement aux machines avec le sous-système Windows pour Linux », **fais un clic droit** sur le programme et sélectionne `uninstall` ; tu devrais pouvoir l’installer normalement cette fois-ci.
#### Pour Windows 10 avec WSL 1 : Définir WSL 2 comme sous-système Windows pour Linux par défaut
Si tu as Windows 10, on va enfin définir la version 2 de WSL comme étant la version par défaut.
Maintenant que WLS 2 est installé, on va le définir comme version par défaut :
- Appuie sur `Windows` + `R`
- Saisis `cmd`
- Appuie sur `Enter`
Dans la fenêtre qui apparaît, saisis :
```bash
wsl --set-default-version 2
```
:heavy_check_mark: Si tu vois apparaître « The operation completed successfully », tu peux fermer ce terminal et suivre les instructions ci-dessous :+1:
:x: Si le message qui s’affiche concerne la virtualisation, **demande au prof**
Activer la fonction Virtual Machine Platform sous Windows
Suis les étapes décrites [ici](https://www.configserverfirewall.com/windows-10/please-enable-the-virtual-machine-platform-windows-feature-and-ensure-virtualization-is-enabled-in-the-bios/#:~:text=To%20enable%20WSL%202,%20Open,Windows%20feature%20on%20or%20off.&text=Ensure%20that%20the%20Virtual%20Machine,Windows%20will%20enable%20WSL%202) pour activer Virtual Machine Platform et le sous-système Windows pour Linux
Activer la fonction Hyper-V sous Windows
Suis les étapes décrites [ici](https://winaero.com/enable-use-hyper-v-windows-10/) pour activer le groupe Hyper-V
:information_source: Si tu as Windows 10 **Home edition**, la fonction Hyper-V n'est pas disponible sur ton système d'exploitation. Ce n'est pas bloquant et tu peux continuer à suivre les instructions ci-dessous :ok_hand:
================================================
FILE: _partials/fr/yarn.md
================================================
## yarn
[`yarn`](https://yarnpkg.com/) est un gestionnaire de paquets, qui permet d’installer des bibliothèques JavaScript. Installons-le :
Exécute les commandes suivantes dans le terminal :
```bash
corepack enable
yarn set version stable
```
```bash
exec zsh
```
⚠️ Si tu rencontres des messages d'erreur, essaye d'exécuter `npm install -g corepack` puis exécute à nouveau les commandes ci-dessus.
Puis exécute la commande suivante :
```bash
yarn -v
```
:heavy_check_mark: Si tu vois apparaître une version, c’est bon :+1:
:x: Sinon, **demande au prof**
================================================
FILE: _partials/gh_cli.md
================================================
## GitHub CLI
CLI is the acronym of [Command-line Interface](https://en.wikipedia.org/wiki/Command-line_interface).
In this section, we will use [GitHub CLI](https://cli.github.com/) to interact with GitHub directly from the terminal.
It should already be installed on your computer from the previous commands.
We will use the GitHub CLI (`gh`) to connect to GitHub using *SSH*, a protocol to log in using SSH keys instead of the well known username/password pair.
First in order to **login**, copy-paste the following command in your terminal:
:warning: **DO NOT edit the `email`**
```bash
gh auth login -s 'user:email' -w --git-protocol ssh
```
`gh` will ask you few questions:
- `Generate a new SSH key to add to your GitHub account?` Press `Enter` to ask gh to generate the SSH keys for you.
If you already have SSH keys, you will see instead `Upload your SSH public key to your GitHub account?` With the arrows, select your public key file path and press `Enter`.
- `Enter a passphrase for your new SSH key (Optional)`. Type something you want and that you'll remember. It's a password to protect your private key stored on your hard drive. Then press `Enter`.
- `Title for your SSH key`. You can leave it at the proposed "GitHub CLI", press `Enter`.
You will then get the following output:
```bash
! First copy your one-time code: 0EF9-D015
- Press Enter to open github.com in your browser...
```
Select and copy the code (`0EF9-D015` in the example), then press `Enter`.
Your browser will open and ask you to authorize GitHub CLI to use your GitHub account. Accept and wait a bit.
Come back to the terminal, press `Enter` again, and that's it.
To check that you are properly connected, type:
```bash
gh auth status
```
:heavy_check_mark: If you get `Logged in to github.com as `, then all good :+1:
:x: If not, **contact a teacher**.
================================================
FILE: _partials/github.md
================================================
## GitHub account
Have you signed up to GitHub? If not, [do it right away](https://github.com/join).
:point_right: **[Upload a picture](https://github.com/settings/profile)** and put your name correctly on your GitHub account. This is important as we'll use an internal dashboard with your avatar. Please do this **now**, before you continue with this guide.

:point_right: **[Enable Two-Factor Authentication (2FA)](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication#configuring-two-factor-authentication-using-text-messages)**. GitHub will send you text messages with a code when you try to log in. This is important for security and also will soon be required in order to contribute code on GitHub.
================================================
FILE: _partials/intro.md
================================================
# Setup instructions
You will find below the instructions to set up your computer for [Le Wagon AI Software Development course](https://www.lewagon.com/web-development-course/full-time).
Please **read them carefully and execute all commands in the following order**.
If you get stuck, don't hesitate to ask a teacher for help :raising_hand:
You can also have a look at [our cheatsheets](https://github.com/lewagon/setup/tree/master/docs) for common issue fixes and tips :heavy_check_mark:
Let's start :rocket:
================================================
FILE: _partials/kitt.md
================================================
## Kitt
You should have received an email from Le Wagon inviting you to sign up on [Kitt](https://kitt.lewagon.com) (our learning platform). When submitting your onboarding form on Kitt, you should have received two additional invitations:
- One from Slack, inviting you to the Le Wagon Alumni slack community (where you'll chat with your buddies and all the previous alumni). Click on **Join** and fill the information.
- One from GitHub, inviting you to `lewagon` team. **Accept it** otherwise you won't be able to access the lecture slides.
If you haven't, please contact your teaching team.
================================================
FILE: _partials/macos_apple_silicon.md
================================================
## Apple Silicon Chips
If you bought your computer after late 2020, chances are it has a new Apple silicon chip instead of an Intel processor: let's find out.
Open a new terminal window from Applications > Utilities or search for it with [Spotlight](https://support.apple.com/en-gb/HT204014):

Copy-paste the following command in the terminal and hit `Enter` to execute.
``` bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/setup/master/utils/macos_list_processor_type.sh)"
```
☝️ The result of the command should indicate whether your computer uses Apple Silicon.
If your computer uses Apple Silicon, expand the paragraph below and go through it. Otherwise ignore it.
👉 Setup for Apple Silicon 👈
### Uninstall Homebrew
We need to uninstall Homebrew in case a native version was installed.
Execute the following command in the terminal:
``` bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
```
If brew was not installed you will get the message `brew: command not found!`
### Configure Terminal for Rosetta
Open the Finder app (or search for it with [Spotlight](https://support.apple.com/en-gb/HT204014)).
Go to Applications > Utilities.
Duplicate the terminal app (select it, then `Cmd` + `C`, `Cmd` + `V`), and rename a copy as Terminal Rosetta.
Press `Cmd` + `I` on the Terminal Rosetta app, then check the box "Open using Rosetta".
⚠️ From now on during the bootcamp, whenever you are asked to open a Terminal, you will use the **Terminal Rosetta** app.
================================================
FILE: _partials/macos_command_line_tools.md
================================================
## A note about quitting apps on a Mac
Clicking the little red cross in the top left corner of the application window on a Mac **does not really quit it**, it just closes an active window. To quit the application _for real_ either press `Cmd + Q` when the application is active, or navigate to `APP_NAME` -> `Quit` in the menu bar.

During this setup you will be asked to **quit and re-open** applications multiple times, please make sure you do it properly :pray:
## Command Line Tools
Open a new terminal, copy-paste the following command and hit `Enter`:
```bash
xcode-select --install
```
If you receive the following message, you can just skip this step and go to next step.
```bash
# command line tools are already installed, use "Software Update" to install updates
```
Otherwise, it will open a window asking you if you want to install some software: click on "Install" and wait.

:heavy_check_mark: If you see the message "The software was installed" then all good :+1:
:x: If the command `xcode-select --install` fails try again: sometimes the Apple servers are overloaded.
:x: If you see the message "Xcode is not currently available from the Software Update server", you need to update the software update catalog:
```bash
sudo softwareupdate --clear-catalog
```
Once this is done, you can try to install again.
================================================
FILE: _partials/macos_homebrew.md
================================================
## Homebrew
[Homebrew](http://brew.sh/) is a package manager: it's a software used to install other software from the command line. Let's install it!
Open a terminal and run:
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```
This will ask for your confirmation (hit `Enter`) and your **macOS user account password** (the one you use to [log in](https://support.apple.com/en-gb/HT202860) when you reboot your Macbook).
:warning: When you type your password, nothing will show up on the screen, **that's normal**. This is a security feature to mask not only your password as a whole but also its length. Just type your password and when you're done, press `Enter`.
:warning: If you see this warning :point_down:, run the two commands in the `Next steps` section to add Homebrew to your PATH:

```bash
# ⚠️ Only execute these commands if you saw this warning ☝
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
```
If you already have Homebrew, it will tell you so, that's fine, go on.
Then install some useful software:
```bash
brew update
```
If you get a `/usr/local must be writable` error, just run this:
```bash
sudo chown -R $USER:admin /usr/local
```
```bash
brew update
```
Proceed running the following in the terminal (you can copy / paste all the lines at once).
```bash
brew upgrade git || brew install git
```
```bash
brew upgrade gh || brew install gh
```
```bash
brew upgrade wget || brew install wget
```
```bash
brew upgrade imagemagick || brew install imagemagick
```
```bash
brew upgrade jq || brew install jq
```
```bash
brew upgrade openssl || brew install openssl
```
================================================
FILE: _partials/macos_postgresql.md
================================================
## PostgreSQL
Sometimes, SQLite is not enough and we will need a more advanced tool called [PostgreSQL](https://www.postgresql.org/), an open-source robust and production-ready database system.
Let's install it now.
Run the following commands:
```bash
brew install postgresql@15 libpq
brew link --force libpq
```
```bash
brew services start postgresql@15
```
Once you've done that, let's check that it worked:
```bash
psql -d postgres
```
You should you see a new prompt like this one :point_down:
```bash
psql (15.2)
Type "help" for help.
postgres=#
```
:heavy_check_mark: If this is the case, type `\q` then `Enter` to quit this prompt. You're good to go :+1:
:x: If not, please **ask for a teacher**
================================================
FILE: _partials/macos_rbenv.md
================================================
## rbenv
Let's install [`rbenv`](https://github.com/sstephenson/rbenv), a software to install and manage `ruby` environments.
First, we need to clean up any previous Ruby installation you might have:
```bash
rvm implode && sudo rm -rf ~/.rvm
# If you got "zsh: command not found: rvm", carry on. It means `rvm` is not
# on your computer, that's what we want!
sudo rm -rf $HOME/.rbenv /usr/local/rbenv /opt/rbenv /usr/local/opt/rbenv
```
:warning: This command may prompt for your password.
:warning: When you type your password, nothing will show up on the screen, **that's normal**. This is a security feature to mask not only your password as a whole but also its length. Just type your password and when you're done, press `Enter`.
In the terminal, run:
```bash
brew uninstall --force rbenv ruby-build
```
```bash
exec zsh
```
Then run:
```bash
brew install rbenv libyaml
```
================================================
FILE: _partials/macos_settings.md
================================================
## macOS settings
### Security
It is mandatory that you protect your session behind a password. If it is not already the case, go to ` > System Settings... > Users & Groups` and change your account password. You should also go to ` > System Settings... > Lock Screen`. You should require a password `5 seconds` after screen saver begins or display is turned off.
You can also go to ` > System Settings... > Desktop & Dock` and click on the `Hot Corners...` button at the bottom left. Choose for the bottom right corner to start the screen saver. That way, when you leave your desk, you can quickly lock you screen by putting your mouse in the bottom right corner. 5 seconds after, your MacBook will be locked and will ask for a password to get back on the session.
### Keyboard
As you become a programmer, you'll understand that leaving the keyboard takes a lot of time, so you'll want to minimize using the trackpad or the mouse. Here are a few tricks on macOS to help you do that.
#### Keyboard speed
Go to ` > System Settings... > Keyboard`. Set `Key repeat rate` to the fastest position (to the right) and `Delay until repeat` to the shortest position (also to the right).
#### macOS For hackers
[Read this script](https://github.com/mathiasbynens/dotfiles/blob/master/.macos) and cherry-pick some stuff you think will suit you. For instance, you can type in the terminal this one:
```bash
# Expanding the save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
# Save screenshots to the Desktop (or elsewhere)
defaults write com.apple.screencapture location "${HOME}/Desktop"
# etc..
```
### Pin apps to your dock
You are going to use most of the apps you've installed today really often. Let's pin them to your dock so that they are just one click away!
To pin an app to your dock, launch the app, right-click on the icon in the taskbar to bring up the context menu and choose "Options" then "Keep in Dock".

You must pin:
- Your terminal
- Your file explorer
- VS Code
- Your Internet browser
- Slack
================================================
FILE: _partials/macos_slack.md
================================================
## Slack
[Slack](https://slack.com/) is a communication platform pretty popular in the tech industry.
### Installation
[Download the Slack app](https://itunes.apple.com/us/app/slack/id803453959?mt=12) and install it.
:warning: If you are already using Slack in your browser, please download and install **the desktop app** which is fully featured.
================================================
FILE: _partials/macos_sqlite.md
================================================
## SQLite
In a few weeks, we'll talk about databases and SQL. [SQLite](https://sqlite.org/index.html) is a database engine used to execute SQL queries on single-file databases. Let's install it:
In a terminal, execute the following commands:
```bash
brew install sqlite
```
Then run the following command:
```bash
sqlite3 -version
```
:heavy_check_mark: If you see a version, you're good :+1:
:x: If not, **ask for a teacher**
================================================
FILE: _partials/macos_terminal.md
================================================
## macOS Terminal Theme
Launch a terminal, click on `Terminal > Preferences` and set the "Pro" theme as default profile.

In Window tab, set also your **Window Size** to Columns: 200, Rows: 50
**Quit and restart** your terminal: it should now have a nice black background, easier on the eyes.
================================================
FILE: _partials/macos_vscode.md
================================================
## Visual Studio Code
### Installation
Let's install [Visual Studio Code](https://code.visualstudio.com) text editor.
Copy (`Cmd` + `C`) the command below then paste it in your terminal (`Cmd` + `V`):
```bash
brew install --cask visual-studio-code
```
Then launch VS Code by running the following command in your terminal:
```bash
code
```
:heavy_check_mark: If a VS Code window has just opened, you're good to go :+1:
:x: Otherwise, please **contact a teacher**
================================================
FILE: _partials/nvm.md
================================================
## Node.js
[Node.js](https://nodejs.org/en/) is a JavaScript runtime to execute JavaScript code in the terminal. Let's install it with [nvm](https://github.com/nvm-sh/nvm), a version manager for Node.js.
In a terminal, execute the following commands:
```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v/install.sh | zsh
```
```bash
exec zsh
```
Then run the following command:
```bash
nvm -v
```
You should see a version. If not, ask a teacher.
Now let's install node:
```bash
nvm install
```
When the installation is finished, run:
```bash
node -v
```
If you see `v`, the installation succeeded :heavy_check_mark: You can then run:
```bash
nvm cache clear
```
:x: If not, **contact a teacher**
================================================
FILE: _partials/oh_my_zsh.md
================================================
## Oh-my-zsh
Let's install the `zsh` plugin [Oh My Zsh](https://ohmyz.sh/).
In a terminal execute the following command:
```bash
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```
If asked "Do you want to change your default shell to zsh?", press `Y`
At the end your terminal should look like this:

:heavy_check_mark: If it does, you can continue :+1:
:x: Otherwise, please **ask for a teacher**
================================================
FILE: _partials/pt/checkup.md
================================================
## Checagem
Vamos verificar se você instalou tudo com sucesso.
No seu terminal, execute o seguinte comando:
```bash
exec zsh
```
Então corra:
```bash
curl -Ls https://raw.githubusercontent.com/lewagon/setup/master/check.rb > _.rb && ruby _.rb && rm _.rb || rm _.rb
```
:heavy_check_mark: Se você receber uma mensagem verde `Awesome! Your computer is now ready!`, então você está bem :+1:
:x: Caso contrário, **entre em contato com um professor**.
================================================
FILE: _partials/pt/cli_tools.md
================================================
## Ferramentas de linha de comando
### Verifique a localidade
A localidade é um mecanismo que permite personalizar programas de acordo com seu idioma e país.
Vamos verificar se a localidade padrão está definida como inglês, digite isto no terminal do Ubuntu:
```bash
locale
```
Se a saída não contiver `LANG=en_US.UTF-8`, execute o seguinte comando em um terminal Ubuntu para instalar a localidade em inglês:
```bash
sudo locale-gen en_US.UTF-8
```
Se, depois, receberes um aviso (`bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf-8)`) no teu terminal, por favor faz o seguinte:
Gerar localidade
Por favor, executa estas linhas no teu terminal.
```bash
sudo update-locale LANG=en_US.UTF8
sudo apt-get update
sudo apt-get install language-pack-en language-pack-en-base manpages
```
### Zsh e Git
Em vez de usar o `bash` [shell](https://en.wikipedia.org/wiki/Shell_(computing)), usaremos `zsh`.
Também usaremos [`git`](https://git-scm.com/), um software de linha de comando usado para controle de versão.
Vamos instalá-los, juntamente com outras ferramentas úteis:
- Abra um **terminal Ubuntu**
- Copie e cole os seguintes comandos:
```bash
sudo apt update
```
```bash
sudo apt install -y curl git imagemagick jq unzip vim zsh tree
```
Esses comandos solicitarão sua senha: digite-a.
:warning: Quando você digita sua senha, nada aparecerá na tela, **isso é normal**. Este é um recurso de segurança para mascarar não apenas sua senha como um todo, mas também seu comprimento. Basta digitar sua senha e quando terminar, pressione `Enter`.
### Instalação da CLI do GitHub
Vamos agora instalar a [CLI oficial do GitHub](https://cli.github.com) (interface de linha de comando). É um software usado para interagir com sua conta GitHub através da linha de comando.
Em seu terminal, copie e cole os seguintes comandos e digite sua senha, se solicitado:
```bash
sudo apt remove -y gitsome # gh command can conflict with gitsome if already installed
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
```
```bash
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
```
```bash
sudo apt update
```
```bash
sudo apt install -y gh
```
Para verificar se `gh` foi instalado com sucesso em sua máquina, você pode executar:
```bash
gh --version
```
:heavy_check_mark: Se você vir `gh versão X.Y.Z (AAAA-MM-DD)`, está pronto para prosseguir :+1:
:x: Caso contrário, por favor **entre em contato com um professor**
================================================
FILE: _partials/pt/conclusion.md
================================================
## Configuração concluída!
Seu computador agora está pronto para o [curso de AI Software Development Le Wagon](https://www.lewagon.com/web-development-course/full-time) :muscle: :clap:
Aproveite o bootcamp, você vai acertar :rocket:
================================================
FILE: _partials/pt/dotfiles.md
================================================
## Dotfiles (configuração padrão)
Os hackers adoram refinar e aprimorar sua estrutura e ferramentas.
Começaremos com uma ótima configuração padrão fornecida pelo Le Wagon: [`lewagon/dotfiles`](https://github.com/lewagon/dotfiles).
Como sua configuração é pessoal, você precisa de seu próprio repositório para armazená-la. Então você irá fazer o **fork** do repositório Le Wagon.
Bifurcar significa que você criará um novo repositório em sua própria conta GitHub `$GITHUB_USERNAME/dotfiles`, idêntico ao original do Le Wagon que você poderá modificar à vontade.
Abra seu terminal e defina uma variável para seu nome de usuário GitHub:
```bash
export GITHUB_USERNAME=`gh api user | jq -r '.login'`
```
```bash
echo $GITHUB_USERNAME
```
:heavy_check_mark: Você deverá ver seu nome de usuário do GitHub impresso.
:x: Se não, **pare aqui** e peça ajuda. Pode haver um problema com a etapa anterior (`gh auth`).
:warning: Por favor note que esta variável só é definida para o tempo em que seu terminal está aberto. Se você fechá-lo antes ou durante as próximas etapas, será necessário configurá-lo novamente com as duas etapas acima!
É hora de fazer um fork do repositório e cloná-lo em seu computador:
```bash
mkdir -p ~/code/$GITHUB_USERNAME && cd $_
```
```bash
gh repo fork lewagon/dotfiles --clone
```
### Instalador do Dotfiles
Execute o instalador `dotfiles`:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles
```
```bash
zsh install.sh
```
Verifique os e-mails registrados em sua conta GitHub. Você precisará escolher um na próxima etapa:
```bash
gh api user/emails | jq -r '.[].email'
```
:heavy_check_mark: Se você vir a lista de seus e-mails registrados, você pode prosseguir :+1:
:x: Caso contrário, [reautentique no GitHub](https://github.com/lewagon/setup/blob/master/#github-cli) antes de executar este comando :point_up: novamente.
### Instalador git
Execute o instalador `git`:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh
```
:point_up: Isso **solicitará** seu nome (`Nome Sobrenome`) e seu e-mail. O email que você escolher será exibido **publicamente** na internet. 💡 Selecione o endereço `@users.noreply.github.com` se você não deseja que seu e-mail apareça em repositórios públicos aos quais você possa contribuir.
:warning: Você **precisa** colocar um dos e-mails listados acima graças ao comando anterior `gh api ...`. Se você não fizer isso, Kitt não conseguirá acompanhar seu progresso.
Agora **reinicie** seu terminal executando:
```bash
exec zsh
```
================================================
FILE: _partials/pt/gh_cli.md
================================================
## CLI do GitHub
CLI é o acrônimo de [Interface de linha de comando](https://en.wikipedia.org/wiki/Command-line_interface).
Nesta seção, usaremos [GitHub CLI](https://cli.github.com/) para interagir com o GitHub diretamente do terminal.
Usaremos o GitHub CLI (`gh`) para conectar ao GitHub usando *SSH*, um protocolo para fazer login usando chaves SSH em vez do conhecido par nome de usuário/senha.
Ele já deve estar instalado no seu computador a partir dos comandos anteriores.
Primeiro, para **fazer login**, copie e cole o seguinte comando em seu terminal:
:warning: **NÃO edite o `email`**
```bash
gh auth login -s 'user:email' -w --git-protocol ssh
```
`gh` fará algumas perguntas:
- `Generate a new SSH key to add to your GitHub account?` Pressione `Enter` para pedir ao gh para gerar as chaves SSH para você.
Se você já possui chaves SSH, verá `Upload your SSH public key to your GitHub account?` Com as setas, selecione o caminho do arquivo de sua chave pública e pressione `Enter`.
- `Enter a passphrase for your new SSH key (Optional)`. Digite algo que você deseja e que você lembrará. É uma senha para proteger sua chave privada armazenada no disco rígido. Em seguida, pressione `Enter`.
- `Title for your SSH key`. Você pode deixá-lo no "GitHub CLI" proposto, pressione `Enter`.
Você obterá então a seguinte saída:
```bash
! First copy your one-time code: 0EF9-D015
- Press Enter to open github.com in your browser...
```
Selecione e copie o código (`0EF9-D015` no exemplo) e pressione `Enter`.
Seu navegador será aberto e solicitará que você autorize o GitHub CLI a usar sua conta GitHub. Aceite e espere um pouco.
Volte ao terminal, pressione `Enter` novamente e pronto.
Para verificar se você está conectado corretamente, digite:
```bash
gh auth status
```
:heavy_check_mark: Se você estiver `Logado no github.com como `, então tudo bem :+1:
:x: Caso contrário, **entre em contato com um professor**.
================================================
FILE: _partials/pt/github.md
================================================
## Conta GitHub
Você se inscreveu no GitHub? Caso contrário, [faça isso imediatamente](https://github.com/join).
:point_right: **[Carregue uma imagem](https://github.com/settings/profile)** e coloque seu nome corretamente em sua conta GitHub. Isso é importante porque usaremos um painel interno com seu avatar. Faça isso **agora**, antes de continuar com este guia.

:point_right: [Ative a Autenticação em Duas Etapas (2FA)](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication#configuring-two-factor-authentication-using-text-messages). O GitHub enviará mensagens de texto com um código quando você tentar fazer login. Isso é importante para a segurança e em breve será necessário para contribuir com código no GitHub.
================================================
FILE: _partials/pt/intro.md
================================================
# Instruções de configuração
Você encontrará abaixo as instruções para configurar seu computador para o [curso de AI Software Development Le Wagon](https://www.lewagon.com/web-development-course/full-time).
Por favor **leia-os com atenção e execute todos os comandos na seguinte ordem**.
Se você tiver dúvidas, não hesite em pedir ajuda a um professor :raising_hand:
Você também pode dar uma olhada em [nossas cheatsheets](https://github.com/lewagon/setup/tree/master/docs) para soluções e dicas de problemas comuns :heavy_check_mark:
Vamos começar :rocket:
================================================
FILE: _partials/pt/kitt.md
================================================
## Kitt
:warning: Se você recebeu um e-mail do Le Wagon convidando você a se inscrever no Kitt (nossa plataforma de aprendizagem), você pode pular esta etapa com segurança. Em vez disso, siga as instruções no e-mail que você recebeu, caso ainda não tenha feito isso.
Se não tiver certeza sobre o que fazer, siga [este link](https://kitt.lewagon.com/). Se você já estiver logado, pode pular esta seção com segurança. Se você não estiver logado, clique em `Enter Kitt as a Student`. Se você conseguir fazer login, poderá pular esta etapa com segurança. Caso contrário, pergunte a um professor se você deveria ter recebido um e-mail ou siga as instruções abaixo.
Registre-se como Alumni da Le Wagon acessando [kitt.lewagon.com/onboarding](http://kitt.lewagon.com/onboarding). Selecione seu batch, faça login no GitHub e insira todas as suas informações.
Seu professor irá então validar que você realmente faz parte do batch. Você pode pedir que eles façam isso assim que preencher o formulário de registro.
Assim que o professor aprovar seu perfil, acesse sua caixa de entrada de e-mail. Você deve ter 2 e-mails:
- Um do Slack, convidando você para a comunidade Le Wagon Alumni do Slack (onde você conversará com seus amigos e todos os ex-alunos anteriores). Clique em **Inscreva-se** e preencha os dados.
- Um do GitHub, convidando você para a equipe `lewagon`. **Aceite** caso contrário você não conseguirá acessar os slides da aula.
================================================
FILE: _partials/pt/macos_apple_silicon.md
================================================
## Chips Apple Silicon
Se você comprou seu computador depois do final de 2020, é provável que ele tenha um novo chip de silício da Apple em vez de um processador Intel: vamos descobrir.
Abra uma nova janela de terminal em Aplicativos > Utilitários ou pesquise-a com [Spotlight](https://support.apple.com/en-gb/HT204014):

Copie e cole o seguinte comando no terminal e pressione `Enter` para executar.
``` bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/lewagon/setup/master/utils/macos_list_processor_type.sh)"
```
☝️ O resultado do comando deve indicar se o seu computador usa Apple Silicon.
Se o seu computador usa Apple Silicon, expanda o parágrafo abaixo e leia-o. Caso contrário, ignore-o.
👉Configuração para Apple Silicon 👈
### Desinstalar o Homebrew
Precisamos desinstalar o Homebrew caso uma versão nativa tenha sido instalada.
Execute o seguinte comando no terminal:
``` bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
```
Se o brew não estiver instalado, você receberá a mensagem `brew: comando não encontrado!`
### Configurar Terminal para Rosetta
Abra o aplicativo Finder (ou pesquise-o com o [Spotlight](https://support.apple.com/en-gb/HT204014)).
Vá para Aplicativos > Utilitários.
Duplique o aplicativo de terminal (selecione-o e, em seguida, `Cmd` + `C`, `Cmd` + `V`) e renomeie uma cópia como Terminal Rosetta.
Pressione `Cmd` + `I` no aplicativo Terminal Rosetta e marque a caixa "Abrir usando Rosetta".
⚠️ A partir de agora durante o bootcamp, sempre que for solicitado a abrir um Terminal, você usará o aplicativo **Terminal Rosetta**.
================================================
FILE: _partials/pt/macos_command_line_tools.md
================================================
## Uma observação sobre como encerrar aplicativos em um Mac
Clicar na pequena cruz vermelha no canto superior esquerdo da janela do aplicativo em um Mac **não o encerra**, apenas fecha uma janela ativa. Para sair do aplicativo _de verdade_ pressione `Cmd + Q` quando o aplicativo estiver ativo ou navegue até `APP_NAME` -> `Quit` na barra de menu.

Durante esta configuração, você será solicitado a **sair e reabrir** os aplicativos várias vezes. Certifique-se de fazer isso corretamente :pray:
## Ferramentas de linha de comando
Abra um novo terminal, copie e cole o seguinte comando e pressione `Enter`:
```bash
xcode-select --install
```
Se você receber a mensagem a seguir, basta pular esta etapa e ir para a próxima.
```bash
# ferramentas de linha de comando já estão instaladas, use "Atualização de Software" para instalar atualizações
```
Caso contrário, abrirá uma janela perguntando se deseja instalar algum software: clique em “Instalar” e aguarde.

:heavy_check_mark: Se você vir a mensagem "O software foi instalado", tudo bem :+1:
:x: Se o comando `xcode-select --install` falhar, tente novamente: às vezes os servidores Apple ficam sobrecarregados.
:x: Se você vir a mensagem "O Xcode não está disponível no servidor de atualização de software", será necessário atualizar o catálogo de atualização de software:
```bash
sudo softwareupdate --clear-catalog
```
Feito isso, você pode tentar instalar novamente.
================================================
FILE: _partials/pt/macos_homebrew.md
================================================
## Homebrew
[Homebrew](http://brew.sh/) é um gerenciador de pacotes: é um software usado para instalar outros softwares a partir da linha de comando. Vamos instalá-lo!
Abra um terminal e execute:
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```
Isso solicitará sua confirmação (pressione `Enter`) e sua **senha da conta de usuário do macOS** (aquela que você usa para [fazer login](https://support.apple.com/en-gb/HT202860) quando você reinicia seu Macbook).
:warning: Quando você digita sua senha, nada aparecerá na tela, **isso é normal**. Este é um recurso de segurança para mascarar não apenas sua senha como um todo, mas também seu comprimento. Basta digitar sua senha e quando terminar, pressione `Enter`.
:warning: Se você vir este aviso :point_down:, execute os dois comandos na seção `Próximas etapas` para adicionar o Homebrew ao seu PATH:

```bash
# ⚠️ Execute esses comandos apenas se você viu este aviso ☝
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
```
Se você já tem o Homebrew, ele lhe dirá, tudo bem, vá em frente.
Em seguida, instale algum software útil:
```bash
brew update
```
Se você receber um erro `/usr/local deve ser gravável`, basta executar isto:
```bash
sudo chown -R $USER:admin /usr/local
```
```bash
brew update
```
Continue executando o seguinte no terminal (você pode copiar/colar todas as linhas de uma vez).
```bash
brew upgrade git || brew install git
```
```bash
brew upgrade gh || brew install gh
```
```bash
brew upgrade wget || brew install wget
```
```bash
brew upgrade imagemagick || brew install imagemagick
```
```bash
brew upgrade jq || brew install jq
```
```bash
brew upgrade openssl || brew install openssl
```
================================================
FILE: _partials/pt/macos_postgresql.md
================================================
## PostgreSQL
Às vezes, o SQLite não é suficiente e precisaremos de uma ferramenta mais avançada chamada [PostgreSQL](https://www.postgresql.org/), um sistema de banco de dados de código aberto, robusto e pronto para produção.
Vamos instalá-lo agora.
Execute os seguintes comandos:
```bash
brew install postgresql@15 libpq
brew link --force libpq
```
```bash
brew services start postgresql@15
```
Depois de fazer isso, vamos verificar se funcionou:
```bash
psql -d postgres
```
Você deverá ver um novo prompt como este :point_down:
```bash
psql (15.2)
Type "help" for help.
postgres=#
```
:heavy_check_mark: Se for esse o caso, digite `\q` e depois `Enter` para sair deste prompt. Você está pronto para ir :+1:
:x: Se não, por favor **entre em contato com um professor**
================================================
FILE: _partials/pt/macos_rbenv.md
================================================
## rbenv
Vamos instalar o [`rbenv`](https://github.com/sstephenson/rbenv), um software para instalar e gerenciar ambientes `ruby`.
Primeiro, precisamos limpar qualquer instalação anterior do Ruby que você possa ter:
```bash
rvm implode && sudo rm -rf ~/.rvm
# If you got "zsh: command not found: rvm", carry on. It means `rvm` is not
# on your computer, that's what we want!
sudo rm -rf $HOME/.rbenv /usr/local/rbenv /opt/rbenv /usr/local/opt/rbenv
```
:warning: Este comando pode solicitar sua senha.
:warning: Quando você digita sua senha, nada aparecerá na tela, **isso é normal**. Este é um recurso de segurança para mascarar não apenas sua senha como um todo, mas também seu comprimento. Basta digitar sua senha e quando terminar, pressione `Enter`.
No terminal, execute:
```bash
brew uninstall --force rbenv ruby-build
```
```bash
exec zsh
```
Então rode:
```bash
brew install rbenv libyaml
```
================================================
FILE: _partials/pt/macos_settings.md
================================================
## Configurações do MacOS
### Segurança
É obrigatório que você proteja sua sessão com uma senha. Se ainda não for o caso, vá para ` > Ajustes do Sistema > Usuários e Grupos` e altere a senha da sua conta. Você também deve ir para ` > Ajustes do Sistema > Segurança > Geral`. Você deve exigir uma senha `5 segundos` após o início da suspensão ou da proteção de tela.
Você também pode ir para ` > Ajustes do Sistema > Controle daVelocidade de repetição de teclaVelocidade de repetição de Escritorio y Dock` e clicar no botão `cantos de acesso rápido (Hot Corners)` no canto inferior esquerdo. Escolha no canto inferior direito para iniciar o protetor de tela. Dessa forma, ao sair da mesa, você pode bloquear rapidamente a tela colocando o mouse no canto inferior direito. 5 segundos depois, seu MacBook estará bloqueado e solicitará uma senha para voltar à sessão.
### Teclado
Ao se tornar um programador, você entenderá que deixar o teclado leva muito tempo, então você vai querer minimizar o uso do trackpad ou do mouse. Aqui estão alguns truques no macOS para ajudá-lo a fazer isso.
#### Velocidade do teclado
Vá para ` > Preferências do Sistema > Teclado`. Defina `Velocidade de repetição de tecla` para a posição mais rápida (à direita) e `Atraso da repetição` para a posição mais curta (à direita).
#### macOS Para hackers
[Leia este script](https://github.com/mathiasbynens/dotfiles/blob/master/.macos) e escolha algumas coisas que você acha que combinam com você. Por exemplo, você pode digitar no terminal este:
```bash
# Expanding the save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
# Save screenshots to the Desktop (or elsewhere)
defaults write com.apple.screencapture location "${HOME}/Desktop"
# etc..
```
### Fixe aplicativos no seu dock
Você usará a maioria dos aplicativos que instalou hoje com muita frequência. Vamos fixá-los no seu dock para que fiquem a apenas um clique de distância!
Para fixar um aplicativo no seu dock, inicie o aplicativo, clique com o botão direito no ícone na barra de tarefas para abrir o menu de contexto e escolha "Opções" e depois "Manter no Dock".

Você deve fixar:
- Seu terminal
- Seu explorador de arquivos
- VS Code
- Seu navegador de Internet
- Slack
================================================
FILE: _partials/pt/macos_slack.md
================================================
## Slack
[Slack](https://slack.com/) é uma plataforma de comunicação bastante popular na indústria de tecnologia.
### Instalação
[Baixe o aplicativo Slack](https://itunes.apple.com/us/app/slack/id803453959?mt=12) e instale-o.
:warning: Se você já usa o Slack em seu navegador, baixe e instale **o aplicativo para desktop** que vem com todos os recursos.
================================================
FILE: _partials/pt/macos_sqlite.md
================================================
## SQLite
Em algumas semanas falaremos sobre bancos de dados e SQL. [SQLite](https://sqlite.org/index.html) é um mecanismo de banco de dados usado para executar consultas SQL em bancos de dados de arquivo único. Vamos instalá-lo:
Em um terminal, execute os seguintes comandos:
```bash
brew install sqlite
```
Em seguida, execute o seguinte comando:
```bash
sqlite3 -version
```
:heavy_check_mark: Se você vir uma versão, você está bem :+1:
:x: Se não, **peça um professor**
================================================
FILE: _partials/pt/macos_terminal.md
================================================
## Tema do Terminal macOS
Inicie um terminal, clique em `Terminal > Preferências` e defina o tema "Pro" como perfil padrão.

Na guia Janela, defina também seu **Tamanho da janela** para Colunas: 200, Linhas: 50
**Saia e reinicie** seu terminal: agora ele deve ter um belo fundo preto, mais agradável aos olhos.
================================================
FILE: _partials/pt/macos_vscode.md
================================================
## Visual Studio Code
### Instalação
Vamos instalar o editor de texto [Visual Studio Code](https://code.visualstudio.com).
Copie (`Cmd` + `C`) o comando abaixo e cole-o em seu terminal (`Cmd` + `V`):
```bash
brew install --cask visual-studio-code
```
Em seguida, inicie o VS Code executando o seguinte comando em seu terminal:
```bash
code
```
:heavy_check_mark: Se uma janela do VS Code acabou de abrir, você está pronto :+1:
:x: Caso contrário, por favor **entre em contato com um professor**
================================================
FILE: _partials/pt/nvm.md
================================================
## Node.js
[Node.js](https://nodejs.org/en/) é um tempo de execução JavaScript para executar código JavaScript no terminal. Vamos instalá-lo com [nvm](https://github.com/nvm-sh/nvm), um gerenciador de versões para Node.js.
Em um terminal, execute os seguintes comandos:
```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v/install.sh | zsh
```
```bash
exec zsh
```
Em seguida, execute o seguinte comando:
```bash
nvm -v
```
Você deverá ver uma versão. Se não, pergunte a um professor.
Agora vamos instalar o Node.js:
```bash
nvm install
```
Quando a instalação terminar, execute:
```bash
node -v
```
Se você vir `v`, a instalação foi bem-sucedida :heavy_check_mark: Você pode então executar:
```bash
nvm cache clear
```
:x: Caso contrário, **entre em contato com um professor**
================================================
FILE: _partials/pt/oh_my_zsh.md
================================================
## Oh-My-Zsh
Vamos instalar o plugin `zsh` [Oh My Zsh](https://ohmyz.sh/).
Em um terminal execute o seguinte comando:
```bash
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```
Se for perguntado "Deseja alterar seu shell padrão para zsh?", pressione `Y`
No final seu terminal deverá ficar assim:

:heavy_check_mark: Se isso acontecer, você pode continuar :+1:
:x: Caso contrário, por favor **entre em contato com um professor**
================================================
FILE: _partials/pt/rbenv.md
================================================
## rbenv
Vamos instalar o [`rbenv`](https://github.com/sstephenson/rbenv), um software para instalar e gerenciar ambientes `ruby`.
Primeiro, precisamos limpar qualquer instalação anterior do Ruby que você possa ter:
```bash
rvm implode && sudo rm -rf ~/.rvm
# Se você obteve "zsh: comando não encontrado: rvm", continue.
# Significa que `rvm` não está no seu computador, é isso que queremos!
rm -rf ~/.rbenv
```
Então no terminal, execute:
```bash
sudo apt install -y build-essential tklib zlib1g-dev libssl-dev libffi-dev libxml2 libxml2-dev libxslt1-dev libreadline-dev libyaml-dev
```
```bash
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
```
```bash
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
```
```bash
exec zsh
```
================================================
FILE: _partials/pt/ruby.md
================================================
## Ruby
### Instalação
Agora, você está pronto para instalar a versão mais recente do [ruby](https://www.ruby-lang.org/en/) e defini-la como a versão padrão.
Execute este comando, **demorará um pouco (5 a 10 minutos)**
```bash
rbenv install
```
Assim que a instalação do Ruby estiver concluída, execute este comando para informar ao sistema
para usar a versão por padrão.
```bash
rbenv global
```
**Reinicialize** seu terminal e verifique sua versão do Ruby:
```bash
exec zsh
```
Então corra:
```bash
ruby -v
```
:heavy_check_mark: Se você vir algo começando com `ruby ` então você pode prosseguir :+1:
:x: Se não, **pergunte a um professor**
### Instalando algumas gems
Se você estiver na China 🇨🇳 clique aqui
:warning: Se você estiver na China, você deve atualizar a forma como instalaremos o gem com os seguintes comandos.
```bash
# Somente China!
fontes de gemas --remove https://rubygems.org/
fontes de gemas -a https://gems.ruby-china.com/
fontes de gemas -l
#***FONTES ATUAIS***
# https://gems.ruby-china.com/
# Ruby-china.com deve estar na lista agora
```
**Todos, na China ou não**, continuem aqui para instalar gems.
No mundo Ruby, chamamos bibliotecas externas de `gems`: são pedaços de código Ruby que você pode baixar e executar em seu computador. Vamos instalar alguns!
No seu terminal, copie e cole o seguinte comando:
```bash
gem install
```
:heavy_check_mark: Se você tiver `xx gems installed`, então tudo bem :+1:
:x: Se você encontrar o seguinte erro:
```bash
ERROR: While executing gem ... (TypeError)
incompatible marshal file format (can't be read)
format version 4.8 required; 60.33 given
```
Execute o seguinte comando:
```bash
rm -rf ~/.gemrc
```
Execute novamente o comando para instalar as gemas.
:warning: **NUNCA** instale uma gem com `sudo gem install`! Mesmo se você encontrar uma resposta do Stackoverflow (ou o terminal) solicitando que você faça isso.
================================================
FILE: _partials/pt/slack_settings.md
================================================
### Configurações
Inicie o aplicativo e faça login na organização `lewagon-alumni`.
Certifique-se de **fazer upload de uma foto de perfil** :point_down:

A ideia é que você tenha o Slack aberto o dia todo, para que você possa compartilhar links úteis/pedir ajuda/decidir onde ir almoçar/etc.
Para garantir que tudo está funcionando bem nas videochamadas, vamos testar sua câmera e microfone:
- Abra o aplicativo Slack
- Clique na foto do seu perfil no canto superior direito.
- Selecione `Preferências` no menu.
- Clique em `Áudio e vídeo` na coluna do lado esquerdo.
- Abaixo de `Solução de problemas`, clique em `Executar um teste de áudio, vídeo e compartilhamento de tela`. O teste será aberto em uma nova janela.
- Verifique se seus dispositivos preferidos de alto-falante, microfone e câmera aparecem nos menus suspensos e clique em `Iniciar teste`.

:heavy_check_mark: Quando o teste terminar, você deverá ver mensagens verdes de "Sucesso" pelo menos para seu microfone e câmera. :+1:
:x: Caso contrário, **entre em contato com um professor**.
Você também pode instalar o aplicativo Slack no seu telefone e entrar em `lewagon-alumni`!
================================================
FILE: _partials/pt/sqlite.md
================================================
## SQLite
Em algumas semanas falaremos sobre bancos de dados e SQL. [SQLite](https://sqlite.org/index.html) é um mecanismo de banco de dados usado para executar consultas SQL em bancos de dados de arquivo único. Vamos instalá-lo:
Em um terminal, execute os seguintes comandos:
```bash
sudo apt-get install sqlite3 libsqlite3-dev pkg-config
```
Em seguida, execute o seguinte comando:
```bash
sqlite3 -version
```
:heavy_check_mark: Se você vir uma versão, você está bem :+1:
:x: Se não, **peça um professor**
================================================
FILE: _partials/pt/ssh_agent.md
================================================
## Desativar prompt de senha SSH
Você não quer que sua senha seja solicitada sempre que se comunicar com um repositório distante. Então, você precisa adicionar o plugin `ssh-agent` ao `oh my zsh`:
Primeiro, abra o arquivo `.zshrc`:
```bash
code ~/.zshrc
```
Então:
- Identifique a linha que começa com `plugins=`
- Adicione `ssh-agent` no final da lista de plugins
:heavy_check_mark: Salve o arquivo `.zshrc` com `Ctrl` + `S` e feche seu editor de texto.
================================================
FILE: _partials/pt/ubuntu_postgresql.md
================================================
## PostgreSQL
Às vezes, o SQLite não é suficiente e precisaremos de uma ferramenta mais avançada chamada [PostgreSQL](https://www.postgresql.org/), um sistema de banco de dados de código aberto, robusto e pronto para produção.
Vamos instalá-lo agora.
Execute os seguintes comandos:
```bash
sudo apt install -y postgresql postgresql-contrib libpq-dev build-essential
```
```bash
sudo -u postgres psql --command "CREATE ROLE \"`whoami`\" LOGIN createdb superuser;"
```
================================================
FILE: _partials/pt/ubuntu_settings.md
================================================
## Configurações do Ubuntu
### Instale o codec de vídeo H264
Na nossa plataforma pedagógica (Kitt, você vai descobrir em breve!), temos alguns vídeos. Por padrão, o Firefox no Linux não pode reproduzi-los porque eles usam um codec não suportado (H264). Para que esses vídeos funcionem para você, você precisa executar o seguinte:
```bash
sudo apt install libavcodec-extra -y
```
### Instale ferramentas de terminal úteis
`tree` é uma boa ferramenta para visualizar uma árvore de diretórios dentro do terminal:
`ncdu` é um utilitário de disco de interface baseado em texto.
`htop` é um visualizador de processos interativo.
`tig` é uma interface em modo texto para `git`.
```bash
sudo apt install tree ncdu htop tig
```
### Ubuntu inotify
O Ubuntu está sempre rastreando alterações em suas pastas e para isso usa o inotify.
Por padrão, o limite do Ubuntu é definido para 8.192 arquivos monitorados.
Como a programação envolve muitos arquivos, precisamos aumentar esse limite.
Em seu terminal, execute:
```bash
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
```
### Fixe aplicativos no seu dock
Você usará a maioria dos aplicativos que instalou hoje com muita frequência. Então, vamos fixá-los no seu dock para que fiquem a apenas um clique de distância!
Para fixar um aplicativo no seu dock, inicie o aplicativo, clique com o botão direito no ícone do dock para abrir o menu de contexto e escolha "Adicionar aos Favoritos".

Você deve fixar:
- Seu terminal
- Seu explorador de arquivos
- VS Code
- Seu navegador de Internet
- Slack
================================================
FILE: _partials/pt/ubuntu_slack.md
================================================
## Slack
[Slack](https://slack.com/) é uma plataforma de comunicação bastante popular na indústria de tecnologia.
### Instalação
[Baixe o aplicativo Slack](https://get.slack.help/hc/en-us/articles/212924728-Slack-for-Linux-beta-) e instale-o.
:warning: Se você já usa o Slack em seu navegador, baixe e instale **o aplicativo para desktop** que vem com todos os recursos.
================================================
FILE: _partials/pt/ubuntu_vscode.md
================================================
## Visual Studio Code
### Instalação
Vamos instalar o editor de texto [Visual Studio Code](https://code.visualstudio.com).
Copie (`Ctrl` + `C`) os comandos abaixo e cole-os em seu terminal (`Ctrl` + `Shift` + `v`):
```bash
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
```
```bash
sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
```
```bash
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
```
```bash
rm -f packages.microsoft.gpg
```
```bash
sudo apt update
```
```bash
sudo apt install -y code
```
Esses comandos solicitarão sua senha: digite-a.
:warning: Quando você digita sua senha, nada aparecerá na tela, **isso é normal**. Este é um recurso de segurança para mascarar não apenas sua senha como um todo, mas também seu comprimento. Basta digitar sua senha e quando terminar, pressione `Enter`.
### Iniciando a partir do terminal
Agora vamos iniciar o VS Code no **terminal**:
```bash
code
```
:heavy_check_mark: Se uma janela do VS Code acabou de abrir, você está pronto: +1:
:x: Caso contrário, por favor **entre em contato com um professor**
================================================
FILE: _partials/pt/vscode_aifeatures.md
================================================
### Recursos de IA no VS Code
O VS Code inclui muitos **recursos poderosos de IA**, que são ótimas ferramentas quando você já sabe programar.
Dito isso, confiar na IA muito cedo pode ocultar conceitos importantes e dificultar o entendimento da depuração. Quando você estiver confortável com os fundamentos, saberá quando e como usar a IA de forma eficaz — sem deixar que ela faça o raciocínio por você.
Para o início do bootcamp, vamos desativar esses recursos. No momento certo do curso, os reativaremos para que você possa usá-los bem.
Em **VS Code**:
1. Vamos abrir a "Paleta de Comandos" do VS Code: digite `Ctrl-Shift-P` (Windows / Linux) ou `Cmd-Shift-P` (macOS).
1. Isso abrirá a Paleta de Comandos: uma pequena caixa de texto no topo da tela. Comece a digitar `aifeatures` até ver "Chat: Learn How to Hide AI features". Clique nela.

1. Isso abrirá as configurações e mostrará a opção "Disable and hide built-in AI features ...". Marque a caixa de seleção à frente dessa opção.

Mais tarde, se quiser **reativar** os recursos de IA, você pode seguir as mesmas instruções para desmarcar a caixa.
================================================
FILE: _partials/pt/vscode_extensions.md
================================================
## Extensões do VS Code
### Instalação
Vamos instalar algumas extensões úteis no VS Code.
Copie e cole os seguintes comandos em seu terminal:
```bash
code --install-extension ms-vscode.sublime-keybindings
code --install-extension emmanuelbeziat.vscode-great-icons
code --install-extension github.github-vscode-theme
code --install-extension MS-vsliveshare.vsliveshare
code --install-extension shopify.ruby-lsp
code --install-extension dbaeumer.vscode-eslint
code --install-extension Rubymaniac.vscode-paste-and-indent
code --install-extension alexcvzz.vscode-sqlite
code --install-extension anteprimorac.html-end-tag-labels
code --install-extension marcoroth.herb-lsp
code --install-extension rayhanw.erb-helpers
```
Aqui está uma lista das extensões que você está instalando:
- [Sublime Text Keymap and Settings Importer](https://marketplace.visualstudio.com/items?itemName=ms-vscode.sublime-keybindings)
- [VSCode Great Icons](https://marketplace.visualstudio.com/items?itemName=emmanuelbeziat.vscode-great-icons)
- [Live Share](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare)
- [Ruby](https://marketplace.visualstudio.com/items?itemName=shopify.ruby-lsp)
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [Paste and Indent](https://marketplace.visualstudio.com/items?itemName=Rubymaniac.vscode-paste-and-indent)
- [SQLite](https://marketplace.visualstudio.com/items?itemName=alexcvzz.vscode-sqlite)
================================================
FILE: _partials/pt/vscode_liveshare.md
================================================
### Configuração do Live Share
[Visual Studio Live Share](https://visualstudio.microsoft.com/services/live-share/) é uma extensão do VS Code que permite compartilhar o código em seu editor de texto para depuração e programação em pares: vamos configurá-lo acima!
Inicie o VS Code em seu terminal digitando `code` e pressionando `Enter`.
Clique na pequena seta na parte inferior da barra esquerda :point_down:

- Clique no botão "Compartilhar" e depois em "GitHub (faça login usando a conta GitHub)".
- Um pop-up aparece solicitando que você faça login no GitHub: clique em “Permitir”.
- Você é redirecionado para uma página do GitHub em seu navegador solicitando autorização do Visual Studio Code: clique em "Continuar" e depois em "Autorizar github".
- O VS Code pode exibir pop-ups adicionais: feche-os clicando em "OK".
É isso, você está pronto para continuar!
================================================
FILE: _partials/pt/windows_browser.md
================================================
## Vinculando seu navegador padrão ao Ubuntu
Para ter certeza de que você pode interagir com seu navegador instalado no Windows a partir do terminal Ubuntu, precisamos defini-lo como navegador padrão.
:warning: Você precisa executar pelo menos um dos seguintes comandos abaixo:
Google Chrome como navegador padrão
Execute o comando:
```bash
ls /mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe
```
Você recebeu um erro como `ls: não é possível acessar...`?
Sim, ocorreu um erro
Execute os seguintes comandos:
```bash
echo "export BROWSER=\"/mnt/c/Program Files/Google/Chrome/Application/chrome.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files/Google/Chrome/Application/chrome.exe'\"" >> ~/.zshrc
```
Não, estava tudo bem
Execute os seguintes comandos:
```bash
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe'\"" >> ~/.zshrc
```
---
Mozilla Firefox como seu navegador padrão
Execute o comando:
```bash
ls /mnt/c/Program\ Files\ \(x86\)/Mozilla\ Firefox/firefox.exe
```
Você recebeu um erro como `ls: não é possível acessar...`?
Sim, ocorreu um erro
Execute os seguintes comandos:
```bash
echo "export BROWSER=\"/mnt/c/Program Files/Mozilla Firefox/firefox.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files/Mozilla Firefox/firefox.exe'\"" >> ~/.zshrc
```
Não, estava tudo bem
Execute os seguintes comandos:
```bash
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Mozilla Firefox/firefox.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Mozilla Firefox/firefox.exe'\"" >> ~/.zshrc
```
---
Microsoft Edge como navegador padrão
Execute os comandos:
```bash
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe'\"" >> ~/.zshrc
```
---
Reinicie seu terminal.
Em seguida, certifique-se de que o seguinte comando retorne "Browser Defined 👌":
```bash
[ -z "$BROWSER" ] && echo "ERROR: please define a BROWSER environment variable ⚠️" || echo "Browser defined 👌"
```
Se isso não acontecer,
:heavy_check_mark: Se você recebeu esta mensagem, pode continuar :+1:
:x: Caso contrário, escolha um navegador na lista acima e execute o comando correspondente. Então não se esqueça de redefinir seu terminal:
```bash
exec zsh
```
Não hesite em **entrar em contato com um professor**.
================================================
FILE: _partials/pt/windows_postgresql.md
================================================
## PostgreSQL
Às vezes, o SQLite não é suficiente e precisaremos de uma ferramenta mais avançada chamada [PostgreSQL](https://www.postgresql.org/), um sistema de banco de dados de código aberto, robusto e pronto para produção.
Vamos instalá-lo agora.
Execute os seguintes comandos:
```bash
sudo apt install -y postgresql postgresql-contrib libpq-dev build-essential
```
```bash
sudo /etc/init.d/postgresql start
```
```bash
sudo -u postgres psql --command "CREATE ROLE \"`whoami`\" LOGIN createdb superuser;"
```
Você pode configurar o PostgreSQL para inicialização automática, para que não precise executar `sudo /etc/init.d/postgresql start` cada vez que abrir um novo terminal:
```bash
sudo echo "`whoami` ALL=NOPASSWD:/etc/init.d/postgresql start" | sudo tee /etc/sudoers.d/postgresql
```
```bash
sudo chmod 440 /etc/sudoers.d/postgresql
```
```bash
echo "sudo /etc/init.d/postgresql start" >> ~/.zshrc
```
Abra um novo terminal.
:heavy_check_mark: Se você vir uma mensagem `* Starting postgresql (via systemctl): postgresql.service` OU `* Starting PostgreSQL 14 database server`, você está pronto para prosseguir :+1:
:x: Caso contrário, **entre em contato com um professor**.
================================================
FILE: _partials/pt/windows_settings.md
================================================
## Configurações do Windows
### Troque arquivos entre Windows e Ubuntu
Precisamos de uma maneira fácil de transferir arquivos do Windows para o Ubuntu e vice-versa.
Para fazer isso, vamos criar atalhos para diretórios do Ubuntu no **File Explorer** do Windows:
- Abra o Windows File Explorer (ou use o atalho `WIN` + `E`)
- Na barra de endereços, digite `\\wsl$\` (ou `\\wsl$\Ubuntu` se não funcionar)
- Agora você tem acesso ao sistema de arquivos Ubuntu
- Mergulhe no sistema de arquivos Ubuntu para procurar diretórios de interesse
- Arraste as pastas desejadas para a barra de endereços para criar atalhos

### Abra o Windows File Explorer no terminal Ubuntu
Outra opção para mover arquivos é abrir o Windows **File Explorer** no terminal Ubuntu:
- Abra um terminal Ubuntu
- Vá para o diretório que deseja explorar
- Execute o comando `explorer.exe .` (alternativamente, use `wslview .`)
- Se você receber uma mensagem de erro de entrada e saída, execute `wsl --shutdown` em um Windows PowerShell e reabra um terminal Ubuntu

### Encontre o seu caminho no sistema de arquivos Ubuntu
Você pode querer descobrir a localização exata de um diretório do Windows no sistema de arquivos Ubuntu ou vice-versa.
Para converter um caminho do Windows de e para um caminho do Ubuntu:
- Abra um terminal Ubuntu
- Use o comando `wslpath "C:\Program Files"` para traduzir um caminho do Windows em um caminho do Ubuntu
- Use o comando `wslpath -w "/home"` para traduzir um caminho do Ubuntu em um caminho do Windows
- Em particular, o comando `wslpath -w $(pwd)` retorna o caminho do Windows do diretório atual do Ubuntu

### Fixe aplicativos na sua barra de tarefas
Você usará a maioria dos aplicativos que instalou hoje com muita frequência. Vamos fixá-los na barra de tarefas para que estejam a apenas um clique de distância!
Para fixar um aplicativo na barra de tarefas, inicie o aplicativo, clique com o botão direito no ícone da barra de tarefas para abrir o menu de contexto e escolha “Fixar na barra de tarefas”.

Você deve fixar:
- Seu terminal
- Seu explorador de arquivos
- VS Code
- Seu navegador de Internet
- Slack
================================================
FILE: _partials/pt/windows_slack.md
================================================
## Slack
[Slack](https://slack.com/) é uma plataforma de comunicação bastante popular na indústria de tecnologia.
### Instalação
[Baixe o aplicativo Slack](https://slack.com/downloads/windows) e instale-o.
:warning: Se você já usa o Slack em seu navegador, baixe e instale **o aplicativo para desktop** que vem com todos os recursos.
================================================
FILE: _partials/pt/windows_terminal.md
================================================
## Terminal do Windows
### Instalação
:information_source: As instruções a seguir dependem da sua versão do Windows.
Se você estiver executando o Windows 11, o Terminal do Windows já está instalado e você pode prosseguir para a próxima seção :point_down:
Se você estiver executando o Windows 10, vamos instalar o Windows Terminal, um terminal realmente moderno.
Windows 10: Instalar Windows Terminal
- Clique em `Iniciar`
- Digite `Microsoft Store`
- Clique em `Microsoft Store` na lista
- Procure por `Windows Terminal` na barra de pesquisa
- **Selecione Terminal do Windows"**
- Clique em `Instalar`
:warning: NÃO instale o **Windows Terminal Preview**, apenas o **Windows Terminal**!
Desinstale a versão errada do Terminal do Windows
Para desinstalar uma versão errada do Terminal Windows, basta ir até a Lista de Programas Instalados do Windows 10:
- Pressione `Windows` + `R`
- Digite `ms-settings:appsfeatures`
- Pressione `Enter`
Encontre o software para desinstalar e clique no botão desinstalar.
Assim que a instalação for concluída, o botão `Instalar` se torna um botão `Iniciar`: clique nele.
### Ubuntu como terminal padrão
Vamos tornar o Ubuntu o terminal padrão do seu aplicativo Windows Terminal.
Pressione `Ctrl` + `,`
Deve abrir as configurações do terminal:

- Altere o perfil padrão para "Ubuntu"
- Clique em "Salvar"
- Clique em "Abrir arquivo JSON"
Você pode ver um círculo laranja em vez de um pinguim como logotipo do Ubuntu.
Temos um círculo em vermelho na parte que você irá alterar:

Primeiro, vamos pedir ao Ubuntu para iniciar diretamente dentro do diretório inicial do Ubuntu, em vez do diretório do Windows:
- Localize a entrada com `"name": "Ubuntu",` e `"hidden": false,`
- Adicione a seguinte linha depois dela:
```bash
"commandline": "wsl.exe ~",
```
:warning: Não esqueça a vírgula no final da linha!
Então, vamos desabilitar o aviso para comandos de copiar e colar entre o Windows e o Ubuntu:
- Localize a linha `"defaultProfile": "{2c4de342-...}"`
- Adicione a seguinte linha depois dela:
```bash
"warning.multiLinePaste": false,
```
:warning: Não esqueça a vírgula no final da linha!
Você pode salvar essas alterações pressionando `Ctrl` + `S`
:heavy_check_mark: Seu **Terminal Windows** agora está configurado :+1:
Este terminal possui abas: você pode optar por abrir uma nova aba do terminal clicando em **+** ao lado da atual.
**De agora em diante, toda vez que nos referirmos ao terminal ou ao console será este.** NÃO utilize mais nenhum outro terminal.
================================================
FILE: _partials/pt/windows_ubuntu.md
================================================
## Ubuntu
### Instalação
Após reiniciar o computador, você deverá ver uma janela de terminal informando que o WSL está retomando o processo de instalação do Ubuntu. Quando terminar, o Ubuntu será lançado.
Solução de problemas para Windows 10 (apenas se necessário, consulte um TA)
Se a instalação do Ubuntu não foi retomada, tente novamente: abra o Powershell ou o Prompt de Comando e execute `wsl --install` novamente.
Se você estiver executando o Windows 10, vamos instalar o Ubuntu através da Microsoft Store:
- Clique em `Iniciar`
- Digite `Microsoft Store`
- Clique em `Microsoft Store` na lista
- Procure por `Ubuntu` na barra de pesquisa
- **Selecione a versão sem nenhum número, simplesmente "Ubuntu"**
- Clique em `Obter`
:warning: Não instale **Ubuntu 18.04 LTS** nem **Ubuntu 20.04**!
Desinstale versões erradas do Ubuntu
Para desinstalar uma versão errada do Ubuntu, basta ir até a Lista de Programas Instalados do Windows 10:
- Pressione `Windows` + `R`
- Digite `ms-settings:appsfeatures`
- Pressione `Enter`
Encontre o software para desinstalar e clique no botão desinstalar.
Assim que a instalação for concluída, o botão `Get` se torna um botão `Open`: clique nele.
### Executando pela primeira vez
Na primeira execução, serão solicitadas algumas informações:
- Escolha um nome de **usuário**:
- uma palavra
- minúsculas
- sem caracteres especiais
- por exemplo: `lewagon` ou seu `nome`
- Escolha uma **senha**
- Confirme sua senha
:warning: Quando você digita sua senha, nada aparecerá na tela, **isso é normal**. Este é um recurso de segurança para mascarar não apenas sua senha como um todo, mas também seu comprimento. Basta digitar sua senha e quando terminar, pressione `Enter`.
Você pode fechar a janela do Ubuntu agora que ele está instalado no seu computador.
### Verifique a versão WSL do Ubuntu
- Pressione `Windows` + `R`
- Digite `cmd`
- Pressione `Enter`
Digite o seguinte comando:
```bash
wsl -l -v
```
:heavy_check_mark: Se a versão do Ubuntu WSL for 2, você está pronto :+1:
:x: Se a versão do Ubuntu WSL for 1, precisaremos convertê-lo para a versão 2.
Converter Ubuntu WSL V1 em V2
Na janela do prompt de comando, digite:
```bash
wsl --set-version Ubuntu 2
```
:heavy_check_mark: Após alguns segundos, você deverá receber a seguinte mensagem: `A conversão foi concluída`.
:x: Se não funcionar, precisamos ter certeza de que os arquivos do Ubuntu não estão compactados.
Verificar arquivos descompactados
- Pressione `Windows` + `R`
- Digite `%localappdata%\Packages`
- Pressione `Enter`
- Abra a pasta chamada `CanonicalGroupLimited.UbuntuonWindows...`
- Clique com o botão direito na pasta `LocalState`
- Clique em `Propriedades`
- Clique em `Avançado`
- Certifique-se de que a opção `Compactar conteúdo` **não** esteja marcada e clique em `Ok`.
Aplique as alterações apenas nesta pasta e tente converter a versão WSL do Ubuntu novamente.
:x: Se a conversão ainda não funcionar, por favor **entre em contato com um professor**.
Agora você pode fechar esta janela do terminal.
### Check your username
Type this in the Ubuntu terminal:
```bash
whoami
```
It should return the username you chose before.
:x: It if says `root`, **contact a TA** before continuing!
================================================
FILE: _partials/pt/windows_version.md
================================================
## Versão do Windows
Antes de começarmos, precisamos verificar se a versão do Windows instalada no seu computador é compatível com estas instruções de configuração.
### Windows 10 ou Windows 11
> :warning: **Nota sobre o Windows 10 e segurança**
>
> O setup do bootcamp Le Wagon funciona no Windows 10. Dito isso, recomendamos fortemente a atualização para o Windows 11. A partir de 14 de outubro de 2025, a Microsoft encerrou o suporte ao Windows 10, o que significa que ele não receberá mais atualizações de segurança, potencialmente deixando sua máquina em risco. Para mais detalhes, leia o guia da Microsoft: https://support.microsoft.com/en-us/windows/windows-10-support-has-ended-on-october-14-2025-2ca8b313-1946-43d3-b55c-2b95b107f281. Caso sua máquina não consiga executar o Windows 11, considere mudar para o Ubuntu.
Para poder configurar seu computador, você precisa ter o **Windows 10 ou Windows 11** instalado.
Para verificar sua versão do Windows:
- Pressione `Windows` + `R`
- Digite `winver`
- Pressione `Enter`
:heavy_check_mark: Se as primeiras palavras desta janela forem **Windows 11** você está pronto para prosseguir :+1:
- :heavy_check_mark: Se as primeiras palavras desta janela forem **Windows 10**, verifique o **Número da versão**::
- :x: Caso contrário, você não poderá prosseguir com esta configuração. Você precisa atualizar.
-
Como instalar as últimas atualizações?
Abra a atualização do Windows:
- Pressione `Windows` + `R`
- Digite `ms-settings:windowsupdate`
- Pressione `Enter`
- Clique em `Verificar atualizações`
:heavy_check_mark: Se você vir uma marca de seleção verde e a mensagem "Você está atualizado", você está pronto para prosseguir :+1:
:warning: Se você tiver um ponto de exclamação vermelho e a mensagem "Atualização disponível", instale-os e repita o processo até que apareça que você está atualizado :loop:
:x: Se você receber uma mensagem de erro sobre o Windows não conseguir aplicar atualizações, **entre em contato com um professor**.
Ative o Windows Update Service para corrigir atualizações
Alguns antivírus e softwares desativam o serviço de atualização de que precisamos, resultando no erro que você vê. Vamos consertar isso!
- Pressione `Windows` + `R`
- Digite `services.msc`
- Pressione `Enter`
- Clique duas vezes em `Serviço de atualização do Windows`
- Defina sua `Inicialização` para `Automático`
- Clique em `Iniciar`
- Clique em `Ok`
Então vamos tentar as atualizações novamente!
Verifique o Número da versão:
- Pressione `Windows` + `R`
- Digite `winver`
- Pressione `Enter`
:heavy_check_mark: Se disser pelo menos `2004`, você está pronto :+1:
:x: Se estiver abaixo de `22004`, por favor **entre em contato com um professor**.
================================================
FILE: _partials/pt/windows_virtualization.md
================================================
## Virtualização
Precisamos garantir que as opções de virtualização estejam habilitadas no BIOS do seu computador.
Para muitos computadores, este já é o caso. Vamos checar:
- Pressione `Windows` + `R`
- Digite `taskmgr`
- Pressione `Enter`
- Clique na aba `Desempenho`
- Clique em `CPU`

:heavy_check_mark: Se você vir "Virtualização: Ativada", está pronto :+1:
:x: Se a linha estiver faltando ou se a virtualização estiver desabilitada, por favor **entre em contato com um professor antes de tentar ativar a Virtualização**
Ativar virtualização
Precisamos acessar o BIOS/UEFI do computador para ativá-lo.
- Pressione `Windows + R`
- Digite `shutdown.exe /r /o /t 1`
- Pressione `Enter`
- Aguarde o computador desligar
- Clique em `Solucionar problemas`
- Clique em `Opções avançadas`
- Clique em `Configurações de firmware UEFI`
- Clique em `Reiniciar`
Você precisa ativar a opção de virtualização para o seu processador aqui:
- Na maioria das vezes, nas configurações avançadas, nas configurações da CPU ou nas configurações do Northbridge
- A opção pode ter um nome diferente de acordo com o seu computador:
- Intel: `Intel VT-x`, `Tecnologia de virtualização Intel`, `Extensões de virtualização`, `Vanderpool`...
- AMD: `Modo SVM` ou `AMD-V`
- Salve as alterações após a ativação e reinicie o computador através da opção apropriada
================================================
FILE: _partials/pt/windows_vscode.md
================================================
## Visual Studio Code
### Instalação
Vamos instalar o editor de texto [Visual Studio Code](https://code.visualstudio.com).
- Vá para a [página de download do Visual Studio Code](https://code.visualstudio.com/download).
- Clique no botão "Windows"
- Abra o arquivo que você acabou de baixar.
- Instale-o com algumas opções:

Quando a instalação for concluída, inicie o VS Code.
### Conectando o código VS ao Ubuntu
Para fazer o VS Code interagir corretamente com o Ubuntu, vamos instalar a extensão [Remote - WSL](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) VS Code.
Abra seu **terminal Ubuntu**.
Copie e cole os seguintes comandos no terminal:
```bash
code --install-extension ms-vscode-remote.remote-wsl
```
Em seguida, abra o VS Code em seu terminal:
```bash
code .
```
:heavy_check_mark: Se você vir `WSL: Ubuntu` no canto inferior esquerdo da janela do VS Code, você está pronto para prosseguir :+1:

:x: Caso contrário, por favor **entre em contato com um professor**
================================================
FILE: _partials/pt/windows_wsl.md
================================================
## Subsistema Windows para Linux (WSL)
WSL é o ambiente de desenvolvimento que usamos para executar o Ubuntu. Você pode aprender mais sobre WSL [aqui](https://docs.microsoft.com/en-us/windows/wsl/faq).
Instalaremos o WSL 2 e o Ubuntu em um comando através do Windows Command Prompt.
:warning: Nas instruções a seguir, esteja ciente do pressionamento de tecla `Ctrl` + `Shift` + `Enter` para executar o **Windows Command Prompt** com privilégios de administrador em vez de apenas clicar em `Ok` ou pressionar `Enter` .
- Pressione `Windows` + `R`
- Digite `cmd`
- Pressione **`Ctrl` + `Shift` + `Enter`**
:warning: Você pode ter que aceitar a confirmação do UAC sobre a elevação de privilégio.
Uma janela de terminal aparecerá:
- Copie o seguinte comando (`Ctrl` + `C`)
- Cole-o na janela do terminal (`Ctrl` + `V` ou clicando com o botão direito na janela)
- Execute-o pressionando `Enter`
```powershell
wsl --install
```
:heavy_check_mark: Se o comando foi executado sem nenhum erro, reinicie o computador e continue abaixo :+1:
:x: Se você encontrar uma mensagem de erro (ou se vir algum texto em vermelho na janela), por favor **entre em contato com um professor**
Solução de problemas para Windows 10 (apenas se necessário, consulte um professor)
#### Para Windows 10 < 2004: instale o WSL 1 primeiro
:warning: Nas instruções a seguir, esteja ciente do pressionamento de tecla `Ctrl` + `Shift` + `Enter` para executar o **Windows PowerShell** com privilégios de administrador em vez de apenas clicar em `Ok` ou pressionar `Enter` .
- Pressione `Windows` + `R`
- Digite `powershell`
- Pressione **`Ctrl` + `Shift` + `Enter`**
:warning: Você pode ter que aceitar a confirmação do UAC sobre a elevação de privilégio.
Uma janela de terminal azul aparecerá:
- Copie os seguintes comandos um por um (`Ctrl` + `C`)
- Cole-os na janela do PowerShell (`Ctrl` + `V` ou clicando com o botão direito na janela)
- Execute-os pressionando `Enter`
```powershell
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
```
```powershell
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
```
```powershell
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
```
:heavy_check_mark: Se todos os três comandos foram executados sem nenhum erro, reinicie o computador e continue abaixo :+1:
:x: Se você encontrar uma mensagem de erro (ou se vir algum texto em vermelho na janela), por favor **entre em contato com um professor**
#### Para Windows 10 com WSL 1: Atualizar para WSL 2
Se você estiver executando o Windows 10, atualizaremos o WSL para a versão 2.
Assim que o computador for reiniciado, precisamos baixar o instalador WSL2.
- Vá para a [página de download](https://aka.ms/wsl2kernel)
- Baixe o "pacote de atualização do kernel WSL2 Linux"
- Abra o arquivo que você acabou de baixar
- Clique em `Avançar`
- Clique em `Concluir`

:heavy_check_mark: Se não encontrou nenhuma mensagem de erro, você está pronto :+1:
:x: Se você encontrar o erro "Esta atualização se aplica apenas a máquinas com o subsistema Windows para Linux", **clique com o botão direito** no programa e selecione `uninstall`; você poderá instalá-lo normalmente desta vez.
#### Para Windows 10 com WSL 1: Torne o WSL 2 o subsistema Windows padrão para Linux
Se você estiver executando o Windows 10, definiremos a versão padrão do WSL como 2.
Agora que o WSL 2 está instalado, vamos torná-lo a versão padrão:
- Pressione `Windows` + `R`
- Digite `cmd`
- Pressione `Enter`
Na janela que aparece, digite:
```bash
wsl --set-default-version 2
```
:heavy_check_mark: Se você vir "A operação foi concluída com sucesso", você pode fechar este terminal e continuar seguindo as instruções abaixo :+1:
:x: Se a mensagem que você receber for sobre Virtualização, por favor **entre em contato com um professor**
Ativar recurso Windows da Plataforma de Máquina Virtual
Siga as etapas descritas [aqui](https://www.configserverfirewall.com/windows-10/please-enable-the-virtual-machine-platform-windows-feature-and-ensure-virtualization-is-enabled-in- the-bios/#:~:text=To%20enable%20WSL%202,%20Open,Windows%20feature%20on%20or%20off.&text=Garanta%20que%20the%20Virtual%20Machine,Windows%20will%20enable%20WSL %202) até você ativar a Plataforma de Máquina Virtual e o Subsistema Windows para Linux
Ativar recurso Hyper-V do Windows
Siga as etapas descritas [aqui](https://winaero.com/enable-use-hyper-v-windows-10/) até ativar o grupo Hyper-V
:information_source: Se você estiver executando o Windows 10 **Home edition**, o recurso Hyper-V não estará disponível para o seu sistema operacional. Não bloqueia e você ainda pode continuar seguindo as instruções abaixo :ok_hand:
================================================
FILE: _partials/pt/yarn.md
================================================
## Yarn
[`yarn`](https://yarnpkg.com/) é um gerenciador de pacotes para instalar bibliotecas JavaScript. Vamos instalá-lo:
Em um terminal, execute os seguintes comandos:
```bash
corepack enable
yarn set version stable
```
```bash
exec zsh
```
⚠️ Se vires quaisquer mensagens de erro, tenta executar `npm install -g corepack` e, em seguida, volta a executar os comandos acima.
Em seguida, execute o seguinte comando:
```bash
yarn -v
```
:heavy_check_mark: Se você vir uma versão, você está bem :+1:
:x: Se não, **entre em contato com um professor**
================================================
FILE: _partials/rbenv.md
================================================
## rbenv
Let's install [`rbenv`](https://github.com/sstephenson/rbenv), a software to install and manage `ruby` environments.
First, we need to clean up any previous Ruby installation you might have:
```bash
rvm implode && sudo rm -rf ~/.rvm
# If you got "zsh: command not found: rvm", carry on.
# It means `rvm` is not on your computer, that's what we want!
rm -rf ~/.rbenv
```
Then in the terminal, run:
```bash
sudo apt install -y build-essential tklib zlib1g-dev libssl-dev libffi-dev libxml2 libxml2-dev libxslt1-dev libreadline-dev libyaml-dev
```
```bash
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
```
```bash
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
```
```bash
exec zsh
```
================================================
FILE: _partials/ruby.md
================================================
## Ruby
### Installation
Now, you are ready to install the latest [ruby](https://www.ruby-lang.org/en/) version and set it as the default version.
Run this command, it will **take a while (5-10 minutes)**
```bash
rbenv install
```
Once the ruby installation is done, run this command to tell the system
to use the version by default.
```bash
rbenv global
```
**Reset** your terminal and check your Ruby version:
```bash
exec zsh
```
Then run:
```bash
ruby -v
```
:heavy_check_mark: If you see something starting with `ruby ` then you can proceed :+1:
:x: If not, **ask a teacher**
### Installing some gems
If you are in China 🇨🇳 click here
:warning: If you are in China, you should update the way we'll install gem with the following commands.
```bash
# China only!
gem sources --remove https://rubygems.org/
gem sources -a https://gems.ruby-china.com/
gem sources -l
# *** CURRENT SOURCES ***
# https://gems.ruby-china.com/
# Ruby-china.com must be in the list now
```
**Everyone, in China or not**, continue here to install gems.
In the ruby world, we call external libraries `gems`: they are pieces of ruby code that you can download and execute on your computer. Let's install some!
First, we'll update `bundler`, which is what lets us install gems:
```bash
gem update bundler
```
In your terminal, copy-paste the following command:
```bash
gem install
```
:heavy_check_mark: If you get `xx gems installed`, then all good :+1:
:x: If you encounter the following error:
```bash
ERROR: While executing gem ... (TypeError)
incompatible marshal file format (can't be read)
format version 4.8 required; 60.33 given
```
Run the following command:
```bash
rm -rf ~/.gemrc
```
Rerun the command to install the gems.
:warning: **NEVER** install a gem with `sudo gem install`! Even if you stumble upon a Stackoverflow answer (or the terminal) telling you to do so.
================================================
FILE: _partials/slack_settings.md
================================================
### Settings
Launch the app and sign in to `lewagon-alumni` organization.
Make sure you **upload a profile picture** :point_down:

The idea is that you'll have Slack open all day, so that you can share useful links / ask for help / decide where to go to lunch / etc.
To ensure that everything is working fine for video calls, let's test your camera and microphone:
- Open the Slack app
- Click your profile picture in the top right.
- Select `Preferences` from the menu.
- Click `Audio & video` in the left-side column.
- Below `Troubleshooting`, click `Run an audio, video and screensharing test`. The test will open in a new window.
- Check that your preferred speaker, microphone and camera devices appear in the drop-down menus, then click `Start test`.

:heavy_check_mark: When the test is finished, you should see green "Succeed" messages at least for your microphone and camera. :+1:
:x: If not, **contact a teacher**.
You can also install Slack app on your phone and sign in `lewagon-alumni`!
================================================
FILE: _partials/sqlite.md
================================================
## SQLite
In a few weeks, we'll talk about databases and SQL. [SQLite](https://sqlite.org/index.html) is a database engine used to execute SQL queries on single-file databases. Let's install it:
In a terminal, execute the following commands:
```bash
sudo apt-get install sqlite3 libsqlite3-dev pkg-config
```
Then run the following command:
```bash
sqlite3 -version
```
:heavy_check_mark: If you see a version, you're good :+1:
:x: If not, **ask for a teacher**
================================================
FILE: _partials/ssh_agent.md
================================================
## Disable SSH passphrase prompt
You don't want to be asked for your passphrase every time you communicate with a distant repository. So, you need to add the plugin `ssh-agent` to `oh my zsh`:
First, open the `.zshrc` file:
```bash
code ~/.zshrc
```
Then:
- Spot the line starting with `plugins=`
- Add `ssh-agent` at the end of the plugins list
:heavy_check_mark: Save the `.zshrc` file with `Ctrl` + `S` and close your text editor.
================================================
FILE: _partials/ubuntu_postgresql.md
================================================
## PostgreSQL
Sometimes, SQLite is not enough and we will need a more advanced tool called [PostgreSQL](https://www.postgresql.org/), an open-source robust and production-ready database system.
Let's install it now.
Run the following commands:
```bash
sudo apt install -y postgresql postgresql-contrib libpq-dev build-essential
```
```bash
sudo -u postgres psql --command "CREATE ROLE \"`whoami`\" LOGIN createdb superuser;"
```
================================================
FILE: _partials/ubuntu_settings.md
================================================
## Ubuntu settings
### Install video codec H264
On our pedagogical platform (Kitt, you'll soon discover it!), we have some videos. By default Firefox on Linux cannot play them as they use an unsupported codec (H264). To get those videos working for you, you need to run this:
```bash
sudo apt install libavcodec-extra -y
```
### Install useful terminal tools
`tree` is a nice tool to visualize a directory tree inside the terminal:
`ncdu` is a text-based interface disk utility.
`htop` is an interactive process viewer.
`tig` is a text-mode interface for `git`.
```bash
sudo apt install tree ncdu htop tig
```
### Ubuntu inotify
Ubuntu is always tracking changes in your folders and to do this it uses inotify.
By default the Ubuntu limit is set to 8192 files monitored.
As programming involves a lot of files, we need to raise this limit.
In your terminal run:
```bash
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
```
### Pin apps to your dock
You are going to use most of the apps you've installed today really often. So let's pin them to your dock so that they are just one click away!
To pin an app to your dock, launch the app, right-click on the icon in the dock to bring up the context menu and choose "Add to Favorites".

You must pin:
- Your terminal
- Your file explorer
- VS Code
- Your Internet browser
- Slack
================================================
FILE: _partials/ubuntu_slack.md
================================================
## Slack
[Slack](https://slack.com/) is a communication platform pretty popular in the tech industry.
### Installation
[Download the Slack app](https://get.slack.help/hc/en-us/articles/212924728-Slack-for-Linux-beta-) and install it.
:warning: If you are already using Slack in your browser, please download and install **the desktop app** which is fully featured.
================================================
FILE: _partials/ubuntu_vscode.md
================================================
## Visual Studio Code
### Installation
Let's install [Visual Studio Code](https://code.visualstudio.com) text editor.
Copy (`Ctrl` + `C`) the commands below then paste them in your terminal (`Ctrl` + `Shift` + `v`):
```bash
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
```
```bash
sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
```
```bash
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
```
```bash
rm -f packages.microsoft.gpg
```
```bash
sudo apt update
```
```bash
sudo apt install -y code
```
These commands will ask for your password: type it in.
:warning: When you type your password, nothing will show up on the screen, **that's normal**. This is a security feature to mask not only your password as a whole but also its length. Just type in your password and when you're done, press `Enter`.
### Launching from the terminal
Now let's launch VS Code from **the terminal**:
```bash
code
```
:heavy_check_mark: If a VS Code window has just opened, you're good to go :+1:
:x: Otherwise, please **contact a teacher**
================================================
FILE: _partials/vscode_aifeatures.md
================================================
### VS Code AI Features
VS Code includes many powerful **AI features**, which are a great tool once you already know how to code.
That said, relying on AI too early can hide important concepts and make debugging harder to understand. Once you’re comfortable with the fundamentals, you’ll know when and how to use AI effectively — without letting it do the thinking for you.
For the start of the bootcamp, we’ll disable these features. At the right point in the course, we’ll reenable them so you can put them to good use.
In **VS Code**:
1. Let's open the VS Code "Command **P**alette": type `Ctrl-Shift-P` (Windows / Linux) or `Cmd-Shift-P` (macOS).
1. This will open the Command Palette: a small text box at the top of your screen. Start typing `aifeatures` until you see "Chat: Learn How to Hide AI features". Click on it.

1. This will open the settings, and will show you the option "Disable and hide built-in AI features ...". Tick the checkbox in front of that option.

Later, if you want **to reenable** the AI features, you can follow the same instructions to untick the checkbox.
================================================
FILE: _partials/vscode_extensions.md
================================================
## VS Code Extensions
### Installation
Let's install some useful extensions to VS Code.
Copy-paste the following commands in your terminal:
```bash
code --install-extension ms-vscode.sublime-keybindings
code --install-extension emmanuelbeziat.vscode-great-icons
code --install-extension github.github-vscode-theme
code --install-extension MS-vsliveshare.vsliveshare
code --install-extension shopify.ruby-lsp
code --install-extension dbaeumer.vscode-eslint
code --install-extension Rubymaniac.vscode-paste-and-indent
code --install-extension alexcvzz.vscode-sqlite
code --install-extension anteprimorac.html-end-tag-labels
code --install-extension rayhanw.erb-helpers
```
Here is a list of the extensions you are installing:
- [Sublime Text Keymap and Settings Importer](https://marketplace.visualstudio.com/items?itemName=ms-vscode.sublime-keybindings)
- [VSCode Great Icons](https://marketplace.visualstudio.com/items?itemName=emmanuelbeziat.vscode-great-icons)
- [Live Share](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare)
- [Ruby](https://marketplace.visualstudio.com/items?itemName=shopify.ruby-lsp)
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [Paste and Indent](https://marketplace.visualstudio.com/items?itemName=Rubymaniac.vscode-paste-and-indent)
- [SQLite](https://marketplace.visualstudio.com/items?itemName=alexcvzz.vscode-sqlite)
================================================
FILE: _partials/vscode_liveshare.md
================================================
### Live Share configuration
[Visual Studio Live Share](https://visualstudio.microsoft.com/services/live-share/) is a VS Code extension which allows you to share the code in your text editor for debugging and pair-programming: let's set it up!
Launch VS Code from your terminal by typing `code` and pressing `Enter`.
Click on the little arrow at the bottom of the left bar :point_down:

- Click on the "Share" button, then on "GitHub (Sign in using GitHub account)".
- A popup appears asking you to sign in with GitHub: click on "Allow".
- You are redirected to a GitHub page in you browser asking you to authorize Visual Studio Code: click on "Continue" then "Authorize github".
- VS Code may display additional pop-ups: close them by clicking "OK".
That's it, you're good to go!
================================================
FILE: _partials/windows_browser.md
================================================
## Linking your default browser to Ubuntu
To be sure that you can interact with your browser installed on Windows from your Ubuntu terminal, we need to set it as your default browser there.
:warning: You need to execute at least one of the following commands below:
Google Chrome as your default browser
Run the command:
```bash
ls /mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe
```
Did you get an error like `ls: cannot access...`?
Yes, I had an error
Run the following commands:
```bash
echo "export BROWSER=\"/mnt/c/Program Files/Google/Chrome/Application/chrome.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files/Google/Chrome/Application/chrome.exe'\"" >> ~/.zshrc
```
No, everything was fine
Run the following commands:
```bash
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe'\"" >> ~/.zshrc
```
---
Mozilla Firefox as your default browser
Run the command:
```bash
ls /mnt/c/Program\ Files\ \(x86\)/Mozilla\ Firefox/firefox.exe
```
Did you get an error like `ls: cannot access...`?
Yes, I had an error
Run the following commands:
```bash
echo "export BROWSER=\"/mnt/c/Program Files/Mozilla Firefox/firefox.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files/Mozilla Firefox/firefox.exe'\"" >> ~/.zshrc
```
No, everything was fine
Run the following commands:
```bash
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Mozilla Firefox/firefox.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Mozilla Firefox/firefox.exe'\"" >> ~/.zshrc
```
---
Microsoft Edge as your default browser
Run the commands:
```bash
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe'\"" >> ~/.zshrc
```
---
Restart your terminal.
Then please make sure that the following command returns "Browser defined 👌":
```bash
[ -z "$BROWSER" ] && echo "ERROR: please define a BROWSER environment variable ⚠️" || echo "Browser defined 👌"
```
If it does not,
:heavy_check_mark: If you got this message, you can continue :+1:
:x: If not, choose a browser in the list above and execute the corresponding command. Then don't forget to reset your terminal:
```bash
exec zsh
```
Do not hesitate to **contact a teacher**.
================================================
FILE: _partials/windows_postgresql.md
================================================
## PostgreSQL
Sometimes, SQLite is not enough and we will need a more advanced tool called [PostgreSQL](https://www.postgresql.org/), an open-source robust and production-ready database system.
Let's install it now.
Run the following commands:
```bash
sudo apt install -y postgresql postgresql-contrib libpq-dev build-essential
```
```bash
sudo /etc/init.d/postgresql start
```
```bash
sudo -u postgres psql --command "CREATE ROLE \"`whoami`\" LOGIN createdb superuser;"
```
_📝 If you get an error saying `could not change directory to "/home/your_name": Permission denied` that is totally fine, and there's no need to worry 💆 If, on the first run, it says `CREATE ROLE` in the end all worked fine._
You can configure PostgreSQL to autostart, so you don't have to execute `sudo /etc/init.d/postgresql start` each time you open a new terminal:
```bash
sudo echo "`whoami` ALL=NOPASSWD:/etc/init.d/postgresql start" | sudo tee /etc/sudoers.d/postgresql
```
```bash
sudo chmod 440 /etc/sudoers.d/postgresql
```
```bash
echo "sudo /etc/init.d/postgresql start" >> ~/.zshrc
```
Open a new terminal.
:heavy_check_mark: If you see a `* Starting postgresql (via systemctl): postgresql.service` OR `* Starting PostgreSQL 14 database server` message, you're good to go :+1:
:x: If not, **contact a teacher**.
================================================
FILE: _partials/windows_settings.md
================================================
## Windows settings
### Exchange files between Windows and Ubuntu
We need an easy way to transfer files from Windows to Ubuntu and vice versa.
In order to do that, let's create shortcuts to Ubuntu directories in the Windows **File Explorer**:
- Open the Windows File Explorer (or use the shortcut `WIN` + `E`)
- In the Address Bar, enter `\\wsl$\` (or `\\wsl$\Ubuntu` if it does not work)
- You now have acces to the Ubuntu file system
- Dive into the Ubuntu file system in order to look for directories of interest
- Drag the desired folders into the Address Bar in order to create shortcuts

### Open the Windows File Explorer from the Ubuntu terminal
Another option to move files around is to open the Windows **File Explorer** from the Ubuntu terminal:
- Open an Ubuntu terminal
- Go to the directory you wish to explore
- Run the `explorer.exe .` command (alternatively, use `wslview .`)
- If you get an input output error message, run `wsl --shutdown` in a Windows PowerShell and reopen an Ubuntu terminal

### Find your way in the Ubuntu File System
You might want to figure out the exact location of a Windows directory in the Ubuntu file system, or the other way around.
In order to convert a Windows path to and from an Ubuntu path:
- Open an Ubuntu terminal
- Use the `wslpath "C:\Program Files"` command in order to translate a Windows path into an Ubuntu path
- Use the `wslpath -w "/home"` command in order to translate an Ubuntu path into a Windows path
- In particular, the `wslpath -w $(pwd)` command returns the Windows path of the current Ubuntu directory

### Pin apps to your taskbar
You are going to use most of the apps you've installed today really often. Let's pin them to your taskbar so that they are just one click away!
To pin an app to your taskbar, launch the app, right-click on the icon in the taskbar to bring up the context menu and choose "Pin to taskbar".

You must pin:
- Your terminal
- Your file explorer
- VS Code
- Your Internet browser
- Slack
================================================
FILE: _partials/windows_slack.md
================================================
## Slack
[Slack](https://slack.com/) is a communication platform pretty popular in the tech industry.
### Installation
[Download the Slack app](https://slack.com/downloads/windows) and install it.
:warning: If you are already using Slack in your browser, please download and install **the desktop app** which is fully featured.
================================================
FILE: _partials/windows_terminal.md
================================================
## Windows Terminal
### Installation
:information_source: The following instructions depend on your version of Windows.
If you are running Windows 11, the Windows Terminal is already installed and you can proceed to the next section :point_down:
If you are running Windows 10, let's install Windows Terminal, a real modern terminal.
Windows 10: Install Windows Terminal
- Click on `Start`
- Type `Microsoft Store`
- Click on `Microsoft Store` in the list
- Search for `Windows Terminal` in the search bar
- **Select Windows Terminal"**
- Click on `Install`
:warning: DO NOT install **Windows Terminal Preview**, just **Windows Terminal**!
Uninstall wrong version of Windows Terminal
To uninstall a wrong version of Windows Terminal, you just have to go to the Installed Program List of Windows 10:
- Press `Windows` + `R`
- Type `ms-settings:appsfeatures`
- Press `Enter`
Find the software to uninstall and click on the uninstall button.
Once the installation is finished, the `Install` button becomes a `Launch` button: click on it.
### Ubuntu as the default terminal
Let's make Ubuntu the default terminal of your Windows Terminal application.
Press `Ctrl` + `,`
It should open the terminal settings:

- Change the default profile to "Ubuntu"
- Click on "Save"
- Click on "Open JSON file"
You may see an orange circle rather than a penguin as the logo for Ubuntu.
We have circled in red the part you need to add:

First, let's ask Ubuntu to start directly inside your Ubuntu Home Directory instead of the Windows one.
- Place this line inside the { } block that contains "name": "Ubuntu" (like in the screenshot):
```bash
"commandline": "wsl.exe ~",
```
:warning: Do not forget the comma at the end of the line!
Then, let's disable warnings for copy-pasting commands between Windows and Ubuntu:
- Locate the line "defaultProfile": "{2c4de342-...}"
- Add the following line after it:
```bash
"warning.multiLinePaste": false,
```
:warning: Do not forget the comma at the end of the line!
You can save these changes by pressing `Ctrl` + `S`
:heavy_check_mark: Your **Windows Terminal** is now setup :+1:
This terminal has tabs: you can choose to open a new terminal tab by clicking on the **+** next to the current one.
**From now on, every time we will refer to the terminal or the console it will be this one.** DO NOT use any other terminal anymore.
================================================
FILE: _partials/windows_ubuntu.md
================================================
## Ubuntu
### Installation
After restarting you computer, you should see a terminal window saying WSL is resuming the Ubuntu installation process. When it's done, Ubuntu will be launched.
Troubleshooting for Windows 10 (only if needed, check with a TA)
If the Ubuntu installation did not resume, first try it again: launch Powershell or the Command Prompt again and run `wsl --install` again.
If you are running Windows 10, let's install Ubuntu throught the Microsoft Store:
- Click on `Start`
- Type `Microsoft Store`
- Click on `Microsoft Store` in the list
- Search for `Ubuntu` in the search bar
- **Select version without any number, just plain "Ubuntu"**
- Click on `Get`
:warning: Don't install **Ubuntu 18.04 LTS** nor **Ubuntu 20.04**!
Uninstall wrong versions of Ubuntu
To uninstall a wrong version of Ubuntu, you just have to go to the Installed Program List of Windows 10:
- Press `Windows` + `R`
- Type `ms-settings:appsfeatures`
- Press `Enter`
Find the software to uninstall and click on the uninstall button.
Once the installation is finished, the `Get` button becomes a `Open` button: click on it.
### First launch
At first launch, you will be asked some information:
- Choose a **username**:
- one word
- lowercase
- no special characters
- for example: `lewagon` or your `firstname`
- Choose a **password**
- Confirm your password
:warning: When you type your password, nothing will show up on the screen, **that's normal**. This is a security feature to mask not only your password as a whole but also its length. Just type your password and when you're done, press `Enter`.
### Check the WSL version of Ubuntu
- Press `Windows` + `R`
- Type `cmd`
- Press `Enter`
Type the following command:
```bash
wsl -l -v
```
:heavy_check_mark: If the version of Ubuntu WSL is 2, you are good to go :+1:
:x: If the version of Ubuntu WSL is 1, we will need to convert it to version 2.
Convert Ubuntu WSL V1 to V2
In the Command Prompt window, type:
```bash
wsl --set-version Ubuntu 2
```
:heavy_check_mark: After a few seconds, you should get the following message: `The conversion is complete`.
:x: If it does not work, we need to be sure that Ubuntu files are not compressed.
Check for Uncompressed Files
- Press `Windows` + `R`
- Type `%localappdata%\Packages`
- Press `Enter`
- Open the folder named `CanonicalGroupLimited.UbuntuonWindows...`
- Right Click on the `LocalState` folder
- Click on `Properties`
- Click on `Advanced`
- Make sure that the option `Compress content` is **not** ticked, then click on `Ok`.
Apply changes to this folder only and try to convert the Ubuntu WSL version again.
:x: If the conversion still does not work, please **contact a teacher**.
You can close this terminal now.
### Check your username
Type this in the Ubuntu terminal:
```bash
whoami
```
It should return the username you chose before.
:x: It if says `root`, **contact a TA** before continuing!
================================================
FILE: _partials/windows_version.md
================================================
## Windows version
Before we start, we need to check that the version of Windows installed on your computer is compatible with this setup instructions.
### Windows 10 or Windows 11
> :warning: **Note on Windows 10 and security**
>
> The Le Wagon bootcamp setup works on Windows 10. That said, we highly recommend to upgrade to Windows 11. Since October 14th, 2025, Microsoft has ended support for Windows 10, which means it will no longer receive security updates, potentially putting your machine at risk. For more details, read [Microsoft's guide](https://support.microsoft.com/en-us/windows/windows-10-support-has-ended-on-october-14-2025-2ca8b313-1946-43d3-b55c-2b95b107f281). In case your machine can't run Windows 11, consider switching to Ubuntu.
To be able to set up your computer, you need to have **Windows 10 or Windows 11** installed.
To check your Windows version:
- Press `Windows` + `R`
- Type `winver`
- Press `Enter`
:heavy_check_mark: If the first words of this window are **Windows 11** you're good to go :+1:
If the first words of this window are **Windows 10**, check the **Version number**:
- :heavy_check_mark: If it says at least `2004`, you are good to go :+1:
- :x: If it is below `2004`, you need to run an update.
-
How to install updates?
Open Windows Update:
- Press `Windows` + `R`
- Type `ms-settings:windowsupdate`
- Press `Enter`
- Click on `Check updates`
:heavy_check_mark: If you see a green check mark and the message "You're up to date", you're good to go :+1:
:warning: If you have a red exclamation mark and the message "Update available", please install them and repeat the process until it says that you are up to date :loop:
:x: If you have an error message about Windows not being able to apply updates, please **contact a teacher**.
Activate Windows Update Service to fix Updates
Some antiviruses and pieces of software deactivate the Update service we need, resulting in the error you see. Let's fix that!
- Press `Windows` + `R`
- Type `services.msc`
- Press `Enter`
- Double Click `Windows Update Service`
- Set its `Startup` to `Automatic`
- Click on `Start`
- Click on `Ok`
Then let's try updates again!
Check the version number again:
- Press `Windows` + `R`
- Type `winver`
- Press `Enter`
:heavy_check_mark: If it says at least `2004`, you are good to go :+1:
:x: If it is below `2004`, **contact a TA**.
================================================
FILE: _partials/windows_virtualization.md
================================================
## Virtualization
We need to ensure that the Virtualization options are enabled in the BIOS of your computer.
For many computers, this is already the case. Let's check:
- Press `Windows` + `R`
- Type `taskmgr`
- Press `Enter`
- Click on the `Performance` tab
- Click on `CPU`

:heavy_check_mark: If you see "Virtualization: Enabled", you're good to go :+1:
:x: If the line is missing or if the virtualization is disabled, please **contact a teacher before trying to activate the Virtualization**
Activate Virtualization
We need to access the BIOS / UEFI of the computer to activate it.
- Press `Windows + R`
- Type `shutdown.exe /r /o /t 1`
- Press `Enter`
- Wait for the computer to shutdown
- Click on `Troubleshoot`
- Click on `Advanced Options`
- Click on `UEFI Firmware Settings`
- Click on `Restart`
You need to activate the virtualization option for your processor here:
- Most of the time, in the advanced settings, the CPU settings, or the Northbridge settings
- The option can be called differently according to your computer:
- Intel: `Intel VT-x`, `Intel Virtualization Technology`, `Virtualization Extensions`, `Vanderpool`...
- AMD: `SVM Mode` or `AMD-V`
- Save the changes after activation and reboot the computer through the appropriate option
================================================
FILE: _partials/windows_vscode.md
================================================
## Visual Studio Code
### Installation
Let's install [Visual Studio Code](https://code.visualstudio.com) text editor.
- Go to [Visual Studio Code download page](https://code.visualstudio.com/download).
- Click on "Windows" button
- Open the file you have just downloaded.
- Install it with few options:

When the installation is finished, launch VS Code.
### Connecting VS Code to Ubuntu
To make VS Code interact properly with Ubuntu, let's install the [Remote - WSL](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) VS Code extension.
Open your **Ubuntu terminal**.
Copy-paste the following commands in the terminal:
```bash
code --install-extension ms-vscode-remote.remote-wsl
```
Then open VS Code from your terminal:
```bash
code .
```
:heavy_check_mark: If you see `WSL: Ubuntu` in the bottom left corner of the VS Code window, you're good to go :+1:

:x: Otherwise, please **contact a teacher**
================================================
FILE: _partials/windows_wsl.md
================================================
## Windows Subsystem for Linux (WSL)
WSL is the development environment we are using to run Ubuntu. You can learn more about WSL [here](https://docs.microsoft.com/en-us/windows/wsl/faq).
We will install WSL 2 and Ubuntu in one command through the Windows Command Prompt.
:warning: In the following instruction, please be aware of the `Ctrl` + `Shift` + `Enter` key stroke to execute **Windows Command Prompt** with administrator privileges instead of just clicking on `Ok`or pressing `Enter`.
- Press `Windows` + `R`
- Type `cmd`
- Press **`Ctrl` + `Shift` + `Enter`**
:warning: You may have to accept the UAC confirmation about the privilege elevation.
A black terminal window will appear:
- Copy the following command (`Ctrl` + `C`)
- Paste it into the terminal window (`Ctrl` + `V` or by right-clicking in the window)
- Run it by pressing `Enter`
```powershell
wsl --install
```
:heavy_check_mark: If the command ran without any error, please restart your computer and continue below :+1:
:x: If you encounter an error message (or if you see some text in red in the window), please **contact a teacher**.
Troubleshooting for Windows 10 (only if needed, check with a TA)
#### For Windows 10 < 2004: install WSL 1 first
:warning: In the following instruction, please be aware of the `Ctrl` + `Shift` + `Enter` key stroke to execute **Windows PowerShell** with administrator privileges instead of just clicking on `Ok`or pressing `Enter`.
- Press `Windows` + `R`
- Type `powershell`
- Press **`Ctrl` + `Shift` + `Enter`**
:warning: You may have to accept the UAC confirmation about the privilege elevation.
A blue terminal window will appear:
- Copy the following commands one by one (`Ctrl` + `C`)
- Paste them into the PowerShell window (`Ctrl` + `V` or by right-clicking in the window)
- Run them by pressing `Enter`
```powershell
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
```
```powershell
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
```
```powershell
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
```
:heavy_check_mark: If all three commands ran without any error, please restart your computer and continue below :+1:
:x: If you encounter an error message (or if you see some text in red in the window), please **contact a teacher**
#### For Windows 10 users running WSL 1: Upgrade to WSL 2
If you are running Windows 10, we will then upgrade WSL to version 2.
Once your computer has restarted, we need to download the WSL2 installer.
- Go to the [download page](https://aka.ms/wsl2kernel)
- Download "WSL2 Linux kernel update package"
- Open the file you've just downloaded
- Click `Next`
- Click `Finish`

:heavy_check_mark: If didn't encounter any error message, you're good to go :+1:
:x: If you encounter the error "This update only applies to machines with the Windows Subsystem for Linux", **right click** on the program and select `uninstall`; you shall be able to install it normally this time.
#### For Windows 10 users running WSL 1: Make WSL 2 the default Windows Subsystem for Linux
If you are running Windows 10, we will set WSL default version to 2.
Now that WSL 2 is installed, let's make it the default version:
- Press `Windows` + `R`
- Type `cmd`
- Press `Enter`
In the window which appears, type:
```bash
wsl --set-default-version 2
```
:heavy_check_mark: If you see "The operation completed successfully", you can close this terminal and continue to follow the instructions below :+1:
:x: If the message you get is about Virtualization, please **contact a teacher**
Enable Virtual Machine Platform Windows feature
Follow the steps described [here](https://www.configserverfirewall.com/windows-10/please-enable-the-virtual-machine-platform-windows-feature-and-ensure-virtualization-is-enabled-in-the-bios/#:~:text=To%20enable%20WSL%202,%20Open,Windows%20feature%20on%20or%20off.&text=Ensure%20that%20the%20Virtual%20Machine,Windows%20will%20enable%20WSL%202) until you enable Virtual Machine Platform and Windows Subsystem for Linux
Enable Hyper-V Windows feature
Follow the steps described [here](https://winaero.com/enable-use-hyper-v-windows-10/) until you enable the group Hyper-V
:information_source: If you are running Windows 10 **Home edition**, Hyper-V feature is not available for your operating system. It's non-blocking and you can still continue to follow the instructions below :ok_hand:
================================================
FILE: _partials/yarn.md
================================================
## yarn
[`yarn`](https://yarnpkg.com/) is a package manager to install JavaScript libraries. Let's install it:
In a terminal, run the following commands:
```bash
corepack enable
yarn set version stable
```
⚠️ If you see any error messages, try running `npm install -g corepack` and then run the commands above again.
```bash
exec zsh
```
Then run the following command:
```bash
yarn -v
```
:heavy_check_mark: If you see a version, you're good :+1:
:x: If not, **ask for a teacher**
================================================
FILE: build.rb
================================================
#!/usr/bin/env ruby -wU
PLACEHOLDERS = {
'RUBY_SETUP_VERSION' => "3.3.5",
'NVM_VERSION' => "0.39.1",
'NODE_VERSION' => "20.17.0",
'GEMS' => "colored faker http pry-byebug rake rails:8.1.1 rest-client rspec rubocop-performance sqlite3:2.8.1 activerecord:8.1.1 ruby-lsp"
}
MACOS = %w[
intro
github
macos_command_line_tools
macos_homebrew
macos_vscode
vscode_extensions
vscode_aifeatures
vscode_liveshare
macos_terminal
oh_my_zsh
gh_cli
dotfiles
macos_rbenv
ruby
nvm
yarn
macos_sqlite
macos_postgresql
checkup
kitt
macos_slack
slack_settings
macos_settings
conclusion].freeze
WINDOWS = %w[
intro
github
windows_version
windows_virtualization
windows_wsl
windows_ubuntu
windows_vscode
windows_terminal
vscode_extensions
vscode_aifeatures
vscode_liveshare
cli_tools
oh_my_zsh
windows_browser
gh_cli
dotfiles
ssh_agent
rbenv
ruby
nvm
yarn
sqlite
windows_postgresql
checkup
kitt
windows_slack
slack_settings
windows_settings
conclusion].freeze
UBUNTU = %w[
intro
github
ubuntu_vscode
vscode_extensions
vscode_aifeatures
vscode_liveshare
cli_tools
oh_my_zsh
gh_cli
dotfiles
ssh_agent
rbenv
ruby
nvm
yarn
sqlite
ubuntu_postgresql
checkup
kitt
ubuntu_slack
slack_settings
ubuntu_settings
conclusion].freeze
SETUPS = {
"macos.md" => MACOS,
"windows.md" => WINDOWS,
"ubuntu.md" => UBUNTU
}
["", "cn", "es", "fr", "pt"].each do |locale|
SETUPS.each do |filename, partials|
filename = "#{filename.split(".md").first}.#{locale}.md" unless locale.empty?
File.open(filename, "w:utf-8") do |f|
partials.each do |partial|
if !locale.empty? && File.exist?(File.join("_partials/#{locale}", "#{partial}.md"))
partial_content = File.read(File.join("_partials/#{locale}", "#{partial}.md"), encoding: "utf-8")
else
partial_content = File.read(File.join("_partials", "#{partial}.md"), encoding: "utf-8")
end
PLACEHOLDERS.each do |placeholder, value|
partial_content.gsub!("<#{placeholder}>", value)
end
partial_content.gsub!("", filename)
f << partial_content
f << "\n\n"
end
end
end
end
================================================
FILE: check.rb
================================================
require "io/console"
require "json"
REQUIRED_RUBY_VERSION = "3.3.5"
REQUIRED_GIT_VERSION = "2.0"
REQUIRED_GEMS = %w[colored faker http pry-byebug rake rails rest-client rspec rubocop-performance sqlite3]
MINIMUM_AVATAR_SIZE = 2 * 1024
REQUIRED_GEMS.each do |the_gem|
begin
require the_gem
rescue LoadError
puts "⚠️ The gem '#{the_gem}' is missing."
puts "1️⃣ Please run `gem uninstall -qxaI #{REQUIRED_GEMS.join(" ")}`"
puts "2️⃣ Then run `gem install #{REQUIRED_GEMS.join(" ")}`"
puts "3️⃣ Then retry this check!"
exit 1
end
end
require "colored"
require "http"
$all_good = true
def check(label, &block)
puts "Checking #{label}..."
result, message = yield
$all_good = $all_good && result
puts result ? "[OK] #{message}".green : "[KO] #{message}".red
rescue HTTP::Request::UnsupportedSchemeError
puts "Test not available for now..."
end
def check_all
check("shell") do
if ENV["SHELL"].match(/zsh/)
[ true, "Your default shell is zsh"]
else
[ false, "Your default shell is #{ENV["SHELL"]}, but should be zsh"]
end
end
check("ruby version") do
if RUBY_VERSION == REQUIRED_RUBY_VERSION
[ true, "Your default ruby version is #{RUBY_VERSION}" ]
else
details = `type -a ruby`
[ false, "Your default ruby version is #{RUBY_VERSION}, but should be #{REQUIRED_RUBY_VERSION}. Did you run `rbenv global #{REQUIRED_RUBY_VERSION}`?\n#{details}---" ]
end
end
check("git version") do
version_tokens = `git --version`.gsub("git version", "").strip.split(".").map(&:to_i)
required_version_tokens = REQUIRED_GIT_VERSION.split(".").map(&:to_i)
if version_tokens.first == required_version_tokens.first && version_tokens[1] >= required_version_tokens[1]
[ true, "Your default git version is #{version_tokens.join(".")}"]
else
[ false, "Your default git version is outdated: #{version_tokens.join(".")}"]
end
end
check("git/Github email matching") do
git_email = (`git config --global user.email`).chomp
puts "Please go to https://github.com/settings/emails and make sure that"
puts "the following email is listed on that page:"
puts "👉 #{git_email}"
print "Is that the case? (y/n + )\n> "
response = gets.chomp
ok = response.downcase.include?("y")
[ ok, ok ? "git email is included in Github emails" : "Add #{git_email} to your GitHub account or update your git global settings" ]
end
check("GitHub profile picture") do
groups = `ssh -T git@github.com 2>&1`.match(/Hi (?.*)! You've successfully authenticated/)
nickname = groups["nickname"]
puts "Your username on GitHub is #{nickname}, checking your profile picture now..."
avatar_url = JSON.parse(HTTP.get("https://api.github.com/users/#{nickname}"))['avatar_url']
content_length = HTTP.get(avatar_url).headers["Content-Length"].to_i
if content_length >= MINIMUM_AVATAR_SIZE
[ true, "Thanks for uploading a GitHub profile picture 📸"]
else
[ false, "You don't have any profile picture set.\nIt's important, go to github.com/settings/profile and upload a picture *right now*."]
end
end
check("git editor setup") do
editor = `git config --global core.editor`
if editor.match(/code/i)
[ true, "VS Code is your default git editor"]
else
[ false, "Ask a teacher to check your ~/.gitconfig editor setup. Right now, it's `#{editor.chomp}`"]
end
end
check("ruby gems") do
if (`which rspec`) != "" && (`which rubocop`) != ""
[ true, "Everything's fine"]
else
[ false, "Rspec and Rubocop gems aren't there. Did you run the `gem install ...` command?"]
end
end
end
def outro
if $all_good
puts ""
puts "🚀 Awesome! Your computer is now ready!".green
else
puts ""
puts "😥 Bummer! Something's wrong, if you're stuck, ask a teacher.".red
end
end
check_all
outro
================================================
FILE: docs/macos_cheatsheet.md
================================================
Hello and welcome to this macOS cheatsheet.
The goal is to gather here all known issues and tips with the macOS setup.
# Issues
## Brew HEAD not linked to origin/master ?
If you get one of the following error while installing a binary
```bash
~ % brew install git
fatal: Could not resolve HEAD to a revision
No available formula or cask for the name "git"
```
This should help
```bash
git -C $(brew --repository homebrew/core) checkout master
```
## Error: Permission denied @ apply2files - /usr/local/lib/docker/cli-plugins
If you get a Homebrew error `Permission denied @ apply2files` with "docker" in the path that follows,
run
```
mkdir -p /Applications/Docker.app/Contents/Resources/cli-plugins
```
and then rerun `brew cleanup`.
See  for more info
================================================
FILE: docs/pull_request_template.md
================================================
# How to contribute to the Setup repository
## Before opening a Pull Request
We know that encountering issues can be frustrating but before opening a PR to modify the setup that can theoretically be used by a few thousand people:
- Are you the only one experiencing this issue?
- Is it a temporary issue?
- Is it a quick fix and shouldn't be used in the long term?
We currently have a cheatsheet for each OS for tips and / issues that don't belong to the setup itself, so feel free to have a look there first. Maybe your contributing should live there:
- [macOS](https://github.com/lewagon/setup/blob/master/docs/macos_cheatsheet.md)
- [Windows](https://github.com/lewagon/setup/blob/master/docs/windows_cheatsheet.md)
- [Ubuntu](https://github.com/lewagon/setup/blob/master/docs/ubuntu_cheatsheet.md)
## Opening a Pull Request
We have a specific architecture for the setup so we can reuse part of the content for different platforms (macOS/Windows/Ubuntu).
There are 2 main folders **_partials** and **images**:
- *images* is where the images live
- **partials_ is where the content live. For example, setting up Github is not platform dependent. So we have a `_partials/github.md` file with the guidelines to setup Github. This allows us to reuse the content described there.**
**Naming convention**
Partials prefixed with the OS are specific to only one OS. Partials shared among two or more OSes have no prefix.
**Build**
[`build.rb`](https://github.com/lewagon/setup/blob/master/build.rb) is the code that generates the 3 files `macos.md`, `ubuntu.md` & `windows.md` and the corresponding chinese translated versions. For each platform, there is a list of partials to use.
To update any content, it is required to update the matching partial. The CI will then run `ruby build.rb` and commit the changes to the main md files on the branch.
If you modify directly the destination file (`macos.md`, `ubuntu.md` & `windows.md`) without modifying the partials, your changes will be overridden the next time someone (or the CI) runs `ruby build.rb`
This is the flow you need to follow:
- Identify the partial(s) in which you want to make modifications
- Make changes
- Open PR
- Check files after the CI build
- Ask for a review
Many thanks for contributing 🙌 🚀
================================================
FILE: docs/ubuntu_cheatsheet.md
================================================
Hello and welcome to this Ubuntu cheatsheet.
The goal is to gather here all known issues and tips with the Ubuntu setup.
# Issues
## No Devices choice at reboot
Make sure Windows FastBoot is disabled and restart in **Advanced Mode**.
## No OS choice at reboot
Disable Windows FastBoot **&** Bios FastBoot (see below).
**OR**
Access the Bios and change Boot option **ONE by ONE** <=> choose an option, save, reboot, if your problem persists, come back to default Boot option, choose another option and move on.
## Disable Bios FastBoot
1. Restart your machine in default mode and keep pushing on F2 or F11 or Suppr. to access the Bios.
2. Look for the boot options to disable the Bios FastBoot
## GitHub CLI installation failure
If [the GitHub CLI installation instructions fail](https://github.com/lewagon/setup/blob/master/ubuntu.md#github-cli-installation), chances are that you have the package `gitsome` installed. This package provides a `gh` binary which can conflict with `gh` GitHub CLI binary. In this case, run `sudo apt remove gitsome` before running the GitHub CLI installation instructions again.
================================================
FILE: docs/windows_cheatsheet.md
================================================
Hello and welcome to this Windows cheatsheet.
The goal is to gather here all known issues and tips with the Windows setup.
# Issues
## Network Unreachable
When trying to connect to remote hosts, eg. when trying to do `sudo apt update`, you might see an error message saying that the network is unreachable. Here are two possible solutions: if the first one doesn't help, try the second one.
### A note about diagnosing this problem
- This is a common networking issue, and we must be sure that the problem lies with WSL only, and not with the Windows host. Please first ensure that there are no known networking issues on Windows. If you can successfully browse a few sites on Windows, but you can't connect to the internet in WSL, it would appear that this is an WSL problem. Please continue to the next section.
### Refresh and reset network
- `Start` > `cmd` > 'Open as administrator'
- Run the following commands:
```bash
wsl --shutdown
netsh winsock reset
netsh int ip reset all
netsh winhttp reset proxy
ipconfig /flushdns
```
- Reset the network (`Start` > Search for `Network Reset`; click `Reset`)
- Restart Windows
- *[Source](https://github.com/microsoft/WSL/issues/4926#issuecomment-679410653)*. There might be other relevant solutions there.
- If this still does not solve your problem, try the next section.
### Add a custom DNS server address to WSL
- Open a WSL terminal and type the following:
```bash
sudo mv /etc/resolv.conf /etc/resolv.conf.old
sudo touch /etc/resolv.conf
sudo echo "[network]\ngenerateResolvConf = false\n" >> /etc/wsl.conf
```
- You should now have internet access within the WSL terminal.
- Ensure that the fix works even when WSL is restarted. Open PowerShell and run the following command:
```bash
wsl.exe --shutdown
```
- Open a new WSL terminal. You should be able to access the internet.
- *[Source](https://stackoverflow.com/a/60302925)*.
## Uncompressed and Unencrypted error
When running `wsl --set-default-version 2`, you might get a:
```
Error: 0xc03a001a The requested operation could not be completed due to a virtual disk system limitation. Virtual hard disk files must be uncompressed and unencrypted and must not be sparse.
```

To fix this issue, open the `File Explorer` and go to:
`C:\Users\\AppData\Local\Packages\CanonicalGroupLimited`
It should look something like this:

Right click on `LocalState`, then `Properties`, then `Advanced`.
Ensure `Compress contents to save disk space` and `Encrypt contents to secure data` are both deselected.
Click `OK`, then `Apply`, then `Apply changes to this folder only`.
[Credits](https://simplernerd.com/wsl2-uncompressed/).
## Input/Output error
This happens when the hidden `wslhost.exe` is not working. We just need to restart it!
Close all WSL2 tabs.
Open a PowerShell tab and run the following command:
```bash
wsl.exe --shutdown
```
Check that your Ubuntu is properly stopped with the command
```bash
wsl -l -v
```
Open a new WSL2 Tab, problem should be fixed.
## ERR_CONNECTION_REFUSED / Unable to reach localhost
If you get this error trying to connect to your `rails server`, `serve` or `jupyter notebook`, a simple restart of WSL might do the trick.
- Open a new PowerShell tab
- Run `wsl --shutdown` to shutdown WSL.
- Open a new PowerShell tab or run `wsl` to restart WSL.
- Retry to connect to `localhost:xxxx`. You can as well try `127.0.0.1:xxxx` (the local IP of the machine) instead.
If the issue is still present, you need to allow the connection in Windows Defender Public rules.
Close all WSL terminal. Open a PowerShell terminal and type the following command to stop all WSL processes:
```bash
wsl --shutdown Ubuntu
```
Hit **Start** and type `Windows Defender Firewall` and open it.
Click on **Advanced Settings**
Right click on **Inboud Rules** and select **New Rule...**. Under **Rule Type** leave `Program` selected and hit **Next**.
For the program, Select `The program path:` and paste this path: `%SystemRoot%\System32\wsl.exe`. Click on **Next**.
For the Action section, make sure `Allow the connection` is selected and hit **Next**.
For the Profile section, make sure the 3 options are selected and click on **Next**.
Finally you will be asked to chose a name for this new rule, go with `WSL - Inbound`.
Repeat the whole process by creating a **Outbound Rule** with the same settings, except for the name: `WSL - Outbound`.
## Insecure World Writable
The warning `Insecure world writable dir /mnt/c in PATH, mode 040777` is caused by the two differents way of Windows & Linux to deal with file permissions.
To silence those warnings:
```bash
sudo touch /etc/wsl.conf
echo '[automount]' | sudo tee -a /etc/wsl.conf > /dev/null
echo 'options="metadata,umask=0033"' | sudo tee -a /etc/wsl.conf > /dev/null
```
Restart all terminals.
## Update version 2004 not offered
Microsoft is slowly releasing the latest major version of Windows (version 2004). Here is the guideline if your Windows is not offering you the update.
Go to [Windows 10](https://www.microsoft.com/en-us/software-download/windows10) and under `Windows 10 May 2020 Update` click on **Update now**. This will download a tool on your machine. Open it.
A compatibility check will start:

Next, you will be offered a choice, choose **Upgrade this PC now** and click on **Next**:

Let the tool do the work:

Microsoft is encountering some errors with the version 2004, Chances are that the update assistant will tell you that you're machine is not compatible yet!
Do not close the assistant.
Open a file explorer at this **path** `C:\$WINDOWS.~BT\Sources\Panther`
Locate the file `compatscancache.dat` and **delete it**
Go back to the update assistant and click **Refresh**.
The installation should carry on.
## Sudo apt update connection timed out
This happens if you're using AVG antivirus.
Disable AVG VPN if you're using it.
Open AVG Internet **Security -> Menu - Settings - Full Protection - Enhanced firewall**. Check `Enable Internet connection sharing mode`
On the same page, click on **System Rules** and enabled the first 2 options `Windows file & printer sharing` `Remote desktop connections`
Scroll down to click on save.
## Slow network
If you experience slow network on your fresh WSL2:
- Open Ubuntu (or your other distro)
- Open Network Connections in your settings ("View network connections" in your windows search)
- You should see
```bash
vEthernet (WSL)
Enabled
Hyper-V Virtual Ethernet Adapter
```
- Right-click and open Properties
- In the Properties pane, click Configure...
- In the Configure pane, go to the "Advanced" Tab
- Click on "Large Send Offload Version 2" and update the value to "Disabled"
If you see two "Large Send Offload Version" options, disable both.
## Cloudinary: Stale request
If you see issues connecting to your Cloudinary API from your local WSL and you saw this error.
```
Stale request - reported time is 2016-12-15 04:14:53 +0000 which is more than 1 hour ago
```
The error is caused by a different system time between the WSL OS and the windows host machine. To fix it, please run this command in your windows terminal:
```
sudo hwclock -s
```
Type your WSL password and click enter.
## GitHub CLI installation failure
If [the GitHub CLI installation instructions fail](https://github.com/lewagon/setup/blob/master/ubuntu.md#github-cli-installation), chances are that you have the package `gitsome` installed. This package provides a `gh` binary which can conflict with `gh` GitHub CLI binary. In this case, run `sudo apt remove gitsome` before running the GitHub CLI installation instructions again.
# Tips
## Check Windows Subsystem for Linux
Open a PowerShell terminal.
Type the following command:
```bash
wsl -l -v
```
It will tell you the name of your WSL, it's state and version.
## Switch from version 1 to version 2
To switch a WSL from version 1 to 2, open a PowerShell terminal.
Type the following command:
⚠️ The conversion's time depends on the size of your Ubuntu filesystem, it can be long and WSL will be unsuable in the meantime. ⚠️
```bash
wsl --set-version Ubuntu 2
```
You can revert to version 1:
```bash
wsl --set-version Ubuntu 1
```
## Access root session
To access the `root` session, open a PowerShell terminal.
Type the following command:
```bash
wsl -d Ubuntu -u root
```
You can change the password of that `root` session by using the command:
```bash
passwd
```
You will prompted to enter a new password.
Now, from your normal session, you can switch from your session to the `root` on with:
```bash
su -
```
You will be asked for the password.
You can exit the `root` session with `Ctrl + D`.
## Testing on Rails
You need to have the latest version of Chrome installed on your machine to run tests on Rails, since we will use _Headless Chrome_ for System Testing. It's a browser without a user interface, well-suited for this kind of automated tests. Before running your system tests you need to make sure you have a **recent** version of Chrome on your system (not Chromium).
If you are getting a `Webdrivers::BrowserNotFound: Failed to find Chrome binary` error when running tests, it means that you are missing Chrome on your system or need to install the latest version:
```bash
# Ubuntu
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome-stable_current_amd64.deb
rm -rf google-chrome-stable_current_amd64.deb
```
Once installed, you can run your tests with:
```bash
rails test:system
```
================================================
FILE: macos.cn.md
================================================
# 电脑设置教程
以下的教程将会帮助你为接下来在[Le Wagon AI Software Development course](https://www.lewagon.com/web-development-course/full-time)全栈开发训练营中做好准备:
请**仔细阅读并按顺序执行指令**。如果你在哪一步卡住了,不用犹豫,可以举手咨询老师:raising_hand:
让我们开始吧 :rocket:
## GitHub账户
你有注册好GitHub账户嘛?如果还没有,[现在注册](https://github.com/join)。
:point_right: **[上传一张照片](https://github.com/settings/profile)** 并在你的GitHub账户中设置你的名称。这一步很重要,因为我们将使用一个带有你头像的内部dashboard。请**现在**立即做这一步,然后再去继续下面的步骤。

**[启用双因素认证(2FA)](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication#configuring-two-factor-authentication-using-text-messages)**。当您尝试登录时,GitHub将向您发送带有代码的短信。这对于安全性很重要,也很快将成为贡献GitHub上的代码的必要条件。
## 一个有关在mac上跳出应用程序的小贴士
在mac上点击应用程序窗口左上方的小红叉**并不是真正的退出了它**,他只是关闭了一个活跃窗口。如果想要 _真正_ 的退出应用程序,你需要在应用活跃的时候按`Cmd + Q`,或者在你的菜单栏里前往`APP_NAME` -> 点击`Quit`

在这个设置教程中,你将会被要求**退出并重启**应用程序很多次,请确保你可以正确的退出重启 :pray:
## 命令行工具
打开一个新的终端窗口,复制粘贴以下指令到你的终端并按下`Enter`来执行指令:
```bash
xcode-select --install
```
如果你收到了以下消息,你可以直接就跳过这一步并前往下一步。
```bash
# command line tools are already installed, use "Software Update" to install updates
```
不然的话,他将会打开一个窗口询问你是否想要下载一些软件: 点击“Install”(安装)并等待。

:heavy_check_mark: 当你看到"The software was installed"这条消息的时候,你就可以继续下一步了 :+1:
:x: 如果`xcode-select --install` 指令失败了,再重新试着运行一次:有时候Apple服务器会过载。
:x: 如果你看到"Xcode is not currently available from the Software Update server",你就需要更新你的软件系统:
```bash
sudo softwareupdate --clear-catalog
```
这个执行结束之后,你可以尝试再一次安装(复制粘贴以下指令并按下Enter)。
## Homebrew
[Homebrew](http://brew.sh/),一个包管理工具:这是一个帮助你在命令行中安装其他软件的软件。让我们一起安装它!
想要安装,你需要打开终端并执行:
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```
这将会询问你的确认(按下`Enter`)并输入你的**macOS用户账户密码**(那个当你重启你Macbook时,用来[登入](https://support.apple.com/en-gb/HT202860) 的密码)。
:warning: 当你输入你的密码的时候,屏幕上不会有任何的显示,**这是正常的**。这是一个安全保护的设置,来隐藏你整个密码,包括它的长度。你可以放心的输入你的密码,结束后按下`Enter`就可以了。
:warning: 如果你看到了下面的警告:point_down:,运行`Next steps`下面的两个命令把Homebrew加到你的PATH里。

```bash
# ⚠️ Only execute these commands if you saw this warning ☝
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
```
如果你已经有了Homebrew,终端会告诉你的。那么一切正常,你可以继续接下来的步骤。
接下来,让我们安装一些有用的软件:
```bash
brew update
```
如果你得到了`/usr/local must be writable`的报错,直接运行以下指令:
```bash
sudo chown -R $USER:admin /usr/local
brew update
```
无论是否有这行报错,继续执行下方的指令(你可以一次性直接复制/粘贴下方所有行)
```bash
brew upgrade git || brew install git
brew upgrade gh || brew install gh
brew upgrade wget || brew install wget
brew upgrade imagemagick || brew install imagemagick
brew upgrade jq || brew install jq
brew upgrade openssl || brew install openssl
```
## Visual Studio Code (VS Code)
### 安装
让我们一起安装[Visual Studio Code](https://code.visualstudio.com)代码编辑器。
复制(`CMD` + `C`)下面的指令,并粘贴(`CMD` + `V`)到终端Terminal里:
```bash
brew install --cask visual-studio-code
```
然后在终端使用下方指令启动VS Code:
```bash
code
```
:heavy_check_mark: 如果一个VS Code窗口被打开,那么你就准备好继续下一步了:+1:
:x: 如果没有成功打开的话,**请联系你的老师**
## VS Code 插件
### 安装
现在我们来给 VS Code 安装一些有用的插件吧。
复制粘贴下面的命令到终端:
```bash
code --install-extension ms-vscode.sublime-keybindings
code --install-extension emmanuelbeziat.vscode-great-icons
code --install-extension MS-vsliveshare.vsliveshare
code --install-extension shopify.ruby-lsp
code --install-extension dbaeumer.vscode-eslint
code --install-extension Rubymaniac.vscode-paste-and-indent
code --install-extension alexcvzz.vscode-sqlite
code --install-extension anteprimorac.html-end-tag-labels
code --install-extension marcoroth.herb-lsp
code --install-extension rayhanw.erb-helpers
```
你安装的就是下面这些插件:
- [Sublime Text Keymap and Settings Importer](https://marketplace.visualstudio.com/items?itemName=ms-vscode.sublime-keybindings)
- [VSCode Great Icons](https://marketplace.visualstudio.com/items?itemName=emmanuelbeziat.vscode-great-icons)
- [Live Share](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare)
- [Ruby](https://marketplace.visualstudio.com/items?itemName=shopify.ruby-lsp)
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [Paste and Indent](https://marketplace.visualstudio.com/items?itemName=Rubymaniac.vscode-paste-and-indent)
- [SQLite](https://marketplace.visualstudio.com/items?itemName=alexcvzz.vscode-sqlite)
### VS Code AI Features
VS Code includes many powerful **AI features**, which are a great tool once you already know how to code.
That said, relying on AI too early can hide important concepts and make debugging harder to understand. Once you’re comfortable with the fundamentals, you’ll know when and how to use AI effectively — without letting it do the thinking for you.
For the start of the bootcamp, we’ll disable these features. At the right point in the course, we’ll reenable them so you can put them to good use.
In **VS Code**:
1. Let's open the VS Code "Command **P**alette": type `Ctrl-Shift-P` (Windows / Linux) or `Cmd-Shift-P` (macOS).
1. This will open the Command Palette: a small text box at the top of your screen. Start typing `aifeatures` until you see "Chat: Learn How to Hide AI features". Click on it.

1. This will open the settings, and will show you the option "Disable and hide built-in AI features ...". Tick the checkbox in front of that option.

Later, if you want **to reenable** the AI features, you can follow the same instructions to untick the checkbox.
## macOS Terminal Theme
在Mac上,打开`Terminal > Preferences`并在`Profiles`中将“Pro”主题设置为默认。

**退出**并重启终端。它现在会有一个好看的黑色背景,对眼睛会更友好。
## Oh-my-zsh
让我们一起安装`zsh`插件[Oh My Zsh](https://ohmyz.sh/).
在终端terminal里执行以下指令:
```bash
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```
如果终端里出现询问"Do you want to change your default shell to zsh?", 可以输入`Y`
在你的终端的最后,你会看到以下内容:

:heavy_check_mark: 如果你的终端成功显示了上面,你就可以继续下一步了:+1:
:x: 如果安装失败的话,请询问**你的老师**
## GitHub CLI
CLI是[Command-line Interface(命令行界面)](https://baike.baidu.com/item/%E5%91%BD%E4%BB%A4%E8%A1%8C%E7%95%8C%E9%9D%A2/9910197?fr=aladdin)的首字母缩写。
在这一章节里面,我们会安装[GitHub CLI](https://cli.github.com/)。这样我们就可以直接在终端和Github互动。
你之前执行的命令应该已经安装了GitHub CLI。
首先你需要**登陆**。复制粘贴下面的命令到终端,敲击回车:
:warning: **不要更改下面指令中的`email`**
```bash
gh auth login -s 'user:email' -w --git-protocol ssh
```
`gh`会问你几个问题:
- `Generate a new SSH key to add to your GitHub account?(生成新的SSH密钥,然后添加到Github账号上?)` 敲击回车,让gh帮你生成。
如果你以前生成过SSH密钥,那你就会看到这个问题`Upload your SSH public key to your GitHub account?(上传公共密钥到Github账户上上吗?)` 上下移动箭头`>`,让它停在你想选的SSH公钥前面,然后敲击回车。
- `Enter a passphrase for your new SSH key (Optional)(输入新的SSH密钥的密码(非必填))`. 输入一个密码,然后写下来或者记住它。这是保护你本地私钥的密码。然后敲击回车。
- `Title for your SSH key`。你可以把它留在建议的 "GitHub CLI",按`Enter`。
然后你会看到下面的文字输出:
```bash
! First copy your one-time code: 0EF9-D015
- Press Enter to open github.com in your browser...
```
复制那段验证码(code)(在上面的例子中是`0EF9-D015` ),然后敲击`Enter`。
你的浏览器就会打开一个页面让你授权GitHub CLI使用你的GitHub账号。同意,并等待一会儿。
回到终端,再次敲击`回车`,然后就应该好啦:tada:
检查一下你有没有链接好:
```bash
gh auth status
```
如果你看到`Logged in to github.com as <你的GitHub用户名> `,那就可以了。
:x: 如果没有,**问问老师**。
## Dotfiles (标准配置)
黑客很喜欢把他们的shell和工具变得很酷炫。
让我们用Le Wagon提供的一个超棒的默认配置文件来开始吧:[`lewagon/dotfiles`](http://github.com/lewagon/dotfiles).
因为你的配置是私人的,所以你需要保存在**自己**的代码库里(repository/repo)。
Fork的意思是:在你的GitHub账号上建一个新的代码库,和原始的那一个是一模一样的(可以想象成你在复制粘贴这个代码库)。这样,你在你的GitHub上就会有一个新的代码库: `$GITHUB_USERNAME/dotfiles`。我们需要fork,因为每个人都需要在那些文件里加上一些**特定**信息(比如你的名字)。
打开终端,运行下面的命令:
```bash
export GITHUB_USERNAME=`gh api user | jq -r '.login'`
echo $GITHUB_USERNAME
```
:heavy_check_mark: 你应该能看到你的GitHub用户名在终端里显示出来了。
:x: 如果没有的话,现在就**停下**,找老师帮忙。看起来之前的步骤(`gh auth`)有一些问题。
现在就可以fork代码库(repo),然后克隆到你自己的电脑上了:
```bash
mkdir -p ~/code/$GITHUB_USERNAME && cd $_
gh repo fork lewagon/dotfiles --clone
```
### Dotfiles安装器
运行`dotfiles`安装器:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles && zsh install.sh
```
用下面的命令检查一下你GitHub账号录入的电子邮箱。你需要在其中选一个(如果你有好几个的话),然后再进入下一个步骤:
```bash
gh api user/emails | jq -r '.[].email'
```
:heavy_check_mark: 如果你看到了你的注册邮箱列表,你就可以继续下一步啦:+1:
:x: 如果没有的话,请在运行上面:point_up: 这个指令之前,[重新授权GitHub](https://github.com/lewagon/setup/blob/master/macos.cn.md#github-cli)。
### git安装器
运行git安装器:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh
```
:point_up: 这会**提示**填写你的全名(`FirstName LastName`)和你的邮箱。
:warning: 注意啦,你**需要**填`gh api ...`命令列出的其中一个电子邮箱。不然,Kitt就没办法跟进你的学习进程。 你选择的电子邮件将**公开**显示在互联网上。💡 如果您不希望您的电子邮件出现在您可能会贡献的公共存储库中,请选择 `@users.noreply.github.com` 地址。
现在运行下面的命令来**重置**你的终端:
```bash
exec zsh
```
## rbenv
让我们来安装[rbenv](https://github.com/sstephenson/rbenv),一个帮助我们安装并管理`ruby`环境的软件。
首先,我们需要先清理我们之前可能安装过的Ruby:
```bash
rvm implode && sudo rm -rf ~/.rvm
# 如果出现"zsh: command not found: rvm"报错, 继续后续的步骤. 这是指你的电脑上没有安装`rvm`
# 这是我们想要的!
sudo rm -rf $HOME/.rbenv /usr/local/rbenv /opt/rbenv /usr/local/opt/rbenv
```
:warning: 这条指令会需要你输入你的密码。
:warning: 当你输入你的密码的时候,屏幕上不会有任何的显示,**这是正常的**。这是一个安全保护的设置,来隐藏你整个密码,包括它的长度。你可以放心的输入你的密码,结束后按下`Enter`就可以了。
在终端里运行:
```bash
brew uninstall --force rbenv ruby-build
```
然后运行:
```bash
exec zsh
brew install rbenv libyaml
```
## Ruby
### 安装
现在,你已经准备好了去安装最新[ruby](https://www.ruby-lang.org/en/)版本并把它设置为默认版本。
运行下方这个指令,它会**花费一些时间(5-10分钟)**
```bash
rbenv install 3.3.5
```
当Ruby安装好后,运行下面这个指令来告诉系统使用3.3.5这个版本作为默认版本。
```bash
rbenv global 3.3.5
```
然后**重置**你的终端,然后检查Ruby版本:
```bash
exec zsh
ruby -v
```
:heavy_check_mark: 如果你有看到`ruby 3.3.5`,那么你可以继续下一步+1:
:x: 如果没有的话,**询问一下老师**。
### 安装一些gems
点击这里,如果你在 :cn: 中国的话
:warning: 如果你在中国的话,你应该使用以下命令来安装gem。
```bash
# China only!
gem sources --remove https://rubygems.org/
gem sources -a https://gems.ruby-china.com/
gem sources -l
# *** CURRENT SOURCES ***
# https://gems.ruby-china.com/
# Ruby-china.com must be in the list now
```
在ruby的世界里,我们将外部的库称之为`gems`:他们是一些你可以下载并在你的电脑上运行的ruby代码。让我们一起安装一些!
首先,我们将更新`bundler`,它是用于安装 gem 的工具:
```bash
gem update bundler
```
在你的终端里,复制粘贴下面的指令:
```bash
gem install colored faker http pry-byebug rake rails:8.1.1 rest-client rspec rubocop-performance sqlite3:2.8.1 activerecord:8.1.1 ruby-lsp
```
:heavy_check_mark: 如果你看到 `xx gems installed`,那么一切正常 :+1:
:x: 如果你遇到了以下的报错:
```bash
ERROR: While executing gem ... (TypeError)
incompatible marshal file format (can't be read)
format version 4.8 required; 60.33 given
```
运行以下的指令:
```bash
rm -rf ~/.gemrc
```
然后,重新运行安装gems的指令。
:warning: **永远不要**使用`sudo gem install`来安装一个gem!即使你偶然发现了一个网络上的答案(或者终端提示)叫你这么做。
## Node.js
[Node.js](https://nodejs.org/en/)是一个JavaScript运行环境以在终端运行JavaScript代码。让我们一起用[nvm](https://github.com/nvm-sh/nvm),一个Node.js的版本管理器,来安装Node.js。
在终端里,运行以下指令:
```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | zsh
```
重启你的终端并执行下方指令:
```bash
nvm -v
```
你应该会看到你的nvm的版本。如果没有的话,问一下你的老师。
现在,让我们来安装node:
```bash
nvm install 20.17.0
```
当这个指令执行结束之后,运行:
```bash
node -v
```
如果看到`v20.17.0`,那么你安装成功了:heavy_check_mark: 然后,你就可以运行下面这个命令了:
```bash
nvm cache clear
```
:x: 如果没有看到版本的话,**问一下你的老师**。
## yarn
让我们一起来安装[`yarn`](https://classic.yarnpkg.com/en/docs/install):
```bash
corepack enable
yarn set version stable
```
```bash
exec zsh
```
⚠️ 如果你看到任何错误信息,请尝试运行 `npm install -g corepack` 然后再次运行上面的命令。
重启终端并运行:
```bash
yarn -v
```
你应该会看到你yarn的版本。如果没有的话,问一下你的老师。
## SQLite
几周后,我们就会开始学习数据库和SQL. [SQLite](https://sqlite.org/index.html)是一个数据库引擎,它可以在单文件数据库上执行SQL查询。现在来安装它吧:
在终端,执行下面的命令:
```bash
brew install sqlite
```
然后执行下面的命令:
```bash
sqlite3 -version
```
:heavy_check_mark: 如果你看到了版本号,那你就可以继续下一步了 :+1:
:x: 如果没有,**问问老师吧**!
## PostgreSQL
有的时候,SQLite功能会不够用。这个时候我们就需要使用一个更高级的工具,叫做[PostgreSQL](https://www.postgresql.org/)。这是一个开源的、强大的、生产环境可用的数据库系统。
让我们现在一起安装它。
运行下方指令:
```bash
brew install postgresql@15 libpq
brew link --force libpq
```
```bash
brew services start postgresql@15
```
当你结束了上方的指令之后,让我们一起来核查一下它是否安装成功了:
```bash
psql -d postgres
```
如果你进入到了一个像下方这个,一个新的输入框的话,那么说明你的PostgreSQL已经安装好啦!
```bash
psql (15.2)
Type "help" for help.
postgres=#
```
如果想要退出它的话,输入`\q`然后按下`Enter`。
## 最后检查
让我们来看看你是否已经成功安装好了所有软件。
在终端,运行下面两行命令:
```bash
exec zsh
curl -Ls https://web-dev-challenge-lewagon-image.oss-cn-shanghai.aliyuncs.com/setup/check.rb > _.rb && ruby _.rb || rm _.rb
```
:heavy_check_mark: 如果出现了一个绿色的`Awesome! Your computer is now ready!`,那么你的工作台已经设置好了 :+1:
如果没有的话,问一下你的老师。
## Kitt
:warning: 如果你已经收到了一封来自Le Wagon邀请你去注册Kitt(我们的学习平台)的邮件并且你也注册完成了的话,你可以安全的跳过这一章节。如果你还没有注册完成的话,请跟随邮件里的教程,完成注册。
如果你不确定你要做什么,可以查看[这个链接](https://kitt.lewagon.com/)。如果你已经登录了的话,你可以跳过这个章节。如果你没有登录的话,你需要点击`Enter Kitt as a Student`。如果你可以成功的登录,你也可以安全的跳过这一步。不然的话,你可以询问一下老师你是否有收到过相关的邮件,或者直接跟着执行下面的教程。
前往[kitt.lewagon.com/onboarding](http://kitt.lewagon.com/onboarding),注册成为Le Wagon的一名校友。选择你的batch,用gitHub账户登录并填写你的信息。
你的老师将会验证你的确属于这个batch。你可以在完成了注册表单后去询问老师去做验证。
当你的老师验证成功后,请前往你的邮箱收件箱。你应该会有两封邮件:
- 一封来自Slack,邀请你加入Le Wagon Alumni Slack社群(在这儿你可以与你的伙伴和所有之前的学员交流)。点击**Join**并填写相应的个人信息。
- 一封来自GitHub,要求你加入`lewagon`团队。**接受它**,不然的话你将没有办法看到有关讲座和课程的文件。
## Slack
[Slack](https://slack.com/)是一个在技术领域里非常流行的一个交流平台。
### 安装
[下载Slack应用程序](https://itunes.apple.com/fr/app/slack/id803453959?mt=12)并安装它。
:warning: 如果你已经在你的浏览器里使用Slack了,请还是下载并安装功能更全面的**Slack桌面应用程序**。
### 设置
打开Slack应用程序并登入`lewagon-alumni`组织。
确保你已经**上传了你的头像照片** :point_down:

之后你可以全天开着Slack,这样你可以在上面分享有用的链接/寻求帮助/决定去那儿吃饭/...
为了确保视频电话可以正常工作,让我们一起测试摄像头和麦克风:
- 打开Slack应用程序。
- 点击右上方的个人照片。
- 从菜单中选择 `首选项(Preferences)`。
- 点击左侧栏中的 `音频和视频(Audio & video)`。
- 在 `故障排除(Troubleshooting)`下面,点击 `运行音频、视频和屏幕共享测试(Run an audio, video and screensharing test)`。该测试将在一个新窗口中打开。
- 检查你使用的扬声器、麦克风和摄像机设备是否出现在选项中,然后点击 `开始测试(Start test)`。

:heavy_check_mark: 当测试结束以后,你应该会看到你的摄像头和麦克风有绿色的"Succeed"信息。:+1:
:x: 如果测试失败的话,**请联系你的老师**.
你也可以在手机上安装Slack应用并登入`lewagon-alumni`!
## macOS设置
### 安全
你必须使用密码来保护你的电脑。如果你还没有设置过密码的话,请前往`>系统偏好设置>用户和组`并更改您的帐户密码。您还应该前往`>系统偏好设置>安全性>通用`。睡眠或屏幕保护程序启动的`5秒`后,您应该要求输入密码。
您也可以前往` > 系统偏好设置 > 任务控制`,然后单击左下角的`Hot Corners`按钮。选择右下角以启动屏幕保护程序。这样,当您离开办公桌时,可以通过将鼠标置于右下角来快速锁定屏幕。5秒钟后,您的Macbook将被锁定,并要求输入密码以恢复。
### 键盘
当你成为了一名程序员的时候,你将明白离开键盘去操作将会耗费大量的时间,所以你将会想最大化的减少花费在触控盘和鼠标的时间。以下是一些在macOS上的小技巧可以帮助你做到这些。
#### 键盘速度
前往 > 系统偏好设置 > 键盘。设置`Key Repeat`到最快的位置(最右边)并将`Delay Until Repeat`移到最短的位置(最右边)。
#### 黑客的macOS
[阅读这个脚本](https://github.com/mathiasbynens/dotfiles/blob/master/.macos)然后挑选一些你认为适合你的指令。例如,您可以在终端中输入以下内容:
```bash
# 默认情况下扩展保存面板
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
# 将截屏保存到桌面(或其他位置)
defaults write com.apple.screencapture location "${HOME}/Desktop"
# etc..
```
### 将应用程序固定在你的Dock上
你将会经常使用今天安装的大部分应用程序。所以让我们把这些应用程序固定在Dock上,这样我们就很容易打开他们啦!
我们需要启动程序,右键点击,打开菜单栏并选择“选项”(Options),然后选择“保留在Dock上”(Keep in Dock)。

你一定要固定以下应用程序:
- 你的终端
- 你的文件资源管理器
- VS Code
- 你的浏览器
- Slack
## 设置完成啦!
现在你的电脑已经完成[Le Wagon网页开发课程](https://www.lewagon.com/web-development-course/full-time)的设置啦 :muscle: :clap:
享受你的编程之旅,你会掌握它的! :rocket:
================================================
FILE: macos.es.md
================================================
# Instrucciones de la configuración
Aquí abajo encontrarás las instrucciones para la configuración que tu computadora necesita para el [curso de AI Software Development de Le Wagon](https://www.lewagon.com/web-development-course/full-time).
Por favor, **léelas cuidadosamente y ejecuta todos los comandos en el orden indicado**. Si tienes algún problema, no dudes en pedirle ayuda a tu profesor :raising_hand:
¡Comencemos! :rocket:
## Cuenta GitHub
¿Ya tienes una cuenta GitHub? Si no es el caso, [ábrela ya](https://github.com/join).
:point_right: **[Sube una foto](https://github.com/settings/profile)** y escribe tu nombre correctamente en tu cuenta GitHub. Esto es importante porque nosotros usaremos un tablero de comando interno con tu avatar. Por favor hazlo **ahora** antes de dar un paso más en esta guía.

:point_right: **[Habilita la Autenticación de Dos Factores (2FA)](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication#configuring-two-factor-authentication-using-text-messages)**. GitHub te enviará mensajes de texto con un código cuando intentes iniciar sesión. Esto es importante para la seguridad y también pronto será necesario para contribuir código en GitHub.
## Cómo cerrar aplicaciones en una Mac correctamente
Hacer clic en círculo rojo en la esquina superior izquierda de la ventana de la aplicación en Mac **no la termina el proceso**, solo cierra una ventana activa. Hay dos alternativas para cerrar la aplicación _realmente_. Puedes presionar `Cmd + Q` cuando la misma está activa. La otra opción es ir a `APP_NAME` -> `Quit` en la barra del menú.

Durante esta configuración, se te pedirá **cerrar y abrir nuevamente** aplicaciones varias veces. Por favor asegúrate de hacerlo correctamente :pray:
## Herramientas de la Línea de Comando
Abre una nueva terminal, copia y pega el comando siguiente y presiona `Enter`:
```bash
xcode-select --install
```
Si obtienes el mensaje que te mostramos a continuación, puedes ignorar este paso e ir al siguiente.
```bash
# command line tools are already installed, use "Software Update" to install updates
```
Este mensaje significa que las herramientas de la línea de comando ya están instaladas y te pide que uses "Software Update" para instalar las actualizaciones. Si no recibes este mensaje, se abrirá una ventana preguntándote si quieres instalar algún programa: haz clic en "Install" y espera.

:heavy_check_mark: Si ves el mensaje "The software was installed", lo que significa que el programa se ha instalado, entonces todo está bien :+1:
:x: Si falla el comando `xcode-select --install` , intenta nuevamente: algunas veces los servidores de Apple se sobrecargan.
:x: Si ves el mensaje "Xcode is not currently available from the Software Update server", debes actualizar el catálogo de actualización de programas:
```bash
sudo softwareupdate --clear-catalog
```
Cuando termines eso, puedes intentar hacer la instalación nuevamente.
## Homebrew
[Homebrew](http://brew.sh/) es un gestionador de paquetes: es un programa que se usa para instalar otros programas desde la línea de comando. ¡Vamos a instalarlo!
Abre la terminal y ejecuta lo siguiente:
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```
Te pedirá que confirmes (presionando `Enter`) y también te pedirá la **contraseña de tu cuenta de usuario macOS** (la que usas para [iniciar sesión](https://support.apple.com/en-gb/HT202860) cuando reinicias tu Macbook).
:warning: Cuando escribas tu contraseña no verás nada en la pantalla. **Esto es normal**. Es una herramienta de seguridad para ocultar tanto el contenido de tu contraseña como su longitud. Simplemente escribe tu contraseña y presiona `Enter` al terminar.
:warning: Si ves esta advertencia :point_down:, ejecuta los dos comandos de la sección `Next steps` para añadir Homebrew a tu PATH:

```bash
# ⚠️ Only execute these commands if you saw this warning ☝
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
```
Si ya tienes Homebrew instalado, el sistema te lo dirá y puedes continuar.
Luego instala algunos programas útiles:
```bash
brew update
```
Si obtienes un error como este: `/usr/local must be writable`, ejecuta el código que te mostramos a continuación:
```bash
sudo chown -R $USER:admin /usr/local
brew update
```
Ejecuta el siguiente código en tu terminal (puedes copiar y pegar todas las líneas de código al mismo tiempo):
```bash
brew upgrade git || brew install git
brew upgrade gh || brew install gh
brew upgrade wget || brew install wget
brew upgrade imagemagick || brew install imagemagick
brew upgrade jq || brew install jq
brew upgrade openssl || brew install openssl
```
## Visual Studio Code
### Instalación
Instala el editor de texto [Visual Studio Code](https://code.visualstudio.com).
Copia (presionando `Cmd` + `C`) el comando de aquí abajo y luego pégalo en tu terminal (con `Cmd` + `V`):
```bash
brew install --cask visual-studio-code
```
Luego abre VS Code ejecutando el siguiente comando en tu terminal:
```bash
code
```
:heavy_check_mark: Si se acaba de abrir una ventana de VS Code, todo está bien y puedes continuar :+1:
:x: De lo contrario, por favor **contacta a un profesor**.
## Extensiones de VS Code
### Instalación
Vamos a instalar algunas extensiones útiles de VS Code.
Copia y pega los siguientes comandos en tu terminal:
```bash
code --install-extension ms-vscode.sublime-keybindings
code --install-extension emmanuelbeziat.vscode-great-icons
code --install-extension github.github-vscode-theme
code --install-extension MS-vsliveshare.vsliveshare
code --install-extension shopify.ruby-lsp
code --install-extension dbaeumer.vscode-eslint
code --install-extension Rubymaniac.vscode-paste-and-indent
code --install-extension alexcvzz.vscode-sqlite
code --install-extension anteprimorac.html-end-tag-labels
code --install-extension marcoroth.herb-lsp
code --install-extension rayhanw.erb-helpers
```
Aquí está la lista de las extensiones que estás instalando:
- [Sublime Text Keymap and Settings Importer](https://marketplace.visualstudio.com/items?itemName=ms-vscode.sublime-keybindings)
- [VSCode Great Icons](https://marketplace.visualstudio.com/items?itemName=emmanuelbeziat.vscode-great-icons)
- [Live Share](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare)
- [Ruby](https://marketplace.visualstudio.com/items?itemName=shopify.ruby-lsp)
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [Paste and Indent](https://marketplace.visualstudio.com/items?itemName=Rubymaniac.vscode-paste-and-indent)
- [SQLite](https://marketplace.visualstudio.com/items?itemName=alexcvzz.vscode-sqlite)
### Funciones de IA en VS Code
VS Code incluye muchas y potentes **funciones de IA**, que son una gran herramienta una vez que ya sabes programar.
Dicho esto, depender de la IA demasiado pronto puede ocultar conceptos importantes y dificultar la comprensión de la depuración. Una vez que estés cómodo con los fundamentos, sabrás cuándo y cómo usar la IA de forma eficaz —sin dejar que haga el trabajo por ti.
Para el inicio del bootcamp, desactivaremos estas funciones. Llegado el momento apropiado en el curso, las volveremos a habilitar para que puedas utilizarlas bien.
En **VS Code**:
1. Abramos la "Paleta de comandos" de VS Code: escribe `Ctrl-Shift-P` (Windows / Linux) o `Cmd-Shift-P` (macOS).
1. Se abrirá la Paleta de comandos: una pequeña caja de texto en la parte superior de la pantalla. Empieza a escribir `aifeatures` hasta que veas "Chat: Learn How to Hide AI features". Haz clic en ella.

1. Esto abrirá la configuración y te mostrará la opción "Disable and hide built-in AI features ...". Marca la casilla delante de esa opción.

Más adelante, si quieres **volver a habilitar** las funciones de IA, puedes seguir las mismas instrucciones para desmarcar la casilla.
### Configuración de Live Share
[Visual Studio Live Share](https://visualstudio.microsoft.com/services/live-share/) es una extensión de VS Code que te permite compartir el código en tu editor de texto para debugging y pair-programming: ¡Instalémoslo!
Abre VS Code desde tu terminal escribiendo `code` y presionando `Enter`.
Haz clic en la pequeña flecha de la parte inferior de la barra de la izquierda:

- Haz clic en el botón "Share". Luego en "GitHub (Inicia sesión usando tu cuenta GitHub)".
- Va a aparecer una ventana emergente pidiéndote que inicies sesión con GitHub: Haz clic en "Allow".
- Te redireccionarán a una página GitHub en tu navegador pidiéndote que autorices Visual Studio Code: Haz clic en "Continue" y luego en "Authorize github".
- Es posible que VS Code muestre más ventanas emergentess: Ciérralas haciendo clic en "OK".
Eso es todo. ¡Ya puedes continuar!
## Tema de la Terminal en macOS
Abre una terminal. Haz clic en `Terminal > Preferences` y coloca el tema llamado "Pro" como perfil predeterminado.

En la pestaña "Ventana", configura también tu **Tamaño de la ventana** a Columnas: 200, Filas: 50
**Cierra y reinicia** tu terminal: ahora debería tener un fondo negro que no te cansa tanto la vista.
## Oh-my-zsh
Instalemos el plugin `zsh` [Oh My Zsh](https://ohmyz.sh/).
Ejecuta este comando en la terminal:
```bash
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```
Si te preguntan "Do you want to change your default shell to zsh?", presiona `Y`
Cuando termines, tu terminal debería lucir así:

:heavy_check_mark: Si es el caso, puedes continuar :+1:
:x: Si no, por favor **pídele ayuda a un profesor**.
## GitHub CLI
CLI es una abreviación de [Command-line Interface](https://en.wikipedia.org/wiki/Command-line_interface) que significa interfaz de línea de comando.
En esta sección usaremos [GitHub CLI](https://cli.github.com/) para interactuar directamente con GitHub desde la terminal.
Usaremos la GitHub CLI (`gh`) para conectarnos a GitHub utilizando *SSH*, un protocolo para iniciar la sesión utilizando claves SSH en lugar de la famosa pareja nombre de usuario y contraseña.
Ya debería haberse instalado en tu computadora con los comandos que ejecutaste anteriormente.
Lo primero que hay que hacer para **iniciar sesión** es copiar y pegar el comando siguiente en tu terminal:
:warning: **NO edites el `email`**
```bash
gh auth login -s 'user:email' -w --git-protocol ssh
```
`gh` le hará algunas preguntas:
- `Generate a new SSH key to add to your GitHub account?` Presiona `Enter` para pedirle a gh que genere las claves SSH por ti.
Si ya tienes claves SSH, verás en su lugar `Upload your SSH public key to your GitHub account?`Con las flechas, selecciona la ruta de tu archivo de clave pública y pulsa `Intro`.
- `Enter a passphrase for your new SSH key (Optional)`. Pon algo que quieras y que recuerdes. Es una contraseña para proteger tu private key que está almacenada en tu disco duro. Luego presiona `Enter`.
- `Title for your SSH key`. Puede dejarlo en la propuesta "GitHub CLI", presiona `Enter`.
Obtendrás el siguiente resultado:
```bash
! First copy your one-time code: 0EF9-D015
- Press Enter to open github.com in your browser...
```
Selecciona y copia el código (`0EF9-D015` en el ejemplo) y luego presiona `Enter`.
Tu navegador se abrirá y te pedirá que autorices GitHub CLI para usar tu cuenta GitHub. Acepta y espera un poco.
Regresa a la terminal, presiona `Enter` nuevamente y listo. Eso es todo.
Para verificar que están conectado correctamente, escribe lo siguiente:
```bash
gh auth status
```
:heavy_check_mark: Si obtienes este mensaje: `Logged in to github.com as `, significa que todo está bien :+1:
:x: De lo contrario, **contacta a un profesor**.
## Dotfiles (configuración estándar)
Los hackers aman mejorar sus shells y sus herramientas.
Comenzaremos con una configuración predeterminada proporcionada por Le Wagon: [`lewagon/dotfiles`](https://github.com/lewagon/dotfiles).
Tu configuración es personal, así que necesitas tu **propio** repositorio para almacenarla. Haz el **fork** del repositorio de Le Wagon.
Hacer un fork significa crear un nuevo repositorio en tu propia cuenta GitHub `$GITHUB_USERNAME/dotfiles` el cual es idéntico al original de Le Wagon y que podrás modificar como quieras.
Abre tu terminal y ejecuta los siguientes comandos:
```bash
export GITHUB_USERNAME=`gh api user | jq -r '.login'`
echo $GITHUB_USERNAME
```
:heavy_check_mark: Deberías ver tu usuario GitHub en la pantalla.
:x: Si no es el caso, **no des un paso más** y pide ayuda. Es posible que haya un problema con el paso anterior (`gh auth`).
Es hora de hacer el fork del repositorio y clonarlo en tu computadora:
```bash
mkdir -p ~/code/$GITHUB_USERNAME && cd $_
gh repo fork lewagon/dotfiles --clone
```
### Instalación de Dotfiles
Ejecuta el instalador de `dotfiles`:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles
zsh install.sh
```
Verifica los emails registrados en tu cuenta GitHub. Deberás seleccionar uno en el paso siguiente:
```bash
gh api user/emails | jq -r '.[].email'
```
:heavy_check_mark: Si ves una lista de tus emails registrados, puedes continuar :+1:
:x: De lo contrario, por favor haz la [autenticación en GitHub](https://github.com/lewagon/setup/blob/master/macos.es.md#github-cli) nuevamente antes de ejecutar este comando :point_up: again.
### Instalación de git
Ejecuta el instalador de `git`:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh
```
:point_up: Esto te **pedirá** tu nombre (`FirstName LastName`) y tu email. Cualquier correo que elijas se mostrará **públicamente** en internet. 💡 Selecciona la dirección `@users.noreply.github.com` si no quieres que tu correo electrónico aparezca en los repositorios públicos a los que puedas contribuir.
:warning: **Necesitas** poner uno de los emails que aparecen arriba gracias al comando anterior `gh api ...`. De lo contrario, Kitt no podrá hacerle seguimiento a tu progreso.
Ahora **resetea** tu terminal ejecutando lo siguiente:
```bash
exec zsh
```
## rbenv
Instala [`rbenv`](https://github.com/sstephenson/rbenv), un programa para instalar y gestionar entornos `ruby`.
Primero debemos limpiar cualquier instalación previa de Ruby que tengas en tu computadora:
```bash
rvm implode && sudo rm -rf ~/.rvm
# If you got "zsh: command not found: rvm", carry on. It means `rvm` is not
# on your computer, that's what we want!
sudo rm -rf $HOME/.rbenv /usr/local/rbenv /opt/rbenv /usr/local/opt/rbenv
```
:warning: Este comando te puede pedir tu contraseña.
:warning: Cuando escribas tu contraseña no verás nada en la pantalla. **Esto es normal**. Es una herramienta de seguridad para ocultar tanto el contenido de tu contraseña como su longitud. Simplemente escribe tu contraseña y presiona `Enter` al terminar.
Ejecuta lo siguiente en tu terminal:
```bash
brew uninstall --force rbenv ruby-build
exec zsh
```
Luego ejecuta esto:
```bash
brew install rbenv libyaml
```
## Ruby
### Instalación
Ahora estás listo para instalar la última versión de [ruby](https://www.ruby-lang.org/en/) y ponerla como la versión predeterminada.
Corre este comando, **tomará un tiempo (5-10 minutos)**
```bash
rbenv install 3.3.5
```
Cuando la instalación de ruby termine, corre este comando para decirle al sistema que use la versión 3.3.5 por defecto.
```bash
rbenv global 3.3.5
```
**Reinicia** tu terminal y chequea tu versión Ruby:
```bash
exec zsh
```
Luego ejecuta esto:
```bash
ruby -v
```
:heavy_check_mark: Si ves algo que comience por `ruby 3.3.5`, entonces puedes continuar +1:
:x: Si no es el caso, **pídele ayuda a un profesor**.
### Instalación de algunas gemas
Si estás en China 🇨🇳 haga clic aquí
:warning: Si estás en China, deberías actualizar la forma de instalar las gemas con los siguientes comandos.
```bash
# China only!
gem sources --remove https://rubygems.org/
gem sources -a https://gems.ruby-china.com/
gem sources -l
# *** CURRENT SOURCES ***
# https://gems.ruby-china.com/
# Ruby-china.com must be in the list now
```
**Todos, todas, en China o no**, continúen aquí para instalar gemas.
En el universo de ruby, a las librerías externas se les llama `gems`: son pedazos de código ruby que puedes descargar y ejecutar en tu computadora. ¡Instalemos algunas!
Primero, vamos a actualizar `bundler`, que es lo que nos permite instalar gemas:
```bash
gem update bundler
```
En tu terminal, copia y pega el siguiente comando:
```bash
gem install colored faker http pry-byebug rake rails:8.1.1 rest-client rspec rubocop-performance sqlite3:2.8.1 activerecord:8.1.1 ruby-lsp
```
:heavy_check_mark: Si obtienes `xx gems installed`, entonces todo está bien :+1:
:x: Si obtienes el siguiente error:
```bash
ERROR: While executing gem ... (TypeError)
incompatible marshal file format (can't be read)
format version 4.8 required; 60.33 given
```
Ejecuta el siguiente comando:
```bash
rm -rf ~/.gemrc
```
Ejecuta el comando nuevamente para instalar las gemas.
:warning: ¡**NUNCA** instales una gema con `sudo gem install`! Incluso si encuentras una solución en Stackoverflow (o la terminal) diciéndote que lo hagas.
## Node.js
[Node.js](https://nodejs.org/en/) es un JavaScript runtime para ejecutar código JavaScript en la terminal. Instálalo con [nvm](https://github.com/nvm-sh/nvm), aun gestionador de versiones para Node.js.
En una terminal, ejecuta estos comandos:
```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | zsh
exec zsh
```
Luego corre el siguiente comando:
```bash
nvm -v
```
Deberías ver una versión. Si no, pídele ayuda a tu profesor.
Ahora instala node:
```bash
nvm install 20.17.0
```
Cuando termine la instalación, corre lo siguiente:
```bash
node -v
```
Si ves `v20.17.0`, the installation succeeded :heavy_check_mark: entonces ahora puedes ejecutar lo siguiente:
```bash
nvm cache clear
```
:x: De lo contrario, **contacta a un profesor**.
## yarn
[`yarn`](https://yarnpkg.com/) es un gestor de paquetes para instalar librerías JavaScript. Instálalo:
En una terminal, ejecuta los siguientes comandos:
```bash
corepack enable
yarn set version stable
```
```bash
exec zsh
```
⚠️ Si ves algún mensaje de error, intenta ejecutar `npm install -g corepack` y luego vuelve a ejecutar los comandos anteriores.
Luego ejecuta este comando:
```bash
yarn -v
```
:heavy_check_mark: si ves una versión, entonces todo está bien :+1:
:x: Si no es el caso, **pídele ayuda a un profesor**
## SQLite
En algunas semanas hablaremos de bases de datos y de SQL. [SQLite](https://sqlite.org/index.html) es un sistema utilizado en bases de datos para ejecutar consultas SQL en bases de datos de un solo archivo. Vamos a instalarlo:
En un terminal, ejecuta los siguientes comandos:
```bash
brew install sqlite
```
A continuación, ejecuta el siguiente comando:
```bash
sqlite3 -version
```
:heavy_check_mark: Si ves una versión, puedes continuar :+1:
:x: Si no, **pídele ayuda a un profesor**
## PostgreSQL
A veces SQLite no es suficiente y necesitaremos una herramienta más avanzada llamada [PostgreSQL](https://www.postgresql.org/). Esta es un sistema para bases de datos de código abierto y listo para usar en producción.
Vamos a instalarlo ahora.
Ejecuta los siguientes comandos:
```bash
brew install postgresql@15 libpq
brew link --force libpq
```
```bash
brew services start postgresql@15
```
Cuando termines, verifica que funcione:
```bash
psql -d postgres
```
Deberías ver un nuevo mensaje como este :point_down:
```bash
psql (15.2)
Type "help" for help.
postgres=#
```
:heavy_check_mark: Si es asi, escribe `\q` y luego presiona `Enter` para cerrar el programa. Puede continuar :+1:
:x: Si no, **pídele ayuda a un profesor**
## Chequeo
Verifiquemos si has instalado todo bien.
Ejecuta el siguiente comando en tu terminal:
```bash
exec zsh
```
Luego ejecuta lo siguiente:
```bash
curl -Ls https://raw.githubusercontent.com/lewagon/setup/master/check.rb > _.rb && ruby _.rb && rm _.rb || rm _.rb
```
:heavy_check_mark: Si obtienes un mensaje verde diciendo `Awesome! Your computer is now ready!`, significa que tu computadora está lista y que todo está bien :+1:
:x: De lo contrario, **habla con tu profesor**.
## Kitt
:warning: Si recibiste una invitación por email de Le Wagon para crear una cuenta en Kitt (nuestra plataforma de aprendizaje), ignora este paso y sigue las instrucciones en el email si es que todavía no lo has hecho.
Si no sabes que hacer, haz clic en [este enlace](https://kitt.lewagon.com/). Si ya iniciaste sesión, puedes omitir esta sección. Si no, haz clic en `Enter Kitt as a Student`. Esto significa iniciar sesión como estudiante. Si no tienes problemas para iniciar sesión, puedes omitir este paso. De lo contrario pídele a un profesor que te confirme si debiste haber recibido o si debes seguir las instrucciones de aquí abajo.
Registrate como alumni de Le Wagon yendo a [kitt.lewagon.com/onboarding](http://kitt.lewagon.com/onboarding). Selecciona tu batch, inicia sesión con GitHub y completa toda la información que te piden.
Ahora tu profesor podrá validar que realmente eres parte del batch. Pídele que lo haga justo después de que hayas completado el formulario de registro.
Cuando el profesor haya aprobado tu perfil, ve a la bandeja de entrada de tu email. Deberías tener 2 nuevos emails:
- Uno de Slack, invitándote a la comunidad de los alumni de Le Wagon en slack (donde podrás chatear con tus compañeros y todos los demás alumni). Haz clic en **Join** y completa la información que te piden.
- Otro de GitHub, invitándote a `lewagon` team. **Acéptala**, de lo contrario no podrás acceder a las diapositivas de las clases.
## Slack
[Slack](https://slack.com/) es una plataforma de comunicación popular en la industria tech.
### Instalación
[Descarga la aplicación Slack](https://itunes.apple.com/fr/app/slack/id803453959?mt=12) e instálala.
:warning: Si ya estás usando Slack en tu navegador, por favor descarga e instala **la aplicación de escritorio** la cual tiene todas las funciones.
### Parámetros
Abre la aplicación e inicia sesión en `lewagon-alumni`.
Asegúrate de **subir una foto para tu perfil** :point_down:

La idea es tener Slack abierto todo el día para compartir enlaces útiles / pedir ayuda / decidir dónde almorzar / etc.
Para asegurarte de que todo lo relacionado a videollamadas funcione bien, prueba tu cámara y tu micrófono:
- Abre la aplicación Slack
- Haz clic en tu foto de perfil en la esquina superior derecha
- Selecciona "Preferencias" en el menú.
- Haz clic en "Audio y vídeo" en la columna de la izquierda.
- Debajo de "Solución de problemas", haz clic en "Ejecutar una prueba de audio, vídeo y pantalla compartida". La prueba se abrirá en una nueva ventana.
- Comprueba que tus dispositivos preferidos de altavoz, micrófono y cámara aparecen en los menús desplegables y haz clic en "Iniciar prueba"
- Haz clic en el botón verde "Start test"

:heavy_check_mark: Cuando termine el test deberías ver mensajes de "Succeed" en verde por lo menos para tu micrófono y tu cámara. :+1:
:x: Si no es el caso, **contacta a un profesor**.
¡También puedes instalar la aplicación Slack en tu smartphone e iniciar sesión en `lewagon-alumni`!
## Parámetros de macOS
### Seguridad
Es imperativo proteger tu sesión con una contraseña. Si todavía no es el caso, ve a ` > System Settings... > Users & Groups` y cambia la contraseña de tu computadora. Luego ve a ` > System Settings... > Lock Screen`. Configura el sistema para que pida la contraseña cada `5 seconds` después de regresar de la opción suspender y cuando se active el protector de pantalla.
También puedes ir a ` > System Settings... > Desktop & Dock` y hacer clic en el botón `Hot Corners...` abajo a la izquierda. Selecciona la opción donde al hacer clic en la esquina inferior derecha se active el protector de pantalla. De esa manera al dejar tu escritorio podrás bloquear tu pantalla rápidamente poniendo el cursor del ratón en la esquina inferior derecha. En 5 segundos tu Macbook se bloqueará y te pedirá la contraseña para volver a tu sesión.
### Teclado
A medida que te vayas convirtiendo en programador, entenderás que pierdes tiempo cuando quitas las manos del teclado para usar otra herramienta. Por esa razón es importante aprender a minimizar el uso del trackpad o del ratón. Aquí te mostramos algunos trucos para que lo hagas en macOS.
#### Velocidad del teclado
Ve a ` > System Settings... > Keyboard`. Coloca a `Key repeat rate` en la posición más rápida (a la derecha) y a `Delay until repeat` en la posición más corta (a la derecha).
#### macOS para hackers
[Lee este script](https://github.com/mathiasbynens/dotfiles/blob/master/.macos) y selecciona algunas cosas que creas que serán útiles para ti. Por ejemplo, puedes escribir lo siguiente en la terminal:
```bash
# Expanding the save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
# Save screenshots to the Desktop (or elsewhere)
defaults write com.apple.screencapture location "${HOME}/Desktop"
# etc..
```
### Anclaje de aplicaciones a tu dock
Usarás frecuentemente casi todas las aplicaciones que has instalado hoy. ¡Anclémoslas a tu dock para que estén a solo un clic de ti!
Para ello, inicia la aplicación. Haz clic derecho en el ícono de la barra de tareas para hacer que aparezca el menú contextual (también llamado emergente) y selecciona "Options" y después "Keep in Dock".

Ancla lo siguiente:
- Tu terminal
- Tu explorador de archivos
- VS Code
- Tu navegador de Internet
- Slack
## ¡Fin de la configuración!
Tu computadora está lista para el [curso de AI Software Development de Le Wagon](https://www.lewagon.com/web-development-course/full-time) :muscle: :clap:
Disfrútalo, sabemos que te va a ir genial :rocket:
================================================
FILE: macos.fr.md
================================================
# Instructions de configuration
Les instructions ci-dessous vont te permettre de configurer ton ordinateur pour [la formation AI Software Development du Wagon](https://www.lewagon.com/web-development-course/full-time).
**Lis-les attentivement et exécute toutes les commandes dans l’ordre suivant**. En cas de blocage, n’hésite pas à demander au prof :raising_hand:
C’est parti :rocket:
## Compte GitHub
Est-ce que tu as déjà un compte GitHub ? Si ce n’est pas le cas, [inscris-toi maintenant](https://github.com/join).
:point_right: **[Télécharge une photo](https://github.com/settings/profile)** et indique correctement ton nom sur ton compte GitHub. C’est important, car notre tableau de bord interne utilise ton avatar. Fais-le **maintenant** avant de poursuivre la configuration de ton ordinateur.

:point_right: **[Activez l'authentification à deux facteurs (2FA)](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication#configuring-two-factor-authentication-using-text-messages)**. GitHub vous enverra des messages texte avec un code lorsque vous essayez de vous connecter. C'est important pour la sécurité et cela sera bientôt obligatoire pour contribuer du code sur GitHub.
## Comment quitter des applications sur un Mac
Cliquer sur la petite croix rouge dans le coin supérieur gauche de la fenêtre d’une application sur un Mac **ne permet pas vraiment de quitter l’application**, mais seulement de fermer une fenêtre active. Pour *vraiment* quitter une application, appuie sur `Cmd + Q` lorsque l’application est active, ou clique sur `APP_NAME` -\> `Quitter` dans la barre de menu.

Pendant le processus de configuration, on te demandera de **quitter et rouvrir** des applications plusieurs fois ; assure-toi de le faire correctement :pray:
## Outils de ligne de commande
Ouvre un nouveau terminal, copie-colle la commande suivante et appuie sur `Enter` :
```bash
xcode-select --install
```
Si tu vois apparaître le message suivant, passe directement à l’étape suivante.
```bash
# command line tools are already installed, use "Software Update" to install updates
```
Sinon, une nouvelle fenêtre s’ouvrira, te demandant si tu souhaites installer certains logiciels : clique sur « Installer » et patiente.

:heavy_check_mark: Si tu vois apparaître le message « Le logiciel a été installé », alors c’est bon :+1:
:x: Si la commande `xcode-select --install` échoue, réessaie. Les serveurs Apple sont parfois saturés.
:x: Si tu vois apparaître le message « Xcode is not currently available from the Software Update server », tu dois mettre à jour le catalogue de mise à jour de logiciels :
```bash
sudo softwareupdate --clear-catalog
```
Une fois la mise à jour effectuée, réessaie d’installer le logiciel.
## Homebrew
[Homebrew](http://brew.sh/) est un gestionnaire de paquets : un logiciel servant à installer d’autres logiciels à partir de la ligne de commande. Installons-le !
Ouvre un terminal et exécute :
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```
On te demandera de confirmer (appuie sur `Enter`) et de saisir ton **mot de passe de compte utilisateur macOS** (celui que tu utilises pour [te connecter](https://support.apple.com/en-gb/HT202860) lorsque tu redémarres ton MacBook).
:warning: Lorsque tu saisiras ton mot de passe, rien ne s’affichera à l’écran ; **c’est normal**. Il s’agit d’une mesure de sécurité permettant de masquer ton mot de passe et sa longueur. Saisis simplement ton mot de passe, puis appuie sur `Enter`.
:warning: Si tu vois cet avertissement :point_down:, exécute les deux commandes de la section `Next steps` pour ajouter Homebrew à ton PATH

```bash
# ⚠️ Only execute these commands if you saw this warning ☝
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
```
Si tu as déjà Homebrew, le système te l’indiquera. Continue.
Installe ensuite quelques logiciels utiles :
```bash
brew update
```
Si tu vois apparaître une erreur `/usr/local must be writable`, exécute simplement :
```bash
sudo chown -R $USER:admin /usr/local
brew update
```
Exécute les commandes suivantes dans le terminal (tu peux copier-coller toutes les lignes en une seule fois):
```bash
brew upgrade git || brew install git
brew upgrade gh || brew install gh
brew upgrade wget || brew install wget
brew upgrade imagemagick || brew install imagemagick
brew upgrade jq || brew install jq
brew upgrade openssl || brew install openssl
```
## Visual Studio Code
### Installation
On va maintenant installer l’éditeur de texte [Visual Studio Code](https://code.visualstudio.com).
Copie (`Cmd` + `C`) la commande ci-dessous, puis colle-la dans ton terminal (`Cmd` + `V`) :
```bash
brew install --cask visual-studio-code
```
Puis lance VS Code en exécutant la commande suivante dans ton terminal :
```bash
code
```
:heavy_check_mark: Si une fenêtre VS Code s’ouvre, c’est bon. :+1:
:x: Sinon, **demande au prof**.
## Extensions VS Code
### Installation
On va maintenant installer quelques extensions utiles à VS Code.
Copie-colle les commandes suivantes dans le terminal :
```bash
code --install-extension ms-vscode.sublime-keybindings
code --install-extension emmanuelbeziat.vscode-great-icons
code --install-extension MS-vsliveshare.vsliveshare
code --install-extension shopify.ruby-lsp
code --install-extension dbaeumer.vscode-eslint
code --install-extension Rubymaniac.vscode-paste-and-indent
code --install-extension alexcvzz.vscode-sqlite
code --install-extension anteprimorac.html-end-tag-labels
code --install-extension marcoroth.herb-lsp
code --install-extension rayhanw.erb-helpers
```
Voici la liste des extensions que tu es en train d'installer :
- [Sublime Text Keymap and Settings Importer](https://marketplace.visualstudio.com/items?itemName=ms-vscode.sublime-keybindings)
- [VSCode Great Icons](https://marketplace.visualstudio.com/items?itemName=emmanuelbeziat.vscode-great-icons)
- [Live Share](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare)
- [Ruby](https://marketplace.visualstudio.com/items?itemName=shopify.ruby-lsp)
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [Paste and Indent](https://marketplace.visualstudio.com/items?itemName=Rubymaniac.vscode-paste-and-indent)
- [SQLite](https://marketplace.visualstudio.com/items?itemName=alexcvzz.vscode-sqlite)
### Fonctionnalités IA de VS Code
VS Code inclut de nombreuses **fonctionnalités d'IA** puissantes, qui sont un excellent outil une fois que vous savez déjà coder.
Cela dit, s'appuyer sur l'IA trop tôt peut masquer des concepts importants et rendre le débogage plus difficile à comprendre. Une fois à l'aise avec les fondamentaux, vous saurez quand et comment utiliser l'IA efficacement — sans lui laisser faire la réflexion à votre place.
Pour le début du bootcamp, nous allons désactiver ces fonctionnalités. Au bon moment du cours, nous les réactiverons afin que vous puissiez les utiliser à bon escient.
Dans **VS Code** :
1. Ouvrez la "Palette de commandes" de VS Code : tapez `Ctrl-Shift-P` (Windows / Linux) ou `Cmd-Shift-P` (macOS).
1. La Palette de commandes s'ouvrira : une petite zone de texte en haut de l'écran. Commencez à taper `aifeatures` jusqu'à voir "Chat: Learn How to Hide AI features". Cliquez dessus.

1. Cela ouvrira les paramètres et affichera l'option "Disable and hide built-in AI features ...". Cochez la case devant cette option.

Plus tard, si vous souhaitez **réactiver** les fonctionnalités d'IA, vous pouvez suivre les mêmes instructions pour décocher la case.
### Configuration de Live Share
[Visual Studio Live Share](https://visualstudio.microsoft.com/services/live-share/) est une extension de VS Code, qui te permet de partager du code dans ton éditeur de texte pour débugger et faire de la programmation en binôme. Configurons-le !
Lance VS Code depuis ton terminal en saisissant `code` et en appuyant sur `Enter`.
Clique sur la petite flèche en bas de la barre de gauche :point_down:

- Clique sur le bouton « Partager », puis sur « GitHub (connecte-toi avec ton compte GitHub) ».
- Une popup t’invitant à te connecter avec GitHub apparaît. Clique sur « Autoriser ».
- Tu arriveras alors sur une page GitHub dans ton navigateur, où on te demandera d’autoriser Visual Studio Code ; clique sur « Continuer », puis « Autoriser GitHub ».
- Il se peut que VS Code affiche d’autres popups ; ferme-les en cliquant sur « OK ».
C’est bon !
## Thème du terminal macOS
Lance un terminal, clique sur `Terminal > Preferences`, puis sélectionne le thème « Pro » comme profil par défaut.

**Quitte et redémarre** ton terminal ; tu devrais maintenant voir apparaître un fond noir, plus agréable à l’œil.
## Oh-my-zsh
On va maintenant installer le plug-in `zsh` [Oh My Zsh](https://ohmyz.sh/).
Exécute la commande suivante dans un terminal :
```bash
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```
Si tu vois apparaître la question « Do you want to change your default shell to zsh? ? », appuie sur `Y`
À la fin, ton terminal devrait ressembler à ceci :

:heavy_check_mark: Si c’est le cas, tu peux continuer :+1:
:x: Sinon, **demande au prof**
## GitHub CLI
CLI est l’acronyme de [Command-line Interface](https://en.wikipedia.org/wiki/Command-line_interface), interface en ligne de commande.
Dans cette section, tu vas installer [GitHub CLI](https://cli.github.com/) pour interagir avec GitHub directement depuis le terminal.
Nous allons utiliser GitHub CLI (`gh`) pour nous connecter à GitHub en utilisant *SSH*, un protocole pour s'authentifier en utilisant des clés SSH au lieu de la fameuse paire nom d'utilisateur et mot de passe.
Elle doit déjà être installée sur ton ordinateur grâce aux commandes précédentes.
Pour **te connecter**, commence par copier-coller la commande suivante dans ton terminal :
:warning: **NE modifie PAS `email`**
```bash
gh auth login -s 'user:email' -w --git-protocol ssh
```
`gh` va te poser quelques questions :
- `Generate a new SSH key to add to your GitHub account?` Appuie sur `Enter` pour demander à gh de générer les clés SSH pour toi.
Si tu as déjà des clés SSH, tu verras à la place `Upload your SSH public key to your GitHub account?` Avec les flèches, sélectionne le chemain de ta clé publique et appuie sur `Enter`.
- `Enter a passphrase for your new SSH key (Optional)`. Saisis un mot de passe dont tu te souviendras. Ce mot de passe sert à protéger ta clé privée enregistrée sur ton disque sur. Ensuite, appuie sur `Enter`.
- `Title for your SSH key`. Tu peux laisser ce qui est proposé par défaut, à savoir "GitHub CLI", appuie sur `Enter`.
Tu obtiendras le résultat suivant :
```bash
! First copy your one-time code: 0EF9-D015
- Press Enter to open github.com in your browser...
```
Sélectionne et copie le code (`0EF9-D015` dans l’exemple), puis appuie sur `Enter`.
Ton navigateur s’ouvrira et te demandera d’autoriser GitHub CLI à utiliser ton compte GitHub. Accepte et patiente un instant.
Reviens au terminal, appuie à nouveau sur `Enter` et voilà.
Pour vérifier que tu es bien connecté, saisis :
```bash
gh auth status
```
:heavy_check_mark: Si tu vois apparaître `Logged in to github.com as `, alors c’est bon :+1:
:x: Sinon, **demande au prof**.
## Dotfiles (configuration standard)
Les hackers adorent perfectionner leur shell et leurs outils.
On va commencer avec une super configuration par défaut fournie par Le Wagon : [`lewagon/dotfiles`](https://github.com/lewagon/dotfiles).
Ta configuration est personnelle ; tu as donc besoin de ton **propre** dépôt de code (repository) pour la sauvegarder. Tu vas donc faire un fork, c’est-à-dire une copie, du dépôt Le Wagon.
Faire un fork consiste à créer un nouveau dépôt dans ton compte GitHub personnel `$GITHUB_USERNAME/dotfiles`, identique au dépôt Le Wagon d’origine et que tu pourras modifier librement.
Ouvre ton terminal et exécute les commandes suivantes :
```bash
export GITHUB_USERNAME=`gh api user | jq -r '.login'`
echo $GITHUB_USERNAME
```
:heavy\_check\_mark: Tu devrais voir apparaître ton nom d’utilisateur GitHub.
:x: Si ce n’est pas le cas, **arrête-toi ici** et demande de l’aide. Il se peut que tu aies rencontré un problème à l’étape précédente (`gh auth`).
Il est temps de faire un fork du dépôt et de le cloner sur ton ordinateur :
```bash
mkdir -p ~/code/$GITHUB_USERNAME && cd $_
gh repo fork lewagon/dotfiles --clone
```
### Programme d'installation des Dotfiles
Exécute le programme d’installation `dotfiles` :
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles
zsh install.sh
```
Vérifie les adresses e-mail associées à ton compte GitHub. Tu devras en choisir une à l’étape suivante :
```bash
gh api user/emails | jq -r '.[].email'
```
:heavy_check_mark: Si tu vois la liste de tes adresses e-mail enregistrées, tu peux continuer :+1:
:x: Sinon, [reconnecte-toi à GitHub](https://github.com/lewagon/setup/blob/master/macos.fr.md#github-cli) avant d'exécuter cette commande à nouveau :point_up:.
### Programme d'installation git
Exécute le programme d’installation de `git` :
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh
```
:point_up: On te **demandera** de fournir ton nom (`FirstName LastName`) et ton adresse e-mail.
:warning: Tu **dois** saisir l’une des adresses e-mail indiquées ci-dessus avec la commande `gh api ...` précédente. Sinon, Kitt ne pourra pas suivre tes progrès. 💡 Sélectionnez l'adresse `@users.noreply.github.com` si vous ne souhaitez pas que votre adresse e-mail apparaisse dans les dépôts publics auxquels vous pourriez contribuer.
**Réinitialise** ton terminal en exécutant :
```bash
exec zsh
```
## rbenv
On va maintenant installer [`rbenv`](https://github.com/sstephenson/rbenv), un logiciel qui permet d’installer et de gérer des environnements `ruby`.
Pour commencer, tu dois nettoyer toute installation antérieure éventuelle de Ruby :
```bash
rvm implode && sudo rm -rf ~/.rvm
# Si tu vois apparaître « zsh: command not found: rvm », continue. Cela signifie que `rvm` n’est pas installé
# sur ton ordinateur, et c’est qu’on veut !
sudo rm -rf $HOME/.rbenv /usr/local/rbenv /opt/rbenv /usr/local/opt/rbenv
```
:warning: Cette commande est susceptible de te demander ton mot de passe.
:warning: Lorsque tu saisiras ton mot de passe, rien ne s’affichera à l’écran ; **c’est normal**. Il s’agit d’une mesure de sécurité permettant de masquer ton mot de passe et sa longueur. Saisis simplement ton mot de passe, puis appuie sur `Enter`.
Dans le terminal, exécute :
```bash
brew uninstall --force rbenv ruby-build
exec zsh
```
Puis exécute ensuite :
```bash
brew install rbenv libyaml
```
## Ruby
### Installation
Tu peux maintenant installer la dernière version de [ruby](https://www.ruby-lang.org/en/) et en faire la version par défaut.
Exécute cette commande ; cela **peut prendre un moment (5-10 minutes)**
```bash
rbenv install 3.3.5
```
Une fois que l’installation de Ruby est terminée, exécute cette commande pour indiquer au système
d’utiliser la version 3.3.5 par défaut.
```bash
rbenv global 3.3.5
```
**Réinitialise** ton ton terminal et vérifie ta version de Ruby :
```bash
exec zsh
```
Puis exécute :
```bash
ruby -v
```
:heavy_check_mark: Si tu vois apparaître un message commençant par `ruby 3.3.5`, tu peux continuer :+1:
:x: Sinon, **demande au prof**
### Installer des gems
Si tu es en Chine 🇨🇳 clique ici
:warning: Si tu es en Chine, mets à jour la procédure d’installation des gems avec les commandes suivantes.
```bash
# En Chine seulement !
gem sources --remove https://rubygems.org/
gem sources -a https://gems.ruby-china.com/
gem sources -l
# *** SOURCES ACTUELLES ***
# https://gems.ruby-china.com/
# Ruby-china.com doit maintenant figurer dans la liste
```
**Que tu sois en Chine ou non**, continue ici pour installer les gems.
Dans l’environnement ruby, les bibliothèques externes sont appelées des `gems` : ce sont des bouts de code ruby, que tu peux télécharger et exécuter sur ton ordinateur. On va en installer quelques-unes.
Tout d'abord, nous allons mettre à jour `bundler`, ce qui nous permet d'installer des gemmes :
```bash
gem update bundler
```
Copie-colle la commande suivante dans ton terminal :
```bash
gem install colored faker http pry-byebug rake rails:8.1.1 rest-client rspec rubocop-performance sqlite3:2.8.1 activerecord:8.1.1 ruby-lsp
```
:heavy_check_mark: Si tu vois apparaître `xx gems installed`, c’est bon :+1:
:x: Si tu obtiens l’erreur suivante :
```bash
ERROR: While executing gem ... (TypeError)
incompatible marshal file format (can't be read)
format version 4.8 required; 60.33 given
```
Exécute la commande suivante :
```bash
rm -rf ~/.gemrc
```
Exécute à nouveau la commande pour installer les gems.
:warning: N’installe **JAMAIS** une gem avec `sudo gem install` ! Et ce même si tu tombes sur une réponse de Stack Overflow (ou du terminal) t’invitant à le faire.
## Node.js
[Node.js](https://nodejs.org/en/) est un programme d’exécution JavaScript qui permet d’exécuter du code JavaScript dans le terminal. On va l’installer avec [nvm](https://github.com/nvm-sh/nvm), un gestionnaire de versions pour Node.js.
Exécute les commandes suivantes dans ton terminal :
```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | zsh
exec zsh
```
Puis exécute la commande suivante :
```bash
nvm -v
```
Tu devrais voir apparaître une version. Sinon, demande au prof.
On va maintenant installer node :
```bash
nvm install 20.17.0
```
Une fois l’installation terminée, exécute :
```bash
node -v
```
Si tu vois apparaître `v20.17.0`, l'installation a réussi :heavy_check_mark: Tu peux alors exécuter :
```bash
nvm cache clear
```
:x: Sinon, **demande au prof**
## yarn
[`yarn`](https://yarnpkg.com/) est un gestionnaire de paquets, qui permet d’installer des bibliothèques JavaScript. Installons-le :
Exécute les commandes suivantes dans le terminal :
```bash
corepack enable
yarn set version stable
```
```bash
exec zsh
```
⚠️ Si tu rencontres des messages d'erreur, essaye d'exécuter `npm install -g corepack` puis exécute à nouveau les commandes ci-dessus.
Puis exécute la commande suivante :
```bash
yarn -v
```
:heavy_check_mark: Si tu vois apparaître une version, c’est bon :+1:
:x: Sinon, **demande au prof**
## SQLite
Dans quelques semaines, on abordera les bases de données et le SQL. [SQLite](https://sqlite.org/index.html) est un système de gestion de base de données utilisé pour exécuter des requêtes SQL sur des bases de données d'un seul fichier. Installons-le :
Dans un terminal, exécute la commande suivante :
```bash
brew install sqlite
```
Puis exécute celle-ci :
```bash
sqlite3 -version
```
:heavy_check_mark: Si tu vois une version s'afficher, c'est tout bon :+1:
:x: If not, **demande au prof**
## PostgreSQL
Parfois, SQLite n'est pas suffisant et nous aurons besoin d'un outil plus avancé appelé [PostgreSQL](https://www.postgresql.org/), un système de gestion de base de données adapté à la production, puissant et open source.
Installons-le maintenant.
Exécute les commandes suivantes :
```bash
brew install postgresql@15 libpq
brew link --force libpq
```
```bash
brew services start postgresql@15
```
Une fois que c’est fait, on va vérifier que tout a bien fonctionné :
```bash
psql -d postgres
```
Tu devrais voir apparaître un nouveau message comme celui-ci :point_down:
```bash
psql (15.2)
Type "help" for help.
postgres=#
```
:heavy_check_mark: Si c'est le cas, saisis `\q` puis `Enter` pour quitter ce programme. Tu peux poursuivre :+1:
:x: Sinon, **demande au prof**
## Vérification
On va maintenant vérifier que tu as tout installé correctement.
Dans ton terminal, exécute la commande suivante :
```bash
exec zsh
```
Puis exécute :
```bash
curl -Ls https://raw.githubusercontent.com/lewagon/setup/master/check.rb > _.rb && ruby _.rb && rm _.rb || rm _.rb
```
:heavy_check_mark: Si tu vois apparaître en vert `Awesome! Your computer is now ready!`, c’est bon :+1:
:x: Sinon, **demande au prof**.
## Kitt
:warning: Si tu as reçu un e-mail du Wagon t’invitant à t’inscrire sur Kitt (notre plateforme pédagogique), tu peux passer cette étape. Suis plutôt les instructions contenues dans l’e-mail que tu as reçu, si tu ne l’as pas déjà fait.
Si tu n’es pas certain de ce que tu dois faire, suis [ce lien](https://kitt.lewagon.com/). Si tu es déjà connecté, tu peux passer cette section. Si tu n’es pas connecté, clique sur `Enter Kitt as a Student`. Si tu réussis à te connecter, tu peux passer cette étape. Sinon, demande au prof si tu aurais dû recevoir un e-mail ou si tu dois suivre les instructions ci-dessous.
Inscris-toi en tant qu’alumni du Wagon sur [kitt.lewagon.com/onboarding](http://kitt.lewagon.com/onboarding). Sélectionne ton batch, connecte-toi avec GitHub et renseigne toutes tes informations.
Le prof vérifiera ensuite avec toi que tu fais bien partie de ce batch. Tu peux lui demander de vérifier dès que tu as fini de remplir le formulaire d’inscription.
Une fois que le prof a vérifié ton profil, consulte ta messagerie. Tu devrais avoir reçu 2 e-mails :
- un de Slack, t’invitant à rejoindre la communauté Slack des anciens étudiants du Wagon (où tu pourras discuter avec tes amis et tous les anciens élèves). Clique sur **Devenir membre** et renseigne toutes les informations ;
- un de GitHub, t’invitant à rejoindre l’équipe `lewagon`. **Accepte** pour accéder aux cours.
## Slack
[Slack](https://slack.com/) est une plateforme de communication assez populaire dans le secteur de la technologie.
### Installation
[Télécharge l’application Slack](https://itunes.apple.com/fr/app/slack/id803453959?mt=12) et installe-la.
:warning: Si tu utilises déjà Slack dans ton navigateur, télécharge et installe **l'application de bureau**, qui comprend toutes les fonctionnalités.
### Paramètres
Lance l’application et connecte-toi à l’organisation `lewagon-alumni`.
Pense à **télécharger une photo de profil** :point_down:

L’idée est de laisser Slack ouvert toute la journée pour partager des liens utiles / demander de l’aide / décider où aller manger, etc.
On va vérifier que tout fonctionne correctement ; pour cela, on va tester ta caméra et ton microphone :
- Ouvre l’application Slack
- Clique sur ta photo de profil en haut à droite
- Clique sur `Preferences` depuis le menu
- Séléctionne `Audio & video` dans la colonne de gauche
- En dessous de `Troubleshooting`, clique sur `Run an audio, video and screensharing test`. Le test va s’ouvrir dans une nouvelle fenêtre
- Vérifie que ton microphone, caméra, et enceintes soient bien séléctionnés, puis clique sur `Start test`

:heavy_check_mark: Une fois le test terminé, tu devrais voir apparaître des messages de succès en vert, au moins pour ton microphone et ta caméra. :+1:
:x: Sinon, **demande au prof**.
Tu peux également installer l’application Slack sur ton téléphone et te connecter à `lewagon-alumni` !
## Paramètres de macOS
### Sécurité
Tu dois obligatoirement protéger ta session avec un mot de passe. Si ce n’est pas déjà le cas, va dans ` > Réglages Système > Utilisateurs & groupes` et modifie le mot de passe de ton compte. Va aussi dans ` > Réglages Système > Sécurité > Général` et configure la sécurité de façon à ce que ton mot de passe te soit demandé `5 secondes` après la mise en veille ou le démarrage de l’économiseur d’écran.
Tu peux également aller dans ` > Réglages Système > Bureau et Dock` et cliquer sur le bouton `coins actifs (Hot Corners)` en bas à gauche. Choisis le coin inférieur droit pour démarrer l’économiseur d’écran. De cette façon, lorsque tu quitteras ton bureau, tu pourras rapidement verrouiller ton écran en plaçant ta souris dans le coin inférieur droit. Cinq secondes plus tard, ton Mac sera verrouillé et tu devras fournir ton mot de passe pour accéder à ta session.
### Clavier
Au fur et à mesure de ta formation de programmeur, tu comprendras que quitter le clavier fait perdre beaucoup de temps ; tu vas donc chercher à limiter ton utilisation du pavé tactile ou de la souris. Voici quelques astuces macOS pour t’aider.
#### Vitesse du clavier
Va dans ` > Réglages Système > Clavier`. Définis `Vitesse de répétition des touches` sur la position la plus rapide (à droite) et `Pause avant répétition` sur la position la plus courte (à droite).
#### macOS pour les hackers
[Lis ce script](https://github.com/mathiasbynens/dotfiles/blob/master/.macos) et sélectionne ce qui t’intéresse. Par exemple, tu peux saisir ce qui suit dans le terminal :
```bash
# Agrandir la fenêtre de sauvegarde par défaut
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
# Enregistrer les captures d’écran sur le bureau (ou ailleurs)
defaults write com.apple.screencapture location "${HOME}/Desktop"
# etc..
```
### Épingler des applications à ton Dock
Tu utiliseras très souvent la plupart des applications que tu as installées aujourd’hui. Épingle-les à ton Dock pour y accéder en un seul clic !
Pour épingler une application à ton Dock, lance l’application, fais un clic droit sur l’icône dans la barre des tâches pour faire apparaître le menu contextuel et choisis « Options », puis « Garder dans le Dock ».

Tu dois épingler :
- ton terminal
- ton explorateur de fichiers
- VS Code
- ton navigateur Internet
- Slack
## La configuration est terminée !
Ton ordinateur est prêt pour [la formation AI Software Development du Wagon](https://www.lewagon.com/web-development-course/full-time) :muscle: :clap:
Profite du bootcamp, tu vas assurer :rocket:
================================================
FILE: macos.md
================================================
# Setup instructions
You will find below the instructions to set up your computer for [Le Wagon AI Software Development course](https://www.lewagon.com/web-development-course/full-time).
Please **read them carefully and execute all commands in the following order**.
If you get stuck, don't hesitate to ask a teacher for help :raising_hand:
You can also have a look at [our cheatsheets](https://github.com/lewagon/setup/tree/master/docs) for common issue fixes and tips :heavy_check_mark:
Let's start :rocket:
## GitHub account
Have you signed up to GitHub? If not, [do it right away](https://github.com/join).
:point_right: **[Upload a picture](https://github.com/settings/profile)** and put your name correctly on your GitHub account. This is important as we'll use an internal dashboard with your avatar. Please do this **now**, before you continue with this guide.

:point_right: **[Enable Two-Factor Authentication (2FA)](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication#configuring-two-factor-authentication-using-text-messages)**. GitHub will send you text messages with a code when you try to log in. This is important for security and also will soon be required in order to contribute code on GitHub.
## A note about quitting apps on a Mac
Clicking the little red cross in the top left corner of the application window on a Mac **does not really quit it**, it just closes an active window. To quit the application _for real_ either press `Cmd + Q` when the application is active, or navigate to `APP_NAME` -> `Quit` in the menu bar.

During this setup you will be asked to **quit and re-open** applications multiple times, please make sure you do it properly :pray:
## Command Line Tools
Open a new terminal, copy-paste the following command and hit `Enter`:
```bash
xcode-select --install
```
If you receive the following message, you can just skip this step and go to next step.
```bash
# command line tools are already installed, use "Software Update" to install updates
```
Otherwise, it will open a window asking you if you want to install some software: click on "Install" and wait.

:heavy_check_mark: If you see the message "The software was installed" then all good :+1:
:x: If the command `xcode-select --install` fails try again: sometimes the Apple servers are overloaded.
:x: If you see the message "Xcode is not currently available from the Software Update server", you need to update the software update catalog:
```bash
sudo softwareupdate --clear-catalog
```
Once this is done, you can try to install again.
## Homebrew
[Homebrew](http://brew.sh/) is a package manager: it's a software used to install other software from the command line. Let's install it!
Open a terminal and run:
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```
This will ask for your confirmation (hit `Enter`) and your **macOS user account password** (the one you use to [log in](https://support.apple.com/en-gb/HT202860) when you reboot your Macbook).
:warning: When you type your password, nothing will show up on the screen, **that's normal**. This is a security feature to mask not only your password as a whole but also its length. Just type your password and when you're done, press `Enter`.
:warning: If you see this warning :point_down:, run the two commands in the `Next steps` section to add Homebrew to your PATH:

```bash
# ⚠️ Only execute these commands if you saw this warning ☝
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
```
If you already have Homebrew, it will tell you so, that's fine, go on.
Then install some useful software:
```bash
brew update
```
If you get a `/usr/local must be writable` error, just run this:
```bash
sudo chown -R $USER:admin /usr/local
```
```bash
brew update
```
Proceed running the following in the terminal (you can copy / paste all the lines at once).
```bash
brew upgrade git || brew install git
```
```bash
brew upgrade gh || brew install gh
```
```bash
brew upgrade wget || brew install wget
```
```bash
brew upgrade imagemagick || brew install imagemagick
```
```bash
brew upgrade jq || brew install jq
```
```bash
brew upgrade openssl || brew install openssl
```
## Visual Studio Code
### Installation
Let's install [Visual Studio Code](https://code.visualstudio.com) text editor.
Copy (`Cmd` + `C`) the command below then paste it in your terminal (`Cmd` + `V`):
```bash
brew install --cask visual-studio-code
```
Then launch VS Code by running the following command in your terminal:
```bash
code
```
:heavy_check_mark: If a VS Code window has just opened, you're good to go :+1:
:x: Otherwise, please **contact a teacher**
## VS Code Extensions
### Installation
Let's install some useful extensions to VS Code.
Copy-paste the following commands in your terminal:
```bash
code --install-extension ms-vscode.sublime-keybindings
code --install-extension emmanuelbeziat.vscode-great-icons
code --install-extension github.github-vscode-theme
code --install-extension MS-vsliveshare.vsliveshare
code --install-extension shopify.ruby-lsp
code --install-extension dbaeumer.vscode-eslint
code --install-extension Rubymaniac.vscode-paste-and-indent
code --install-extension alexcvzz.vscode-sqlite
code --install-extension anteprimorac.html-end-tag-labels
code --install-extension rayhanw.erb-helpers
```
Here is a list of the extensions you are installing:
- [Sublime Text Keymap and Settings Importer](https://marketplace.visualstudio.com/items?itemName=ms-vscode.sublime-keybindings)
- [VSCode Great Icons](https://marketplace.visualstudio.com/items?itemName=emmanuelbeziat.vscode-great-icons)
- [Live Share](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare)
- [Ruby](https://marketplace.visualstudio.com/items?itemName=shopify.ruby-lsp)
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [Paste and Indent](https://marketplace.visualstudio.com/items?itemName=Rubymaniac.vscode-paste-and-indent)
- [SQLite](https://marketplace.visualstudio.com/items?itemName=alexcvzz.vscode-sqlite)
### VS Code AI Features
VS Code includes many powerful **AI features**, which are a great tool once you already know how to code.
That said, relying on AI too early can hide important concepts and make debugging harder to understand. Once you’re comfortable with the fundamentals, you’ll know when and how to use AI effectively — without letting it do the thinking for you.
For the start of the bootcamp, we’ll disable these features. At the right point in the course, we’ll reenable them so you can put them to good use.
In **VS Code**:
1. Let's open the VS Code "Command **P**alette": type `Ctrl-Shift-P` (Windows / Linux) or `Cmd-Shift-P` (macOS).
1. This will open the Command Palette: a small text box at the top of your screen. Start typing `aifeatures` until you see "Chat: Learn How to Hide AI features". Click on it.

1. This will open the settings, and will show you the option "Disable and hide built-in AI features ...". Tick the checkbox in front of that option.

Later, if you want **to reenable** the AI features, you can follow the same instructions to untick the checkbox.
### Live Share configuration
[Visual Studio Live Share](https://visualstudio.microsoft.com/services/live-share/) is a VS Code extension which allows you to share the code in your text editor for debugging and pair-programming: let's set it up!
Launch VS Code from your terminal by typing `code` and pressing `Enter`.
Click on the little arrow at the bottom of the left bar :point_down:

- Click on the "Share" button, then on "GitHub (Sign in using GitHub account)".
- A popup appears asking you to sign in with GitHub: click on "Allow".
- You are redirected to a GitHub page in you browser asking you to authorize Visual Studio Code: click on "Continue" then "Authorize github".
- VS Code may display additional pop-ups: close them by clicking "OK".
That's it, you're good to go!
## macOS Terminal Theme
Launch a terminal, click on `Terminal > Preferences` and set the "Pro" theme as default profile.

In Window tab, set also your **Window Size** to Columns: 200, Rows: 50
**Quit and restart** your terminal: it should now have a nice black background, easier on the eyes.
## Oh-my-zsh
Let's install the `zsh` plugin [Oh My Zsh](https://ohmyz.sh/).
In a terminal execute the following command:
```bash
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```
If asked "Do you want to change your default shell to zsh?", press `Y`
At the end your terminal should look like this:

:heavy_check_mark: If it does, you can continue :+1:
:x: Otherwise, please **ask for a teacher**
## GitHub CLI
CLI is the acronym of [Command-line Interface](https://en.wikipedia.org/wiki/Command-line_interface).
In this section, we will use [GitHub CLI](https://cli.github.com/) to interact with GitHub directly from the terminal.
It should already be installed on your computer from the previous commands.
We will use the GitHub CLI (`gh`) to connect to GitHub using *SSH*, a protocol to log in using SSH keys instead of the well known username/password pair.
First in order to **login**, copy-paste the following command in your terminal:
:warning: **DO NOT edit the `email`**
```bash
gh auth login -s 'user:email' -w --git-protocol ssh
```
`gh` will ask you few questions:
- `Generate a new SSH key to add to your GitHub account?` Press `Enter` to ask gh to generate the SSH keys for you.
If you already have SSH keys, you will see instead `Upload your SSH public key to your GitHub account?` With the arrows, select your public key file path and press `Enter`.
- `Enter a passphrase for your new SSH key (Optional)`. Type something you want and that you'll remember. It's a password to protect your private key stored on your hard drive. Then press `Enter`.
- `Title for your SSH key`. You can leave it at the proposed "GitHub CLI", press `Enter`.
You will then get the following output:
```bash
! First copy your one-time code: 0EF9-D015
- Press Enter to open github.com in your browser...
```
Select and copy the code (`0EF9-D015` in the example), then press `Enter`.
Your browser will open and ask you to authorize GitHub CLI to use your GitHub account. Accept and wait a bit.
Come back to the terminal, press `Enter` again, and that's it.
To check that you are properly connected, type:
```bash
gh auth status
```
:heavy_check_mark: If you get `Logged in to github.com as `, then all good :+1:
:x: If not, **contact a teacher**.
## Dotfiles (Standard configuration)
Hackers love to refine and polish their shell and tools.
We'll start with a great default configuration provided by Le Wagon: [`lewagon/dotfiles`](https://github.com/lewagon/dotfiles).
As your configuration is personal, you need your **own** repository storing it. So you will **fork** Le Wagon repository.
Forking means that you will create a new repo in your own GitHub account `$GITHUB_USERNAME/dotfiles`, identical to the original Le Wagon one that you will be able to modify at will.
Open your terminal and set a variable for your GitHub username:
```bash
export GITHUB_USERNAME=`gh api user | jq -r '.login'`
```
```bash
echo $GITHUB_USERNAME
```
:heavy_check_mark: You should see your GitHub username printed.
:x: If not, **stop here** and ask for help. There may be a problem with the previous step (`gh auth`).
:warning: Please note that this variable is only set for the time your terminal is open. If you close it before or during the next steps, you need to set it again with the two steps above!
Time to fork the repo and clone it on your computer:
```bash
mkdir -p ~/code/$GITHUB_USERNAME && cd $_
```
```bash
gh repo fork lewagon/dotfiles --clone
```
### Dotfiles installer
Run the `dotfiles` installer:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles
```
```bash
zsh install.sh
```
Check the emails registered with your GitHub Account. You'll need to pick one at the next step:
```bash
gh api user/emails | jq -r '.[].email'
```
:heavy_check_mark: If you see the list of your registered emails, you can proceed :+1:
:x: If not, please [reauthenticate to GitHub](https://github.com/lewagon/setup/blob/master/macos.md#github-cli) before running this command :point_up: again.
### git installer
Run the `git` installer:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh
```
:point_up: This will **prompt** you for your name (`FirstName LastName`) and your email.
:warning: You **need** to put one of the emails listed above thanks to the previous `gh api ...` command. If you don't do that, Kitt won't be able to track your progress. 💡 Select the `@users.noreply.github.com` address if you don't want your email to appear in public repositories you may contribute to.
Please now **reset** your terminal by running:
```bash
exec zsh
```
## rbenv
Let's install [`rbenv`](https://github.com/sstephenson/rbenv), a software to install and manage `ruby` environments.
First, we need to clean up any previous Ruby installation you might have:
```bash
rvm implode && sudo rm -rf ~/.rvm
# If you got "zsh: command not found: rvm", carry on. It means `rvm` is not
# on your computer, that's what we want!
sudo rm -rf $HOME/.rbenv /usr/local/rbenv /opt/rbenv /usr/local/opt/rbenv
```
:warning: This command may prompt for your password.
:warning: When you type your password, nothing will show up on the screen, **that's normal**. This is a security feature to mask not only your password as a whole but also its length. Just type your password and when you're done, press `Enter`.
In the terminal, run:
```bash
brew uninstall --force rbenv ruby-build
```
```bash
exec zsh
```
Then run:
```bash
brew install rbenv libyaml
```
## Ruby
### Installation
Now, you are ready to install the latest [ruby](https://www.ruby-lang.org/en/) version and set it as the default version.
Run this command, it will **take a while (5-10 minutes)**
```bash
rbenv install 3.3.5
```
Once the ruby installation is done, run this command to tell the system
to use the 3.3.5 version by default.
```bash
rbenv global 3.3.5
```
**Reset** your terminal and check your Ruby version:
```bash
exec zsh
```
Then run:
```bash
ruby -v
```
:heavy_check_mark: If you see something starting with `ruby 3.3.5` then you can proceed :+1:
:x: If not, **ask a teacher**
### Installing some gems
If you are in China 🇨🇳 click here
:warning: If you are in China, you should update the way we'll install gem with the following commands.
```bash
# China only!
gem sources --remove https://rubygems.org/
gem sources -a https://gems.ruby-china.com/
gem sources -l
# *** CURRENT SOURCES ***
# https://gems.ruby-china.com/
# Ruby-china.com must be in the list now
```
**Everyone, in China or not**, continue here to install gems.
In the ruby world, we call external libraries `gems`: they are pieces of ruby code that you can download and execute on your computer. Let's install some!
First, we'll update `bundler`, which is what lets us install gems:
```bash
gem update bundler
```
In your terminal, copy-paste the following command:
```bash
gem install colored faker http pry-byebug rake rails:8.1.1 rest-client rspec rubocop-performance sqlite3:2.8.1 activerecord:8.1.1 ruby-lsp
```
:heavy_check_mark: If you get `xx gems installed`, then all good :+1:
:x: If you encounter the following error:
```bash
ERROR: While executing gem ... (TypeError)
incompatible marshal file format (can't be read)
format version 4.8 required; 60.33 given
```
Run the following command:
```bash
rm -rf ~/.gemrc
```
Rerun the command to install the gems.
:warning: **NEVER** install a gem with `sudo gem install`! Even if you stumble upon a Stackoverflow answer (or the terminal) telling you to do so.
## Node.js
[Node.js](https://nodejs.org/en/) is a JavaScript runtime to execute JavaScript code in the terminal. Let's install it with [nvm](https://github.com/nvm-sh/nvm), a version manager for Node.js.
In a terminal, execute the following commands:
```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | zsh
```
```bash
exec zsh
```
Then run the following command:
```bash
nvm -v
```
You should see a version. If not, ask a teacher.
Now let's install node:
```bash
nvm install 20.17.0
```
When the installation is finished, run:
```bash
node -v
```
If you see `v20.17.0`, the installation succeeded :heavy_check_mark: You can then run:
```bash
nvm cache clear
```
:x: If not, **contact a teacher**
## yarn
[`yarn`](https://yarnpkg.com/) is a package manager to install JavaScript libraries. Let's install it:
In a terminal, run the following commands:
```bash
corepack enable
yarn set version stable
```
⚠️ If you see any error messages, try running `npm install -g corepack` and then run the commands above again.
```bash
exec zsh
```
Then run the following command:
```bash
yarn -v
```
:heavy_check_mark: If you see a version, you're good :+1:
:x: If not, **ask for a teacher**
## SQLite
In a few weeks, we'll talk about databases and SQL. [SQLite](https://sqlite.org/index.html) is a database engine used to execute SQL queries on single-file databases. Let's install it:
In a terminal, execute the following commands:
```bash
brew install sqlite
```
Then run the following command:
```bash
sqlite3 -version
```
:heavy_check_mark: If you see a version, you're good :+1:
:x: If not, **ask for a teacher**
## PostgreSQL
Sometimes, SQLite is not enough and we will need a more advanced tool called [PostgreSQL](https://www.postgresql.org/), an open-source robust and production-ready database system.
Let's install it now.
Run the following commands:
```bash
brew install postgresql@15 libpq
brew link --force libpq
```
```bash
brew services start postgresql@15
```
Once you've done that, let's check that it worked:
```bash
psql -d postgres
```
You should you see a new prompt like this one :point_down:
```bash
psql (15.2)
Type "help" for help.
postgres=#
```
:heavy_check_mark: If this is the case, type `\q` then `Enter` to quit this prompt. You're good to go :+1:
:x: If not, please **ask for a teacher**
## Check-up
Let's check if you successfully installed everything.
In you terminal, run the following command:
```bash
exec zsh
```
Then run:
```bash
curl -Ls https://raw.githubusercontent.com/lewagon/setup/master/check.rb > _.rb && ruby _.rb && rm _.rb || rm _.rb
```
:heavy_check_mark: If you get a green `Awesome! Your computer is now ready!`, then you're good :+1:
:x: If not, **contact a teacher**.
## Kitt
You should have received an email from Le Wagon inviting you to sign up on [Kitt](https://kitt.lewagon.com) (our learning platform). When submitting your onboarding form on Kitt, you should have received two additional invitations:
- One from Slack, inviting you to the Le Wagon Alumni slack community (where you'll chat with your buddies and all the previous alumni). Click on **Join** and fill the information.
- One from GitHub, inviting you to `lewagon` team. **Accept it** otherwise you won't be able to access the lecture slides.
If you haven't, please contact your teaching team.
## Slack
[Slack](https://slack.com/) is a communication platform pretty popular in the tech industry.
### Installation
[Download the Slack app](https://itunes.apple.com/us/app/slack/id803453959?mt=12) and install it.
:warning: If you are already using Slack in your browser, please download and install **the desktop app** which is fully featured.
### Settings
Launch the app and sign in to `lewagon-alumni` organization.
Make sure you **upload a profile picture** :point_down:

The idea is that you'll have Slack open all day, so that you can share useful links / ask for help / decide where to go to lunch / etc.
To ensure that everything is working fine for video calls, let's test your camera and microphone:
- Open the Slack app
- Click your profile picture in the top right.
- Select `Preferences` from the menu.
- Click `Audio & video` in the left-side column.
- Below `Troubleshooting`, click `Run an audio, video and screensharing test`. The test will open in a new window.
- Check that your preferred speaker, microphone and camera devices appear in the drop-down menus, then click `Start test`.

:heavy_check_mark: When the test is finished, you should see green "Succeed" messages at least for your microphone and camera. :+1:
:x: If not, **contact a teacher**.
You can also install Slack app on your phone and sign in `lewagon-alumni`!
## macOS settings
### Security
It is mandatory that you protect your session behind a password. If it is not already the case, go to ` > System Settings... > Users & Groups` and change your account password. You should also go to ` > System Settings... > Lock Screen`. You should require a password `5 seconds` after screen saver begins or display is turned off.
You can also go to ` > System Settings... > Desktop & Dock` and click on the `Hot Corners...` button at the bottom left. Choose for the bottom right corner to start the screen saver. That way, when you leave your desk, you can quickly lock you screen by putting your mouse in the bottom right corner. 5 seconds after, your MacBook will be locked and will ask for a password to get back on the session.
### Keyboard
As you become a programmer, you'll understand that leaving the keyboard takes a lot of time, so you'll want to minimize using the trackpad or the mouse. Here are a few tricks on macOS to help you do that.
#### Keyboard speed
Go to ` > System Settings... > Keyboard`. Set `Key repeat rate` to the fastest position (to the right) and `Delay until repeat` to the shortest position (also to the right).
#### macOS For hackers
[Read this script](https://github.com/mathiasbynens/dotfiles/blob/master/.macos) and cherry-pick some stuff you think will suit you. For instance, you can type in the terminal this one:
```bash
# Expanding the save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
# Save screenshots to the Desktop (or elsewhere)
defaults write com.apple.screencapture location "${HOME}/Desktop"
# etc..
```
### Pin apps to your dock
You are going to use most of the apps you've installed today really often. Let's pin them to your dock so that they are just one click away!
To pin an app to your dock, launch the app, right-click on the icon in the taskbar to bring up the context menu and choose "Options" then "Keep in Dock".

You must pin:
- Your terminal
- Your file explorer
- VS Code
- Your Internet browser
- Slack
## Setup completed!
Your computer is now all set for [Le Wagon AI Software Development course](https://www.lewagon.com/web-development-course/full-time) :muscle: :clap:
Enjoy the bootcamp, you will nail it :rocket:
================================================
FILE: macos.pt.md
================================================
# Instruções de configuração
Você encontrará abaixo as instruções para configurar seu computador para o [curso de AI Software Development Le Wagon](https://www.lewagon.com/web-development-course/full-time).
Por favor **leia-os com atenção e execute todos os comandos na seguinte ordem**.
Se você tiver dúvidas, não hesite em pedir ajuda a um professor :raising_hand:
Você também pode dar uma olhada em [nossas cheatsheets](https://github.com/lewagon/setup/tree/master/docs) para soluções e dicas de problemas comuns :heavy_check_mark:
Vamos começar :rocket:
## Conta GitHub
Você se inscreveu no GitHub? Caso contrário, [faça isso imediatamente](https://github.com/join).
:point_right: **[Carregue uma imagem](https://github.com/settings/profile)** e coloque seu nome corretamente em sua conta GitHub. Isso é importante porque usaremos um painel interno com seu avatar. Faça isso **agora**, antes de continuar com este guia.

:point_right: [Ative a Autenticação em Duas Etapas (2FA)](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication#configuring-two-factor-authentication-using-text-messages). O GitHub enviará mensagens de texto com um código quando você tentar fazer login. Isso é importante para a segurança e em breve será necessário para contribuir com código no GitHub.
## Uma observação sobre como encerrar aplicativos em um Mac
Clicar na pequena cruz vermelha no canto superior esquerdo da janela do aplicativo em um Mac **não o encerra**, apenas fecha uma janela ativa. Para sair do aplicativo _de verdade_ pressione `Cmd + Q` quando o aplicativo estiver ativo ou navegue até `APP_NAME` -> `Quit` na barra de menu.

Durante esta configuração, você será solicitado a **sair e reabrir** os aplicativos várias vezes. Certifique-se de fazer isso corretamente :pray:
## Ferramentas de linha de comando
Abra um novo terminal, copie e cole o seguinte comando e pressione `Enter`:
```bash
xcode-select --install
```
Se você receber a mensagem a seguir, basta pular esta etapa e ir para a próxima.
```bash
# ferramentas de linha de comando já estão instaladas, use "Atualização de Software" para instalar atualizações
```
Caso contrário, abrirá uma janela perguntando se deseja instalar algum software: clique em “Instalar” e aguarde.

:heavy_check_mark: Se você vir a mensagem "O software foi instalado", tudo bem :+1:
:x: Se o comando `xcode-select --install` falhar, tente novamente: às vezes os servidores Apple ficam sobrecarregados.
:x: Se você vir a mensagem "O Xcode não está disponível no servidor de atualização de software", será necessário atualizar o catálogo de atualização de software:
```bash
sudo softwareupdate --clear-catalog
```
Feito isso, você pode tentar instalar novamente.
## Homebrew
[Homebrew](http://brew.sh/) é um gerenciador de pacotes: é um software usado para instalar outros softwares a partir da linha de comando. Vamos instalá-lo!
Abra um terminal e execute:
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```
Isso solicitará sua confirmação (pressione `Enter`) e sua **senha da conta de usuário do macOS** (aquela que você usa para [fazer login](https://support.apple.com/en-gb/HT202860) quando você reinicia seu Macbook).
:warning: Quando você digita sua senha, nada aparecerá na tela, **isso é normal**. Este é um recurso de segurança para mascarar não apenas sua senha como um todo, mas também seu comprimento. Basta digitar sua senha e quando terminar, pressione `Enter`.
:warning: Se você vir este aviso :point_down:, execute os dois comandos na seção `Próximas etapas` para adicionar o Homebrew ao seu PATH:

```bash
# ⚠️ Execute esses comandos apenas se você viu este aviso ☝
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
```
Se você já tem o Homebrew, ele lhe dirá, tudo bem, vá em frente.
Em seguida, instale algum software útil:
```bash
brew update
```
Se você receber um erro `/usr/local deve ser gravável`, basta executar isto:
```bash
sudo chown -R $USER:admin /usr/local
```
```bash
brew update
```
Continue executando o seguinte no terminal (você pode copiar/colar todas as linhas de uma vez).
```bash
brew upgrade git || brew install git
```
```bash
brew upgrade gh || brew install gh
```
```bash
brew upgrade wget || brew install wget
```
```bash
brew upgrade imagemagick || brew install imagemagick
```
```bash
brew upgrade jq || brew install jq
```
```bash
brew upgrade openssl || brew install openssl
```
## Visual Studio Code
### Instalação
Vamos instalar o editor de texto [Visual Studio Code](https://code.visualstudio.com).
Copie (`Cmd` + `C`) o comando abaixo e cole-o em seu terminal (`Cmd` + `V`):
```bash
brew install --cask visual-studio-code
```
Em seguida, inicie o VS Code executando o seguinte comando em seu terminal:
```bash
code
```
:heavy_check_mark: Se uma janela do VS Code acabou de abrir, você está pronto :+1:
:x: Caso contrário, por favor **entre em contato com um professor**
## Extensões do VS Code
### Instalação
Vamos instalar algumas extensões úteis no VS Code.
Copie e cole os seguintes comandos em seu terminal:
```bash
code --install-extension ms-vscode.sublime-keybindings
code --install-extension emmanuelbeziat.vscode-great-icons
code --install-extension github.github-vscode-theme
code --install-extension MS-vsliveshare.vsliveshare
code --install-extension shopify.ruby-lsp
code --install-extension dbaeumer.vscode-eslint
code --install-extension Rubymaniac.vscode-paste-and-indent
code --install-extension alexcvzz.vscode-sqlite
code --install-extension anteprimorac.html-end-tag-labels
code --install-extension marcoroth.herb-lsp
code --install-extension rayhanw.erb-helpers
```
Aqui está uma lista das extensões que você está instalando:
- [Sublime Text Keymap and Settings Importer](https://marketplace.visualstudio.com/items?itemName=ms-vscode.sublime-keybindings)
- [VSCode Great Icons](https://marketplace.visualstudio.com/items?itemName=emmanuelbeziat.vscode-great-icons)
- [Live Share](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare)
- [Ruby](https://marketplace.visualstudio.com/items?itemName=shopify.ruby-lsp)
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [Paste and Indent](https://marketplace.visualstudio.com/items?itemName=Rubymaniac.vscode-paste-and-indent)
- [SQLite](https://marketplace.visualstudio.com/items?itemName=alexcvzz.vscode-sqlite)
### Recursos de IA no VS Code
O VS Code inclui muitos **recursos poderosos de IA**, que são ótimas ferramentas quando você já sabe programar.
Dito isso, confiar na IA muito cedo pode ocultar conceitos importantes e dificultar o entendimento da depuração. Quando você estiver confortável com os fundamentos, saberá quando e como usar a IA de forma eficaz — sem deixar que ela faça o raciocínio por você.
Para o início do bootcamp, vamos desativar esses recursos. No momento certo do curso, os reativaremos para que você possa usá-los bem.
Em **VS Code**:
1. Vamos abrir a "Paleta de Comandos" do VS Code: digite `Ctrl-Shift-P` (Windows / Linux) ou `Cmd-Shift-P` (macOS).
1. Isso abrirá a Paleta de Comandos: uma pequena caixa de texto no topo da tela. Comece a digitar `aifeatures` até ver "Chat: Learn How to Hide AI features". Clique nela.

1. Isso abrirá as configurações e mostrará a opção "Disable and hide built-in AI features ...". Marque a caixa de seleção à frente dessa opção.

Mais tarde, se quiser **reativar** os recursos de IA, você pode seguir as mesmas instruções para desmarcar a caixa.
### Configuração do Live Share
[Visual Studio Live Share](https://visualstudio.microsoft.com/services/live-share/) é uma extensão do VS Code que permite compartilhar o código em seu editor de texto para depuração e programação em pares: vamos configurá-lo acima!
Inicie o VS Code em seu terminal digitando `code` e pressionando `Enter`.
Clique na pequena seta na parte inferior da barra esquerda :point_down:

- Clique no botão "Compartilhar" e depois em "GitHub (faça login usando a conta GitHub)".
- Um pop-up aparece solicitando que você faça login no GitHub: clique em “Permitir”.
- Você é redirecionado para uma página do GitHub em seu navegador solicitando autorização do Visual Studio Code: clique em "Continuar" e depois em "Autorizar github".
- O VS Code pode exibir pop-ups adicionais: feche-os clicando em "OK".
É isso, você está pronto para continuar!
## Tema do Terminal macOS
Inicie um terminal, clique em `Terminal > Preferências` e defina o tema "Pro" como perfil padrão.

Na guia Janela, defina também seu **Tamanho da janela** para Colunas: 200, Linhas: 50
**Saia e reinicie** seu terminal: agora ele deve ter um belo fundo preto, mais agradável aos olhos.
## Oh-My-Zsh
Vamos instalar o plugin `zsh` [Oh My Zsh](https://ohmyz.sh/).
Em um terminal execute o seguinte comando:
```bash
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```
Se for perguntado "Deseja alterar seu shell padrão para zsh?", pressione `Y`
No final seu terminal deverá ficar assim:

:heavy_check_mark: Se isso acontecer, você pode continuar :+1:
:x: Caso contrário, por favor **entre em contato com um professor**
## CLI do GitHub
CLI é o acrônimo de [Interface de linha de comando](https://en.wikipedia.org/wiki/Command-line_interface).
Nesta seção, usaremos [GitHub CLI](https://cli.github.com/) para interagir com o GitHub diretamente do terminal.
Usaremos o GitHub CLI (`gh`) para conectar ao GitHub usando *SSH*, um protocolo para fazer login usando chaves SSH em vez do conhecido par nome de usuário/senha.
Ele já deve estar instalado no seu computador a partir dos comandos anteriores.
Primeiro, para **fazer login**, copie e cole o seguinte comando em seu terminal:
:warning: **NÃO edite o `email`**
```bash
gh auth login -s 'user:email' -w --git-protocol ssh
```
`gh` fará algumas perguntas:
- `Generate a new SSH key to add to your GitHub account?` Pressione `Enter` para pedir ao gh para gerar as chaves SSH para você.
Se você já possui chaves SSH, verá `Upload your SSH public key to your GitHub account?` Com as setas, selecione o caminho do arquivo de sua chave pública e pressione `Enter`.
- `Enter a passphrase for your new SSH key (Optional)`. Digite algo que você deseja e que você lembrará. É uma senha para proteger sua chave privada armazenada no disco rígido. Em seguida, pressione `Enter`.
- `Title for your SSH key`. Você pode deixá-lo no "GitHub CLI" proposto, pressione `Enter`.
Você obterá então a seguinte saída:
```bash
! First copy your one-time code: 0EF9-D015
- Press Enter to open github.com in your browser...
```
Selecione e copie o código (`0EF9-D015` no exemplo) e pressione `Enter`.
Seu navegador será aberto e solicitará que você autorize o GitHub CLI a usar sua conta GitHub. Aceite e espere um pouco.
Volte ao terminal, pressione `Enter` novamente e pronto.
Para verificar se você está conectado corretamente, digite:
```bash
gh auth status
```
:heavy_check_mark: Se você estiver `Logado no github.com como `, então tudo bem :+1:
:x: Caso contrário, **entre em contato com um professor**.
## Dotfiles (configuração padrão)
Os hackers adoram refinar e aprimorar sua estrutura e ferramentas.
Começaremos com uma ótima configuração padrão fornecida pelo Le Wagon: [`lewagon/dotfiles`](https://github.com/lewagon/dotfiles).
Como sua configuração é pessoal, você precisa de seu próprio repositório para armazená-la. Então você irá fazer o **fork** do repositório Le Wagon.
Bifurcar significa que você criará um novo repositório em sua própria conta GitHub `$GITHUB_USERNAME/dotfiles`, idêntico ao original do Le Wagon que você poderá modificar à vontade.
Abra seu terminal e defina uma variável para seu nome de usuário GitHub:
```bash
export GITHUB_USERNAME=`gh api user | jq -r '.login'`
```
```bash
echo $GITHUB_USERNAME
```
:heavy_check_mark: Você deverá ver seu nome de usuário do GitHub impresso.
:x: Se não, **pare aqui** e peça ajuda. Pode haver um problema com a etapa anterior (`gh auth`).
:warning: Por favor note que esta variável só é definida para o tempo em que seu terminal está aberto. Se você fechá-lo antes ou durante as próximas etapas, será necessário configurá-lo novamente com as duas etapas acima!
É hora de fazer um fork do repositório e cloná-lo em seu computador:
```bash
mkdir -p ~/code/$GITHUB_USERNAME && cd $_
```
```bash
gh repo fork lewagon/dotfiles --clone
```
### Instalador do Dotfiles
Execute o instalador `dotfiles`:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles
```
```bash
zsh install.sh
```
Verifique os e-mails registrados em sua conta GitHub. Você precisará escolher um na próxima etapa:
```bash
gh api user/emails | jq -r '.[].email'
```
:heavy_check_mark: Se você vir a lista de seus e-mails registrados, você pode prosseguir :+1:
:x: Caso contrário, [reautentique no GitHub](https://github.com/lewagon/setup/blob/master/macos.pt.md#github-cli) antes de executar este comando :point_up: novamente.
### Instalador git
Execute o instalador `git`:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh
```
:point_up: Isso **solicitará** seu nome (`Nome Sobrenome`) e seu e-mail. O email que você escolher será exibido **publicamente** na internet. 💡 Selecione o endereço `@users.noreply.github.com` se você não deseja que seu e-mail apareça em repositórios públicos aos quais você possa contribuir.
:warning: Você **precisa** colocar um dos e-mails listados acima graças ao comando anterior `gh api ...`. Se você não fizer isso, Kitt não conseguirá acompanhar seu progresso.
Agora **reinicie** seu terminal executando:
```bash
exec zsh
```
## rbenv
Vamos instalar o [`rbenv`](https://github.com/sstephenson/rbenv), um software para instalar e gerenciar ambientes `ruby`.
Primeiro, precisamos limpar qualquer instalação anterior do Ruby que você possa ter:
```bash
rvm implode && sudo rm -rf ~/.rvm
# If you got "zsh: command not found: rvm", carry on. It means `rvm` is not
# on your computer, that's what we want!
sudo rm -rf $HOME/.rbenv /usr/local/rbenv /opt/rbenv /usr/local/opt/rbenv
```
:warning: Este comando pode solicitar sua senha.
:warning: Quando você digita sua senha, nada aparecerá na tela, **isso é normal**. Este é um recurso de segurança para mascarar não apenas sua senha como um todo, mas também seu comprimento. Basta digitar sua senha e quando terminar, pressione `Enter`.
No terminal, execute:
```bash
brew uninstall --force rbenv ruby-build
```
```bash
exec zsh
```
Então rode:
```bash
brew install rbenv libyaml
```
## Ruby
### Instalação
Agora, você está pronto para instalar a versão mais recente do [ruby](https://www.ruby-lang.org/en/) e defini-la como a versão padrão.
Execute este comando, **demorará um pouco (5 a 10 minutos)**
```bash
rbenv install 3.3.5
```
Assim que a instalação do Ruby estiver concluída, execute este comando para informar ao sistema
para usar a versão 3.3.5 por padrão.
```bash
rbenv global 3.3.5
```
**Reinicialize** seu terminal e verifique sua versão do Ruby:
```bash
exec zsh
```
Então corra:
```bash
ruby -v
```
:heavy_check_mark: Se você vir algo começando com `ruby 3.3.5` então você pode prosseguir :+1:
:x: Se não, **pergunte a um professor**
### Instalando algumas gems
Se você estiver na China 🇨🇳 clique aqui
:warning: Se você estiver na China, você deve atualizar a forma como instalaremos o gem com os seguintes comandos.
```bash
# Somente China!
fontes de gemas --remove https://rubygems.org/
fontes de gemas -a https://gems.ruby-china.com/
fontes de gemas -l
#***FONTES ATUAIS***
# https://gems.ruby-china.com/
# Ruby-china.com deve estar na lista agora
```
**Todos, na China ou não**, continuem aqui para instalar gems.
No mundo Ruby, chamamos bibliotecas externas de `gems`: são pedaços de código Ruby que você pode baixar e executar em seu computador. Vamos instalar alguns!
No seu terminal, copie e cole o seguinte comando:
```bash
gem install colored faker http pry-byebug rake rails:8.1.1 rest-client rspec rubocop-performance sqlite3:2.8.1 activerecord:8.1.1 ruby-lsp
```
:heavy_check_mark: Se você tiver `xx gems installed`, então tudo bem :+1:
:x: Se você encontrar o seguinte erro:
```bash
ERROR: While executing gem ... (TypeError)
incompatible marshal file format (can't be read)
format version 4.8 required; 60.33 given
```
Execute o seguinte comando:
```bash
rm -rf ~/.gemrc
```
Execute novamente o comando para instalar as gemas.
:warning: **NUNCA** instale uma gem com `sudo gem install`! Mesmo se você encontrar uma resposta do Stackoverflow (ou o terminal) solicitando que você faça isso.
## Node.js
[Node.js](https://nodejs.org/en/) é um tempo de execução JavaScript para executar código JavaScript no terminal. Vamos instalá-lo com [nvm](https://github.com/nvm-sh/nvm), um gerenciador de versões para Node.js.
Em um terminal, execute os seguintes comandos:
```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | zsh
```
```bash
exec zsh
```
Em seguida, execute o seguinte comando:
```bash
nvm -v
```
Você deverá ver uma versão. Se não, pergunte a um professor.
Agora vamos instalar o Node.js:
```bash
nvm install 20.17.0
```
Quando a instalação terminar, execute:
```bash
node -v
```
Se você vir `v20.17.0`, a instalação foi bem-sucedida :heavy_check_mark: Você pode então executar:
```bash
nvm cache clear
```
:x: Caso contrário, **entre em contato com um professor**
## Yarn
[`yarn`](https://yarnpkg.com/) é um gerenciador de pacotes para instalar bibliotecas JavaScript. Vamos instalá-lo:
Em um terminal, execute os seguintes comandos:
```bash
corepack enable
yarn set version stable
```
```bash
exec zsh
```
⚠️ Se vires quaisquer mensagens de erro, tenta executar `npm install -g corepack` e, em seguida, volta a executar os comandos acima.
Em seguida, execute o seguinte comando:
```bash
yarn -v
```
:heavy_check_mark: Se você vir uma versão, você está bem :+1:
:x: Se não, **entre em contato com um professor**
## SQLite
Em algumas semanas falaremos sobre bancos de dados e SQL. [SQLite](https://sqlite.org/index.html) é um mecanismo de banco de dados usado para executar consultas SQL em bancos de dados de arquivo único. Vamos instalá-lo:
Em um terminal, execute os seguintes comandos:
```bash
brew install sqlite
```
Em seguida, execute o seguinte comando:
```bash
sqlite3 -version
```
:heavy_check_mark: Se você vir uma versão, você está bem :+1:
:x: Se não, **peça um professor**
## PostgreSQL
Às vezes, o SQLite não é suficiente e precisaremos de uma ferramenta mais avançada chamada [PostgreSQL](https://www.postgresql.org/), um sistema de banco de dados de código aberto, robusto e pronto para produção.
Vamos instalá-lo agora.
Execute os seguintes comandos:
```bash
brew install postgresql@15 libpq
brew link --force libpq
```
```bash
brew services start postgresql@15
```
Depois de fazer isso, vamos verificar se funcionou:
```bash
psql -d postgres
```
Você deverá ver um novo prompt como este :point_down:
```bash
psql (15.2)
Type "help" for help.
postgres=#
```
:heavy_check_mark: Se for esse o caso, digite `\q` e depois `Enter` para sair deste prompt. Você está pronto para ir :+1:
:x: Se não, por favor **entre em contato com um professor**
## Checagem
Vamos verificar se você instalou tudo com sucesso.
No seu terminal, execute o seguinte comando:
```bash
exec zsh
```
Então corra:
```bash
curl -Ls https://raw.githubusercontent.com/lewagon/setup/master/check.rb > _.rb && ruby _.rb && rm _.rb || rm _.rb
```
:heavy_check_mark: Se você receber uma mensagem verde `Awesome! Your computer is now ready!`, então você está bem :+1:
:x: Caso contrário, **entre em contato com um professor**.
## Kitt
:warning: Se você recebeu um e-mail do Le Wagon convidando você a se inscrever no Kitt (nossa plataforma de aprendizagem), você pode pular esta etapa com segurança. Em vez disso, siga as instruções no e-mail que você recebeu, caso ainda não tenha feito isso.
Se não tiver certeza sobre o que fazer, siga [este link](https://kitt.lewagon.com/). Se você já estiver logado, pode pular esta seção com segurança. Se você não estiver logado, clique em `Enter Kitt as a Student`. Se você conseguir fazer login, poderá pular esta etapa com segurança. Caso contrário, pergunte a um professor se você deveria ter recebido um e-mail ou siga as instruções abaixo.
Registre-se como Alumni da Le Wagon acessando [kitt.lewagon.com/onboarding](http://kitt.lewagon.com/onboarding). Selecione seu batch, faça login no GitHub e insira todas as suas informações.
Seu professor irá então validar que você realmente faz parte do batch. Você pode pedir que eles façam isso assim que preencher o formulário de registro.
Assim que o professor aprovar seu perfil, acesse sua caixa de entrada de e-mail. Você deve ter 2 e-mails:
- Um do Slack, convidando você para a comunidade Le Wagon Alumni do Slack (onde você conversará com seus amigos e todos os ex-alunos anteriores). Clique em **Inscreva-se** e preencha os dados.
- Um do GitHub, convidando você para a equipe `lewagon`. **Aceite** caso contrário você não conseguirá acessar os slides da aula.
## Slack
[Slack](https://slack.com/) é uma plataforma de comunicação bastante popular na indústria de tecnologia.
### Instalação
[Baixe o aplicativo Slack](https://itunes.apple.com/us/app/slack/id803453959?mt=12) e instale-o.
:warning: Se você já usa o Slack em seu navegador, baixe e instale **o aplicativo para desktop** que vem com todos os recursos.
### Configurações
Inicie o aplicativo e faça login na organização `lewagon-alumni`.
Certifique-se de **fazer upload de uma foto de perfil** :point_down:

A ideia é que você tenha o Slack aberto o dia todo, para que você possa compartilhar links úteis/pedir ajuda/decidir onde ir almoçar/etc.
Para garantir que tudo está funcionando bem nas videochamadas, vamos testar sua câmera e microfone:
- Abra o aplicativo Slack
- Clique na foto do seu perfil no canto superior direito.
- Selecione `Preferências` no menu.
- Clique em `Áudio e vídeo` na coluna do lado esquerdo.
- Abaixo de `Solução de problemas`, clique em `Executar um teste de áudio, vídeo e compartilhamento de tela`. O teste será aberto em uma nova janela.
- Verifique se seus dispositivos preferidos de alto-falante, microfone e câmera aparecem nos menus suspensos e clique em `Iniciar teste`.

:heavy_check_mark: Quando o teste terminar, você deverá ver mensagens verdes de "Sucesso" pelo menos para seu microfone e câmera. :+1:
:x: Caso contrário, **entre em contato com um professor**.
Você também pode instalar o aplicativo Slack no seu telefone e entrar em `lewagon-alumni`!
## Configurações do MacOS
### Segurança
É obrigatório que você proteja sua sessão com uma senha. Se ainda não for o caso, vá para ` > Ajustes do Sistema > Usuários e Grupos` e altere a senha da sua conta. Você também deve ir para ` > Ajustes do Sistema > Segurança > Geral`. Você deve exigir uma senha `5 segundos` após o início da suspensão ou da proteção de tela.
Você também pode ir para ` > Ajustes do Sistema > Controle daVelocidade de repetição de teclaVelocidade de repetição de Escritorio y Dock` e clicar no botão `cantos de acesso rápido (Hot Corners)` no canto inferior esquerdo. Escolha no canto inferior direito para iniciar o protetor de tela. Dessa forma, ao sair da mesa, você pode bloquear rapidamente a tela colocando o mouse no canto inferior direito. 5 segundos depois, seu MacBook estará bloqueado e solicitará uma senha para voltar à sessão.
### Teclado
Ao se tornar um programador, você entenderá que deixar o teclado leva muito tempo, então você vai querer minimizar o uso do trackpad ou do mouse. Aqui estão alguns truques no macOS para ajudá-lo a fazer isso.
#### Velocidade do teclado
Vá para ` > Preferências do Sistema > Teclado`. Defina `Velocidade de repetição de tecla` para a posição mais rápida (à direita) e `Atraso da repetição` para a posição mais curta (à direita).
#### macOS Para hackers
[Leia este script](https://github.com/mathiasbynens/dotfiles/blob/master/.macos) e escolha algumas coisas que você acha que combinam com você. Por exemplo, você pode digitar no terminal este:
```bash
# Expanding the save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
# Save screenshots to the Desktop (or elsewhere)
defaults write com.apple.screencapture location "${HOME}/Desktop"
# etc..
```
### Fixe aplicativos no seu dock
Você usará a maioria dos aplicativos que instalou hoje com muita frequência. Vamos fixá-los no seu dock para que fiquem a apenas um clique de distância!
Para fixar um aplicativo no seu dock, inicie o aplicativo, clique com o botão direito no ícone na barra de tarefas para abrir o menu de contexto e escolha "Opções" e depois "Manter no Dock".

Você deve fixar:
- Seu terminal
- Seu explorador de arquivos
- VS Code
- Seu navegador de Internet
- Slack
## Configuração concluída!
Seu computador agora está pronto para o [curso de AI Software Development Le Wagon](https://www.lewagon.com/web-development-course/full-time) :muscle: :clap:
Aproveite o bootcamp, você vai acertar :rocket:
================================================
FILE: ubuntu.cn.md
================================================
# 电脑设置教程
以下的教程将会帮助你为接下来在[Le Wagon AI Software Development course](https://www.lewagon.com/web-development-course/full-time)全栈开发训练营中做好准备:
请**仔细阅读并按顺序执行指令**。如果你在哪一步卡住了,不用犹豫,可以举手咨询老师:raising_hand:
让我们开始吧 :rocket:
## GitHub账户
你有注册好GitHub账户嘛?如果还没有,[现在注册](https://github.com/join)。
:point_right: **[上传一张照片](https://github.com/settings/profile)** 并在你的GitHub账户中设置你的名称。这一步很重要,因为我们将使用一个带有你头像的内部dashboard。请**现在**立即做这一步,然后再去继续下面的步骤。

**[启用双因素认证(2FA)](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication#configuring-two-factor-authentication-using-text-messages)**。当您尝试登录时,GitHub将向您发送带有代码的短信。这对于安全性很重要,也很快将成为贡献GitHub上的代码的必要条件。
## Visual Studio Code
### 安装
让我们一起安装[Visual Studio Code](https://code.visualstudio.com)代码编辑器。
复制(`Ctrl` + `C`)下面的指令,并粘贴(`Ctrl` + `Shift` + `v`)到终端里:
```bash
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
rm -f packages.microsoft.gpg
sudo apt update
sudo apt install -y code
```
这些命令需要你输入密码的时候,请输入!
:warning: 你输入密码的时候,屏幕上不会显示你在输入任何东西,**这是正常的**。这是一个安全措施,保证别人不会看到你的密码内容以及长度。所以输入完成后,敲击回车键(`Enter`)即可。
### 用终端打开VS Code(Visual Studio Code)
现在我们来**从终端**打开VS Code吧:
```bash
code
```
:heavy_check_mark: 如果VS Code窗口打开了,就没什么问题,进入下一步吧 :+1:
:x: 如果没有的话,**请向老师求助**。
## VS Code 插件
### 安装
现在我们来给 VS Code 安装一些有用的插件吧。
复制粘贴下面的命令到终端:
```bash
code --install-extension ms-vscode.sublime-keybindings
code --install-extension emmanuelbeziat.vscode-great-icons
code --install-extension MS-vsliveshare.vsliveshare
code --install-extension shopify.ruby-lsp
code --install-extension dbaeumer.vscode-eslint
code --install-extension Rubymaniac.vscode-paste-and-indent
code --install-extension alexcvzz.vscode-sqlite
code --install-extension anteprimorac.html-end-tag-labels
code --install-extension marcoroth.herb-lsp
code --install-extension rayhanw.erb-helpers
```
你安装的就是下面这些插件:
- [Sublime Text Keymap and Settings Importer](https://marketplace.visualstudio.com/items?itemName=ms-vscode.sublime-keybindings)
- [VSCode Great Icons](https://marketplace.visualstudio.com/items?itemName=emmanuelbeziat.vscode-great-icons)
- [Live Share](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare)
- [Ruby](https://marketplace.visualstudio.com/items?itemName=shopify.ruby-lsp)
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [Paste and Indent](https://marketplace.visualstudio.com/items?itemName=Rubymaniac.vscode-paste-and-indent)
- [SQLite](https://marketplace.visualstudio.com/items?itemName=alexcvzz.vscode-sqlite)
### VS Code AI Features
VS Code includes many powerful **AI features**, which are a great tool once you already know how to code.
That said, relying on AI too early can hide important concepts and make debugging harder to understand. Once you’re comfortable with the fundamentals, you’ll know when and how to use AI effectively — without letting it do the thinking for you.
For the start of the bootcamp, we’ll disable these features. At the right point in the course, we’ll reenable them so you can put them to good use.
In **VS Code**:
1. Let's open the VS Code "Command **P**alette": type `Ctrl-Shift-P` (Windows / Linux) or `Cmd-Shift-P` (macOS).
1. This will open the Command Palette: a small text box at the top of your screen. Start typing `aifeatures` until you see "Chat: Learn How to Hide AI features". Click on it.

1. This will open the settings, and will show you the option "Disable and hide built-in AI features ...". Tick the checkbox in front of that option.

Later, if you want **to reenable** the AI features, you can follow the same instructions to untick the checkbox.
## Command line tools
### Zsh & Git
我们将使用`zsh`来代替默认的`bash` [shell](https://zh.wikipedia.org/zh-cn/殼層)。
我们也会使用[`git`](https://git-scm.com/),它是一个用来进行版本控制的命令行软件。
下面来安装这些工具吧:
- 打开终端
- 复制粘贴下面的命令:
```bash
sudo apt update
```
```bash
sudo apt install -y curl git imagemagick jq unzip vim zsh
```
这些指令会问你的密码:输入你的密码。
:warning: 当你输入你的密码的时候,屏幕上不会有任何的显示,**这是正常的**。这是一个安全保护的设置,来隐藏你整个密码,包括它的长度。你可以放心的输入你的密码,结束后按下`Enter`就可以了。
### 安装GitHub CLI
现在我们来安装GitHub[官方命令行界面(CLI)](https://cli.github.com) (Command Line Interface)。这是一个用来在终端里和你的GitHub账户交互的一个软件。
在你的终端里,复制粘贴以下代码,并在需要的时候,输入你的密码:
```bash
sudo apt remove -y gitsome # gh command can conflict with gitsome if already installed
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install -y gh
```
你可以运行以下的命令,来检查`gh`是否成功安装了:
```bash
gh --version
```
:heavy_check_mark: 如果你看到了`gh version X.Y.Z (YYYY-MM-DD)`,你就可以继续下一步啦!:+1:
:x: 如果没有看到话,**问问老师**。
## Oh-my-zsh
让我们一起安装`zsh`插件[Oh My Zsh](https://ohmyz.sh/).
在终端terminal里执行以下指令:
```bash
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```
如果终端里出现询问"Do you want to change your default shell to zsh?", 可以输入`Y`
在你的终端的最后,你会看到以下内容:

:heavy_check_mark: 如果你的终端成功显示了上面,你就可以继续下一步了:+1:
:x: 如果安装失败的话,请询问**你的老师**
## GitHub CLI
CLI是[Command-line Interface(命令行界面)](https://baike.baidu.com/item/%E5%91%BD%E4%BB%A4%E8%A1%8C%E7%95%8C%E9%9D%A2/9910197?fr=aladdin)的首字母缩写。
在这一章节里面,我们会安装[GitHub CLI](https://cli.github.com/)。这样我们就可以直接在终端和Github互动。
你之前执行的命令应该已经安装了GitHub CLI。
首先你需要**登陆**。复制粘贴下面的命令到终端,敲击回车:
:warning: **不要更改下面指令中的`email`**
```bash
gh auth login -s 'user:email' -w --git-protocol ssh
```
`gh`会问你几个问题:
- `Generate a new SSH key to add to your GitHub account?(生成新的SSH密钥,然后添加到Github账号上?)` 敲击回车,让gh帮你生成。
如果你以前生成过SSH密钥,那你就会看到这个问题`Upload your SSH public key to your GitHub account?(上传公共密钥到Github账户上上吗?)` 上下移动箭头`>`,让它停在你想选的SSH公钥前面,然后敲击回车。
- `Enter a passphrase for your new SSH key (Optional)(输入新的SSH密钥的密码(非必填))`. 输入一个密码,然后写下来或者记住它。这是保护你本地私钥的密码。然后敲击回车。
- `Title for your SSH key`。你可以把它留在建议的 "GitHub CLI",按`Enter`。
然后你会看到下面的文字输出:
```bash
! First copy your one-time code: 0EF9-D015
- Press Enter to open github.com in your browser...
```
复制那段验证码(code)(在上面的例子中是`0EF9-D015` ),然后敲击`Enter`。
你的浏览器就会打开一个页面让你授权GitHub CLI使用你的GitHub账号。同意,并等待一会儿。
回到终端,再次敲击`回车`,然后就应该好啦:tada:
检查一下你有没有链接好:
```bash
gh auth status
```
如果你看到`Logged in to github.com as <你的GitHub用户名> `,那就可以了。
:x: 如果没有,**问问老师**。
## Dotfiles (标准配置)
黑客很喜欢把他们的shell和工具变得很酷炫。
让我们用Le Wagon提供的一个超棒的默认配置文件来开始吧:[`lewagon/dotfiles`](http://github.com/lewagon/dotfiles).
因为你的配置是私人的,所以你需要保存在**自己**的代码库里(repository/repo)。
Fork的意思是:在你的GitHub账号上建一个新的代码库,和原始的那一个是一模一样的(可以想象成你在复制粘贴这个代码库)。这样,你在你的GitHub上就会有一个新的代码库: `$GITHUB_USERNAME/dotfiles`。我们需要fork,因为每个人都需要在那些文件里加上一些**特定**信息(比如你的名字)。
打开终端,运行下面的命令:
```bash
export GITHUB_USERNAME=`gh api user | jq -r '.login'`
echo $GITHUB_USERNAME
```
:heavy_check_mark: 你应该能看到你的GitHub用户名在终端里显示出来了。
:x: 如果没有的话,现在就**停下**,找老师帮忙。看起来之前的步骤(`gh auth`)有一些问题。
现在就可以fork代码库(repo),然后克隆到你自己的电脑上了:
```bash
mkdir -p ~/code/$GITHUB_USERNAME && cd $_
gh repo fork lewagon/dotfiles --clone
```
### Dotfiles安装器
运行`dotfiles`安装器:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles && zsh install.sh
```
用下面的命令检查一下你GitHub账号录入的电子邮箱。你需要在其中选一个(如果你有好几个的话),然后再进入下一个步骤:
```bash
gh api user/emails | jq -r '.[].email'
```
:heavy_check_mark: 如果你看到了你的注册邮箱列表,你就可以继续下一步啦:+1:
:x: 如果没有的话,请在运行上面:point_up: 这个指令之前,[重新授权GitHub](https://github.com/lewagon/setup/blob/master/ubuntu.cn.md#github-cli)。
### git安装器
运行git安装器:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh
```
:point_up: 这会**提示**填写你的全名(`FirstName LastName`)和你的邮箱。
:warning: 注意啦,你**需要**填`gh api ...`命令列出的其中一个电子邮箱。不然,Kitt就没办法跟进你的学习进程。 你选择的电子邮件将**公开**显示在互联网上。💡 如果您不希望您的电子邮件出现在您可能会贡献的公共存储库中,请选择 `@users.noreply.github.com` 地址。
现在运行下面的命令来**重置**你的终端:
```bash
exec zsh
```
## 禁用SSH密码输入
每次跟远程的代码库交流的时候都问你要密码是件很烦的事。所以呀,你需要给`oh my zsh`加上一个`ssh-agent`插件:
首先,打开`.zshrc`文件:
```bash
code ~/.zshrc
```
然后:
- 找到`plugins=`开始的这一行
- 在插件(plugin)列表里加上`ssh-agent`
这个列表现在看起来应该是这样的:
```
plugins=(gitfast last-working-dir common-aliases zsh-syntax-highlighting history-substring-search pyenv ssh-agent)
```
:heavy_check_mark: 按下`Ctrl` + `S` 保存`.zshrc`文件,然后关掉你的代码编辑器。
## rbenv
让我们安装[`rbenv`](https://github.com/sstephenson/rbenv),一个帮助我们安装和管理`ruby`环境的软件。
首先,我们需要清理你可能已经安装过的Ruby:
```bash
rvm implode && sudo rm -rf ~/.rvm
# If you got "zsh: command not found: rvm", carry on.
# It means `rvm` is not on your computer, that's what we want!
rm -rf ~/.rbenv
```
然后在终端里运行:
```bash
sudo apt install -y build-essential tklib zlib1g-dev libssl-dev libffi-dev libxml2 libxml2-dev libxslt1-dev libreadline-dev libyaml-dev
```
```bash
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
```
```bash
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
exec zsh
```
## Ruby
### 安装
现在,你已经准备好了去安装最新[ruby](https://www.ruby-lang.org/en/)版本并把它设置为默认版本。
运行下方这个指令,它会**花费一些时间(5-10分钟)**
```bash
rbenv install 3.3.5
```
当Ruby安装好后,运行下面这个指令来告诉系统使用3.3.5这个版本作为默认版本。
```bash
rbenv global 3.3.5
```
然后**重置**你的终端,然后检查Ruby版本:
```bash
exec zsh
ruby -v
```
:heavy_check_mark: 如果你有看到`ruby 3.3.5`,那么你可以继续下一步+1:
:x: 如果没有的话,**询问一下老师**。
### 安装一些gems
点击这里,如果你在 :cn: 中国的话
:warning: 如果你在中国的话,你应该使用以下命令来安装gem。
```bash
# China only!
gem sources --remove https://rubygems.org/
gem sources -a https://gems.ruby-china.com/
gem sources -l
# *** CURRENT SOURCES ***
# https://gems.ruby-china.com/
# Ruby-china.com must be in the list now
```
在ruby的世界里,我们将外部的库称之为`gems`:他们是一些你可以下载并在你的电脑上运行的ruby代码。让我们一起安装一些!
首先,我们将更新`bundler`,它是用于安装 gem 的工具:
```bash
gem update bundler
```
在你的终端里,复制粘贴下面的指令:
```bash
gem install colored faker http pry-byebug rake rails:8.1.1 rest-client rspec rubocop-performance sqlite3:2.8.1 activerecord:8.1.1 ruby-lsp
```
:heavy_check_mark: 如果你看到 `xx gems installed`,那么一切正常 :+1:
:x: 如果你遇到了以下的报错:
```bash
ERROR: While executing gem ... (TypeError)
incompatible marshal file format (can't be read)
format version 4.8 required; 60.33 given
```
运行以下的指令:
```bash
rm -rf ~/.gemrc
```
然后,重新运行安装gems的指令。
:warning: **永远不要**使用`sudo gem install`来安装一个gem!即使你偶然发现了一个网络上的答案(或者终端提示)叫你这么做。
## Node.js
[Node.js](https://nodejs.org/en/)是一个JavaScript运行环境以在终端运行JavaScript代码。让我们一起用[nvm](https://github.com/nvm-sh/nvm),一个Node.js的版本管理器,来安装Node.js。
在终端里,运行以下指令:
```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | zsh
```
重启你的终端并执行下方指令:
```bash
nvm -v
```
你应该会看到你的nvm的版本。如果没有的话,问一下你的老师。
现在,让我们来安装node:
```bash
nvm install 20.17.0
```
当这个指令执行结束之后,运行:
```bash
node -v
```
如果看到`v20.17.0`,那么你安装成功了:heavy_check_mark: 然后,你就可以运行下面这个命令了:
```bash
nvm cache clear
```
:x: 如果没有看到版本的话,**问一下你的老师**。
## yarn
让我们一起来安装[`yarn`](https://classic.yarnpkg.com/en/docs/install):
```bash
corepack enable
yarn set version stable
```
```bash
exec zsh
```
⚠️ 如果你看到任何错误信息,请尝试运行 `npm install -g corepack` 然后再次运行上面的命令。
重启终端并运行:
```bash
yarn -v
```
你应该会看到你yarn的版本。如果没有的话,问一下你的老师。
## SQLite
几周后,我们就会开始学习数据库和SQL. [SQLite](https://sqlite.org/index.html)是一个数据库引擎,它可以在单文件数据库上执行SQL查询。现在来安装它吧:
在终端,执行下面的命令:
```bash
sudo apt-get install sqlite3 libsqlite3-dev pkg-config
```
然后执行下面的命令:
```bash
sqlite3 -version
```
:heavy_check_mark: 如果你看到了版本号,那你就可以继续下一步了 :+1:
:x: 如果没有,**问问老师吧**!
## PostgreSQL
有的时候,SQLite功能会不够用。这个时候我们就需要使用一个更高级的工具,叫做[PostgreSQL](https://www.postgresql.org/)。这是一个开源的、强大的、生产环境可用的数据库系统。
让我们现在一起安装它。
运行下方指令:
```bash
sudo apt install -y postgresql postgresql-contrib libpq-dev build-essential
```
```bash
sudo -u postgres psql --command "CREATE ROLE \"`whoami`\" LOGIN createdb superuser;"
```
## 最后检查
让我们来看看你是否已经成功安装好了所有软件。
在终端,运行下面两行命令:
```bash
exec zsh
curl -Ls https://web-dev-challenge-lewagon-image.oss-cn-shanghai.aliyuncs.com/setup/check.rb > _.rb && ruby _.rb || rm _.rb
```
:heavy_check_mark: 如果出现了一个绿色的`Awesome! Your computer is now ready!`,那么你的工作台已经设置好了 :+1:
如果没有的话,问一下你的老师。
## Kitt
:warning: 如果你已经收到了一封来自Le Wagon邀请你去注册Kitt(我们的学习平台)的邮件并且你也注册完成了的话,你可以安全的跳过这一章节。如果你还没有注册完成的话,请跟随邮件里的教程,完成注册。
如果你不确定你要做什么,可以查看[这个链接](https://kitt.lewagon.com/)。如果你已经登录了的话,你可以跳过这个章节。如果你没有登录的话,你需要点击`Enter Kitt as a Student`。如果你可以成功的登录,你也可以安全的跳过这一步。不然的话,你可以询问一下老师你是否有收到过相关的邮件,或者直接跟着执行下面的教程。
前往[kitt.lewagon.com/onboarding](http://kitt.lewagon.com/onboarding),注册成为Le Wagon的一名校友。选择你的batch,用gitHub账户登录并填写你的信息。
你的老师将会验证你的确属于这个batch。你可以在完成了注册表单后去询问老师去做验证。
当你的老师验证成功后,请前往你的邮箱收件箱。你应该会有两封邮件:
- 一封来自Slack,邀请你加入Le Wagon Alumni Slack社群(在这儿你可以与你的伙伴和所有之前的学员交流)。点击**Join**并填写相应的个人信息。
- 一封来自GitHub,要求你加入`lewagon`团队。**接受它**,不然的话你将没有办法看到有关讲座和课程的文件。
## Slack
[Install Slack for Linux (beta)](https://get.slack.help/hc/en-us/articles/212924728-Slack-for-Linux-beta-).
Launch the app and sign in to `lewagon-alumni` organization.
Make sure you upload a picture there.
You can also sign in to Slack on your iPhone or Android device!
The idea is that you'll have Slack open all day, so that you can share useful links / ask for help / decide where to go to lunch / etc.
In case of remote tickets, you will use Slack audio or video call to get help. To ensure that everything is working fine, launch the Slack app on your computer, then [follow this procedure](https://slack.com/intl/en-gb/help/articles/115003538426-Troubleshoot-Slack-Calls#run-our-calls-test) (tl;dr type `/call --test` then the `Enter` key in any channel).
After the test are finished, you should have green "All clear" messages at least for your microphone and camera. If not, ask a teacher.

### 设置
打开Slack应用程序并登入`lewagon-alumni`组织。
确保你已经**上传了你的头像照片** :point_down:

之后你可以全天开着Slack,这样你可以在上面分享有用的链接/寻求帮助/决定去那儿吃饭/...
为了确保视频电话可以正常工作,让我们一起测试摄像头和麦克风:
- 打开Slack应用程序。
- 点击右上方的个人照片。
- 从菜单中选择 `首选项(Preferences)`。
- 点击左侧栏中的 `音频和视频(Audio & video)`。
- 在 `故障排除(Troubleshooting)`下面,点击 `运行音频、视频和屏幕共享测试(Run an audio, video and screensharing test)`。该测试将在一个新窗口中打开。
- 检查你使用的扬声器、麦克风和摄像机设备是否出现在选项中,然后点击 `开始测试(Start test)`。

:heavy_check_mark: 当测试结束以后,你应该会看到你的摄像头和麦克风有绿色的"Succeed"信息。:+1:
:x: 如果测试失败的话,**请联系你的老师**.
你也可以在手机上安装Slack应用并登入`lewagon-alumni`!
## Ubuntu settings
### Install video codec H264
On our pedagogical platform (Kitt, you'll soon discover it!), we have some videos. By default Firefox on Linux cannot play them as they use an unsupported codec (H264). To get those videos working for you, you need to run this:
```bash
sudo apt install libavcodec-extra -y
```
### Install useful terminal tools
`tree` is a nice tool to visualize a directory tree inside the terminal:
`ncdu` is a text-based interface disk utility.
`htop` is an interactive process viewer.
`tig` is a text-mode interface for `git`.
```bash
sudo apt install tree ncdu htop tig
```
### Ubuntu inotify
Ubuntu is always tracking changes in your folders and to do this it uses inotify.
By default the Ubuntu limit is set to 8192 files monitored.
As programming involves a lot of files, we need to raise this limit.
In your terminal run:
```bash
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
```
### Pin apps to your dock
You are going to use most of the apps you've installed today really often. So let's pin them to your dock so that they are just one click away!
To pin an app to your dock, launch the app, right-click on the icon in the dock to bring up the context menu and choose "Add to Favorites".

You must pin:
- Your terminal
- Your file explorer
- VS Code
- Your Internet browser
- Slack
## 设置完成啦!
现在你的电脑已经完成[Le Wagon网页开发课程](https://www.lewagon.com/web-development-course/full-time)的设置啦 :muscle: :clap:
享受你的编程之旅,你会掌握它的! :rocket:
================================================
FILE: ubuntu.es.md
================================================
# Instrucciones de la configuración
Aquí abajo encontrarás las instrucciones para la configuración que tu computadora necesita para el [curso de AI Software Development de Le Wagon](https://www.lewagon.com/web-development-course/full-time).
Por favor, **léelas cuidadosamente y ejecuta todos los comandos en el orden indicado**. Si tienes algún problema, no dudes en pedirle ayuda a tu profesor :raising_hand:
¡Comencemos! :rocket:
## Cuenta GitHub
¿Ya tienes una cuenta GitHub? Si no es el caso, [ábrela ya](https://github.com/join).
:point_right: **[Sube una foto](https://github.com/settings/profile)** y escribe tu nombre correctamente en tu cuenta GitHub. Esto es importante porque nosotros usaremos un tablero de comando interno con tu avatar. Por favor hazlo **ahora** antes de dar un paso más en esta guía.

:point_right: **[Habilita la Autenticación de Dos Factores (2FA)](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication#configuring-two-factor-authentication-using-text-messages)**. GitHub te enviará mensajes de texto con un código cuando intentes iniciar sesión. Esto es importante para la seguridad y también pronto será necesario para contribuir código en GitHub.
## Visual Studio Code
### Instalación
Instala el editor de texto [Visual Studio Code](https://code.visualstudio.com).
Copia (presionando `Cmd` + `C`) el comando de aquí abajo y luego pégalo en tu terminal (`Ctrl` + `Shift` + `v`):
```bash
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
rm -f packages.microsoft.gpg
sudo apt update
sudo apt install -y code
```
Escribe tu contraseña cuando estos comandos te la pidan.
:warning: Cuando escribas tu contraseña no verás nada en la pantalla. **Esto es normal**. Es una herramienta de seguridad para ocultar tanto el contenido de tu contraseña como su longitud. Simplemente escribe tu contraseña y presiona `Enter` al terminar.
### Abrir desde la terminal
Ahora abre VS Code desde **la terminal**:
```bash
code
```
:heavy_check_mark: Si se acaba de abrir una ventana de VS Code, entonces todo está bien :+1:
:x: Si no es el caso, por favor **pídele ayuda a un profesor**.
## Extensiones de VS Code
### Instalación
Vamos a instalar algunas extensiones útiles de VS Code.
Copia y pega los siguientes comandos en tu terminal:
```bash
code --install-extension ms-vscode.sublime-keybindings
code --install-extension emmanuelbeziat.vscode-great-icons
code --install-extension github.github-vscode-theme
code --install-extension MS-vsliveshare.vsliveshare
code --install-extension shopify.ruby-lsp
code --install-extension dbaeumer.vscode-eslint
code --install-extension Rubymaniac.vscode-paste-and-indent
code --install-extension alexcvzz.vscode-sqlite
code --install-extension anteprimorac.html-end-tag-labels
code --install-extension marcoroth.herb-lsp
code --install-extension rayhanw.erb-helpers
```
Aquí está la lista de las extensiones que estás instalando:
- [Sublime Text Keymap and Settings Importer](https://marketplace.visualstudio.com/items?itemName=ms-vscode.sublime-keybindings)
- [VSCode Great Icons](https://marketplace.visualstudio.com/items?itemName=emmanuelbeziat.vscode-great-icons)
- [Live Share](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare)
- [Ruby](https://marketplace.visualstudio.com/items?itemName=shopify.ruby-lsp)
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [Paste and Indent](https://marketplace.visualstudio.com/items?itemName=Rubymaniac.vscode-paste-and-indent)
- [SQLite](https://marketplace.visualstudio.com/items?itemName=alexcvzz.vscode-sqlite)
### Funciones de IA en VS Code
VS Code incluye muchas y potentes **funciones de IA**, que son una gran herramienta una vez que ya sabes programar.
Dicho esto, depender de la IA demasiado pronto puede ocultar conceptos importantes y dificultar la comprensión de la depuración. Una vez que estés cómodo con los fundamentos, sabrás cuándo y cómo usar la IA de forma eficaz —sin dejar que haga el trabajo por ti.
Para el inicio del bootcamp, desactivaremos estas funciones. Llegado el momento apropiado en el curso, las volveremos a habilitar para que puedas utilizarlas bien.
En **VS Code**:
1. Abramos la "Paleta de comandos" de VS Code: escribe `Ctrl-Shift-P` (Windows / Linux) o `Cmd-Shift-P` (macOS).
1. Se abrirá la Paleta de comandos: una pequeña caja de texto en la parte superior de la pantalla. Empieza a escribir `aifeatures` hasta que veas "Chat: Learn How to Hide AI features". Haz clic en ella.

1. Esto abrirá la configuración y te mostrará la opción "Disable and hide built-in AI features ...". Marca la casilla delante de esa opción.

Más adelante, si quieres **volver a habilitar** las funciones de IA, puedes seguir las mismas instrucciones para desmarcar la casilla.
### Configuración de Live Share
[Visual Studio Live Share](https://visualstudio.microsoft.com/services/live-share/) es una extensión de VS Code que te permite compartir el código en tu editor de texto para debugging y pair-programming: ¡Instalémoslo!
Abre VS Code desde tu terminal escribiendo `code` y presionando `Enter`.
Haz clic en la pequeña flecha de la parte inferior de la barra de la izquierda:

- Haz clic en el botón "Share". Luego en "GitHub (Inicia sesión usando tu cuenta GitHub)".
- Va a aparecer una ventana emergente pidiéndote que inicies sesión con GitHub: Haz clic en "Allow".
- Te redireccionarán a una página GitHub en tu navegador pidiéndote que autorices Visual Studio Code: Haz clic en "Continue" y luego en "Authorize github".
- Es posible que VS Code muestre más ventanas emergentess: Ciérralas haciendo clic en "OK".
Eso es todo. ¡Ya puedes continuar!
## Herramientas de línea de comando
### Comprueba la configuración regional (locale)
La "locale" es un mecanismo que permite adaptar los programas a su idioma y país.
Comprobemos que la configuración regional por defecto es el inglés:
```bash
locale
```
Si la salida no contiene `LANG=en_US.UTF-8`, ejecute el siguiente comando en un Ubuntu terminal para instalar la locale inglesa:
```bash
sudo locale-gen en_US.UTF-8
```
Si después, recibes una advertencia (`bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf-8)`) en tu terminal, por favor haz lo siguiente:
Generar la configuración regional<>/summary>
Por favor, ejecuta estas líneas en tu terminal.
```bash
sudo update-locale LANG=en_US.UTF8
sudo apt-get update
sudo apt-get install language-pack-en language-pack-en-base manpages
```
### Zsh & Git
En lugar de usar el `bash` [shell](https://en.wikipedia.org/wiki/Shell_(computing)) predeterminado, usaremos `zsh`.
También utilizaremos [`git`](https://git-scm.com/), un programa de línea de comando para control de versiones.
Vamos a instalarlos, junto con otros programas útiles:
- Abre una **terminal de Ubuntu**
- Copia y pega los siguientes comandos:
```bash
sudo apt update
```
```bash
sudo apt install -y curl git imagemagick jq unzip vim zsh
```
Estos comandos te pedirán tu contraseña: escríbela.
:warning: Cuando escribas tu contraseña no verás nada en la pantalla. **Esto es normal**. Es una herramienta de seguridad para ocultar tanto el contenido de tu contraseña como su longitud. Simplemente escribe tu contraseña y presiona `Enter` al terminar.
### Instalación de la CLI de GitHub
Instalemos la [CLI oficial de GitHub](https://cli.github.com) (Interfaz de Línea de Comando). Es un programa que se usa para interactuar con tu cuenta GitHub por medio de la línea de comando.
En tu terminal, copia y pega los siguientes comandos y escribe tu contraseña si te la piden:
```bash
sudo apt remove -y gitsome # gh command can conflict with gitsome if already installed
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install -y gh
```
Ejecuta el comando que te mostramos a continuación para verificar que `gh` se haya instalado correctamente en tu máquina:
```bash
gh --version
```
:heavy_check_mark: Si ves esta versión `gh version X.Y.Z (YYYY-MM-DD)`, puedes continuar trabajando :+1:
:x: Si no es el caso, por favor **contacta a un profesor**
## Oh-my-zsh
Instalemos el plugin `zsh` [Oh My Zsh](https://ohmyz.sh/).
Ejecuta este comando en la terminal:
```bash
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```
Si te preguntan "Do you want to change your default shell to zsh?", presiona `Y`
Cuando termines, tu terminal debería lucir así:

:heavy_check_mark: Si es el caso, puedes continuar :+1:
:x: Si no, por favor **pídele ayuda a un profesor**.
## GitHub CLI
CLI es una abreviación de [Command-line Interface](https://en.wikipedia.org/wiki/Command-line_interface) que significa interfaz de línea de comando.
En esta sección usaremos [GitHub CLI](https://cli.github.com/) para interactuar directamente con GitHub desde la terminal.
Usaremos la GitHub CLI (`gh`) para conectarnos a GitHub utilizando *SSH*, un protocolo para iniciar la sesión utilizando claves SSH en lugar de la famosa pareja nombre de usuario y contraseña.
Ya debería haberse instalado en tu computadora con los comandos que ejecutaste anteriormente.
Lo primero que hay que hacer para **iniciar sesión** es copiar y pegar el comando siguiente en tu terminal:
:warning: **NO edites el `email`**
```bash
gh auth login -s 'user:email' -w --git-protocol ssh
```
`gh` le hará algunas preguntas:
- `Generate a new SSH key to add to your GitHub account?` Presiona `Enter` para pedirle a gh que genere las claves SSH por ti.
Si ya tienes claves SSH, verás en su lugar `Upload your SSH public key to your GitHub account?`Con las flechas, selecciona la ruta de tu archivo de clave pública y pulsa `Intro`.
- `Enter a passphrase for your new SSH key (Optional)`. Pon algo que quieras y que recuerdes. Es una contraseña para proteger tu private key que está almacenada en tu disco duro. Luego presiona `Enter`.
- `Title for your SSH key`. Puede dejarlo en la propuesta "GitHub CLI", presiona `Enter`.
Obtendrás el siguiente resultado:
```bash
! First copy your one-time code: 0EF9-D015
- Press Enter to open github.com in your browser...
```
Selecciona y copia el código (`0EF9-D015` en el ejemplo) y luego presiona `Enter`.
Tu navegador se abrirá y te pedirá que autorices GitHub CLI para usar tu cuenta GitHub. Acepta y espera un poco.
Regresa a la terminal, presiona `Enter` nuevamente y listo. Eso es todo.
Para verificar que están conectado correctamente, escribe lo siguiente:
```bash
gh auth status
```
:heavy_check_mark: Si obtienes este mensaje: `Logged in to github.com as `, significa que todo está bien :+1:
:x: De lo contrario, **contacta a un profesor**.
## Dotfiles (configuración estándar)
Los hackers aman mejorar sus shells y sus herramientas.
Comenzaremos con una configuración predeterminada proporcionada por Le Wagon: [`lewagon/dotfiles`](https://github.com/lewagon/dotfiles).
Tu configuración es personal, así que necesitas tu **propio** repositorio para almacenarla. Haz el **fork** del repositorio de Le Wagon.
Hacer un fork significa crear un nuevo repositorio en tu propia cuenta GitHub `$GITHUB_USERNAME/dotfiles` el cual es idéntico al original de Le Wagon y que podrás modificar como quieras.
Abre tu terminal y ejecuta los siguientes comandos:
```bash
export GITHUB_USERNAME=`gh api user | jq -r '.login'`
echo $GITHUB_USERNAME
```
:heavy_check_mark: Deberías ver tu usuario GitHub en la pantalla.
:x: Si no es el caso, **no des un paso más** y pide ayuda. Es posible que haya un problema con el paso anterior (`gh auth`).
Es hora de hacer el fork del repositorio y clonarlo en tu computadora:
```bash
mkdir -p ~/code/$GITHUB_USERNAME && cd $_
gh repo fork lewagon/dotfiles --clone
```
### Instalación de Dotfiles
Ejecuta el instalador de `dotfiles`:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles
zsh install.sh
```
Verifica los emails registrados en tu cuenta GitHub. Deberás seleccionar uno en el paso siguiente:
```bash
gh api user/emails | jq -r '.[].email'
```
:heavy_check_mark: Si ves una lista de tus emails registrados, puedes continuar :+1:
:x: De lo contrario, por favor haz la [autenticación en GitHub](https://github.com/lewagon/setup/blob/master/ubuntu.es.md#github-cli) nuevamente antes de ejecutar este comando :point_up: again.
### Instalación de git
Ejecuta el instalador de `git`:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh
```
:point_up: Esto te **pedirá** tu nombre (`FirstName LastName`) y tu email. Cualquier correo que elijas se mostrará **públicamente** en internet. 💡 Selecciona la dirección `@users.noreply.github.com` si no quieres que tu correo electrónico aparezca en los repositorios públicos a los que puedas contribuir.
:warning: **Necesitas** poner uno de los emails que aparecen arriba gracias al comando anterior `gh api ...`. De lo contrario, Kitt no podrá hacerle seguimiento a tu progreso.
Ahora **resetea** tu terminal ejecutando lo siguiente:
```bash
exec zsh
```
## Desahilitación de la solicitud de SSH passphrase
No vas a querer que te pidan tu passphrase cada vez que te comuniques con un repositorio remoto. Por eso debes agregarle plugin `ssh-agent` a `oh my zsh`:
Primero abre el archivo `.zshrc`:
```bash
code ~/.zshrc
```
Luego:
- Identifica la línea que comienza por `plugins=`
- Agrega `ssh-agent` al final de la lista de plugins
La lista debería verse de la siguiente manera:
```bash
plugins=(gitfast last-working-dir common-aliases zsh-syntax-highlighting history-substring-search pyenv ssh-agent)
```
:heavy_check_mark: Guarda el archivo `.zshrc` con `Ctrl` + `S` y cierra tu editor de texto.
## rbenv
Instala [`rbenv`](https://github.com/sstephenson/rbenv), un programa para instalar y gestionar entornos `ruby`.
Primero debemos limpiar cualquier instalación previa de Ruby que tengas en tu computadora:
```bash
rvm implode && sudo rm -rf ~/.rvm
# If you got "zsh: command not found: rvm", carry on.
# It means `rvm` is not on your computer, that's what we want!
rm -rf ~/.rbenv
```
Luego ejecuta lo siguiente en tu terminal:
```bash
sudo apt install -y build-essential tklib zlib1g-dev libssl-dev libffi-dev libxml2 libxml2-dev libxslt1-dev libreadline-dev libyaml-dev
```
```bash
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
```
```bash
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
exec zsh
```
## Ruby
### Instalación
Ahora estás listo para instalar la última versión de [ruby](https://www.ruby-lang.org/en/) y ponerla como la versión predeterminada.
Corre este comando, **tomará un tiempo (5-10 minutos)**
```bash
rbenv install 3.3.5
```
Cuando la instalación de ruby termine, corre este comando para decirle al sistema que use la versión 3.3.5 por defecto.
```bash
rbenv global 3.3.5
```
**Reinicia** tu terminal y chequea tu versión Ruby:
```bash
exec zsh
```
Luego ejecuta esto:
```bash
ruby -v
```
:heavy_check_mark: Si ves algo que comience por `ruby 3.3.5`, entonces puedes continuar +1:
:x: Si no es el caso, **pídele ayuda a un profesor**.
### Instalación de algunas gemas
Si estás en China 🇨🇳 haga clic aquí
:warning: Si estás en China, deberías actualizar la forma de instalar las gemas con los siguientes comandos.
```bash
# China only!
gem sources --remove https://rubygems.org/
gem sources -a https://gems.ruby-china.com/
gem sources -l
# *** CURRENT SOURCES ***
# https://gems.ruby-china.com/
# Ruby-china.com must be in the list now
```
**Todos, todas, en China o no**, continúen aquí para instalar gemas.
En el universo de ruby, a las librerías externas se les llama `gems`: son pedazos de código ruby que puedes descargar y ejecutar en tu computadora. ¡Instalemos algunas!
Primero, vamos a actualizar `bundler`, que es lo que nos permite instalar gemas:
```bash
gem update bundler
```
En tu terminal, copia y pega el siguiente comando:
```bash
gem install colored faker http pry-byebug rake rails:8.1.1 rest-client rspec rubocop-performance sqlite3:2.8.1 activerecord:8.1.1 ruby-lsp
```
:heavy_check_mark: Si obtienes `xx gems installed`, entonces todo está bien :+1:
:x: Si obtienes el siguiente error:
```bash
ERROR: While executing gem ... (TypeError)
incompatible marshal file format (can't be read)
format version 4.8 required; 60.33 given
```
Ejecuta el siguiente comando:
```bash
rm -rf ~/.gemrc
```
Ejecuta el comando nuevamente para instalar las gemas.
:warning: ¡**NUNCA** instales una gema con `sudo gem install`! Incluso si encuentras una solución en Stackoverflow (o la terminal) diciéndote que lo hagas.
## Node.js
[Node.js](https://nodejs.org/en/) es un JavaScript runtime para ejecutar código JavaScript en la terminal. Instálalo con [nvm](https://github.com/nvm-sh/nvm), aun gestionador de versiones para Node.js.
En una terminal, ejecuta estos comandos:
```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | zsh
exec zsh
```
Luego corre el siguiente comando:
```bash
nvm -v
```
Deberías ver una versión. Si no, pídele ayuda a tu profesor.
Ahora instala node:
```bash
nvm install 20.17.0
```
Cuando termine la instalación, corre lo siguiente:
```bash
node -v
```
Si ves `v20.17.0`, the installation succeeded :heavy_check_mark: entonces ahora puedes ejecutar lo siguiente:
```bash
nvm cache clear
```
:x: De lo contrario, **contacta a un profesor**.
## yarn
[`yarn`](https://yarnpkg.com/) es un gestor de paquetes para instalar librerías JavaScript. Instálalo:
En una terminal, ejecuta los siguientes comandos:
```bash
corepack enable
yarn set version stable
```
```bash
exec zsh
```
⚠️ Si ves algún mensaje de error, intenta ejecutar `npm install -g corepack` y luego vuelve a ejecutar los comandos anteriores.
Luego ejecuta este comando:
```bash
yarn -v
```
:heavy_check_mark: si ves una versión, entonces todo está bien :+1:
:x: Si no es el caso, **pídele ayuda a un profesor**
## SQLite
En algunas semanas hablaremos de bases de datos y de SQL. [SQLite](https://sqlite.org/index.html) es un sistema utilizado en bases de datos para ejecutar consultas SQL en bases de datos de un solo archivo. Vamos a instalarlo:
En un terminal, ejecuta los siguientes comandos:
```bash
sudo apt-get install sqlite3 libsqlite3-dev pkg-config
```
A continuación, ejecuta el siguiente comando:
```bash
sqlite3 -version
```
:heavy_check_mark: Si ves una versión, puedes continuar :+1:
:x: Si no, **pídele ayuda a un profesor**
## PostgreSQL
A veces SQLite no es suficiente y necesitaremos una herramienta más avanzada llamada [PostgreSQL](https://www.postgresql.org/). Esta es un sistema para bases de datos de código abierto y listo para usar en producción.
Instálalo ejecutando los siguientes comandos:
```bash
sudo apt install -y postgresql postgresql-contrib libpq-dev build-essential
```
```bash
sudo -u postgres psql --command "CREATE ROLE \"`whoami`\" LOGIN createdb superuser;"
```
## Chequeo
Verifiquemos si has instalado todo bien.
Ejecuta el siguiente comando en tu terminal:
```bash
exec zsh
```
Luego ejecuta lo siguiente:
```bash
curl -Ls https://raw.githubusercontent.com/lewagon/setup/master/check.rb > _.rb && ruby _.rb && rm _.rb || rm _.rb
```
:heavy_check_mark: Si obtienes un mensaje verde diciendo `Awesome! Your computer is now ready!`, significa que tu computadora está lista y que todo está bien :+1:
:x: De lo contrario, **habla con tu profesor**.
## Kitt
:warning: Si recibiste una invitación por email de Le Wagon para crear una cuenta en Kitt (nuestra plataforma de aprendizaje), ignora este paso y sigue las instrucciones en el email si es que todavía no lo has hecho.
Si no sabes que hacer, haz clic en [este enlace](https://kitt.lewagon.com/). Si ya iniciaste sesión, puedes omitir esta sección. Si no, haz clic en `Enter Kitt as a Student`. Esto significa iniciar sesión como estudiante. Si no tienes problemas para iniciar sesión, puedes omitir este paso. De lo contrario pídele a un profesor que te confirme si debiste haber recibido o si debes seguir las instrucciones de aquí abajo.
Registrate como alumni de Le Wagon yendo a [kitt.lewagon.com/onboarding](http://kitt.lewagon.com/onboarding). Selecciona tu batch, inicia sesión con GitHub y completa toda la información que te piden.
Ahora tu profesor podrá validar que realmente eres parte del batch. Pídele que lo haga justo después de que hayas completado el formulario de registro.
Cuando el profesor haya aprobado tu perfil, ve a la bandeja de entrada de tu email. Deberías tener 2 nuevos emails:
- Uno de Slack, invitándote a la comunidad de los alumni de Le Wagon en slack (donde podrás chatear con tus compañeros y todos los demás alumni). Haz clic en **Join** y completa la información que te piden.
- Otro de GitHub, invitándote a `lewagon` team. **Acéptala**, de lo contrario no podrás acceder a las diapositivas de las clases.
## Slack
[Slack](https://slack.com/) es una plataforma de comunicación popular en la industria tech.
### Instalación
[Descarga la aplicación Slack](https://get.slack.help/hc/en-us/articles/212924728-Slack-for-Linux-beta-) e instálala.
:warning: Si ya estás usando Slack en tu navegador, por favor descarga e instala **la aplicación de escritorio** la cual tiene todas las funciones.
### Parámetros
Abre la aplicación e inicia sesión en `lewagon-alumni`.
Asegúrate de **subir una foto para tu perfil** :point_down:

La idea es tener Slack abierto todo el día para compartir enlaces útiles / pedir ayuda / decidir dónde almorzar / etc.
Para asegurarte de que todo lo relacionado a videollamadas funcione bien, prueba tu cámara y tu micrófono:
- Abre la aplicación Slack
- Haz clic en tu foto de perfil en la esquina superior derecha
- Selecciona "Preferencias" en el menú.
- Haz clic en "Audio y vídeo" en la columna de la izquierda.
- Debajo de "Solución de problemas", haz clic en "Ejecutar una prueba de audio, vídeo y pantalla compartida". La prueba se abrirá en una nueva ventana.
- Comprueba que tus dispositivos preferidos de altavoz, micrófono y cámara aparecen en los menús desplegables y haz clic en "Iniciar prueba"
- Haz clic en el botón verde "Start test"

:heavy_check_mark: Cuando termine el test deberías ver mensajes de "Succeed" en verde por lo menos para tu micrófono y tu cámara. :+1:
:x: Si no es el caso, **contacta a un profesor**.
¡También puedes instalar la aplicación Slack en tu smartphone e iniciar sesión en `lewagon-alumni`!
## Parámetros de Ubuntu
### Instala video codec H264
Tenemos algunos videos en nuestra plataforma pedagógica (Kitt. ¡La descubrirás pronto!). La configuración predeterminada de Firefox en Linux no permite reproducirlos ya que usan un codec (H264) que no está soportado. Para que funcionen los videos debes ejecutar lo siguiente:
```bash
sudo apt install libavcodec-extra -y
```
### Instalación de herramientas útiles de terminal
`tree` es buena para visualizar un árbol de directorio dentro de la terminal:
`ncdu` es para discos con interfaz en modo texto.
`htop` nos muestra procesos de forma interactiva.
`tig` es una interfaz en modo texto para `git`.
```bash
sudo apt install tree ncdu htop tig
```
### Ubuntu inotify
Ubuntu siempre le hace seguimiento a los cambios en tus carpetas para eso usa inotify.
El límite predeterminado de monitoreo de Ubuntu es 8192 archivos.
Necesitamos aumentar este límite ya que la programación requiere de muchos archivos.
Ejecuta lo siguiente en tu terminal:
```bash
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
```
### Anclaje de aplicaciones a tu dock
Usarás frecuentemente casi todas las aplicaciones que has instalado hoy. ¡Anclémoslas a tu dock para que estén a solo un clic de ti!
Para ello, abre la aplicación. Haz clic derecho en el ícono de la barra de tareas para hacer que aparezca el menú contextual (también llamado emergente). Selecciona "Options" y después "Keep in Dock".

Ancla lo siguiente:
- Tu terminal
- Tu explorador de archivos
- VS Code
- Tu navegador de Internet
- Slack
## ¡Fin de la configuración!
Tu computadora está lista para el [curso de AI Software Development de Le Wagon](https://www.lewagon.com/web-development-course/full-time) :muscle: :clap:
Disfrútalo, sabemos que te va a ir genial :rocket:
================================================
FILE: ubuntu.fr.md
================================================
# Instructions de configuration
Les instructions ci-dessous vont te permettre de configurer ton ordinateur pour [la formation AI Software Development du Wagon](https://www.lewagon.com/web-development-course/full-time).
**Lis-les attentivement et exécute toutes les commandes dans l’ordre suivant**. En cas de blocage, n’hésite pas à demander au prof :raising_hand:
C’est parti :rocket:
## Compte GitHub
Est-ce que tu as déjà un compte GitHub ? Si ce n’est pas le cas, [inscris-toi maintenant](https://github.com/join).
:point_right: **[Télécharge une photo](https://github.com/settings/profile)** et indique correctement ton nom sur ton compte GitHub. C’est important, car notre tableau de bord interne utilise ton avatar. Fais-le **maintenant** avant de poursuivre la configuration de ton ordinateur.

:point_right: **[Activez l'authentification à deux facteurs (2FA)](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication#configuring-two-factor-authentication-using-text-messages)**. GitHub vous enverra des messages texte avec un code lorsque vous essayez de vous connecter. C'est important pour la sécurité et cela sera bientôt obligatoire pour contribuer du code sur GitHub.
## Visual Studio Code
### Installation
On va maintenant installer l’éditeur de texte [Visual Studio Code](https://code.visualstudio.com).
Copie (`Ctrl` + `C`) les commandes ci-dessous, puis colle-les dans ton terminal (`Ctrl` + `Shift` + `v`) :
```bash
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
rm -f packages.microsoft.gpg
sudo apt update
sudo apt install -y code
```
Ces commandes te demanderont ton mot de passe ; saisis-le.
:warning: Lorsque tu saisiras ton mot de passe, rien ne s’affichera à l’écran ; **c’est normal**. Il s’agit d’une mesure de sécurité permettant de masquer ton mot de passe et sa longueur. Saisis simplement ton mot de passe, puis appuie sur `Enter`.
### Lancement depuis le terminal
On va maintenant lancer VS Code depuis **le terminal** :
```bash
code
```
:heavy_check_mark: Si une fenêtre VS Code s’ouvre, c’est bon. :+1:
:x: Sinon, **demande au prof**.
## Extensions VS Code
### Installation
On va maintenant installer quelques extensions utiles à VS Code.
Copie-colle les commandes suivantes dans le terminal :
```bash
code --install-extension ms-vscode.sublime-keybindings
code --install-extension emmanuelbeziat.vscode-great-icons
code --install-extension MS-vsliveshare.vsliveshare
code --install-extension shopify.ruby-lsp
code --install-extension dbaeumer.vscode-eslint
code --install-extension Rubymaniac.vscode-paste-and-indent
code --install-extension alexcvzz.vscode-sqlite
code --install-extension anteprimorac.html-end-tag-labels
code --install-extension marcoroth.herb-lsp
code --install-extension rayhanw.erb-helpers
```
Voici la liste des extensions que tu es en train d'installer :
- [Sublime Text Keymap and Settings Importer](https://marketplace.visualstudio.com/items?itemName=ms-vscode.sublime-keybindings)
- [VSCode Great Icons](https://marketplace.visualstudio.com/items?itemName=emmanuelbeziat.vscode-great-icons)
- [Live Share](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare)
- [Ruby](https://marketplace.visualstudio.com/items?itemName=shopify.ruby-lsp)
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [Paste and Indent](https://marketplace.visualstudio.com/items?itemName=Rubymaniac.vscode-paste-and-indent)
- [SQLite](https://marketplace.visualstudio.com/items?itemName=alexcvzz.vscode-sqlite)
### Fonctionnalités IA de VS Code
VS Code inclut de nombreuses **fonctionnalités d'IA** puissantes, qui sont un excellent outil une fois que vous savez déjà coder.
Cela dit, s'appuyer sur l'IA trop tôt peut masquer des concepts importants et rendre le débogage plus difficile à comprendre. Une fois à l'aise avec les fondamentaux, vous saurez quand et comment utiliser l'IA efficacement — sans lui laisser faire la réflexion à votre place.
Pour le début du bootcamp, nous allons désactiver ces fonctionnalités. Au bon moment du cours, nous les réactiverons afin que vous puissiez les utiliser à bon escient.
Dans **VS Code** :
1. Ouvrez la "Palette de commandes" de VS Code : tapez `Ctrl-Shift-P` (Windows / Linux) ou `Cmd-Shift-P` (macOS).
1. La Palette de commandes s'ouvrira : une petite zone de texte en haut de l'écran. Commencez à taper `aifeatures` jusqu'à voir "Chat: Learn How to Hide AI features". Cliquez dessus.

1. Cela ouvrira les paramètres et affichera l'option "Disable and hide built-in AI features ...". Cochez la case devant cette option.

Plus tard, si vous souhaitez **réactiver** les fonctionnalités d'IA, vous pouvez suivre les mêmes instructions pour décocher la case.
### Configuration de Live Share
[Visual Studio Live Share](https://visualstudio.microsoft.com/services/live-share/) est une extension de VS Code, qui te permet de partager du code dans ton éditeur de texte pour débugger et faire de la programmation en binôme. Configurons-le !
Lance VS Code depuis ton terminal en saisissant `code` et en appuyant sur `Enter`.
Clique sur la petite flèche en bas de la barre de gauche :point_down:

- Clique sur le bouton « Partager », puis sur « GitHub (connecte-toi avec ton compte GitHub) ».
- Une popup t’invitant à te connecter avec GitHub apparaît. Clique sur « Autoriser ».
- Tu arriveras alors sur une page GitHub dans ton navigateur, où on te demandera d’autoriser Visual Studio Code ; clique sur « Continuer », puis « Autoriser GitHub ».
- Il se peut que VS Code affiche d’autres popups ; ferme-les en cliquant sur « OK ».
C’est bon !
## Outils en ligne de commande
### Vérifier la locale
Le concept de "locale" permet de personnaliser les programms en fonction de ta langue et ton pays.
Vérifions que la locale est bien en **anglais** dans le terminal :
```bash
locale
```
Si la commande ne renvoie pas quelque chose qui contient `LANG=en_US.UTF-8`, lance ceci dans un terminal Ubuntu :
```bash
sudo locale-gen en_US.UTF-8
```
Si après, tu reçois un avertissement (`bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf-8)`) dans ton terminal, veuillez faire ce qui suit :
Générer la localisation
Veuillez exécuter ces lignes dans ton terminal.
```bash
sudo update-locale LANG=en_US.UTF8
sudo apt-get update
sudo apt-get install language-pack-en language-pack-en-base manpages
```
### Zsh & Git
Au lieu d’utiliser le [shell](https://fr.wikipedia.org/wiki/Interface_syst%C3%A8me) `bash` par défaut, nous utiliserons `zsh`.
Nous utiliserons aussi [`git`](https://git-scm.com/), un logiciel en ligne de commande utilisé pour la gestion de versions.
Installons-les, avec d'autres outils utiles :
- Ouvre un terminal
- Copie-colle les commandes suivantes :
```bash
sudo apt update
```
```bash
sudo apt install -y curl git imagemagick jq unzip vim zsh
```
Ces commandes te demanderont ton mot de passe ; saisis-le.
:warning: Lorsque tu saisiras ton mot de passe, rien ne s’affichera à l’écran ; **c’est normal**. Il s’agit d’une mesure de sécurité permettant de masquer ton mot de passe et sa longueur. Saisis simplement ton mot de passe, puis appuie sur `Enter`.
### Installation de GitHub CLI
On va maintenant installer la [CLI officielle de GitHub](https://cli.github.com) (Command Line Interface, interface en ligne de commande). Il s’agit d’un logiciel qui te permet d’interagir avec ton compte GitHub via la ligne de commande.
Copie-colle les commandes suivantes dans ton terminal et saisis ton mot de passe s’il t’est demandé :
```bash
sudo apt remove -y gitsome # gh command can conflict with gitsome if already installed
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install -y gh
```
Pour vérifier que `gh` a bien été installé sur ta machine, tu peux exécuter :
```bash
gh --version
```
:heavy_check_mark: Si tu vois apparaître `gh version X.Y.Z (YYYY-MM-DD)`, c’est bon :+1:
:x: Sinon, **demande au la prof**.
## Oh-my-zsh
On va maintenant installer le plug-in `zsh` [Oh My Zsh](https://ohmyz.sh/).
Exécute la commande suivante dans un terminal :
```bash
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```
Si tu vois apparaître la question « Do you want to change your default shell to zsh? ? », appuie sur `Y`
À la fin, ton terminal devrait ressembler à ceci :

:heavy_check_mark: Si c’est le cas, tu peux continuer :+1:
:x: Sinon, **demande au prof**
## GitHub CLI
CLI est l’acronyme de [Command-line Interface](https://en.wikipedia.org/wiki/Command-line_interface), interface en ligne de commande.
Dans cette section, tu vas installer [GitHub CLI](https://cli.github.com/) pour interagir avec GitHub directement depuis le terminal.
Nous allons utiliser GitHub CLI (`gh`) pour nous connecter à GitHub en utilisant *SSH*, un protocole pour s'authentifier en utilisant des clés SSH au lieu de la fameuse paire nom d'utilisateur et mot de passe.
Elle doit déjà être installée sur ton ordinateur grâce aux commandes précédentes.
Pour **te connecter**, commence par copier-coller la commande suivante dans ton terminal :
:warning: **NE modifie PAS `email`**
```bash
gh auth login -s 'user:email' -w --git-protocol ssh
```
`gh` va te poser quelques questions :
- `Generate a new SSH key to add to your GitHub account?` Appuie sur `Enter` pour demander à gh de générer les clés SSH pour toi.
Si tu as déjà des clés SSH, tu verras à la place `Upload your SSH public key to your GitHub account?` Avec les flèches, sélectionne le chemain de ta clé publique et appuie sur `Enter`.
- `Enter a passphrase for your new SSH key (Optional)`. Saisis un mot de passe dont tu te souviendras. Ce mot de passe sert à protéger ta clé privée enregistrée sur ton disque sur. Ensuite, appuie sur `Enter`.
- `Title for your SSH key`. Tu peux laisser ce qui est proposé par défaut, à savoir "GitHub CLI", appuie sur `Enter`.
Tu obtiendras le résultat suivant :
```bash
! First copy your one-time code: 0EF9-D015
- Press Enter to open github.com in your browser...
```
Sélectionne et copie le code (`0EF9-D015` dans l’exemple), puis appuie sur `Enter`.
Ton navigateur s’ouvrira et te demandera d’autoriser GitHub CLI à utiliser ton compte GitHub. Accepte et patiente un instant.
Reviens au terminal, appuie à nouveau sur `Enter` et voilà.
Pour vérifier que tu es bien connecté, saisis :
```bash
gh auth status
```
:heavy_check_mark: Si tu vois apparaître `Logged in to github.com as `, alors c’est bon :+1:
:x: Sinon, **demande au prof**.
## Dotfiles (configuration standard)
Les hackers adorent perfectionner leur shell et leurs outils.
On va commencer avec une super configuration par défaut fournie par Le Wagon : [`lewagon/dotfiles`](https://github.com/lewagon/dotfiles).
Ta configuration est personnelle ; tu as donc besoin de ton **propre** dépôt de code (repository) pour la sauvegarder. Tu vas donc faire un fork, c’est-à-dire une copie, du dépôt Le Wagon.
Faire un fork consiste à créer un nouveau dépôt dans ton compte GitHub personnel `$GITHUB_USERNAME/dotfiles`, identique au dépôt Le Wagon d’origine et que tu pourras modifier librement.
Ouvre ton terminal et exécute les commandes suivantes :
```bash
export GITHUB_USERNAME=`gh api user | jq -r '.login'`
echo $GITHUB_USERNAME
```
:heavy\_check\_mark: Tu devrais voir apparaître ton nom d’utilisateur GitHub.
:x: Si ce n’est pas le cas, **arrête-toi ici** et demande de l’aide. Il se peut que tu aies rencontré un problème à l’étape précédente (`gh auth`).
Il est temps de faire un fork du dépôt et de le cloner sur ton ordinateur :
```bash
mkdir -p ~/code/$GITHUB_USERNAME && cd $_
gh repo fork lewagon/dotfiles --clone
```
### Programme d'installation des Dotfiles
Exécute le programme d’installation `dotfiles` :
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles
zsh install.sh
```
Vérifie les adresses e-mail associées à ton compte GitHub. Tu devras en choisir une à l’étape suivante :
```bash
gh api user/emails | jq -r '.[].email'
```
:heavy_check_mark: Si tu vois la liste de tes adresses e-mail enregistrées, tu peux continuer :+1:
:x: Sinon, [reconnecte-toi à GitHub](https://github.com/lewagon/setup/blob/master/ubuntu.fr.md#github-cli) avant d'exécuter cette commande à nouveau :point_up:.
### Programme d'installation git
Exécute le programme d’installation de `git` :
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh
```
:point_up: On te **demandera** de fournir ton nom (`FirstName LastName`) et ton adresse e-mail.
:warning: Tu **dois** saisir l’une des adresses e-mail indiquées ci-dessus avec la commande `gh api ...` précédente. Sinon, Kitt ne pourra pas suivre tes progrès. 💡 Sélectionnez l'adresse `@users.noreply.github.com` si vous ne souhaitez pas que votre adresse e-mail apparaisse dans les dépôts publics auxquels vous pourriez contribuer.
**Réinitialise** ton terminal en exécutant :
```bash
exec zsh
```
## Désactiver l’invite de phrase secrète SSH
Tu veux éviter d’avoir à fournir ta phrase secrète chaque fois que tu communiques avec un dépôt de code distant. Pour cela, tu as besoin d’ajouter le plug-in `ssh-agent` à `oh my zsh` :
Commence par ouvrir le fichier `.zshrc` :
```bash
code ~/.zshrc
```
Puis :
- Localise la ligne commençant par `plugins=`
- Ajoute `ssh-agent` à la fin de la liste des plug-ins
La liste doit ressembler à ça :
```bash
plugins=(gitfast last-working-dir common-aliases zsh-syntax-highlighting history-substring-search pyenv ssh-agent)
```
:heavy_check_mark: Enregistre le fichier `.zshrc` à l’aide des touches `Ctrl` + `S` et ferme ton éditeur de texte.
## rbenv
On va maintenant installer [`rbenv`](https://github.com/sstephenson/rbenv), un logiciel qui permet d’installer et de gérer des environnements `ruby`.
Pour commencer, tu dois nettoyer toute installation antérieure éventuelle de Ruby :
```bash
rvm implode && sudo rm -rf ~/.rvm
# If you got "zsh: command not found: rvm", carry on.
# It means `rvm` is not on your computer, that's what we want!
rm -rf ~/.rbenv
```
Puis dans le terminal, exécute :
```bash
sudo apt install -y build-essential tklib zlib1g-dev libssl-dev libffi-dev libxml2 libxml2-dev libxslt1-dev libreadline-dev libyaml-dev
```
```bash
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
```
```bash
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
exec zsh
```
## Ruby
### Installation
Tu peux maintenant installer la dernière version de [ruby](https://www.ruby-lang.org/en/) et en faire la version par défaut.
Exécute cette commande ; cela **peut prendre un moment (5-10 minutes)**
```bash
rbenv install 3.3.5
```
Une fois que l’installation de Ruby est terminée, exécute cette commande pour indiquer au système
d’utiliser la version 3.3.5 par défaut.
```bash
rbenv global 3.3.5
```
**Réinitialise** ton ton terminal et vérifie ta version de Ruby :
```bash
exec zsh
```
Puis exécute :
```bash
ruby -v
```
:heavy_check_mark: Si tu vois apparaître un message commençant par `ruby 3.3.5`, tu peux continuer :+1:
:x: Sinon, **demande au prof**
### Installer des gems
Si tu es en Chine 🇨🇳 clique ici
:warning: Si tu es en Chine, mets à jour la procédure d’installation des gems avec les commandes suivantes.
```bash
# En Chine seulement !
gem sources --remove https://rubygems.org/
gem sources -a https://gems.ruby-china.com/
gem sources -l
# *** SOURCES ACTUELLES ***
# https://gems.ruby-china.com/
# Ruby-china.com doit maintenant figurer dans la liste
```
**Que tu sois en Chine ou non**, continue ici pour installer les gems.
Dans l’environnement ruby, les bibliothèques externes sont appelées des `gems` : ce sont des bouts de code ruby, que tu peux télécharger et exécuter sur ton ordinateur. On va en installer quelques-unes.
Tout d'abord, nous allons mettre à jour `bundler`, ce qui nous permet d'installer des gemmes :
```bash
gem update bundler
```
Copie-colle la commande suivante dans ton terminal :
```bash
gem install colored faker http pry-byebug rake rails:8.1.1 rest-client rspec rubocop-performance sqlite3:2.8.1 activerecord:8.1.1 ruby-lsp
```
:heavy_check_mark: Si tu vois apparaître `xx gems installed`, c’est bon :+1:
:x: Si tu obtiens l’erreur suivante :
```bash
ERROR: While executing gem ... (TypeError)
incompatible marshal file format (can't be read)
format version 4.8 required; 60.33 given
```
Exécute la commande suivante :
```bash
rm -rf ~/.gemrc
```
Exécute à nouveau la commande pour installer les gems.
:warning: N’installe **JAMAIS** une gem avec `sudo gem install` ! Et ce même si tu tombes sur une réponse de Stack Overflow (ou du terminal) t’invitant à le faire.
## Node.js
[Node.js](https://nodejs.org/en/) est un programme d’exécution JavaScript qui permet d’exécuter du code JavaScript dans le terminal. On va l’installer avec [nvm](https://github.com/nvm-sh/nvm), un gestionnaire de versions pour Node.js.
Exécute les commandes suivantes dans ton terminal :
```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | zsh
exec zsh
```
Puis exécute la commande suivante :
```bash
nvm -v
```
Tu devrais voir apparaître une version. Sinon, demande au prof.
On va maintenant installer node :
```bash
nvm install 20.17.0
```
Une fois l’installation terminée, exécute :
```bash
node -v
```
Si tu vois apparaître `v20.17.0`, l'installation a réussi :heavy_check_mark: Tu peux alors exécuter :
```bash
nvm cache clear
```
:x: Sinon, **demande au prof**
## yarn
[`yarn`](https://yarnpkg.com/) est un gestionnaire de paquets, qui permet d’installer des bibliothèques JavaScript. Installons-le :
Exécute les commandes suivantes dans le terminal :
```bash
corepack enable
yarn set version stable
```
```bash
exec zsh
```
⚠️ Si tu rencontres des messages d'erreur, essaye d'exécuter `npm install -g corepack` puis exécute à nouveau les commandes ci-dessus.
Puis exécute la commande suivante :
```bash
yarn -v
```
:heavy_check_mark: Si tu vois apparaître une version, c’est bon :+1:
:x: Sinon, **demande au prof**
## SQLite
Dans quelques semaines, on abordera les bases de données et le SQL. [SQLite](https://sqlite.org/index.html) est un système de gestion de base de données utilisé pour exécuter des requêtes SQL sur des bases de données d'un seul fichier. Installons-le :
Dans un terminal, exécute la commande suivante :
```bash
sudo apt-get install sqlite3 libsqlite3-dev pkg-config
```
Puis exécute celle-ci :
```bash
sqlite3 -version
```
:heavy_check_mark: Si tu vois une version s'afficher, c'est tout bon :+1:
:x: If not, **demande au prof**
## PostgreSQL
Parfois, SQLite n'est pas suffisant et nous aurons besoin d'un outil plus avancé appelé [PostgreSQL](https://www.postgresql.org/), un système de gestion de base de données adapté à la production, puissant et open source.
Installons-le maintenant.
Exécute les commandes suivantes :
```bash
sudo apt install -y postgresql postgresql-contrib libpq-dev build-essential
```
```bash
sudo -u postgres psql --command "CREATE ROLE \"`whoami`\" LOGIN createdb superuser;"
```
## Vérification
On va maintenant vérifier que tu as tout installé correctement.
Dans ton terminal, exécute la commande suivante :
```bash
exec zsh
```
Puis exécute :
```bash
curl -Ls https://raw.githubusercontent.com/lewagon/setup/master/check.rb > _.rb && ruby _.rb && rm _.rb || rm _.rb
```
:heavy_check_mark: Si tu vois apparaître en vert `Awesome! Your computer is now ready!`, c’est bon :+1:
:x: Sinon, **demande au prof**.
## Kitt
:warning: Si tu as reçu un e-mail du Wagon t’invitant à t’inscrire sur Kitt (notre plateforme pédagogique), tu peux passer cette étape. Suis plutôt les instructions contenues dans l’e-mail que tu as reçu, si tu ne l’as pas déjà fait.
Si tu n’es pas certain de ce que tu dois faire, suis [ce lien](https://kitt.lewagon.com/). Si tu es déjà connecté, tu peux passer cette section. Si tu n’es pas connecté, clique sur `Enter Kitt as a Student`. Si tu réussis à te connecter, tu peux passer cette étape. Sinon, demande au prof si tu aurais dû recevoir un e-mail ou si tu dois suivre les instructions ci-dessous.
Inscris-toi en tant qu’alumni du Wagon sur [kitt.lewagon.com/onboarding](http://kitt.lewagon.com/onboarding). Sélectionne ton batch, connecte-toi avec GitHub et renseigne toutes tes informations.
Le prof vérifiera ensuite avec toi que tu fais bien partie de ce batch. Tu peux lui demander de vérifier dès que tu as fini de remplir le formulaire d’inscription.
Une fois que le prof a vérifié ton profil, consulte ta messagerie. Tu devrais avoir reçu 2 e-mails :
- un de Slack, t’invitant à rejoindre la communauté Slack des anciens étudiants du Wagon (où tu pourras discuter avec tes amis et tous les anciens élèves). Clique sur **Devenir membre** et renseigne toutes les informations ;
- un de GitHub, t’invitant à rejoindre l’équipe `lewagon`. **Accepte** pour accéder aux cours.
## Slack
[Slack](https://slack.com/) est une plateforme de communication assez populaire dans le secteur de la technologie.
### Installation
[Télécharge l’application Slack](https://slack.com/intl/fr-fr/help/articles/212924728-T%C3%A9l%C3%A9charger-Slack-pour-Linux--version-b%C3%AAta-) et installe-la.
:warning: Si tu utilises déjà Slack dans ton navigateur, télécharge et installe **l'application de bureau**, qui comprend toutes les fonctionnalités.
### Paramètres
Lance l’application et connecte-toi à l’organisation `lewagon-alumni`.
Pense à **télécharger une photo de profil** :point_down:

L’idée est de laisser Slack ouvert toute la journée pour partager des liens utiles / demander de l’aide / décider où aller manger, etc.
On va vérifier que tout fonctionne correctement ; pour cela, on va tester ta caméra et ton microphone :
- Ouvre l’application Slack
- Clique sur ta photo de profil en haut à droite
- Clique sur `Preferences` depuis le menu
- Séléctionne `Audio & video` dans la colonne de gauche
- En dessous de `Troubleshooting`, clique sur `Run an audio, video and screensharing test`. Le test va s’ouvrir dans une nouvelle fenêtre
- Vérifie que ton microphone, caméra, et enceintes soient bien séléctionnés, puis clique sur `Start test`

:heavy_check_mark: Une fois le test terminé, tu devrais voir apparaître des messages de succès en vert, au moins pour ton microphone et ta caméra. :+1:
:x: Sinon, **demande au prof**.
Tu peux également installer l’application Slack sur ton téléphone et te connecter à `lewagon-alumni` !
## Paramètres Ubuntu
### Installer le codec vidéo H264
Sur notre plateforme pédagogique (Kitt, que tu découvriras bientôt), on propose des vidéos. Par défaut, Firefox sur Linux ne peut pas les lire, car elles utilisent un codec qui n’est pas pris en charge (H264). Pour pouvoir lire ces vidéos, tu dois exécuter la commande suivante :
```bash
sudo apt install libavcodec-extra -y
```
### Installer des outils de terminal utiles
`tree` est un outil pratique qui permet de visualiser une arborescence de dossiers à l’intérieur du terminal.
`ncdu` est un utilitaire de disque à interface texte.
`htop` est un visualiseur de processus interactif.
`tig` est une interface en mode texte pour `git`.
```bash
sudo apt install tree ncdu htop tig
```
### inotify Ubuntu
Ubuntu surveille toutes les modifications apportées à tes dossiers ; pour cela, il utilise inotify.
Par défaut, la limite Ubuntu est fixée à 8 192 fichiers surveillés.
La programmation implique de travailler avec un grand nombre de fichiers ; on doit donc relever cette limite.
Dans ton terminal, exécute :
```bash
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
```
### Épingler des applications à ton Dock
Tu utiliseras très souvent la plupart des applications que tu as installées aujourd’hui. Épingle-les pour y accéder en un seul clic !
Pour épingler une application à ton Dock, lance l’application, fais un clic droit sur l’icône dans le Dock pour faire apparaître le menu contextuel et choisis « Ajouter aux favoris ».

Tu dois épingler :
- ton terminal
- ton explorateur de fichiers
- VS Code
- ton navigateur Internet
- Slack
## La configuration est terminée !
Ton ordinateur est prêt pour [la formation AI Software Development du Wagon](https://www.lewagon.com/web-development-course/full-time) :muscle: :clap:
Profite du bootcamp, tu vas assurer :rocket:
================================================
FILE: ubuntu.md
================================================
# Setup instructions
You will find below the instructions to set up your computer for [Le Wagon AI Software Development course](https://www.lewagon.com/web-development-course/full-time).
Please **read them carefully and execute all commands in the following order**.
If you get stuck, don't hesitate to ask a teacher for help :raising_hand:
You can also have a look at [our cheatsheets](https://github.com/lewagon/setup/tree/master/docs) for common issue fixes and tips :heavy_check_mark:
Let's start :rocket:
## GitHub account
Have you signed up to GitHub? If not, [do it right away](https://github.com/join).
:point_right: **[Upload a picture](https://github.com/settings/profile)** and put your name correctly on your GitHub account. This is important as we'll use an internal dashboard with your avatar. Please do this **now**, before you continue with this guide.

:point_right: **[Enable Two-Factor Authentication (2FA)](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication#configuring-two-factor-authentication-using-text-messages)**. GitHub will send you text messages with a code when you try to log in. This is important for security and also will soon be required in order to contribute code on GitHub.
## Visual Studio Code
### Installation
Let's install [Visual Studio Code](https://code.visualstudio.com) text editor.
Copy (`Ctrl` + `C`) the commands below then paste them in your terminal (`Ctrl` + `Shift` + `v`):
```bash
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
```
```bash
sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
```
```bash
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
```
```bash
rm -f packages.microsoft.gpg
```
```bash
sudo apt update
```
```bash
sudo apt install -y code
```
These commands will ask for your password: type it in.
:warning: When you type your password, nothing will show up on the screen, **that's normal**. This is a security feature to mask not only your password as a whole but also its length. Just type in your password and when you're done, press `Enter`.
### Launching from the terminal
Now let's launch VS Code from **the terminal**:
```bash
code
```
:heavy_check_mark: If a VS Code window has just opened, you're good to go :+1:
:x: Otherwise, please **contact a teacher**
## VS Code Extensions
### Installation
Let's install some useful extensions to VS Code.
Copy-paste the following commands in your terminal:
```bash
code --install-extension ms-vscode.sublime-keybindings
code --install-extension emmanuelbeziat.vscode-great-icons
code --install-extension github.github-vscode-theme
code --install-extension MS-vsliveshare.vsliveshare
code --install-extension shopify.ruby-lsp
code --install-extension dbaeumer.vscode-eslint
code --install-extension Rubymaniac.vscode-paste-and-indent
code --install-extension alexcvzz.vscode-sqlite
code --install-extension anteprimorac.html-end-tag-labels
code --install-extension rayhanw.erb-helpers
```
Here is a list of the extensions you are installing:
- [Sublime Text Keymap and Settings Importer](https://marketplace.visualstudio.com/items?itemName=ms-vscode.sublime-keybindings)
- [VSCode Great Icons](https://marketplace.visualstudio.com/items?itemName=emmanuelbeziat.vscode-great-icons)
- [Live Share](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare)
- [Ruby](https://marketplace.visualstudio.com/items?itemName=shopify.ruby-lsp)
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [Paste and Indent](https://marketplace.visualstudio.com/items?itemName=Rubymaniac.vscode-paste-and-indent)
- [SQLite](https://marketplace.visualstudio.com/items?itemName=alexcvzz.vscode-sqlite)
### VS Code AI Features
VS Code includes many powerful **AI features**, which are a great tool once you already know how to code.
That said, relying on AI too early can hide important concepts and make debugging harder to understand. Once you’re comfortable with the fundamentals, you’ll know when and how to use AI effectively — without letting it do the thinking for you.
For the start of the bootcamp, we’ll disable these features. At the right point in the course, we’ll reenable them so you can put them to good use.
In **VS Code**:
1. Let's open the VS Code "Command **P**alette": type `Ctrl-Shift-P` (Windows / Linux) or `Cmd-Shift-P` (macOS).
1. This will open the Command Palette: a small text box at the top of your screen. Start typing `aifeatures` until you see "Chat: Learn How to Hide AI features". Click on it.

1. This will open the settings, and will show you the option "Disable and hide built-in AI features ...". Tick the checkbox in front of that option.

Later, if you want **to reenable** the AI features, you can follow the same instructions to untick the checkbox.
### Live Share configuration
[Visual Studio Live Share](https://visualstudio.microsoft.com/services/live-share/) is a VS Code extension which allows you to share the code in your text editor for debugging and pair-programming: let's set it up!
Launch VS Code from your terminal by typing `code` and pressing `Enter`.
Click on the little arrow at the bottom of the left bar :point_down:

- Click on the "Share" button, then on "GitHub (Sign in using GitHub account)".
- A popup appears asking you to sign in with GitHub: click on "Allow".
- You are redirected to a GitHub page in you browser asking you to authorize Visual Studio Code: click on "Continue" then "Authorize github".
- VS Code may display additional pop-ups: close them by clicking "OK".
That's it, you're good to go!
## Command line tools
### Check the locale
The locale is a mechanism allowing to customize programs to your language and country.
Let's verify that the default locale is set to English, please type this in the Ubuntu terminal:
```bash
locale
```
If the output does not contain `LANG=en_US.UTF-8`, run the following command in a Ubuntu terminal to install the english locale:
```bash
sudo locale-gen en_US.UTF-8
```
If after, you receive a warning (`bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf-8)`) in your terminal, please do the following:
Generate locale
Please, run this lines in your terminal.
```bash
sudo update-locale LANG=en_US.UTF8
sudo apt-get update
sudo apt-get install language-pack-en language-pack-en-base manpages
```
### Zsh & Git
Instead of using the default `bash` [shell](https://en.wikipedia.org/wiki/Shell_(computing)), we will use `zsh`.
We will also use [`git`](https://git-scm.com/), a command line software used for version control.
Let's install them, along with other useful tools:
- Open an **Ubuntu terminal**
- Copy and paste the following commands:
```bash
sudo apt update
```
```bash
sudo apt install -y curl git imagemagick jq unzip vim zsh tree
```
These commands will ask for your password: type it in.
:warning: When you type your password, nothing will show up on the screen, **that's normal**. This is a security feature to mask not only your password as a whole but also its length. Just type in your password and when you're done, press `Enter`.
### GitHub CLI installation
Let's now install [GitHub official CLI](https://cli.github.com) (Command Line Interface). It's a software used to interact with your GitHub account via the command line.
In your terminal, copy-paste the following commands and type in your password if asked:
```bash
sudo apt remove -y gitsome # gh command can conflict with gitsome if already installed
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
```
```bash
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
```
```bash
sudo apt update
```
```bash
sudo apt install -y gh
```
To check that `gh` has been successfully installed on your machine, you can run:
```bash
gh --version
```
:heavy_check_mark: If you see `gh version X.Y.Z (YYYY-MM-DD)`, you're good to go :+1:
:x: Otherwise, please **contact a teacher**
## Oh-my-zsh
Let's install the `zsh` plugin [Oh My Zsh](https://ohmyz.sh/).
In a terminal execute the following command:
```bash
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```
If asked "Do you want to change your default shell to zsh?", press `Y`
At the end your terminal should look like this:

:heavy_check_mark: If it does, you can continue :+1:
:x: Otherwise, please **ask for a teacher**
## GitHub CLI
CLI is the acronym of [Command-line Interface](https://en.wikipedia.org/wiki/Command-line_interface).
In this section, we will use [GitHub CLI](https://cli.github.com/) to interact with GitHub directly from the terminal.
It should already be installed on your computer from the previous commands.
We will use the GitHub CLI (`gh`) to connect to GitHub using *SSH*, a protocol to log in using SSH keys instead of the well known username/password pair.
First in order to **login**, copy-paste the following command in your terminal:
:warning: **DO NOT edit the `email`**
```bash
gh auth login -s 'user:email' -w --git-protocol ssh
```
`gh` will ask you few questions:
- `Generate a new SSH key to add to your GitHub account?` Press `Enter` to ask gh to generate the SSH keys for you.
If you already have SSH keys, you will see instead `Upload your SSH public key to your GitHub account?` With the arrows, select your public key file path and press `Enter`.
- `Enter a passphrase for your new SSH key (Optional)`. Type something you want and that you'll remember. It's a password to protect your private key stored on your hard drive. Then press `Enter`.
- `Title for your SSH key`. You can leave it at the proposed "GitHub CLI", press `Enter`.
You will then get the following output:
```bash
! First copy your one-time code: 0EF9-D015
- Press Enter to open github.com in your browser...
```
Select and copy the code (`0EF9-D015` in the example), then press `Enter`.
Your browser will open and ask you to authorize GitHub CLI to use your GitHub account. Accept and wait a bit.
Come back to the terminal, press `Enter` again, and that's it.
To check that you are properly connected, type:
```bash
gh auth status
```
:heavy_check_mark: If you get `Logged in to github.com as `, then all good :+1:
:x: If not, **contact a teacher**.
## Dotfiles (Standard configuration)
Hackers love to refine and polish their shell and tools.
We'll start with a great default configuration provided by Le Wagon: [`lewagon/dotfiles`](https://github.com/lewagon/dotfiles).
As your configuration is personal, you need your **own** repository storing it. So you will **fork** Le Wagon repository.
Forking means that you will create a new repo in your own GitHub account `$GITHUB_USERNAME/dotfiles`, identical to the original Le Wagon one that you will be able to modify at will.
Open your terminal and set a variable for your GitHub username:
```bash
export GITHUB_USERNAME=`gh api user | jq -r '.login'`
```
```bash
echo $GITHUB_USERNAME
```
:heavy_check_mark: You should see your GitHub username printed.
:x: If not, **stop here** and ask for help. There may be a problem with the previous step (`gh auth`).
:warning: Please note that this variable is only set for the time your terminal is open. If you close it before or during the next steps, you need to set it again with the two steps above!
Time to fork the repo and clone it on your computer:
```bash
mkdir -p ~/code/$GITHUB_USERNAME && cd $_
```
```bash
gh repo fork lewagon/dotfiles --clone
```
### Dotfiles installer
Run the `dotfiles` installer:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles
```
```bash
zsh install.sh
```
Check the emails registered with your GitHub Account. You'll need to pick one at the next step:
```bash
gh api user/emails | jq -r '.[].email'
```
:heavy_check_mark: If you see the list of your registered emails, you can proceed :+1:
:x: If not, please [reauthenticate to GitHub](https://github.com/lewagon/setup/blob/master/ubuntu.md#github-cli) before running this command :point_up: again.
### git installer
Run the `git` installer:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh
```
:point_up: This will **prompt** you for your name (`FirstName LastName`) and your email.
:warning: You **need** to put one of the emails listed above thanks to the previous `gh api ...` command. If you don't do that, Kitt won't be able to track your progress. 💡 Select the `@users.noreply.github.com` address if you don't want your email to appear in public repositories you may contribute to.
Please now **reset** your terminal by running:
```bash
exec zsh
```
## Disable SSH passphrase prompt
You don't want to be asked for your passphrase every time you communicate with a distant repository. So, you need to add the plugin `ssh-agent` to `oh my zsh`:
First, open the `.zshrc` file:
```bash
code ~/.zshrc
```
Then:
- Spot the line starting with `plugins=`
- Add `ssh-agent` at the end of the plugins list
:heavy_check_mark: Save the `.zshrc` file with `Ctrl` + `S` and close your text editor.
## rbenv
Let's install [`rbenv`](https://github.com/sstephenson/rbenv), a software to install and manage `ruby` environments.
First, we need to clean up any previous Ruby installation you might have:
```bash
rvm implode && sudo rm -rf ~/.rvm
# If you got "zsh: command not found: rvm", carry on.
# It means `rvm` is not on your computer, that's what we want!
rm -rf ~/.rbenv
```
Then in the terminal, run:
```bash
sudo apt install -y build-essential tklib zlib1g-dev libssl-dev libffi-dev libxml2 libxml2-dev libxslt1-dev libreadline-dev libyaml-dev
```
```bash
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
```
```bash
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
```
```bash
exec zsh
```
## Ruby
### Installation
Now, you are ready to install the latest [ruby](https://www.ruby-lang.org/en/) version and set it as the default version.
Run this command, it will **take a while (5-10 minutes)**
```bash
rbenv install 3.3.5
```
Once the ruby installation is done, run this command to tell the system
to use the 3.3.5 version by default.
```bash
rbenv global 3.3.5
```
**Reset** your terminal and check your Ruby version:
```bash
exec zsh
```
Then run:
```bash
ruby -v
```
:heavy_check_mark: If you see something starting with `ruby 3.3.5` then you can proceed :+1:
:x: If not, **ask a teacher**
### Installing some gems
If you are in China 🇨🇳 click here
:warning: If you are in China, you should update the way we'll install gem with the following commands.
```bash
# China only!
gem sources --remove https://rubygems.org/
gem sources -a https://gems.ruby-china.com/
gem sources -l
# *** CURRENT SOURCES ***
# https://gems.ruby-china.com/
# Ruby-china.com must be in the list now
```
**Everyone, in China or not**, continue here to install gems.
In the ruby world, we call external libraries `gems`: they are pieces of ruby code that you can download and execute on your computer. Let's install some!
First, we'll update `bundler`, which is what lets us install gems:
```bash
gem update bundler
```
In your terminal, copy-paste the following command:
```bash
gem install colored faker http pry-byebug rake rails:8.1.1 rest-client rspec rubocop-performance sqlite3:2.8.1 activerecord:8.1.1 ruby-lsp
```
:heavy_check_mark: If you get `xx gems installed`, then all good :+1:
:x: If you encounter the following error:
```bash
ERROR: While executing gem ... (TypeError)
incompatible marshal file format (can't be read)
format version 4.8 required; 60.33 given
```
Run the following command:
```bash
rm -rf ~/.gemrc
```
Rerun the command to install the gems.
:warning: **NEVER** install a gem with `sudo gem install`! Even if you stumble upon a Stackoverflow answer (or the terminal) telling you to do so.
## Node.js
[Node.js](https://nodejs.org/en/) is a JavaScript runtime to execute JavaScript code in the terminal. Let's install it with [nvm](https://github.com/nvm-sh/nvm), a version manager for Node.js.
In a terminal, execute the following commands:
```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | zsh
```
```bash
exec zsh
```
Then run the following command:
```bash
nvm -v
```
You should see a version. If not, ask a teacher.
Now let's install node:
```bash
nvm install 20.17.0
```
When the installation is finished, run:
```bash
node -v
```
If you see `v20.17.0`, the installation succeeded :heavy_check_mark: You can then run:
```bash
nvm cache clear
```
:x: If not, **contact a teacher**
## yarn
[`yarn`](https://yarnpkg.com/) is a package manager to install JavaScript libraries. Let's install it:
In a terminal, run the following commands:
```bash
corepack enable
yarn set version stable
```
⚠️ If you see any error messages, try running `npm install -g corepack` and then run the commands above again.
```bash
exec zsh
```
Then run the following command:
```bash
yarn -v
```
:heavy_check_mark: If you see a version, you're good :+1:
:x: If not, **ask for a teacher**
## SQLite
In a few weeks, we'll talk about databases and SQL. [SQLite](https://sqlite.org/index.html) is a database engine used to execute SQL queries on single-file databases. Let's install it:
In a terminal, execute the following commands:
```bash
sudo apt-get install sqlite3 libsqlite3-dev pkg-config
```
Then run the following command:
```bash
sqlite3 -version
```
:heavy_check_mark: If you see a version, you're good :+1:
:x: If not, **ask for a teacher**
## PostgreSQL
Sometimes, SQLite is not enough and we will need a more advanced tool called [PostgreSQL](https://www.postgresql.org/), an open-source robust and production-ready database system.
Let's install it now.
Run the following commands:
```bash
sudo apt install -y postgresql postgresql-contrib libpq-dev build-essential
```
```bash
sudo -u postgres psql --command "CREATE ROLE \"`whoami`\" LOGIN createdb superuser;"
```
## Check-up
Let's check if you successfully installed everything.
In you terminal, run the following command:
```bash
exec zsh
```
Then run:
```bash
curl -Ls https://raw.githubusercontent.com/lewagon/setup/master/check.rb > _.rb && ruby _.rb && rm _.rb || rm _.rb
```
:heavy_check_mark: If you get a green `Awesome! Your computer is now ready!`, then you're good :+1:
:x: If not, **contact a teacher**.
## Kitt
You should have received an email from Le Wagon inviting you to sign up on [Kitt](https://kitt.lewagon.com) (our learning platform). When submitting your onboarding form on Kitt, you should have received two additional invitations:
- One from Slack, inviting you to the Le Wagon Alumni slack community (where you'll chat with your buddies and all the previous alumni). Click on **Join** and fill the information.
- One from GitHub, inviting you to `lewagon` team. **Accept it** otherwise you won't be able to access the lecture slides.
If you haven't, please contact your teaching team.
## Slack
[Slack](https://slack.com/) is a communication platform pretty popular in the tech industry.
### Installation
[Download the Slack app](https://get.slack.help/hc/en-us/articles/212924728-Slack-for-Linux-beta-) and install it.
:warning: If you are already using Slack in your browser, please download and install **the desktop app** which is fully featured.
### Settings
Launch the app and sign in to `lewagon-alumni` organization.
Make sure you **upload a profile picture** :point_down:

The idea is that you'll have Slack open all day, so that you can share useful links / ask for help / decide where to go to lunch / etc.
To ensure that everything is working fine for video calls, let's test your camera and microphone:
- Open the Slack app
- Click your profile picture in the top right.
- Select `Preferences` from the menu.
- Click `Audio & video` in the left-side column.
- Below `Troubleshooting`, click `Run an audio, video and screensharing test`. The test will open in a new window.
- Check that your preferred speaker, microphone and camera devices appear in the drop-down menus, then click `Start test`.

:heavy_check_mark: When the test is finished, you should see green "Succeed" messages at least for your microphone and camera. :+1:
:x: If not, **contact a teacher**.
You can also install Slack app on your phone and sign in `lewagon-alumni`!
## Ubuntu settings
### Install video codec H264
On our pedagogical platform (Kitt, you'll soon discover it!), we have some videos. By default Firefox on Linux cannot play them as they use an unsupported codec (H264). To get those videos working for you, you need to run this:
```bash
sudo apt install libavcodec-extra -y
```
### Install useful terminal tools
`tree` is a nice tool to visualize a directory tree inside the terminal:
`ncdu` is a text-based interface disk utility.
`htop` is an interactive process viewer.
`tig` is a text-mode interface for `git`.
```bash
sudo apt install tree ncdu htop tig
```
### Ubuntu inotify
Ubuntu is always tracking changes in your folders and to do this it uses inotify.
By default the Ubuntu limit is set to 8192 files monitored.
As programming involves a lot of files, we need to raise this limit.
In your terminal run:
```bash
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
```
### Pin apps to your dock
You are going to use most of the apps you've installed today really often. So let's pin them to your dock so that they are just one click away!
To pin an app to your dock, launch the app, right-click on the icon in the dock to bring up the context menu and choose "Add to Favorites".

You must pin:
- Your terminal
- Your file explorer
- VS Code
- Your Internet browser
- Slack
## Setup completed!
Your computer is now all set for [Le Wagon AI Software Development course](https://www.lewagon.com/web-development-course/full-time) :muscle: :clap:
Enjoy the bootcamp, you will nail it :rocket:
================================================
FILE: ubuntu.pt.md
================================================
# Instruções de configuração
Você encontrará abaixo as instruções para configurar seu computador para o [curso de AI Software Development Le Wagon](https://www.lewagon.com/web-development-course/full-time).
Por favor **leia-os com atenção e execute todos os comandos na seguinte ordem**.
Se você tiver dúvidas, não hesite em pedir ajuda a um professor :raising_hand:
Você também pode dar uma olhada em [nossas cheatsheets](https://github.com/lewagon/setup/tree/master/docs) para soluções e dicas de problemas comuns :heavy_check_mark:
Vamos começar :rocket:
## Conta GitHub
Você se inscreveu no GitHub? Caso contrário, [faça isso imediatamente](https://github.com/join).
:point_right: **[Carregue uma imagem](https://github.com/settings/profile)** e coloque seu nome corretamente em sua conta GitHub. Isso é importante porque usaremos um painel interno com seu avatar. Faça isso **agora**, antes de continuar com este guia.

:point_right: [Ative a Autenticação em Duas Etapas (2FA)](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication#configuring-two-factor-authentication-using-text-messages). O GitHub enviará mensagens de texto com um código quando você tentar fazer login. Isso é importante para a segurança e em breve será necessário para contribuir com código no GitHub.
## Visual Studio Code
### Instalação
Vamos instalar o editor de texto [Visual Studio Code](https://code.visualstudio.com).
Copie (`Ctrl` + `C`) os comandos abaixo e cole-os em seu terminal (`Ctrl` + `Shift` + `v`):
```bash
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
```
```bash
sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
```
```bash
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
```
```bash
rm -f packages.microsoft.gpg
```
```bash
sudo apt update
```
```bash
sudo apt install -y code
```
Esses comandos solicitarão sua senha: digite-a.
:warning: Quando você digita sua senha, nada aparecerá na tela, **isso é normal**. Este é um recurso de segurança para mascarar não apenas sua senha como um todo, mas também seu comprimento. Basta digitar sua senha e quando terminar, pressione `Enter`.
### Iniciando a partir do terminal
Agora vamos iniciar o VS Code no **terminal**:
```bash
code
```
:heavy_check_mark: Se uma janela do VS Code acabou de abrir, você está pronto: +1:
:x: Caso contrário, por favor **entre em contato com um professor**
## Extensões do VS Code
### Instalação
Vamos instalar algumas extensões úteis no VS Code.
Copie e cole os seguintes comandos em seu terminal:
```bash
code --install-extension ms-vscode.sublime-keybindings
code --install-extension emmanuelbeziat.vscode-great-icons
code --install-extension github.github-vscode-theme
code --install-extension MS-vsliveshare.vsliveshare
code --install-extension shopify.ruby-lsp
code --install-extension dbaeumer.vscode-eslint
code --install-extension Rubymaniac.vscode-paste-and-indent
code --install-extension alexcvzz.vscode-sqlite
code --install-extension anteprimorac.html-end-tag-labels
code --install-extension marcoroth.herb-lsp
code --install-extension rayhanw.erb-helpers
```
Aqui está uma lista das extensões que você está instalando:
- [Sublime Text Keymap and Settings Importer](https://marketplace.visualstudio.com/items?itemName=ms-vscode.sublime-keybindings)
- [VSCode Great Icons](https://marketplace.visualstudio.com/items?itemName=emmanuelbeziat.vscode-great-icons)
- [Live Share](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare)
- [Ruby](https://marketplace.visualstudio.com/items?itemName=shopify.ruby-lsp)
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [Paste and Indent](https://marketplace.visualstudio.com/items?itemName=Rubymaniac.vscode-paste-and-indent)
- [SQLite](https://marketplace.visualstudio.com/items?itemName=alexcvzz.vscode-sqlite)
### Recursos de IA no VS Code
O VS Code inclui muitos **recursos poderosos de IA**, que são ótimas ferramentas quando você já sabe programar.
Dito isso, confiar na IA muito cedo pode ocultar conceitos importantes e dificultar o entendimento da depuração. Quando você estiver confortável com os fundamentos, saberá quando e como usar a IA de forma eficaz — sem deixar que ela faça o raciocínio por você.
Para o início do bootcamp, vamos desativar esses recursos. No momento certo do curso, os reativaremos para que você possa usá-los bem.
Em **VS Code**:
1. Vamos abrir a "Paleta de Comandos" do VS Code: digite `Ctrl-Shift-P` (Windows / Linux) ou `Cmd-Shift-P` (macOS).
1. Isso abrirá a Paleta de Comandos: uma pequena caixa de texto no topo da tela. Comece a digitar `aifeatures` até ver "Chat: Learn How to Hide AI features". Clique nela.

1. Isso abrirá as configurações e mostrará a opção "Disable and hide built-in AI features ...". Marque a caixa de seleção à frente dessa opção.

Mais tarde, se quiser **reativar** os recursos de IA, você pode seguir as mesmas instruções para desmarcar a caixa.
### Configuração do Live Share
[Visual Studio Live Share](https://visualstudio.microsoft.com/services/live-share/) é uma extensão do VS Code que permite compartilhar o código em seu editor de texto para depuração e programação em pares: vamos configurá-lo acima!
Inicie o VS Code em seu terminal digitando `code` e pressionando `Enter`.
Clique na pequena seta na parte inferior da barra esquerda :point_down:

- Clique no botão "Compartilhar" e depois em "GitHub (faça login usando a conta GitHub)".
- Um pop-up aparece solicitando que você faça login no GitHub: clique em “Permitir”.
- Você é redirecionado para uma página do GitHub em seu navegador solicitando autorização do Visual Studio Code: clique em "Continuar" e depois em "Autorizar github".
- O VS Code pode exibir pop-ups adicionais: feche-os clicando em "OK".
É isso, você está pronto para continuar!
## Ferramentas de linha de comando
### Verifique a localidade
A localidade é um mecanismo que permite personalizar programas de acordo com seu idioma e país.
Vamos verificar se a localidade padrão está definida como inglês, digite isto no terminal do Ubuntu:
```bash
locale
```
Se a saída não contiver `LANG=en_US.UTF-8`, execute o seguinte comando em um terminal Ubuntu para instalar a localidade em inglês:
```bash
sudo locale-gen en_US.UTF-8
```
Se, depois, receberes um aviso (`bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf-8)`) no teu terminal, por favor faz o seguinte:
Gerar localidade
Por favor, executa estas linhas no teu terminal.
```bash
sudo update-locale LANG=en_US.UTF8
sudo apt-get update
sudo apt-get install language-pack-en language-pack-en-base manpages
```
### Zsh e Git
Em vez de usar o `bash` [shell](https://en.wikipedia.org/wiki/Shell_(computing)), usaremos `zsh`.
Também usaremos [`git`](https://git-scm.com/), um software de linha de comando usado para controle de versão.
Vamos instalá-los, juntamente com outras ferramentas úteis:
- Abra um **terminal Ubuntu**
- Copie e cole os seguintes comandos:
```bash
sudo apt update
```
```bash
sudo apt install -y curl git imagemagick jq unzip vim zsh tree
```
Esses comandos solicitarão sua senha: digite-a.
:warning: Quando você digita sua senha, nada aparecerá na tela, **isso é normal**. Este é um recurso de segurança para mascarar não apenas sua senha como um todo, mas também seu comprimento. Basta digitar sua senha e quando terminar, pressione `Enter`.
### Instalação da CLI do GitHub
Vamos agora instalar a [CLI oficial do GitHub](https://cli.github.com) (interface de linha de comando). É um software usado para interagir com sua conta GitHub através da linha de comando.
Em seu terminal, copie e cole os seguintes comandos e digite sua senha, se solicitado:
```bash
sudo apt remove -y gitsome # gh command can conflict with gitsome if already installed
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
```
```bash
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
```
```bash
sudo apt update
```
```bash
sudo apt install -y gh
```
Para verificar se `gh` foi instalado com sucesso em sua máquina, você pode executar:
```bash
gh --version
```
:heavy_check_mark: Se você vir `gh versão X.Y.Z (AAAA-MM-DD)`, está pronto para prosseguir :+1:
:x: Caso contrário, por favor **entre em contato com um professor**
## Oh-My-Zsh
Vamos instalar o plugin `zsh` [Oh My Zsh](https://ohmyz.sh/).
Em um terminal execute o seguinte comando:
```bash
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```
Se for perguntado "Deseja alterar seu shell padrão para zsh?", pressione `Y`
No final seu terminal deverá ficar assim:

:heavy_check_mark: Se isso acontecer, você pode continuar :+1:
:x: Caso contrário, por favor **entre em contato com um professor**
## CLI do GitHub
CLI é o acrônimo de [Interface de linha de comando](https://en.wikipedia.org/wiki/Command-line_interface).
Nesta seção, usaremos [GitHub CLI](https://cli.github.com/) para interagir com o GitHub diretamente do terminal.
Usaremos o GitHub CLI (`gh`) para conectar ao GitHub usando *SSH*, um protocolo para fazer login usando chaves SSH em vez do conhecido par nome de usuário/senha.
Ele já deve estar instalado no seu computador a partir dos comandos anteriores.
Primeiro, para **fazer login**, copie e cole o seguinte comando em seu terminal:
:warning: **NÃO edite o `email`**
```bash
gh auth login -s 'user:email' -w --git-protocol ssh
```
`gh` fará algumas perguntas:
- `Generate a new SSH key to add to your GitHub account?` Pressione `Enter` para pedir ao gh para gerar as chaves SSH para você.
Se você já possui chaves SSH, verá `Upload your SSH public key to your GitHub account?` Com as setas, selecione o caminho do arquivo de sua chave pública e pressione `Enter`.
- `Enter a passphrase for your new SSH key (Optional)`. Digite algo que você deseja e que você lembrará. É uma senha para proteger sua chave privada armazenada no disco rígido. Em seguida, pressione `Enter`.
- `Title for your SSH key`. Você pode deixá-lo no "GitHub CLI" proposto, pressione `Enter`.
Você obterá então a seguinte saída:
```bash
! First copy your one-time code: 0EF9-D015
- Press Enter to open github.com in your browser...
```
Selecione e copie o código (`0EF9-D015` no exemplo) e pressione `Enter`.
Seu navegador será aberto e solicitará que você autorize o GitHub CLI a usar sua conta GitHub. Aceite e espere um pouco.
Volte ao terminal, pressione `Enter` novamente e pronto.
Para verificar se você está conectado corretamente, digite:
```bash
gh auth status
```
:heavy_check_mark: Se você estiver `Logado no github.com como `, então tudo bem :+1:
:x: Caso contrário, **entre em contato com um professor**.
## Dotfiles (configuração padrão)
Os hackers adoram refinar e aprimorar sua estrutura e ferramentas.
Começaremos com uma ótima configuração padrão fornecida pelo Le Wagon: [`lewagon/dotfiles`](https://github.com/lewagon/dotfiles).
Como sua configuração é pessoal, você precisa de seu próprio repositório para armazená-la. Então você irá fazer o **fork** do repositório Le Wagon.
Bifurcar significa que você criará um novo repositório em sua própria conta GitHub `$GITHUB_USERNAME/dotfiles`, idêntico ao original do Le Wagon que você poderá modificar à vontade.
Abra seu terminal e defina uma variável para seu nome de usuário GitHub:
```bash
export GITHUB_USERNAME=`gh api user | jq -r '.login'`
```
```bash
echo $GITHUB_USERNAME
```
:heavy_check_mark: Você deverá ver seu nome de usuário do GitHub impresso.
:x: Se não, **pare aqui** e peça ajuda. Pode haver um problema com a etapa anterior (`gh auth`).
:warning: Por favor note que esta variável só é definida para o tempo em que seu terminal está aberto. Se você fechá-lo antes ou durante as próximas etapas, será necessário configurá-lo novamente com as duas etapas acima!
É hora de fazer um fork do repositório e cloná-lo em seu computador:
```bash
mkdir -p ~/code/$GITHUB_USERNAME && cd $_
```
```bash
gh repo fork lewagon/dotfiles --clone
```
### Instalador do Dotfiles
Execute o instalador `dotfiles`:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles
```
```bash
zsh install.sh
```
Verifique os e-mails registrados em sua conta GitHub. Você precisará escolher um na próxima etapa:
```bash
gh api user/emails | jq -r '.[].email'
```
:heavy_check_mark: Se você vir a lista de seus e-mails registrados, você pode prosseguir :+1:
:x: Caso contrário, [reautentique no GitHub](https://github.com/lewagon/setup/blob/master/ubuntu.pt.md#github-cli) antes de executar este comando :point_up: novamente.
### Instalador git
Execute o instalador `git`:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh
```
:point_up: Isso **solicitará** seu nome (`Nome Sobrenome`) e seu e-mail. O email que você escolher será exibido **publicamente** na internet. 💡 Selecione o endereço `@users.noreply.github.com` se você não deseja que seu e-mail apareça em repositórios públicos aos quais você possa contribuir.
:warning: Você **precisa** colocar um dos e-mails listados acima graças ao comando anterior `gh api ...`. Se você não fizer isso, Kitt não conseguirá acompanhar seu progresso.
Agora **reinicie** seu terminal executando:
```bash
exec zsh
```
## Desativar prompt de senha SSH
Você não quer que sua senha seja solicitada sempre que se comunicar com um repositório distante. Então, você precisa adicionar o plugin `ssh-agent` ao `oh my zsh`:
Primeiro, abra o arquivo `.zshrc`:
```bash
code ~/.zshrc
```
Então:
- Identifique a linha que começa com `plugins=`
- Adicione `ssh-agent` no final da lista de plugins
:heavy_check_mark: Salve o arquivo `.zshrc` com `Ctrl` + `S` e feche seu editor de texto.
## rbenv
Vamos instalar o [`rbenv`](https://github.com/sstephenson/rbenv), um software para instalar e gerenciar ambientes `ruby`.
Primeiro, precisamos limpar qualquer instalação anterior do Ruby que você possa ter:
```bash
rvm implode && sudo rm -rf ~/.rvm
# Se você obteve "zsh: comando não encontrado: rvm", continue.
# Significa que `rvm` não está no seu computador, é isso que queremos!
rm -rf ~/.rbenv
```
Então no terminal, execute:
```bash
sudo apt install -y build-essential tklib zlib1g-dev libssl-dev libffi-dev libxml2 libxml2-dev libxslt1-dev libreadline-dev libyaml-dev
```
```bash
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
```
```bash
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
```
```bash
exec zsh
```
## Ruby
### Instalação
Agora, você está pronto para instalar a versão mais recente do [ruby](https://www.ruby-lang.org/en/) e defini-la como a versão padrão.
Execute este comando, **demorará um pouco (5 a 10 minutos)**
```bash
rbenv install 3.3.5
```
Assim que a instalação do Ruby estiver concluída, execute este comando para informar ao sistema
para usar a versão 3.3.5 por padrão.
```bash
rbenv global 3.3.5
```
**Reinicialize** seu terminal e verifique sua versão do Ruby:
```bash
exec zsh
```
Então corra:
```bash
ruby -v
```
:heavy_check_mark: Se você vir algo começando com `ruby 3.3.5` então você pode prosseguir :+1:
:x: Se não, **pergunte a um professor**
### Instalando algumas gems
Se você estiver na China 🇨🇳 clique aqui
:warning: Se você estiver na China, você deve atualizar a forma como instalaremos o gem com os seguintes comandos.
```bash
# Somente China!
fontes de gemas --remove https://rubygems.org/
fontes de gemas -a https://gems.ruby-china.com/
fontes de gemas -l
#***FONTES ATUAIS***
# https://gems.ruby-china.com/
# Ruby-china.com deve estar na lista agora
```
**Todos, na China ou não**, continuem aqui para instalar gems.
No mundo Ruby, chamamos bibliotecas externas de `gems`: são pedaços de código Ruby que você pode baixar e executar em seu computador. Vamos instalar alguns!
No seu terminal, copie e cole o seguinte comando:
```bash
gem install colored faker http pry-byebug rake rails:8.1.1 rest-client rspec rubocop-performance sqlite3:2.8.1 activerecord:8.1.1 ruby-lsp
```
:heavy_check_mark: Se você tiver `xx gems installed`, então tudo bem :+1:
:x: Se você encontrar o seguinte erro:
```bash
ERROR: While executing gem ... (TypeError)
incompatible marshal file format (can't be read)
format version 4.8 required; 60.33 given
```
Execute o seguinte comando:
```bash
rm -rf ~/.gemrc
```
Execute novamente o comando para instalar as gemas.
:warning: **NUNCA** instale uma gem com `sudo gem install`! Mesmo se você encontrar uma resposta do Stackoverflow (ou o terminal) solicitando que você faça isso.
## Node.js
[Node.js](https://nodejs.org/en/) é um tempo de execução JavaScript para executar código JavaScript no terminal. Vamos instalá-lo com [nvm](https://github.com/nvm-sh/nvm), um gerenciador de versões para Node.js.
Em um terminal, execute os seguintes comandos:
```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | zsh
```
```bash
exec zsh
```
Em seguida, execute o seguinte comando:
```bash
nvm -v
```
Você deverá ver uma versão. Se não, pergunte a um professor.
Agora vamos instalar o Node.js:
```bash
nvm install 20.17.0
```
Quando a instalação terminar, execute:
```bash
node -v
```
Se você vir `v20.17.0`, a instalação foi bem-sucedida :heavy_check_mark: Você pode então executar:
```bash
nvm cache clear
```
:x: Caso contrário, **entre em contato com um professor**
## Yarn
[`yarn`](https://yarnpkg.com/) é um gerenciador de pacotes para instalar bibliotecas JavaScript. Vamos instalá-lo:
Em um terminal, execute os seguintes comandos:
```bash
corepack enable
yarn set version stable
```
```bash
exec zsh
```
⚠️ Se vires quaisquer mensagens de erro, tenta executar `npm install -g corepack` e, em seguida, volta a executar os comandos acima.
Em seguida, execute o seguinte comando:
```bash
yarn -v
```
:heavy_check_mark: Se você vir uma versão, você está bem :+1:
:x: Se não, **entre em contato com um professor**
## SQLite
Em algumas semanas falaremos sobre bancos de dados e SQL. [SQLite](https://sqlite.org/index.html) é um mecanismo de banco de dados usado para executar consultas SQL em bancos de dados de arquivo único. Vamos instalá-lo:
Em um terminal, execute os seguintes comandos:
```bash
sudo apt-get install sqlite3 libsqlite3-dev pkg-config
```
Em seguida, execute o seguinte comando:
```bash
sqlite3 -version
```
:heavy_check_mark: Se você vir uma versão, você está bem :+1:
:x: Se não, **peça um professor**
## PostgreSQL
Às vezes, o SQLite não é suficiente e precisaremos de uma ferramenta mais avançada chamada [PostgreSQL](https://www.postgresql.org/), um sistema de banco de dados de código aberto, robusto e pronto para produção.
Vamos instalá-lo agora.
Execute os seguintes comandos:
```bash
sudo apt install -y postgresql postgresql-contrib libpq-dev build-essential
```
```bash
sudo -u postgres psql --command "CREATE ROLE \"`whoami`\" LOGIN createdb superuser;"
```
## Checagem
Vamos verificar se você instalou tudo com sucesso.
No seu terminal, execute o seguinte comando:
```bash
exec zsh
```
Então corra:
```bash
curl -Ls https://raw.githubusercontent.com/lewagon/setup/master/check.rb > _.rb && ruby _.rb && rm _.rb || rm _.rb
```
:heavy_check_mark: Se você receber uma mensagem verde `Awesome! Your computer is now ready!`, então você está bem :+1:
:x: Caso contrário, **entre em contato com um professor**.
## Kitt
:warning: Se você recebeu um e-mail do Le Wagon convidando você a se inscrever no Kitt (nossa plataforma de aprendizagem), você pode pular esta etapa com segurança. Em vez disso, siga as instruções no e-mail que você recebeu, caso ainda não tenha feito isso.
Se não tiver certeza sobre o que fazer, siga [este link](https://kitt.lewagon.com/). Se você já estiver logado, pode pular esta seção com segurança. Se você não estiver logado, clique em `Enter Kitt as a Student`. Se você conseguir fazer login, poderá pular esta etapa com segurança. Caso contrário, pergunte a um professor se você deveria ter recebido um e-mail ou siga as instruções abaixo.
Registre-se como Alumni da Le Wagon acessando [kitt.lewagon.com/onboarding](http://kitt.lewagon.com/onboarding). Selecione seu batch, faça login no GitHub e insira todas as suas informações.
Seu professor irá então validar que você realmente faz parte do batch. Você pode pedir que eles façam isso assim que preencher o formulário de registro.
Assim que o professor aprovar seu perfil, acesse sua caixa de entrada de e-mail. Você deve ter 2 e-mails:
- Um do Slack, convidando você para a comunidade Le Wagon Alumni do Slack (onde você conversará com seus amigos e todos os ex-alunos anteriores). Clique em **Inscreva-se** e preencha os dados.
- Um do GitHub, convidando você para a equipe `lewagon`. **Aceite** caso contrário você não conseguirá acessar os slides da aula.
## Slack
[Slack](https://slack.com/) é uma plataforma de comunicação bastante popular na indústria de tecnologia.
### Instalação
[Baixe o aplicativo Slack](https://get.slack.help/hc/en-us/articles/212924728-Slack-for-Linux-beta-) e instale-o.
:warning: Se você já usa o Slack em seu navegador, baixe e instale **o aplicativo para desktop** que vem com todos os recursos.
### Configurações
Inicie o aplicativo e faça login na organização `lewagon-alumni`.
Certifique-se de **fazer upload de uma foto de perfil** :point_down:

A ideia é que você tenha o Slack aberto o dia todo, para que você possa compartilhar links úteis/pedir ajuda/decidir onde ir almoçar/etc.
Para garantir que tudo está funcionando bem nas videochamadas, vamos testar sua câmera e microfone:
- Abra o aplicativo Slack
- Clique na foto do seu perfil no canto superior direito.
- Selecione `Preferências` no menu.
- Clique em `Áudio e vídeo` na coluna do lado esquerdo.
- Abaixo de `Solução de problemas`, clique em `Executar um teste de áudio, vídeo e compartilhamento de tela`. O teste será aberto em uma nova janela.
- Verifique se seus dispositivos preferidos de alto-falante, microfone e câmera aparecem nos menus suspensos e clique em `Iniciar teste`.

:heavy_check_mark: Quando o teste terminar, você deverá ver mensagens verdes de "Sucesso" pelo menos para seu microfone e câmera. :+1:
:x: Caso contrário, **entre em contato com um professor**.
Você também pode instalar o aplicativo Slack no seu telefone e entrar em `lewagon-alumni`!
## Configurações do Ubuntu
### Instale o codec de vídeo H264
Na nossa plataforma pedagógica (Kitt, você vai descobrir em breve!), temos alguns vídeos. Por padrão, o Firefox no Linux não pode reproduzi-los porque eles usam um codec não suportado (H264). Para que esses vídeos funcionem para você, você precisa executar o seguinte:
```bash
sudo apt install libavcodec-extra -y
```
### Instale ferramentas de terminal úteis
`tree` é uma boa ferramenta para visualizar uma árvore de diretórios dentro do terminal:
`ncdu` é um utilitário de disco de interface baseado em texto.
`htop` é um visualizador de processos interativo.
`tig` é uma interface em modo texto para `git`.
```bash
sudo apt install tree ncdu htop tig
```
### Ubuntu inotify
O Ubuntu está sempre rastreando alterações em suas pastas e para isso usa o inotify.
Por padrão, o limite do Ubuntu é definido para 8.192 arquivos monitorados.
Como a programação envolve muitos arquivos, precisamos aumentar esse limite.
Em seu terminal, execute:
```bash
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
```
### Fixe aplicativos no seu dock
Você usará a maioria dos aplicativos que instalou hoje com muita frequência. Então, vamos fixá-los no seu dock para que fiquem a apenas um clique de distância!
Para fixar um aplicativo no seu dock, inicie o aplicativo, clique com o botão direito no ícone do dock para abrir o menu de contexto e escolha "Adicionar aos Favoritos".

Você deve fixar:
- Seu terminal
- Seu explorador de arquivos
- VS Code
- Seu navegador de Internet
- Slack
## Configuração concluída!
Seu computador agora está pronto para o [curso de AI Software Development Le Wagon](https://www.lewagon.com/web-development-course/full-time) :muscle: :clap:
Aproveite o bootcamp, você vai acertar :rocket:
================================================
FILE: utils/macos_list_processor_type.sh
================================================
#!/bin/bash
# the goal of this script is to tell Mac students whether their late 2020 machine
# uses an Intel or Apple Silicon chip
# this script is aimed at running on macOS only
# ⚠️ the output of this script will not make sense if ran on a Windows or Linux machine
arch_name="$(uname -m)"
if [ "${arch_name}" = "x86_64" ]; then
if [ "$(sysctl -in sysctl.proc_translated)" = "1" ]; then
echo "Your computer uses Apple Silicon (Rosetta) 🌟"
else
echo "Your computer has an Intel processor 🤖"
fi
elif [ "${arch_name}" = "arm64" ]; then
echo "Your computer uses Apple Silicon 🌟"
else
echo "Unknown architecture: ${arch_name}, call a TA 🤔"
fi
================================================
FILE: utils/turn_off_fast_startup.bat
================================================
@echo off
:: Created by: Shawn Brink
:: http://www.eightforums.com
:: Tutorial: http://www.eightforums.com/tutorials/6320-fast-startup-turn-off-windows-8-a.html
:: To turn off Fast Startup
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Power" /V HiberbootEnabled /T REG_dWORD /D 0 /F
================================================
FILE: windows.cn.md
================================================
# 电脑设置教程
以下的教程将会帮助你为接下来在[Le Wagon AI Software Development course](https://www.lewagon.com/web-development-course/full-time)全栈开发训练营中做好准备:
请**仔细阅读并按顺序执行指令**。如果你在哪一步卡住了,不用犹豫,可以举手咨询老师:raising_hand:
让我们开始吧 :rocket:
## GitHub账户
你有注册好GitHub账户嘛?如果还没有,[现在注册](https://github.com/join)。
:point_right: **[上传一张照片](https://github.com/settings/profile)** 并在你的GitHub账户中设置你的名称。这一步很重要,因为我们将使用一个带有你头像的内部dashboard。请**现在**立即做这一步,然后再去继续下面的步骤。

**[启用双因素认证(2FA)](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication#configuring-two-factor-authentication-using-text-messages)**。当您尝试登录时,GitHub将向您发送带有代码的短信。这对于安全性很重要,也很快将成为贡献GitHub上的代码的必要条件。
## 开始设置的条件
在开始之前,很重要的一件事是先看看你的电脑设置有没有满足这些条件!这样才能保证配置成功。请花点时间仔细阅读所有的文字。如果有问题,不要犹豫向老师提问哦。
### Windows 10 或者 Windows 11
你的电脑必须是 **Windows 10 或者 Windows 11**才可以开始配置。
检查windows版本的方式:
- 按下 `Windows` + `R`
- 输入 `winver`
- 按下 `Enter`
:heavy_check_mark: 如果窗口里的前几个词就是**Windows 10 或者 Windows 11**的话,你可以直接到下一步了!:+1:
:x: 如果你的电脑没有提示**Windows 10 或者 Windows 11**,那你现在就需要更新到Windows 10:point_down:
更新到Windows 10
- 从[Microsoft](https://www.microsoft.com/software-download/windows10ISO)下载Windows 10
- 下载后就可以安装它。应该会花掉差不多1小时的时间,这取决于你的电脑。
- 安装结束后,运行上面的命令:point_up:来检查你有没有**Windows 10**。
:information_source: [Windows 11更新正在滚动](https://www.microsoft.com/en-us/windows/get-windows-11),意思就是有些电脑可能还不能更新到11。
:warning: **如果Windows 10已经装好了,你不需要更新到11来继续配置**。
### 最近的更新
确认好你的电脑是Windows 10或者11之后,你就可以安装最近的更新了。
打开Windows更新:
- 按下 `Windows` + `R`
- 输入 `ms-settings:windowsupdate`
- 按下 `Enter`
- 点击 `检查更新`(`Check updates`)
:heavy_check_mark: 如果你看到一个绿色的勾勾,然后还有一条“You're up to date(已经是最新版本)”的信息,那你就可以继续下一步了:+1:
:warning: 如果你看到一个红色的感叹号,然后还有一条“Update available(有可更新版本)”,那就请安装它,然后重复以上步骤直到电脑提示你所有的东西都是最新版本:loop:
:x: 如果出现关于无法更新的错误提示,**叫老师**来看看。
启用Windows Update Service(Windows更新服务)来修复更新
有些软件可能会禁用我们想用的更新服务。所以更新的时候你的电脑就会报错。可以这样修复它!(如果你的电脑系统语言是中文,你可以找到下面英文按键的对应中文按键。如果找不到,可以问问老师!)
- 按下 `Windows` + `R`
- 输入 `services.msc`
- 按下 `Enter`
- 双击 `Windows Update Service`
- 把它从 `Startup` 改成 `Automatic`
- 点击 `Start`
- 点击 `Ok`
现在,我们再来试试更新吧!
### 最低版本需求
有些我们需要的工具已经在Windows 10的`1903`或**之后**的版本中发布了。所以请保证你最少要这个版本!
- 按下 `Windows` + `R`
- 输入 `winver`
- 按下 `Enter`
检查**版本号**:
:heavy_check_mark: 如果你是`1903`或以上的版本, 你就可以继续下一步了:+1:
:x: 如果低于`1903`, 请**问老师**。
### 虚拟化
我们需要保证你电脑的虚拟化选项是激活的。
对于大多数电脑来说,这个选项已经被激活了。不过还是检查一下吧:
- 按下 `Windows` + `R`
- 输入 `taskmgr`
- 按下 `Enter`
>
>
- 点击 `Performance`
- 点击 `CPU`

:x: 如果这一行没有出现,或者显示禁用了,请**让老师来帮你激活虚拟化**。
:heavy_check_mark: 如果被激活了的话,那在图表下方会显示状态 "Virtualization: Enabled"。
---
#### :wrench: 可能的解决方案
激活虚拟化
要激活它,我们需要访问电脑的 BIOS / UEFI。
- 按下 `Windows + R`
- 输入 `shutdown.exe /r /o /t 1`
- 按下 `Enter`
>
>
- 等待电脑关机
>
>
- 点击 `Troubleshoot`
- 点击 `Advanced Options`
- 点击 `UEFI Firmware Settings`
- 点击 `Restart`
在这儿,你需要激活你处理器的虚拟化选项:
- 大多数时候,在高级设置里面,CPU设置,或者北桥(Northbridge)设置里面
- 电脑不一样,选项的名称可能也不一样:
- 因特尔(Intel): `Intel VT-x`, `Intel Virtualization Technology`, `Virtualization Extensions`, `Vanderpool`...
- AMD: `SVM Mode` 或者 `AMD-V`
- 在激活后请保存,然后重启电脑
---
## Windows的Linux子系统
WSL是一个用来运行Ubuntu的开发环境。你可以在[这儿](https://docs.microsoft.com/en-us/windows/wsl/faq)了解更多关于WSL的信息。
:information_source: 接下来的步骤是要看你的Windows系统版本的。请执行你对应系统版本的步骤哦:point_down:
### Windows 11
如果你是Windows 11,我们就在Windows终端用一个命令来安装WSL 2和Ubuntu。
:warning: 在下面的步骤中,请使用 `Ctrl` + `Shift` + `Enter`来用管理员权限执行**Windows终端**,而不是只点击 `Ok`或者敲击`Enter`。
- 按下 `Windows` + `R`
- 输入 `powershell`
- 按下 **`Ctrl` + `Shift` + `Enter`**
:warning: 在这一步,你可能需要确认UAC权限升级。
一个蓝色的终端窗口会出现:
- 复制下面的命令(`Ctrl` + `C`)
- 单击右键把它们复制到PowerShell窗口(`Ctrl` + `V` 不能再这里使用)
- 按下`Enter`执行这些命令
```powershell
wsl --install
```
:heavy_check_mark: 如果这个命令执行好后没有任何错误,那就重启电脑然后继续下面步骤:+1:
:x: 如果你看到了错误信息(或者你在窗口里看到红色的字),请**叫老师来帮忙**。
### Windows 10
#### 安装WSL 1
如果你是Windows 10,你首先要用PowerShell终端来安装WSL 1。
:warning: 在下面的步骤中,请使用 `Ctrl` + `Shift` + `Enter`来用管理员权限执行**Windows终端**,而不是只点击 `Ok`或者敲击`Enter`。
- 按下 `Windows` + `R`
- 输入 `powershell`
- 按下 **`Ctrl` + `Shift` + `Enter`**
:warning: 在这一步,你可能需要确认UAC权限升级。
一个蓝色的终端窗口会出现:
- 复制下面的命令(`Ctrl` + `C`)
- 单击右键把它们复制到PowerShell窗口(`Ctrl` + `V` 不能再这里使用)
- 按下`Enter`执行这些命令
```powershell
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
```
```powershell
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
```
```powershell
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
```
:heavy_check_mark: 如果这个命令执行好后没有任何错误,那就重启电脑然后继续下面步骤:+1:
:x: 如果你看到了错误信息(或者你在窗口里看到红色的字),请**叫老师来帮忙**。
#### 升级到WSL 2
如果你是Windows 10,你需要把WSL升级到2。
等你的电脑重启好,你就可以下载WSL2安装包。
- 打开[下载页面](https://aka.ms/wsl2kernel)
- 下载安装包"WSL2 Linux kernel update package"
- 点击`Next`(下一步)
- 点击`Finish`(完成)

:heavy_check_mark: 如果没有错误提示的话,那你现在就可以使用WSL 2了!
:x: 如果出现了这个错误:`This update only applies to machines with the Windows Subsystem for Linux`, 那就在软件上**右击**,然后选择`uninstall`(卸载); 然后你再安装一次,这次应该可以正常地安装。
#### 把WSL 2设置成Windows默认的Linux子系统
如果你用的是Windows 10的话,我们就需要把WSL默认版本设成2。
现在WSL 2已经安装好了,那就把它设置成默认的WSL吧:
- 按下 `Windows` + `R`
- 输入 `cmd`
- 按下 `Enter`
在弹出的窗口里面,输入:
```bash
wsl --set-default-version 2
```
:heavy_check_mark: 如果你看到“The operation completed successfully(成功完成设置)”,那你就可以关掉这个终端,然后继续跟着下面的指示:+1:
:x: 如果出现了关于虚拟化的信息,请**叫老师来帮忙**。
激活Windows虚拟机平台功能
完成[这些](https://www.configserverfirewall.com/windows-10/please-enable-the-virtual-machine-platform-windows-feature-and-ensure-virtualization-is-enabled-in-the-bios/#:~:text=To%20enable%20WSL%202,%20Open,Windows%20feature%20on%20or%20off.&text=Ensure%20that%20the%20Virtual%20Machine,Windows%20will%20enable%20WSL%202)步骤,然后确保最后你激活了虚拟机平台和Windows的Linux子系统。
激活Windows的Hyper-V功能
完成[这些](https://winaero.com/enable-use-hyper-v-windows-10/)步骤,然后确保你激活了Hyper-V。
:information_source: 如果你的电脑是Windows 10 **Home edition**,那你的操作系统上就没有Hyper-V的功能。这不会妨碍什么,你继续下面的步骤就好:ok_hand:
## Ubuntu
### 安装
:information_source: 接下来的步骤是要看你的Windows系统版本的。请执行你的版本对应的步骤:point_down:
#### Windows 11
如果你是Windows 11,那重启你的电脑后,你就应该能看到一个终端窗口告诉你说WSL正在恢复Ubuntu的安装过程。结束后,Ubuntu就会打开。
#### Windows 10
如果你是Windows 10,那我们在Microsoft商店安装Ubuntu吧:
- 点击`Start`
- 输入`Microsoft Store`
- 点击列表中的微软的Windows商店
- 在搜索栏里搜索`Ubuntu`
- **选择没有数字的版本,就只是一个单词"Ubuntu"**
- 点击`安装`
:warning: 不要安装**Ubuntu 18.04 LTS**或者**Ubuntu 20.04**!
卸载不正确版本的Ubuntu
要卸载不正确的版本,你只需要打开Windows 10的已安装软件的列表:
- 按下`Windows` + `R`
- 输入`ms-settings:appsfeatures`
- 按下`Enter`
找到那个软件,然后点击卸载按钮。
旦安装完成了,`安装`按钮就会变成`启动`按钮:点击`启动`。
### 第一次启动
第一次启动的时候,你会需要填写一些信息:
- 选择一个**用户名**:
- 一个词
- 全小写
- 不要特殊字符
- 举个例子: `lewagon`或者你的`firstname`
- 选择一个**密码**
- 确认你的密码
:warning: 你输入密码的时候,屏幕上不会显示你在输入任何东西,**这是正常的**。这是一个安全措施,保证别人不会看到你的密码内容以及长度。所以输入完成后,敲击回车键(`Enter`)即可。
现在安装好了,你就可以关掉Ubuntu窗口了。
### 检查Ubuntu的WSL version
- 按下`Windows` + `R`
- 输入`cmd`
- 按下`Enter`
输入下面的命令:
```bash
wsl -l -v
```
:heavy_check_mark: 如果Ubuntu WSL版本是2,你就可以进入下一步了:+1:
:x: 如果Ubuntu WSL的版本是1,你需要把它换成2。
把Ubuntu WSL V1换成V2
在命令提示字元窗口,输入:
```bash
wsl --set-version Ubuntu 2
```
:heavy_check_mark: 几秒之后,你应该会收到这条转换完成的信息:`The conversion is complete`.
:x: 如果不行的话,我们就需要检查并确保Ubuntu文件没有被压缩。
检查没有被压缩的文件
- 按下`Windows` + `R`
- 输入`%localappdata%\Packages`
- 按下`Enter`
- 打开这个文件夹`CanonicalGroupLimited.UbuntuonWindows...`
- 右击`LocalState`文件夹
- 点击`Properties`(属性)
- 点击`Advanced`(高级)
- 确保`Compress content`(压缩内容)选项**没有**被选,然后点击`Ok`。
只对这个文件夹应用修改,然后再试试换Ubuntu WSL的版本。
:x: 如果转换还是不行,**叫老师来帮忙**。
你现在可以关掉这个终端窗口了。
## Visual Studio Code
在Windows上,我们会用Visual Code Studio来编辑代码,因为它和Ubuntu终端配合得很好~
想让它们一体化的话,你需要卸载其他的代码编辑器,比如SublimeText,因为它们会干扰VSCoed和WSL的一体化。
### 安装
- 打开[Visual Studio Code page](https://code.visualstudio.com/download)
- 选择Windows版本的VS Code
然后,就会开始自动下载了。
- 打开你刚下载的文件。
- 安装它的时候需要改变一下选项:
- 把VS Code注册成一个支持文件类型的编辑器
- 其他选项不用变

### 链接VS Code和Ubuntu
- 首次启动VS Code之后:
- 把它加在你的任务栏上;你会经常用到它!
- 在VS Code的右下角,应该有一个框框提示你它检测到了WSL
- 接受VS Code WSL插件的安装
:warning: 要用VS Code,这个插件必须要安装!
## Windows终端
### 安装
:information_source: 接下来的步骤是要看你的Windows系统版本的。
如果你是Windows 11,那么你的Windows终端已经装好了。直接进入下一步吧:point_down:
如果你是Windows 10,那我们来装Windows终端吧,一个真正的现代终端:
- 点击`Start`
- 输入`Microsoft Store`
- 点击列表上的``Mircosoft Store`
- 搜索`Windows Terminal`
- **选择Windows Terminal"**
- 点击`安装`
:warning: 不要安装**Windows Terminal Preview**,安装**Windows Terminal**就好了!
卸载错误版本的Windows Terminal
要下载错误版本的Windows Terminal的话,你需要去到Windows 10的已装软件列表:
- 按下`Windows` + `R`
- 输入`ms-settings:appsfeatures`
- 按下`Enter`
找到需要卸载的软件,然后点击卸载(uninstall)按钮。
当安装完成之后,`安装(Install)` 按钮就会变成`启动(Launch)`按钮:点击这个按钮吧!
### Ubuntu作为默认终端
让我们把Ubuntu变成Windows终端应用的默认终端吧!
点击`Ctrl` + `,`
它会打开设置:

- 把默认的profile改成"Ubuntu"
- 点击"Save"
- 点击"Open JSON file"
你需要改动的是被红色圈起来的部分:

首先,我们要让Ubuntu从Ubuntu主目录启动,而不是Windows的主目录:
- 找到`"name": "Ubuntu",`
- 把下面这行加在后面:
```bash
"commandline": "wsl.exe ~",
```
:warning: 别忘了这行最后有个逗号哟!
然后,我们把Windows和Ubuntu之间复制粘贴的警告禁用了吧:
- 找到`"defaultProfile": "{2c4de342-...}"`这行
- 在它后面加上这行:
```bash
"warning.multiLinePaste": false,
```
:warning: 别忘了这行最后有个逗号哟!
现在按这两个键`Ctrl` + `S`保存一下。
:heavy_check_mark: 好咯, 你的**Windows终端**就设置好了!:+1:
这个终端有标签页的功能:你可以通过点击当前标签页旁边的**+**来打开一个新的标签页。
**从现在开始,每次我们说终端的时候,就是在指这个终端。**不用使用其他的terminal了。
## VS Code 插件
### 安装
现在我们来给 VS Code 安装一些有用的插件吧。
复制粘贴下面的命令到终端:
```bash
code --install-extension ms-vscode.sublime-keybindings
code --install-extension emmanuelbeziat.vscode-great-icons
code --install-extension MS-vsliveshare.vsliveshare
code --install-extension shopify.ruby-lsp
code --install-extension dbaeumer.vscode-eslint
code --install-extension Rubymaniac.vscode-paste-and-indent
code --install-extension alexcvzz.vscode-sqlite
code --install-extension anteprimorac.html-end-tag-labels
code --install-extension marcoroth.herb-lsp
code --install-extension rayhanw.erb-helpers
```
你安装的就是下面这些插件:
- [Sublime Text Keymap and Settings Importer](https://marketplace.visualstudio.com/items?itemName=ms-vscode.sublime-keybindings)
- [VSCode Great Icons](https://marketplace.visualstudio.com/items?itemName=emmanuelbeziat.vscode-great-icons)
- [Live Share](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare)
- [Ruby](https://marketplace.visualstudio.com/items?itemName=shopify.ruby-lsp)
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [Paste and Indent](https://marketplace.visualstudio.com/items?itemName=Rubymaniac.vscode-paste-and-indent)
- [SQLite](https://marketplace.visualstudio.com/items?itemName=alexcvzz.vscode-sqlite)
### VS Code AI Features
VS Code includes many powerful **AI features**, which are a great tool once you already know how to code.
That said, relying on AI too early can hide important concepts and make debugging harder to understand. Once you’re comfortable with the fundamentals, you’ll know when and how to use AI effectively — without letting it do the thinking for you.
For the start of the bootcamp, we’ll disable these features. At the right point in the course, we’ll reenable them so you can put them to good use.
In **VS Code**:
1. Let's open the VS Code "Command **P**alette": type `Ctrl-Shift-P` (Windows / Linux) or `Cmd-Shift-P` (macOS).
1. This will open the Command Palette: a small text box at the top of your screen. Start typing `aifeatures` until you see "Chat: Learn How to Hide AI features". Click on it.

1. This will open the settings, and will show you the option "Disable and hide built-in AI features ...". Tick the checkbox in front of that option.

Later, if you want **to reenable** the AI features, you can follow the same instructions to untick the checkbox.
## Command line tools
### Zsh & Git
我们将使用`zsh`来代替默认的`bash` [shell](https://zh.wikipedia.org/zh-cn/殼層)。
我们也会使用[`git`](https://git-scm.com/),它是一个用来进行版本控制的命令行软件。
下面来安装这些工具吧:
- 打开终端
- 复制粘贴下面的命令:
```bash
sudo apt update
```
```bash
sudo apt install -y curl git imagemagick jq unzip vim zsh
```
这些指令会问你的密码:输入你的密码。
:warning: 当你输入你的密码的时候,屏幕上不会有任何的显示,**这是正常的**。这是一个安全保护的设置,来隐藏你整个密码,包括它的长度。你可以放心的输入你的密码,结束后按下`Enter`就可以了。
### 安装GitHub CLI
现在我们来安装GitHub[官方命令行界面(CLI)](https://cli.github.com) (Command Line Interface)。这是一个用来在终端里和你的GitHub账户交互的一个软件。
在你的终端里,复制粘贴以下代码,并在需要的时候,输入你的密码:
```bash
sudo apt remove -y gitsome # gh command can conflict with gitsome if already installed
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install -y gh
```
你可以运行以下的命令,来检查`gh`是否成功安装了:
```bash
gh --version
```
:heavy_check_mark: 如果你看到了`gh version X.Y.Z (YYYY-MM-DD)`,你就可以继续下一步啦!:+1:
:x: 如果没有看到话,**问问老师**。
## Oh-my-zsh
让我们一起安装`zsh`插件[Oh My Zsh](https://ohmyz.sh/).
在终端terminal里执行以下指令:
```bash
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```
如果终端里出现询问"Do you want to change your default shell to zsh?", 可以输入`Y`
在你的终端的最后,你会看到以下内容:

:heavy_check_mark: 如果你的终端成功显示了上面,你就可以继续下一步了:+1:
:x: 如果安装失败的话,请询问**你的老师**
## 把你的默认浏览器链接到Ubuntu
为了保证你可以在Ubuntu终端和浏览器进行交互,你需要设置你的默认浏览器。
⚠️ 你需要执行下面的至少一组命令:
用Google Chrome作为默认浏览器
运行下面的命令:
```bash
ls /mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe
```
如果你看到了错误信息,比如`ls: cannot access...` 那就运行下面的命令:
```bash
echo "export BROWSER=\"/mnt/c/Program Files/Google/Chrome/Application/chrome.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files/Google/Chrome/Application/chrome.exe'\"" >> ~/.zshrc
```
如果没有错误信息,就运行下面这一行:
```bash
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe'\"" >> ~/.zshrc
```
用Mozilla Firefox作为默认浏览器
运行下面的命令:
```bash
ls /mnt/c/Program\ Files\ \(x86\)/Mozilla\ Firefox/firefox.exe
```
如果你看到了错误信息,比如`ls: cannot access...` 那就运行下面的命令:
```bash
echo "export BROWSER=\"/mnt/c/Program Files/Mozilla Firefox/firefox.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files/Mozilla Firefox/firefox.exe'\"" >> ~/.zshrc
```
如果没有错误信息,就运行下面这一行:
```bash
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Mozilla Firefox/firefox.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Mozilla Firefox/firefox.exe'\"" >> ~/.zshrc
```
用Microsoft Edge作为默认浏览器
运行下面的命令:
```bash
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe'\"" >> ~/.zshrc
```
重启你的终端。
然后请保证在终端运行下面这行命令后,会返回"Browser defined 👌"这句话:
```bash
[ -z "$BROWSER" ] && echo "ERROR: please define a BROWSER environment variable ⚠️" || echo "Browser defined 👌"
```
如果没有返回这句话,那在上面的列表中选一个浏览器,然后运行对应的命令。
如果没有的话,
:heavy_check_mark: 如果你看到那条信息,你就可以继续 :+1:
:x: 如果没有,那在上面的列表中选一个浏览器,然后运行对应的命令。然后别忘记重置你的终端:
```bash
exec zsh
```
有问题的话,别犹豫**问老师**。
## GitHub CLI
CLI是[Command-line Interface(命令行界面)](https://baike.baidu.com/item/%E5%91%BD%E4%BB%A4%E8%A1%8C%E7%95%8C%E9%9D%A2/9910197?fr=aladdin)的首字母缩写。
在这一章节里面,我们会安装[GitHub CLI](https://cli.github.com/)。这样我们就可以直接在终端和Github互动。
你之前执行的命令应该已经安装了GitHub CLI。
首先你需要**登陆**。复制粘贴下面的命令到终端,敲击回车:
:warning: **不要更改下面指令中的`email`**
```bash
gh auth login -s 'user:email' -w --git-protocol ssh
```
`gh`会问你几个问题:
- `Generate a new SSH key to add to your GitHub account?(生成新的SSH密钥,然后添加到Github账号上?)` 敲击回车,让gh帮你生成。
如果你以前生成过SSH密钥,那你就会看到这个问题`Upload your SSH public key to your GitHub account?(上传公共密钥到Github账户上上吗?)` 上下移动箭头`>`,让它停在你想选的SSH公钥前面,然后敲击回车。
- `Enter a passphrase for your new SSH key (Optional)(输入新的SSH密钥的密码(非必填))`. 输入一个密码,然后写下来或者记住它。这是保护你本地私钥的密码。然后敲击回车。
- `Title for your SSH key`。你可以把它留在建议的 "GitHub CLI",按`Enter`。
然后你会看到下面的文字输出:
```bash
! First copy your one-time code: 0EF9-D015
- Press Enter to open github.com in your browser...
```
复制那段验证码(code)(在上面的例子中是`0EF9-D015` ),然后敲击`Enter`。
你的浏览器就会打开一个页面让你授权GitHub CLI使用你的GitHub账号。同意,并等待一会儿。
回到终端,再次敲击`回车`,然后就应该好啦:tada:
检查一下你有没有链接好:
```bash
gh auth status
```
如果你看到`Logged in to github.com as <你的GitHub用户名> `,那就可以了。
:x: 如果没有,**问问老师**。
## Dotfiles (标准配置)
黑客很喜欢把他们的shell和工具变得很酷炫。
让我们用Le Wagon提供的一个超棒的默认配置文件来开始吧:[`lewagon/dotfiles`](http://github.com/lewagon/dotfiles).
因为你的配置是私人的,所以你需要保存在**自己**的代码库里(repository/repo)。
Fork的意思是:在你的GitHub账号上建一个新的代码库,和原始的那一个是一模一样的(可以想象成你在复制粘贴这个代码库)。这样,你在你的GitHub上就会有一个新的代码库: `$GITHUB_USERNAME/dotfiles`。我们需要fork,因为每个人都需要在那些文件里加上一些**特定**信息(比如你的名字)。
打开终端,运行下面的命令:
```bash
export GITHUB_USERNAME=`gh api user | jq -r '.login'`
echo $GITHUB_USERNAME
```
:heavy_check_mark: 你应该能看到你的GitHub用户名在终端里显示出来了。
:x: 如果没有的话,现在就**停下**,找老师帮忙。看起来之前的步骤(`gh auth`)有一些问题。
现在就可以fork代码库(repo),然后克隆到你自己的电脑上了:
```bash
mkdir -p ~/code/$GITHUB_USERNAME && cd $_
gh repo fork lewagon/dotfiles --clone
```
### Dotfiles安装器
运行`dotfiles`安装器:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles && zsh install.sh
```
用下面的命令检查一下你GitHub账号录入的电子邮箱。你需要在其中选一个(如果你有好几个的话),然后再进入下一个步骤:
```bash
gh api user/emails | jq -r '.[].email'
```
:heavy_check_mark: 如果你看到了你的注册邮箱列表,你就可以继续下一步啦:+1:
:x: 如果没有的话,请在运行上面:point_up: 这个指令之前,[重新授权GitHub](https://github.com/lewagon/setup/blob/master/windows.cn.md#github-cli)。
### git安装器
运行git安装器:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh
```
:point_up: 这会**提示**填写你的全名(`FirstName LastName`)和你的邮箱。
:warning: 注意啦,你**需要**填`gh api ...`命令列出的其中一个电子邮箱。不然,Kitt就没办法跟进你的学习进程。 你选择的电子邮件将**公开**显示在互联网上。💡 如果您不希望您的电子邮件出现在您可能会贡献的公共存储库中,请选择 `@users.noreply.github.com` 地址。
现在运行下面的命令来**重置**你的终端:
```bash
exec zsh
```
## 禁用SSH密码输入
每次跟远程的代码库交流的时候都问你要密码是件很烦的事。所以呀,你需要给`oh my zsh`加上一个`ssh-agent`插件:
首先,打开`.zshrc`文件:
```bash
code ~/.zshrc
```
然后:
- 找到`plugins=`开始的这一行
- 在插件(plugin)列表里加上`ssh-agent`
这个列表现在看起来应该是这样的:
```
plugins=(gitfast last-working-dir common-aliases zsh-syntax-highlighting history-substring-search pyenv ssh-agent)
```
:heavy_check_mark: 按下`Ctrl` + `S` 保存`.zshrc`文件,然后关掉你的代码编辑器。
## rbenv
让我们安装[`rbenv`](https://github.com/sstephenson/rbenv),一个帮助我们安装和管理`ruby`环境的软件。
首先,我们需要清理你可能已经安装过的Ruby:
```bash
rvm implode && sudo rm -rf ~/.rvm
# If you got "zsh: command not found: rvm", carry on.
# It means `rvm` is not on your computer, that's what we want!
rm -rf ~/.rbenv
```
然后在终端里运行:
```bash
sudo apt install -y build-essential tklib zlib1g-dev libssl-dev libffi-dev libxml2 libxml2-dev libxslt1-dev libreadline-dev libyaml-dev
```
```bash
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
```
```bash
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
exec zsh
```
## Ruby
### 安装
现在,你已经准备好了去安装最新[ruby](https://www.ruby-lang.org/en/)版本并把它设置为默认版本。
运行下方这个指令,它会**花费一些时间(5-10分钟)**
```bash
rbenv install 3.3.5
```
当Ruby安装好后,运行下面这个指令来告诉系统使用3.3.5这个版本作为默认版本。
```bash
rbenv global 3.3.5
```
然后**重置**你的终端,然后检查Ruby版本:
```bash
exec zsh
ruby -v
```
:heavy_check_mark: 如果你有看到`ruby 3.3.5`,那么你可以继续下一步+1:
:x: 如果没有的话,**询问一下老师**。
### 安装一些gems
点击这里,如果你在 :cn: 中国的话
:warning: 如果你在中国的话,你应该使用以下命令来安装gem。
```bash
# China only!
gem sources --remove https://rubygems.org/
gem sources -a https://gems.ruby-china.com/
gem sources -l
# *** CURRENT SOURCES ***
# https://gems.ruby-china.com/
# Ruby-china.com must be in the list now
```
在ruby的世界里,我们将外部的库称之为`gems`:他们是一些你可以下载并在你的电脑上运行的ruby代码。让我们一起安装一些!
首先,我们将更新`bundler`,它是用于安装 gem 的工具:
```bash
gem update bundler
```
在你的终端里,复制粘贴下面的指令:
```bash
gem install colored faker http pry-byebug rake rails:8.1.1 rest-client rspec rubocop-performance sqlite3:2.8.1 activerecord:8.1.1 ruby-lsp
```
:heavy_check_mark: 如果你看到 `xx gems installed`,那么一切正常 :+1:
:x: 如果你遇到了以下的报错:
```bash
ERROR: While executing gem ... (TypeError)
incompatible marshal file format (can't be read)
format version 4.8 required; 60.33 given
```
运行以下的指令:
```bash
rm -rf ~/.gemrc
```
然后,重新运行安装gems的指令。
:warning: **永远不要**使用`sudo gem install`来安装一个gem!即使你偶然发现了一个网络上的答案(或者终端提示)叫你这么做。
## Node.js
[Node.js](https://nodejs.org/en/)是一个JavaScript运行环境以在终端运行JavaScript代码。让我们一起用[nvm](https://github.com/nvm-sh/nvm),一个Node.js的版本管理器,来安装Node.js。
在终端里,运行以下指令:
```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | zsh
```
重启你的终端并执行下方指令:
```bash
nvm -v
```
你应该会看到你的nvm的版本。如果没有的话,问一下你的老师。
现在,让我们来安装node:
```bash
nvm install 20.17.0
```
当这个指令执行结束之后,运行:
```bash
node -v
```
如果看到`v20.17.0`,那么你安装成功了:heavy_check_mark: 然后,你就可以运行下面这个命令了:
```bash
nvm cache clear
```
:x: 如果没有看到版本的话,**问一下你的老师**。
## yarn
让我们一起来安装[`yarn`](https://classic.yarnpkg.com/en/docs/install):
```bash
corepack enable
yarn set version stable
```
```bash
exec zsh
```
⚠️ 如果你看到任何错误信息,请尝试运行 `npm install -g corepack` 然后再次运行上面的命令。
重启终端并运行:
```bash
yarn -v
```
你应该会看到你yarn的版本。如果没有的话,问一下你的老师。
## SQLite
几周后,我们就会开始学习数据库和SQL. [SQLite](https://sqlite.org/index.html)是一个数据库引擎,它可以在单文件数据库上执行SQL查询。现在来安装它吧:
在终端,执行下面的命令:
```bash
sudo apt-get install sqlite3 libsqlite3-dev pkg-config
```
然后执行下面的命令:
```bash
sqlite3 -version
```
:heavy_check_mark: 如果你看到了版本号,那你就可以继续下一步了 :+1:
:x: 如果没有,**问问老师吧**!
## PostgreSQL
有的时候,SQLite功能会不够用。这个时候我们就需要使用一个更高级的工具,叫做[PostgreSQL](https://www.postgresql.org/)。这是一个开源的、强大的、生产环境可用的数据库系统。
让我们现在安装它。
运行下方指令:
```bash
sudo apt install -y postgresql postgresql-contrib libpq-dev build-essential
```
```bash
sudo /etc/init.d/postgresql start
```
```bash
sudo -u postgres psql --command "CREATE ROLE \"`whoami`\" LOGIN createdb superuser;"
```
你可以把PostgreSQL配置成自动启动,这样每次你打开新的终端时,你就不需要执行`sudo /etc/init.d/postgresql start`:
```bash
sudo echo "`whoami` ALL=NOPASSWD:/etc/init.d/postgresql start" | sudo tee /etc/sudoers.d/postgresql
```
```bash
sudo chmod 440 /etc/sudoers.d/postgresql
```
```bash
echo "sudo /etc/init.d/postgresql start" >> ~/.zshrc
```
打开一个新的终端。
:heavy_check_mark: 如果你看到一行字说`* Starting postgresql (via systemctl): postgresql.service`还是`* Starting PostgreSQL 14 database server`,那你就可以进行下一步了 :+1:
:x: 如果没有的话, **请让老师来帮助你**。
## 最后检查
让我们来看看你是否已经成功安装好了所有软件。
在终端,运行下面两行命令:
```bash
exec zsh
curl -Ls https://web-dev-challenge-lewagon-image.oss-cn-shanghai.aliyuncs.com/setup/check.rb > _.rb && ruby _.rb || rm _.rb
```
:heavy_check_mark: 如果出现了一个绿色的`Awesome! Your computer is now ready!`,那么你的工作台已经设置好了 :+1:
如果没有的话,问一下你的老师。
## Kitt
:warning: 如果你已经收到了一封来自Le Wagon邀请你去注册Kitt(我们的学习平台)的邮件并且你也注册完成了的话,你可以安全的跳过这一章节。如果你还没有注册完成的话,请跟随邮件里的教程,完成注册。
如果你不确定你要做什么,可以查看[这个链接](https://kitt.lewagon.com/)。如果你已经登录了的话,你可以跳过这个章节。如果你没有登录的话,你需要点击`Enter Kitt as a Student`。如果你可以成功的登录,你也可以安全的跳过这一步。不然的话,你可以询问一下老师你是否有收到过相关的邮件,或者直接跟着执行下面的教程。
前往[kitt.lewagon.com/onboarding](http://kitt.lewagon.com/onboarding),注册成为Le Wagon的一名校友。选择你的batch,用gitHub账户登录并填写你的信息。
你的老师将会验证你的确属于这个batch。你可以在完成了注册表单后去询问老师去做验证。
当你的老师验证成功后,请前往你的邮箱收件箱。你应该会有两封邮件:
- 一封来自Slack,邀请你加入Le Wagon Alumni Slack社群(在这儿你可以与你的伙伴和所有之前的学员交流)。点击**Join**并填写相应的个人信息。
- 一封来自GitHub,要求你加入`lewagon`团队。**接受它**,不然的话你将没有办法看到有关讲座和课程的文件。
## Slack
从[slack.com](https://slack.com/downloads/windows)上下载Slack的本地应用。
启动程序并注册进入`lewagon-alumni`的组织。
确保你在上面上传了照片。
你也可以在你的iPhone或者Android设备上登录Slack!
这么做的意义是,你可以一直开着Slack,于是你就可以分享有用的链接/寻求帮助/决定哪儿里吃饭/等等。
至于远程的ticket,你将可以用Slack语音或者视频电话来获取帮助。为了确保所有都可以正常工作,在你的电脑上启动Slack应用程序,然后[跟着这里的步骤](https://slack.com/intl/en-gb/help/articles/115003538426-Troubleshoot-Slack-Calls#run-our-calls-test)(tl;dr 输入`/call --test`然后在任何的channel里按下`Enter`键)。
等测试结束之后,你应该至少会在麦克风和相机处,看到绿色“All clear”消息。如果没有的话,问一下你的老师。

### 设置
打开Slack应用程序并登入`lewagon-alumni`组织。
确保你已经**上传了你的头像照片** :point_down:

之后你可以全天开着Slack,这样你可以在上面分享有用的链接/寻求帮助/决定去那儿吃饭/...
为了确保视频电话可以正常工作,让我们一起测试摄像头和麦克风:
- 打开Slack应用程序。
- 点击右上方的个人照片。
- 从菜单中选择 `首选项(Preferences)`。
- 点击左侧栏中的 `音频和视频(Audio & video)`。
- 在 `故障排除(Troubleshooting)`下面,点击 `运行音频、视频和屏幕共享测试(Run an audio, video and screensharing test)`。该测试将在一个新窗口中打开。
- 检查你使用的扬声器、麦克风和摄像机设备是否出现在选项中,然后点击 `开始测试(Start test)`。

:heavy_check_mark: 当测试结束以后,你应该会看到你的摄像头和麦克风有绿色的"Succeed"信息。:+1:
:x: 如果测试失败的话,**请联系你的老师**.
你也可以在手机上安装Slack应用并登入`lewagon-alumni`!
## Ubuntu文件系统
### 在Windows和Ubuntu之间交换文件
我们需要一个简单的方法在Windows和Ubuntu之间交换文件。
想这样的话,你需要建一些可以从Windows的**File Explorer**访问Ubuntu文件目录的快捷键。

你需要做下面这些步骤:
- 打开Ubuntu终端
- 打开Windows File Explorer (或者使用快捷键Win + E)
- 在地址栏,输入`\\wsl$\`(如果不行的话,就输入`\\wsl$\Ubuntu`)
- 现在你就有Ubuntu文件系统的访问权限了
- 看一下Ubuntu的文件系统,看看有哪些目录是你会想用的
- 拖拽想要的文件夹到地址栏,就可以创建快捷键了

### 从Ubuntu终端打开Windows File Explorer
另一个交换文件的方法是从Ubuntu终端打开Windows**File Explorer**。
你需要做下面这些步骤:
- 打开Ubuntu终端
- 进入你想看的目录
- 运行`explorer.exe .`命令(或者,使用`wslview .`)
- 如果你看到一条输入输出的报错,那就在Windows PowerShell运行`wsl --shutdown`然后再重新打开Ubuntu终端

### 在Ubuntu文件系统里找到方向
你可能想搞清楚Ubuntu文件系统里的Windows目录到底在哪儿。或者Windows文件系统里的Ubuntu目录在哪儿。
要把一个Windows路径变成Ubuntu路径(或者反过来),你需要做:
- 打开Ubuntu终端
- 使用`wslpath "C:\Program Files"`命令来把Windows路径变成Ubuntu路径
- 使用`wslpath -w "/home"`命令来把Ubuntu路径变成Windows路径
- 还有,`wslpath -w $(pwd)`命令会返回当前Ubuntu路径的Windows路径

## 设置完成啦!
现在你的电脑已经完成[Le Wagon网页开发课程](https://www.lewagon.com/web-development-course/full-time)的设置啦 :muscle: :clap:
享受你的编程之旅,你会掌握它的! :rocket:
================================================
FILE: windows.es.md
================================================
# Instrucciones de la configuración
Aquí abajo encontrarás las instrucciones para la configuración que tu computadora necesita para el [curso de AI Software Development de Le Wagon](https://www.lewagon.com/web-development-course/full-time).
Por favor, **léelas cuidadosamente y ejecuta todos los comandos en el orden indicado**. Si tienes algún problema, no dudes en pedirle ayuda a tu profesor :raising_hand:
¡Comencemos! :rocket:
## Cuenta GitHub
¿Ya tienes una cuenta GitHub? Si no es el caso, [ábrela ya](https://github.com/join).
:point_right: **[Sube una foto](https://github.com/settings/profile)** y escribe tu nombre correctamente en tu cuenta GitHub. Esto es importante porque nosotros usaremos un tablero de comando interno con tu avatar. Por favor hazlo **ahora** antes de dar un paso más en esta guía.

:point_right: **[Habilita la Autenticación de Dos Factores (2FA)](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication#configuring-two-factor-authentication-using-text-messages)**. GitHub te enviará mensajes de texto con un código cuando intentes iniciar sesión. Esto es importante para la seguridad y también pronto será necesario para contribuir código en GitHub.
## La versión de Windows
Antes de comenzar, necesitamos verificar que la versión de Windows instalada en tu computadora sea compatible con estas instrucciones de configuración.
### Windows 10 o Windows 11
> :warning: **Nota sobre Windows 10 y seguridad**
>
> La configuración del bootcamp de Le Wagon funciona en Windows 10. Dicho esto, recomendamos encarecidamente actualizar a Windows 11. Desde el 14 de octubre de 2025 Microsoft finalizó el soporte para Windows 10, lo que significa que ya no recibirá actualizaciones de seguridad y podría poner tu equipo en riesgo. Para más detalles, consulta la [guía de Microsoft](https://support.microsoft.com/en-us/windows/windows-10-support-has-ended-on-october-14-2025-2ca8b313-1946-43d3-b55c-2b95b107f281). Si tu equipo no puede ejecutar Windows 11, considera cambiar a Ubuntu.
Para poder configurar tu computadora, necesitas tener **Windows 10 o Windows 11** instalado.
Para chequear la versión de tu Windows:
- Presiona `Windows` + `R`
- Escribe `winver`
- Presiona `Enter`
:heavy_check_mark: Si las primeras palabras de esta ventana son **Windows 11**, entonces todo está bien y puedes continuar trabajando en la configuración :+1:
:heavy_check_mark: Si las primeras palabras de esta ventana son **Windows 10**, verifica el **número de la versión**:
- :heavy_check_mark: Si dice al menos `2004`, entonces todo está bien :+1:
- :x: Si es inferior a `2004`, debes actualizar tu versión.
-
Cómo instalar las últimas actualizaciones?
Abre Windows Update:
- Presiona `Windows` + `R`
- Escribe `ms-settings:windowsupdate`
- Presiona `Enter`
- Haz clic en `Check updates`
:heavy_check_mark: Si tienes una marca verde y el siguiente mensaje "You're up to date", entonces todo está bien :+1:
:warning: Si obtienes una exclamación roja y el siguiente mensaje "Update available", por favor instala las actualizaciones y repite el proceso hasta que diga que todo está actualizado :loop:
:x: Si obtienes un mensaje de error diciendo que Windows no puede aplicar las actualizaciones, por favor **contacta a un profesor**.
Activa Windows Update Service para resolver las Actualizaciones
Algunos antivirus y programas deshabilitan las actualizaciones que necesitamos y luego se muestra un error. ¡Solucionemos esto!
- Presiona `Windows` + `R`
- Escribe `services.msc`
- Presiona `Enter`
- Haz doble clic en `Windows Update Service`
- Coloca su `Startup` en `Automatic`
- Haz clic en `Start`
- Haz clic en `Ok`
¡Ahora intenta instalar las actualizaciones nuevamente!
Verifica el número de la versión:
- Presiona `Windows` + `R`
- Escribe `winver`
- Presiona `Enter`
:heavy_check_mark: Si dice al menos `2004`, entonces todo está bien :+1:
:x: Si es inferior a `2004`, por favor **contacta a un profesor**.
## Virtualización
Tenemos que asegurarnos de que las opciones de Virtualización estén habilitadas en el BIOS de tu computadora.
Normalmente ya es el caso en muchas computadoras. Verifiquemos:
- Presiona `Windows` + `R`
- Escribe `taskmgr`
- Presiona `Enter`
- Haz clic en la pestaña `Performance`
- Haz clic en `CPU`

:heavy_check_mark: Si ves "Virtualization: Enabled", entonces todo está bien :+1:
:x: Si falta la línea o si la virtualización está desactivada, por favor **contacta a un profesor antes de intentar activar la Virtualización por tu cuenta**
Activa la Virtualización
Debemos acceder al BIOS / UEFI de la computadora para activarla.
- Presiona `Windows + R`
- Escribe `shutdown.exe /r /o /t 1`
- Presiona `Enter`
- Espera a que la computadora se apague
- Haz clic en `Troubleshoot`
- Haz clic en `Advanced Options`
- Haz clic en `UEFI Firmware Settings`
- Haz clic en `Restart`
Debes activar la opción de la virtualización para tu procesador aquí:
- La mayoría de las veces se hace en los parámetros avanzados, los parámetros del CPU o los parámetros de Northbridge
- El nombre de la opción puede variar de una computadora a otra:
- Intel: `Intel VT-x`, `Intel Virtualization Technology`, `Virtualization Extensions`, `Vanderpool`...
- AMD: `SVM Mode` o `AMD-V`
- Guarda los cambios después de la activación y reinicia la computadora con las opciones correspondientes
## Subsistema de Windows para Linux (WSL)
WSL es el ambiente de entorno que estamos usando para usar Ubuntu. Puedes aprender más sobre WSL [aquí](https://docs.microsoft.com/en-us/windows/wsl/faq).
Instalaremos WSL 2 y Ubuntu con un comando a través de la Windows Command Prompt.
:warning: en esta instrucción, utiliza el atajo `Ctrl` + `Shift` + `Enter` para usar la **Windows Command Prompt** con privilegios de administrador en lugar de simplemente hacer clic en `Ok` o presionar `Enter`.
- Presiona `Windows` + `R`
- Escribe `cmd`
- Presiona **`Ctrl` + `Shift` + `Enter`**
:warning: tal vez tengas que aceptar la confirmación UAC sobre el cambio en los privilegios.
Un ventana de terminal aparecerá:
- Copia el siguiente comando (`Ctrl` + `C`)
- Pégalo en la ventana de la terminal (`Ctrl` + `V` o haciendo clic derecho en la ventana)
- Ejecútalo presionado `Enter`
```powershell
wsl --install
```
:heavy_check_mark: Si el comando se ejecutó sin ningún error, por favor reinicia tu computadora y continúa con las siguientes instrucciones aquí abajo :+1:
:x: Si obtienes un mensaje de error (o si ves algún texto en rojo en la ventana), por favor **contacta a un profesor**
Solución de problemas para Windows 10 (solo si es necesario, consulta con un profesor)
#### Para Windows 10 < 2004: instala primero WSL 1
:warning: en esta instrucción, utiliza el atajo `Ctrl` + `Shift` + `Enter` para usar **Windows PowerShell** con privilegios de administrador en lugar de hacer clic en `Ok` o presionar `Enter`.
- Presiona `Windows` + `R`
- Escribe `powershell`
- Presiona **`Ctrl` + `Shift` + `Enter`**
:warning: tal vez tengas que aceptar la confirmación UAC sobre el cambio en los privilegios.
Un ventana de terminal azul aparecerá:
- Copia los siguiente comandos uno por uno (`Ctrl` + `C`)
- Pégalos en la ventana de Powershell (`Ctrl` + `V` o haciendo clic derecho en la ventana)
- Ejecútalos presionado `Enter`
```powershell
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
```
```powershell
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
```
```powershell
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
```
:heavy_check_mark: Si los tres comandos se ejecutaron sin ningún error, por favor reinicia tu computadora y continúa con las instrucciones de aquí abajo :+1:
:x: Si obtienes un mensaje de error (o si ves algún texto en rojo en la ventada), por favor **contacta a un profesor**
#### Para Windows 10 con WSL 1: Actualización a WSL 2
Si tienes Windows 10, actualizaremos WSL a la versión 2.
Cuando se reinicie tu computadora, descarga el instalador de WSL2.
- Ve a la [página de descarga](https://aka.ms/wsl2kernel)
- Descarga "el paquete de actualización de WSL2 Linux kernel"
- Abre el archivo que acabas de descargar
- Haz clic en `Next`
- Haz clic en `Finish`

:heavy_check_mark: Si no obtuviste ningún mensaje de error, entonces puedes continuar :+1:
:x: Si obtienes el siguiente error "This update only applies to machines with the Windows Subsystem for Linux", **haz clic derecho** en el programa y selecciona `uninstall`; esta vez deberías poder instalarlo sin problemas.
#### Para Windows 10 con WSL 1: Coloca WSL 2 como el Subsistema Windows por defecto para Linux
Si tienes Windows 10, pondremos la versión predeterminada de WSL en 2.
Ahora coloca WSL 2 como la versión predeterminada. Esto lo podemos hacer porque ya está instalado:
- Presiona `Windows` + `R`
- Escribe `cmd`
- Presiona `Enter`
Escribe lo siguiente en la ventana que aparecerá:
```bash
wsl --set-default-version 2
```
:heavy_check_mark: Si ves este mensaje "The operation completed successfully", puedes cerrar esta terminal y continuar con las siguientes instrucciones aquí abajo :+1:
:x: Si el mensaje que obtienes es sobre virtualización, por favor **contacta a un profesor**
Habilita de la feature de la Virtual Machine Platform en Windows
Sigue los pasos [siguientes](https://www.configserverfirewall.com/windows-10/please-enable-the-virtual-machine-platform-windows-feature-and-ensure-virtualization-is-enabled-in-the-bios/#:~:text=To%20enable%20WSL%202,%20Open,Windows%20feature%20on%20or%20off.&text=Ensure%20that%20the%20Virtual%20Machine,Windows%20will%20enable%20WSL%202) hasta que hayas habilitado la Virtual Machine Platform y el Subsistema de Windows para Linux
Habilita la feature de Windows Hyper-V
Sigue los pasos [siguientes](https://winaero.com/enable-use-hyper-v-windows-10/) hasta que hayas habilitado el grupo Hyper-V
:information_source: Si tienes Windows 10 **Home edition**, la feature Hyper-V no está disponible para su sistema operativo. No es un bloqueo y puedes continuar con las siguientes instrucciones aquí abajo :ok_hand:
## Ubuntu
### Instalación
Después de reiniciar tu computadora, deberías ver una ventana de terminal diciendo WSL está retomando el proceso de instalación de Ubuntu. Cuando termine, iniciará Ubuntu.
Solución de problemas para Windows 10 (solo si es necesario, consulta con un profesor)
Si la instalación de Ubuntu no se reanudó, primero intenta nuevamente: abre Powershell o el Símbolo del sistema y ejecuta `wsl --install` otra vez.
Si tienes Windows 10, instala la terminal de Windows por medio de la Microsoft Store:
- Haz clic en `Start`
- Escribe `Microsoft Store`
- Haz clic en `Microsoft Store` en la lista
- Busca `Ubuntu` en la barra de búsqueda
- **Selecciona la versión sin nombre, simplemente "Ubuntu"**
- Haz clic en `Get`
:warning: ¡NO instales **Ubuntu 18.04 LTS** ni **Ubuntu 20.04**!
Desinstala las versiones incorrectas de Ubuntu
Para desinstalar las versiones incorrectas de Ubuntu, solo tienes que ir a la Lista de Programas Instalados de Windows 10:
- Presiona `Windows` + `R`
- Escribe `ms-settings:appsfeatures`
- Preiona `Enter`
Busca el programa que desees desinstalar y haz clic en el botón de desinstalación.
Cuando termine la instalación, el botón `Get` se transformará en un botón `Open`: Haz clic en él.
### Primer uso
La primera vez que lo abras, te pedirán que:
- Escojas un **username** de:
- una palabra
- minúscula
- sin caracteres especiales
- por ejemplo: `lewagon` o tu `firstname`, es decir, tu primer nombre
- Escoge un **password**
- Confírmalo
:warning: Cuando escribas tu contraseña no verás nada en la pantalla. **Esto es normal**. Es una herramienta de seguridad para ocultar tanto el contenido de tu contraseña como su longitud. Simplemente escribe tu contraseña y presiona `Enter` al terminar.
### Chequea la versión WSL de Ubuntu
- Presiona `Windows` + `R`
- Escribe `cmd`
- Presiona `Enter`
Escribe el siguiente comando:
```bash
wsl -l -v
```
:heavy_check_mark: Si la versión de WSL de Ubuntu es 2, entonces todo está bien y puedes continuar :+1:
:x: Si la versión de WSL de Ubuntu es 1, tendremos que pasarla a la versión 2.
Conversión de WSL de Ubuntu V1 a V2
Escribe esto en la ventana de Entrada de Comandos:
```bash
wsl --set-version Ubuntu 2
```
:heavy_check_mark: Deberías obtener el siguiente mensaje en algunos segundos: `The conversion is complete`. Esto significa que la conversión ha sido completada.
:x: Si no funciona, tendremos que asegurarnos de que los archivos de Ubuntu no estén comprimidos.
Chequea si los archivos no están comprimidos
- Presiona `Windows` + `R`
- Escribe `%localappdata%\Packages`
- Presiona `Enter`
- Abre la carpeta `CanonicalGroupLimited.UbuntuonWindows...`
- Haz clic derecho en la carpeta `LocalState`
- Haz clic en `Properties`
- Haz clic en `Advanced`
- Asegúrate de que la opción `Compress content` **no** esté seleccionada. Luego haz clic en `Ok`.
Aplícale cambios a esta carpeta solamente y trata de convertir la versión de WSL de Ubuntu nuevamente.
:x: Si la conversión aún no funciona, por favor **contacta a un profesor**.
Ya puedes cerrar la ventana de la terminal.
### Comprueba tu nombre de usuario
Escribe esto en la terminal de Ubuntu:
```bash
whoami
```
Debería devolver el nombre de usuario que elegiste anteriormente.
:x: Si dice `root`, **contacta a un profesor** antes de continuar.
## Visual Studio Code
### Instalación
Instala el editor de texto [Visual Studio Code](https://code.visualstudio.com).
- Ve a [la página de descarga de Visual Studio Code](https://code.visualstudio.com/download).
- Haz clic en el botón "Windows"
- Abre el archivo que acabas de descargar.
- Instálalo con pocas opciones:

Abre VS Code cuando termine la instalación.
### Conexión de VS Code con Ubuntu
Instala la extensión de VS Code llamada [Remote - WSL](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) para hacer que VS Code interactúe adecuadamente con Ubuntu.
Abre tu **terminal Ubuntu**.
Copia y pega los siguientes comandos en la terminal:
```bash
code --install-extension ms-vscode-remote.remote-wsl
```
Luego abre VS Code desde la terminal:
```bash
code .
```
:heavy_check_mark: Si ves `WSL: Ubuntu` en la esquina inferior izquierda de la ventana de VS Code, entonces todo está bien y puedes continuar :+1:

:x: Si no es el caso, por favor **pídele ayuda a un profesor**.
## Terminal de Windows
### Instalación
:information_source: Las instrucciones que verás a continuación dependen de la versión de Windows que tengas.
Si estás utilizando Windows 11, la terminal de Windows ya está instalada y puedes ir a la siguiente sección :point_down:
Si tienes Windows 10, instala la terminal de Windows. Verás que es una terminal moderna.
**Windows 10**: Instalar Windows Terminal
- Haz clic en `Start`
- Escribe `Microsoft Store`
- Haz clic en `Microsoft Store` en la lista
- Busca `Windows Terminal` en la barra de búsqueda
- **Selecciona Windows Terminal"**
- Haz clic en `Install`
:warning: ¡NO instales **Windows Terminal Preview**, solo instala **Windows Terminal**!
Desinstala la versión incorrecta de la terminal de Windows
Para desinstalar la versión incorrecta la terminal de Windows, solamente tienes que ir a la lista de programas instalados de Windows 10:
- Presiona `Windows` + `R`
- EScribe `ms-settings:appsfeatures`
- Presiona `Enter`
Busca el programa que quieres desinstalar y haz clic en el botón de desinstalación.
Cuando termine la instalación, el botón `Install` se transformará en un botón `Launch`: haz clic en él.
### Ubuntu como terminal predeterminada
Hagamos que Ubuntu sea la terminal predeterminada de tu aplicación Windows terminal.
Presiona `Ctrl` + `,`
Debería abrir los parámetros de la terminal:

- Cambia el perfil predeterminado a "Ubuntu"
- Haz clic en "Save"
- Haz clic en "Open JSON file"
Verás la parte a cambiar en un círculo rojo:

Primero pídele a Ubuntu que inicie directamente dentro de tu Ubuntu Home Directory en vez de hacerlo desde Windows:
- Localiza el `"name": "Ubuntu",`
- Agrega la siguiente línea debajo de eso:
```bash
"commandline": "wsl.exe ~",
```
:warning: ¡Que no se te olvide la coma al final de la línea!
Luego deshabilita el warning para copiar y pegar comandos entre Windows y Ubuntu:
- Localiza la línea `"defaultProfile": "{2c4de342-...}"`
- Agrega la siguiente línea debajo de eso:
```bash
"warning.multiLinePaste": false,
```
:warning: ¡No olvides la coma al final de la línea!
Puedes guardar estos cambios presionando `Ctrl` + `S`
:heavy_check_mark: Tu **Windows Terminal** ya está configurada :+1:
Esta terminal tiene pestañas: puedes escoger abrir una terminal en una nueva pestaña haciendo clic en el **+** al lado de la pestaña actual.
**De ahora en adelante, cada vez que hablemos de la terminal o la consola, nos referiremos a esta.** NUNCA más uses otra.
## Extensiones de VS Code
### Instalación
Vamos a instalar algunas extensiones útiles de VS Code.
Copia y pega los siguientes comandos en tu terminal:
```bash
code --install-extension ms-vscode.sublime-keybindings
code --install-extension emmanuelbeziat.vscode-great-icons
code --install-extension github.github-vscode-theme
code --install-extension MS-vsliveshare.vsliveshare
code --install-extension shopify.ruby-lsp
code --install-extension dbaeumer.vscode-eslint
code --install-extension Rubymaniac.vscode-paste-and-indent
code --install-extension alexcvzz.vscode-sqlite
code --install-extension anteprimorac.html-end-tag-labels
code --install-extension marcoroth.herb-lsp
code --install-extension rayhanw.erb-helpers
```
Aquí está la lista de las extensiones que estás instalando:
- [Sublime Text Keymap and Settings Importer](https://marketplace.visualstudio.com/items?itemName=ms-vscode.sublime-keybindings)
- [VSCode Great Icons](https://marketplace.visualstudio.com/items?itemName=emmanuelbeziat.vscode-great-icons)
- [Live Share](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare)
- [Ruby](https://marketplace.visualstudio.com/items?itemName=shopify.ruby-lsp)
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [Paste and Indent](https://marketplace.visualstudio.com/items?itemName=Rubymaniac.vscode-paste-and-indent)
- [SQLite](https://marketplace.visualstudio.com/items?itemName=alexcvzz.vscode-sqlite)
### Funciones de IA en VS Code
VS Code incluye muchas y potentes **funciones de IA**, que son una gran herramienta una vez que ya sabes programar.
Dicho esto, depender de la IA demasiado pronto puede ocultar conceptos importantes y dificultar la comprensión de la depuración. Una vez que estés cómodo con los fundamentos, sabrás cuándo y cómo usar la IA de forma eficaz —sin dejar que haga el trabajo por ti.
Para el inicio del bootcamp, desactivaremos estas funciones. Llegado el momento apropiado en el curso, las volveremos a habilitar para que puedas utilizarlas bien.
En **VS Code**:
1. Abramos la "Paleta de comandos" de VS Code: escribe `Ctrl-Shift-P` (Windows / Linux) o `Cmd-Shift-P` (macOS).
1. Se abrirá la Paleta de comandos: una pequeña caja de texto en la parte superior de la pantalla. Empieza a escribir `aifeatures` hasta que veas "Chat: Learn How to Hide AI features". Haz clic en ella.

1. Esto abrirá la configuración y te mostrará la opción "Disable and hide built-in AI features ...". Marca la casilla delante de esa opción.

Más adelante, si quieres **volver a habilitar** las funciones de IA, puedes seguir las mismas instrucciones para desmarcar la casilla.
### Configuración de Live Share
[Visual Studio Live Share](https://visualstudio.microsoft.com/services/live-share/) es una extensión de VS Code que te permite compartir el código en tu editor de texto para debugging y pair-programming: ¡Instalémoslo!
Abre VS Code desde tu terminal escribiendo `code` y presionando `Enter`.
Haz clic en la pequeña flecha de la parte inferior de la barra de la izquierda:

- Haz clic en el botón "Share". Luego en "GitHub (Inicia sesión usando tu cuenta GitHub)".
- Va a aparecer una ventana emergente pidiéndote que inicies sesión con GitHub: Haz clic en "Allow".
- Te redireccionarán a una página GitHub en tu navegador pidiéndote que autorices Visual Studio Code: Haz clic en "Continue" y luego en "Authorize github".
- Es posible que VS Code muestre más ventanas emergentess: Ciérralas haciendo clic en "OK".
Eso es todo. ¡Ya puedes continuar!
## Herramientas de línea de comando
### Comprueba la configuración regional (locale)
La "locale" es un mecanismo que permite adaptar los programas a su idioma y país.
Comprobemos que la configuración regional por defecto es el inglés:
```bash
locale
```
Si la salida no contiene `LANG=en_US.UTF-8`, ejecute el siguiente comando en un Ubuntu terminal para instalar la locale inglesa:
```bash
sudo locale-gen en_US.UTF-8
```
Si después, recibes una advertencia (`bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf-8)`) en tu terminal, por favor haz lo siguiente:
Generar la configuración regional<>/summary>
Por favor, ejecuta estas líneas en tu terminal.
```bash
sudo update-locale LANG=en_US.UTF8
sudo apt-get update
sudo apt-get install language-pack-en language-pack-en-base manpages
```
### Zsh & Git
En lugar de usar el `bash` [shell](https://en.wikipedia.org/wiki/Shell_(computing)) predeterminado, usaremos `zsh`.
También utilizaremos [`git`](https://git-scm.com/), un programa de línea de comando para control de versiones.
Vamos a instalarlos, junto con otros programas útiles:
- Abre una **terminal de Ubuntu**
- Copia y pega los siguientes comandos:
```bash
sudo apt update
```
```bash
sudo apt install -y curl git imagemagick jq unzip vim zsh
```
Estos comandos te pedirán tu contraseña: escríbela.
:warning: Cuando escribas tu contraseña no verás nada en la pantalla. **Esto es normal**. Es una herramienta de seguridad para ocultar tanto el contenido de tu contraseña como su longitud. Simplemente escribe tu contraseña y presiona `Enter` al terminar.
### Instalación de la CLI de GitHub
Instalemos la [CLI oficial de GitHub](https://cli.github.com) (Interfaz de Línea de Comando). Es un programa que se usa para interactuar con tu cuenta GitHub por medio de la línea de comando.
En tu terminal, copia y pega los siguientes comandos y escribe tu contraseña si te la piden:
```bash
sudo apt remove -y gitsome # gh command can conflict with gitsome if already installed
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install -y gh
```
Ejecuta el comando que te mostramos a continuación para verificar que `gh` se haya instalado correctamente en tu máquina:
```bash
gh --version
```
:heavy_check_mark: Si ves esta versión `gh version X.Y.Z (YYYY-MM-DD)`, puedes continuar trabajando :+1:
:x: Si no es el caso, por favor **contacta a un profesor**
## Oh-my-zsh
Instalemos el plugin `zsh` [Oh My Zsh](https://ohmyz.sh/).
Ejecuta este comando en la terminal:
```bash
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```
Si te preguntan "Do you want to change your default shell to zsh?", presiona `Y`
Cuando termines, tu terminal debería lucir así:

:heavy_check_mark: Si es el caso, puedes continuar :+1:
:x: Si no, por favor **pídele ayuda a un profesor**.
## Conexión de tu navegador predeterminado con Ubuntu
Para asegurarnos de que puedas interactuar desde la terminal de Ubuntu con el navegador que tienes instalado en Windows, debemos definirlo como tu navegador predeterminado aquí.
:warning: Tienes que ejecutar al menos uno de los siguientes comandos:
Google Chrome como tu navegador predeterminado
Ejecuta este comando:
```bash
ls /mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe
```
Si obtienes un error como este `ls: cannot access...` corre el siguiente comandos:
```bash
echo "export BROWSER=\"/mnt/c/Program Files/Google/Chrome/Application/chrome.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files/Google/Chrome/Application/chrome.exe'\"" >> ~/.zshrc
```
Si no es el caso, ejecuta lo siguiente:
```bash
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe'\"" >> ~/.zshrc
```
Mozilla Firefox como tu navegador predeterminado
Ejecuta el siguiente comando:
```bash
ls /mnt/c/Program\ Files\ \(x86\)/Mozilla\ Firefox/firefox.exe
```
Si obtienes un error como este `ls: cannot access...` corre el siguiente comandos:
```bash
echo "export BROWSER=\"/mnt/c/Program Files/Mozilla Firefox/firefox.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files/Mozilla Firefox/firefox.exe'\"" >> ~/.zshrc
```
Si no es el caso, ejecuta lo siguiente:
```bash
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Mozilla Firefox/firefox.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Mozilla Firefox/firefox.exe'\"" >> ~/.zshrc
```
Microsoft Edge como tu navegador predeterminado
Ejecuta el siguiente comandos:
```bash
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe'\"" >> ~/.zshrc
```
Reinicia tu terminal.
Luego asegúrate de que el siguiente comando devuelva "Browser defined 👌":
```bash
[ -z "$BROWSER" ] && echo "ERROR: please define a BROWSER environment variable ⚠️" || echo "Browser defined 👌"
```
Si no lo hace pero
:heavy_check_mark: sí obtienes este mensaje, puedes continuar :+1:
:x: De lo contrario, escoge un navegador de la lista de arriba y ejecuta el comando correspondiente. Luego no olvides reiniciar tu terminal:
```bash
exec zsh
```
No dudes en **pedirle ayuda a tu profesor**.
## GitHub CLI
CLI es una abreviación de [Command-line Interface](https://en.wikipedia.org/wiki/Command-line_interface) que significa interfaz de línea de comando.
En esta sección usaremos [GitHub CLI](https://cli.github.com/) para interactuar directamente con GitHub desde la terminal.
Usaremos la GitHub CLI (`gh`) para conectarnos a GitHub utilizando *SSH*, un protocolo para iniciar la sesión utilizando claves SSH en lugar de la famosa pareja nombre de usuario y contraseña.
Ya debería haberse instalado en tu computadora con los comandos que ejecutaste anteriormente.
Lo primero que hay que hacer para **iniciar sesión** es copiar y pegar el comando siguiente en tu terminal:
:warning: **NO edites el `email`**
```bash
gh auth login -s 'user:email' -w --git-protocol ssh
```
`gh` le hará algunas preguntas:
- `Generate a new SSH key to add to your GitHub account?` Presiona `Enter` para pedirle a gh que genere las claves SSH por ti.
Si ya tienes claves SSH, verás en su lugar `Upload your SSH public key to your GitHub account?`Con las flechas, selecciona la ruta de tu archivo de clave pública y pulsa `Intro`.
- `Enter a passphrase for your new SSH key (Optional)`. Pon algo que quieras y que recuerdes. Es una contraseña para proteger tu private key que está almacenada en tu disco duro. Luego presiona `Enter`.
- `Title for your SSH key`. Puede dejarlo en la propuesta "GitHub CLI", presiona `Enter`.
Obtendrás el siguiente resultado:
```bash
! First copy your one-time code: 0EF9-D015
- Press Enter to open github.com in your browser...
```
Selecciona y copia el código (`0EF9-D015` en el ejemplo) y luego presiona `Enter`.
Tu navegador se abrirá y te pedirá que autorices GitHub CLI para usar tu cuenta GitHub. Acepta y espera un poco.
Regresa a la terminal, presiona `Enter` nuevamente y listo. Eso es todo.
Para verificar que están conectado correctamente, escribe lo siguiente:
```bash
gh auth status
```
:heavy_check_mark: Si obtienes este mensaje: `Logged in to github.com as `, significa que todo está bien :+1:
:x: De lo contrario, **contacta a un profesor**.
## Dotfiles (configuración estándar)
Los hackers aman mejorar sus shells y sus herramientas.
Comenzaremos con una configuración predeterminada proporcionada por Le Wagon: [`lewagon/dotfiles`](https://github.com/lewagon/dotfiles).
Tu configuración es personal, así que necesitas tu **propio** repositorio para almacenarla. Haz el **fork** del repositorio de Le Wagon.
Hacer un fork significa crear un nuevo repositorio en tu propia cuenta GitHub `$GITHUB_USERNAME/dotfiles` el cual es idéntico al original de Le Wagon y que podrás modificar como quieras.
Abre tu terminal y ejecuta los siguientes comandos:
```bash
export GITHUB_USERNAME=`gh api user | jq -r '.login'`
echo $GITHUB_USERNAME
```
:heavy_check_mark: Deberías ver tu usuario GitHub en la pantalla.
:x: Si no es el caso, **no des un paso más** y pide ayuda. Es posible que haya un problema con el paso anterior (`gh auth`).
Es hora de hacer el fork del repositorio y clonarlo en tu computadora:
```bash
mkdir -p ~/code/$GITHUB_USERNAME && cd $_
gh repo fork lewagon/dotfiles --clone
```
### Instalación de Dotfiles
Ejecuta el instalador de `dotfiles`:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles
zsh install.sh
```
Verifica los emails registrados en tu cuenta GitHub. Deberás seleccionar uno en el paso siguiente:
```bash
gh api user/emails | jq -r '.[].email'
```
:heavy_check_mark: Si ves una lista de tus emails registrados, puedes continuar :+1:
:x: De lo contrario, por favor haz la [autenticación en GitHub](https://github.com/lewagon/setup/blob/master/windows.es.md#github-cli) nuevamente antes de ejecutar este comando :point_up: again.
### Instalación de git
Ejecuta el instalador de `git`:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh
```
:point_up: Esto te **pedirá** tu nombre (`FirstName LastName`) y tu email. Cualquier correo que elijas se mostrará **públicamente** en internet. 💡 Selecciona la dirección `@users.noreply.github.com` si no quieres que tu correo electrónico aparezca en los repositorios públicos a los que puedas contribuir.
:warning: **Necesitas** poner uno de los emails que aparecen arriba gracias al comando anterior `gh api ...`. De lo contrario, Kitt no podrá hacerle seguimiento a tu progreso.
Ahora **resetea** tu terminal ejecutando lo siguiente:
```bash
exec zsh
```
## Desahilitación de la solicitud de SSH passphrase
No vas a querer que te pidan tu passphrase cada vez que te comuniques con un repositorio remoto. Por eso debes agregarle plugin `ssh-agent` a `oh my zsh`:
Primero abre el archivo `.zshrc`:
```bash
code ~/.zshrc
```
Luego:
- Identifica la línea que comienza por `plugins=`
- Agrega `ssh-agent` al final de la lista de plugins
La lista debería verse de la siguiente manera:
```bash
plugins=(gitfast last-working-dir common-aliases zsh-syntax-highlighting history-substring-search pyenv ssh-agent)
```
:heavy_check_mark: Guarda el archivo `.zshrc` con `Ctrl` + `S` y cierra tu editor de texto.
## rbenv
Instala [`rbenv`](https://github.com/sstephenson/rbenv), un programa para instalar y gestionar entornos `ruby`.
Primero debemos limpiar cualquier instalación previa de Ruby que tengas en tu computadora:
```bash
rvm implode && sudo rm -rf ~/.rvm
# If you got "zsh: command not found: rvm", carry on.
# It means `rvm` is not on your computer, that's what we want!
rm -rf ~/.rbenv
```
Luego ejecuta lo siguiente en tu terminal:
```bash
sudo apt install -y build-essential tklib zlib1g-dev libssl-dev libffi-dev libxml2 libxml2-dev libxslt1-dev libreadline-dev libyaml-dev
```
```bash
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
```
```bash
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
exec zsh
```
## Ruby
### Instalación
Ahora estás listo para instalar la última versión de [ruby](https://www.ruby-lang.org/en/) y ponerla como la versión predeterminada.
Corre este comando, **tomará un tiempo (5-10 minutos)**
```bash
rbenv install 3.3.5
```
Cuando la instalación de ruby termine, corre este comando para decirle al sistema que use la versión 3.3.5 por defecto.
```bash
rbenv global 3.3.5
```
**Reinicia** tu terminal y chequea tu versión Ruby:
```bash
exec zsh
```
Luego ejecuta esto:
```bash
ruby -v
```
:heavy_check_mark: Si ves algo que comience por `ruby 3.3.5`, entonces puedes continuar +1:
:x: Si no es el caso, **pídele ayuda a un profesor**.
### Instalación de algunas gemas
Si estás en China 🇨🇳 haga clic aquí
:warning: Si estás en China, deberías actualizar la forma de instalar las gemas con los siguientes comandos.
```bash
# China only!
gem sources --remove https://rubygems.org/
gem sources -a https://gems.ruby-china.com/
gem sources -l
# *** CURRENT SOURCES ***
# https://gems.ruby-china.com/
# Ruby-china.com must be in the list now
```
**Todos, todas, en China o no**, continúen aquí para instalar gemas.
En el universo de ruby, a las librerías externas se les llama `gems`: son pedazos de código ruby que puedes descargar y ejecutar en tu computadora. ¡Instalemos algunas!
Primero, vamos a actualizar `bundler`, que es lo que nos permite instalar gemas:
```bash
gem update bundler
```
En tu terminal, copia y pega el siguiente comando:
```bash
gem install colored faker http pry-byebug rake rails:8.1.1 rest-client rspec rubocop-performance sqlite3:2.8.1 activerecord:8.1.1 ruby-lsp
```
:heavy_check_mark: Si obtienes `xx gems installed`, entonces todo está bien :+1:
:x: Si obtienes el siguiente error:
```bash
ERROR: While executing gem ... (TypeError)
incompatible marshal file format (can't be read)
format version 4.8 required; 60.33 given
```
Ejecuta el siguiente comando:
```bash
rm -rf ~/.gemrc
```
Ejecuta el comando nuevamente para instalar las gemas.
:warning: ¡**NUNCA** instales una gema con `sudo gem install`! Incluso si encuentras una solución en Stackoverflow (o la terminal) diciéndote que lo hagas.
## Node.js
[Node.js](https://nodejs.org/en/) es un JavaScript runtime para ejecutar código JavaScript en la terminal. Instálalo con [nvm](https://github.com/nvm-sh/nvm), aun gestionador de versiones para Node.js.
En una terminal, ejecuta estos comandos:
```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | zsh
exec zsh
```
Luego corre el siguiente comando:
```bash
nvm -v
```
Deberías ver una versión. Si no, pídele ayuda a tu profesor.
Ahora instala node:
```bash
nvm install 20.17.0
```
Cuando termine la instalación, corre lo siguiente:
```bash
node -v
```
Si ves `v20.17.0`, the installation succeeded :heavy_check_mark: entonces ahora puedes ejecutar lo siguiente:
```bash
nvm cache clear
```
:x: De lo contrario, **contacta a un profesor**.
## yarn
[`yarn`](https://yarnpkg.com/) es un gestor de paquetes para instalar librerías JavaScript. Instálalo:
En una terminal, ejecuta los siguientes comandos:
```bash
corepack enable
yarn set version stable
```
```bash
exec zsh
```
⚠️ Si ves algún mensaje de error, intenta ejecutar `npm install -g corepack` y luego vuelve a ejecutar los comandos anteriores.
Luego ejecuta este comando:
```bash
yarn -v
```
:heavy_check_mark: si ves una versión, entonces todo está bien :+1:
:x: Si no es el caso, **pídele ayuda a un profesor**
## SQLite
En algunas semanas hablaremos de bases de datos y de SQL. [SQLite](https://sqlite.org/index.html) es un sistema utilizado en bases de datos para ejecutar consultas SQL en bases de datos de un solo archivo. Vamos a instalarlo:
En un terminal, ejecuta los siguientes comandos:
```bash
sudo apt-get install sqlite3 libsqlite3-dev pkg-config
```
A continuación, ejecuta el siguiente comando:
```bash
sqlite3 -version
```
:heavy_check_mark: Si ves una versión, puedes continuar :+1:
:x: Si no, **pídele ayuda a un profesor**
## PostgreSQL
A veces SQLite no es suficiente y necesitaremos una herramienta más avanzada llamada [PostgreSQL](https://www.postgresql.org/). Esta es un sistema para bases de datos de código abierto y listo para usar en producción.
Vamos a instalarlo ahora.
Ejecuta los siguientes comandos:
```bash
sudo apt install -y postgresql postgresql-contrib libpq-dev build-essential
```
```bash
sudo /etc/init.d/postgresql start
```
```bash
sudo -u postgres psql --command "CREATE ROLE `whoami` LOGIN createdb superuser;"
```
Puedes configurar PostgreSQL para que inicie automáticamente para no tener que ejecutar el comando `sudo /etc/init.d/postgresql start` cada vez que abras una nueva terminal:
```bash
sudo echo "`whoami` ALL=NOPASSWD:/etc/init.d/postgresql start" | sudo tee /etc/sudoers.d/postgresql
```
```bash
sudo chmod 440 /etc/sudoers.d/postgresql
```
```bash
echo "sudo /etc/init.d/postgresql start" >> ~/.zshrc
```
Abre una nueva terminal.
:heavy_check_mark: Si ves un mensaje `* Starting postgresql (via systemctl): postgresql.service` O `* Starting PostgreSQL 14 database server`, entonces todo está bien y puedes continuar :+1:
:x: Si no es el caso, **contacta a un profesor**.
## Chequeo
Verifiquemos si has instalado todo bien.
Ejecuta el siguiente comando en tu terminal:
```bash
exec zsh
```
Luego ejecuta lo siguiente:
```bash
curl -Ls https://raw.githubusercontent.com/lewagon/setup/master/check.rb > _.rb && ruby _.rb && rm _.rb || rm _.rb
```
:heavy_check_mark: Si obtienes un mensaje verde diciendo `Awesome! Your computer is now ready!`, significa que tu computadora está lista y que todo está bien :+1:
:x: De lo contrario, **habla con tu profesor**.
## Kitt
:warning: Si recibiste una invitación por email de Le Wagon para crear una cuenta en Kitt (nuestra plataforma de aprendizaje), ignora este paso y sigue las instrucciones en el email si es que todavía no lo has hecho.
Si no sabes que hacer, haz clic en [este enlace](https://kitt.lewagon.com/). Si ya iniciaste sesión, puedes omitir esta sección. Si no, haz clic en `Enter Kitt as a Student`. Esto significa iniciar sesión como estudiante. Si no tienes problemas para iniciar sesión, puedes omitir este paso. De lo contrario pídele a un profesor que te confirme si debiste haber recibido o si debes seguir las instrucciones de aquí abajo.
Registrate como alumni de Le Wagon yendo a [kitt.lewagon.com/onboarding](http://kitt.lewagon.com/onboarding). Selecciona tu batch, inicia sesión con GitHub y completa toda la información que te piden.
Ahora tu profesor podrá validar que realmente eres parte del batch. Pídele que lo haga justo después de que hayas completado el formulario de registro.
Cuando el profesor haya aprobado tu perfil, ve a la bandeja de entrada de tu email. Deberías tener 2 nuevos emails:
- Uno de Slack, invitándote a la comunidad de los alumni de Le Wagon en slack (donde podrás chatear con tus compañeros y todos los demás alumni). Haz clic en **Join** y completa la información que te piden.
- Otro de GitHub, invitándote a `lewagon` team. **Acéptala**, de lo contrario no podrás acceder a las diapositivas de las clases.
## Slack
[Slack](https://slack.com/) es una plataforma de comunicación popular en la industria tech.
### Instalación
[Descarga la aplicación Slack](https://slack.com/downloads/windows) e instálala.
:warning: Si ya estás usando Slack en tu navegador, por favor descarga e instala **la aplicación de escritorio** la cual tiene todas las funciones.
### Parámetros
Abre la aplicación e inicia sesión en `lewagon-alumni`.
Asegúrate de **subir una foto para tu perfil** :point_down:

La idea es tener Slack abierto todo el día para compartir enlaces útiles / pedir ayuda / decidir dónde almorzar / etc.
Para asegurarte de que todo lo relacionado a videollamadas funcione bien, prueba tu cámara y tu micrófono:
- Abre la aplicación Slack
- Haz clic en tu foto de perfil en la esquina superior derecha
- Selecciona "Preferencias" en el menú.
- Haz clic en "Audio y vídeo" en la columna de la izquierda.
- Debajo de "Solución de problemas", haz clic en "Ejecutar una prueba de audio, vídeo y pantalla compartida". La prueba se abrirá en una nueva ventana.
- Comprueba que tus dispositivos preferidos de altavoz, micrófono y cámara aparecen en los menús desplegables y haz clic en "Iniciar prueba"
- Haz clic en el botón verde "Start test"

:heavy_check_mark: Cuando termine el test deberías ver mensajes de "Succeed" en verde por lo menos para tu micrófono y tu cámara. :+1:
:x: Si no es el caso, **contacta a un profesor**.
¡También puedes instalar la aplicación Slack en tu smartphone e iniciar sesión en `lewagon-alumni`!
## Parámetros de Windows
### Intercambio de archivos entre Windows y Ubuntu
Necesitamos una manera fácil de transferir archivos de Windows a Ubuntu y viceversa.
Para ello, vamos a crear atajos a directorios Ubuntu en el **Explorador de Archivos** de Windows:
- Abre el Explorador de Archivos de Windows (o usa el atajo `WIN` + `E`)
- En la Barra de Direcciones, coloca `\\wsl$\` (o `\\wsl$\Ubuntu` si eso no funciona)
- Ahora tienes acceso al sistema de archivos de Ubuntu
- Navega por el sistema de archivos de Ubuntu para encontrar los directorios que te interesen
- Arrastra las carpetas que te interesen a la Barra de Direcciones para crear atajos

### Abre el Explorador de Archivos de Windows desde la terminal de Ubuntu
Otra opción para mover archivos es abrir el **Explorador de Archivos** de Windows desde la terminal de Ubuntu:
- Abre una terminal de Ubuntu
- Ve al directorio que quieres explorar
- Ejecuta el comando `explorer.exe .` (Otra alternativa es usar `wslview .`)
- Si obtienes un mensaje de input output error, ejecuta `wsl --shutdown` en una PowerShell de Windows y abre la terminal de Ubuntu nuevamente

### Uso del Sistema de Archivos de Ubuntu
Es posible que quieras averiguar la localización exacta de un directorio en Windows en el sistema de archivos de Ubuntu o viceversa.
Para convertir una ruta Windows a una Ubuntu y viceversa:
- Abre una terminal de Ubuntu
- Usa el comando `wslpath "C:\Program Files"` para traducir la ruta Windows a una Ubuntu
- Usa el comando `wslpath -w "/home"` para traducir una ruta Ubuntu a una Windows
- El comando `wslpath -w $(pwd)` devuelve la ruta Windows del directorio Ubuntu actual

### Anclaje de aplicaciones a tu barra de tareas
Usarás frecuentemente casi todas las aplicaciones que has instalado hoy. ¡Anclémoslas a tu barra de tareas para que estén a solo un clic de ti!
Para ello, abre la aplicación. Haz clic derecho en el ícono de la barra de tareas para hacer que aparezca el menú contextual (también llamado emergente) y selecciona "Pin to taskbar".

Ancla lo siguiente:
- Tu terminal
- Tu explorador de archivos
- VS Code
- Tu navegador de Internet
- Slack
## ¡Fin de la configuración!
Tu computadora está lista para el [curso de AI Software Development de Le Wagon](https://www.lewagon.com/web-development-course/full-time) :muscle: :clap:
Disfrútalo, sabemos que te va a ir genial :rocket:
================================================
FILE: windows.fr.md
================================================
# Instructions de configuration
Les instructions ci-dessous vont te permettre de configurer ton ordinateur pour [la formation AI Software Development du Wagon](https://www.lewagon.com/web-development-course/full-time).
**Lis-les attentivement et exécute toutes les commandes dans l’ordre suivant**. En cas de blocage, n’hésite pas à demander au prof :raising_hand:
C’est parti :rocket:
## Compte GitHub
Est-ce que tu as déjà un compte GitHub ? Si ce n’est pas le cas, [inscris-toi maintenant](https://github.com/join).
:point_right: **[Télécharge une photo](https://github.com/settings/profile)** et indique correctement ton nom sur ton compte GitHub. C’est important, car notre tableau de bord interne utilise ton avatar. Fais-le **maintenant** avant de poursuivre la configuration de ton ordinateur.

:point_right: **[Activez l'authentification à deux facteurs (2FA)](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication#configuring-two-factor-authentication-using-text-messages)**. GitHub vous enverra des messages texte avec un code lorsque vous essayez de vous connecter. C'est important pour la sécurité et cela sera bientôt obligatoire pour contribuer du code sur GitHub.
## Version de Windows
Avant de commencer, on va vérifier que la version de Windows installée sur ton ordinateur est compatible avec ces instructions de configuration.
### Windows 10 ou Windows 11
> :warning: **Note sur Windows 10 et la sécurité**
>
> La configuration du bootcamp Le Wagon fonctionne sur Windows 10. Cela dit, on recommande fortement de passer à Windows 11. Depuis le 14 octobre 2025, Microsoft a mis fin au support de Windows 10 : il ne reçoit plus de mises à jour de sécurité, ce qui peut exposer ta machine. Pour plus de détails, consulte le [guide de Microsoft](https://support.microsoft.com/en-us/windows/windows-10-support-has-ended-on-october-14-2025-2ca8b313-1946-43d3-b55c-2b95b107f281). Si ton ordinateur ne peut pas exécuter Windows 11, envisage de passer à Ubuntu.
Pour pouvoir configurer ton ordinateur, **Windows 10 ou Windows 11** doit être installé dessus.
Pour connaître ta version de Windows :
- Appuie sur `Windows` + `R`
- Saisis `winver`
- Appuie sur `Enter`
:heavy_check_mark: Si les premiers mots qui apparaissent dans cette fenêtre sont **Windows 11**, c’est bon :+1:
Si les premiers mots qui apparaissent dans cette fenêtre sont **Windows 10**, vérifie le numéro de version:
- :heavy_check_mark: Si la version indique au moins `2004`, c’est bon :+1:
- :x: Sinon, il faut que tu mettes à jour ton Windows.
-
Comment installer les dernières mises à jour
Ouvre Windows Update :
- Appuie sur `Windows` + `R`
- Saisis `ms-settings:windowsupdate`
- Appuie sur `Enter`
- Clique sur « Rechercher les mises à jour »
:heavy_check_mark: Si tu vois apparaître une coche verte et le message « Vous êtes à jour », c’est bon :+1:
:warning: Si tu vois apparaître un point d’exclamation rouge et le message « Mise à jour disponible », installe-la et recommence jusqu’à ce que le message « Vous êtes à jour » apparaisse :loop:
:x: Si tu vois apparaître un message d’erreur indiquant que Windows ne peut pas appliquer les mises à jour, **demande au prof**.
Activer le service Windows Update pour corriger les mises à jour
Certains antivirus et logiciels désactivent le service de mise à jour dont on a besoin, entraînant l’erreur que tu vois apparaître. On va corriger ça !
- Appuie sur `Windows` + `R`
- Saisis `services.msc`
- Appuie sur `Enter`
- Double-clique sur `Windows Update Service`
- Définis `Startup` sur `Automatic`
- Clique sur `Start`
- Clique sur `Ok`
On va maintenant réessayer d’effectuer les mises à jour.
Vérifie le numéro de version :
- Appuie sur `Windows` + `R`
- Saisis `winver`
- Appuie sur `Enter`
:heavy_check_mark: Si la version indique au moins `1903`, c’est bon :+1:
:x: S’il s’agit d’une version antérieure, **demande au prof**.
## Virtualisation
On doit vérifier que les options de virtualisation sont activées dans le BIOS de ton ordinateur.
C’est déjà le cas sur de nombreux ordinateurs. Vérifions-le :
- Appuie sur `Windows` + `R`
- Saisis `taskmgr`
- Appuie sur `Enter`
- Clique sur l’onglet `Performance`
- Clique sur `CPU`

:heavy_check_mark: Si tu vois « Virtualisation : activée », c’est bon :+1:
:x: Si la ligne est manquante ou si la virtualisation est désactivée, **demande au prof avant d’essayer d’activer la virtualisation**
Activer la virtualisation
On a besoin d’accéder au BIOS / à l’UEFI de l’ordinateur pour activer la virtualisation.
- Appuie sur `Windows + R`
- Saisis `shutdown.exe /r /o /t 1`
- Appuie sur `Enter`
- Attends que l’ordinateur s’arrête
- Clique sur `Troubleshoot`
- Clique sur `Advanced Options`
- Clique sur `UEFI Firmware Settings`
- Clique sur `Restart`
Tu dois activer l’option de virtualisation de ton processeur ici :
- La plupart du temps, dans les paramètres avancés, les paramètres du processeur ou les paramètres Northbridge
- L’option peut avoir un nom différent en fonction de ton ordinateur :
- Intel : `Intel VT-x`, `Intel Virtualization Technology`, `Virtualization Extensions`, `Vanderpool`...
- AMD : `SVM Mode` ou `AMD-V`
- Enregistre les modifications après activation et redémarre l’ordinateur en utilisant l’option correspondante
## Sous-système Windows pour Linux (WSL)
WSL est l’environnement de développement que l’on utilise pour exécuter Ubuntu. Pour en savoir plus sur WSL, [consulte cette page](https://docs.microsoft.com/fr-fr/windows/wsl/faq).
Nous allons installer WSL 2 et Ubuntu en une seule commande via le Windows Command Prompt.
:warning: Dans les instructions suivantes, utilise la combinaison de touches `Ctrl` + `Shift` + `Enter` pour exécuter **Windows Command Prompt** en tant qu’administrateur au lieu de cliquer simplement sur `Ok` ou d’appuyer sur `Enter`.
- Appuie sur `Windows` + `R`
- Saisis `cmd`
- Appuie sur **`Ctrl` + `Shift` + `Enter`**
:warning: Tu devras peut-être accepter la confirmation UAC concernant l’octroi des droits d’administrateur.
Une fenêtre de terminal apparaîtra :
- Copie la commande suivante (`Ctrl` + `C`)
- Colle-la dans la fenêtre du terminal (`Ctrl` + `V` ou en faisant un clic droit dans la fenêtre)
- Exécute-les en appuyant sur `Enter`
```powershell
wsl --install
```
:heavy_check_mark: Si la commande s’exécute sans erreur, redémarre ton ordinateur et suis les instructions ci-dessous :+1:
:x: Si tu obtiens un message d’erreur (ou si tu vois apparaître du texte en rouge dans la fenêtre), **demande au prof**.
Dépannage pour Windows 10 (uniquement si nécessaire, vérifie avec un professeur)
#### Pour Windows 10 < 2004 : installer d'abord WSL 1
:warning: Dans les instructions suivantes, utilise la combinaison de touches `Ctrl` + `Shift` + `Enter` pour exécuter **Windows PowerShell** en tant qu’administrateur au lieu de cliquer simplement sur `Ok` ou d’appuyer sur `Enter`.
- Appuie sur `Windows` + `R`
- Saisis `powershell`
- Appuie sur **`Ctrl` + `Shift` + `Enter`**
:warning: Tu devras peut-être accepter la confirmation UAC concernant l’octroi des droits d’administrateur.
Une fenêtre de terminal bleue apparaîtra :
- Copie les commandes suivantes une par une (`Ctrl` + `C`)
- Colle-les dans la fenêtre PowerShell (`Ctrl` + `V` ou en faisant un clic droit dans la fenêtre)
- Exécute-les en appuyant sur `Enter`
```powershell
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
```
```powershell
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
```
```powershell
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
```
:heavy_check_mark: Si les trois commandes s’exécutent sans erreur, redémarre ton ordinateur et suis les instructions ci-dessous :+1:
:x: Si tu obtiens un message d’erreur (ou si tu vois apparaître du texte en rouge dans la fenêtre), **demande au prof**
#### Pour Windows 10 avec WSL 1 : Mise à niveau vers WSL 2
Si tu as Windows 10, on va maintenant mettre à jour WSL à la version 2.
Une fois que ton ordinateur a redémarré, on doit télécharger le programme d’installation de WSL 2.
- Va sur la [page de téléchargement](https://aka.ms/wsl2kernel)
- Télécharge le « WSL2 Linux kernel update package 2 »
- Ouvre le fichier que tu viens de télécharger
- Clique sur `Suivant`
- Clique sur `Terminer`

:heavy_check_mark: Si tu ne rencontres aucun message d’erreur, c’est bon :+1:
:x: Si tu obtiens l’erreur « Cette mise à jour s’applique seulement aux machines avec le sous-système Windows pour Linux », **fais un clic droit** sur le programme et sélectionne `uninstall` ; tu devrais pouvoir l’installer normalement cette fois-ci.
#### Pour Windows 10 avec WSL 1 : Définir WSL 2 comme sous-système Windows pour Linux par défaut
Si tu as Windows 10, on va enfin définir la version 2 de WSL comme étant la version par défaut.
Maintenant que WLS 2 est installé, on va le définir comme version par défaut :
- Appuie sur `Windows` + `R`
- Saisis `cmd`
- Appuie sur `Enter`
Dans la fenêtre qui apparaît, saisis :
```bash
wsl --set-default-version 2
```
:heavy_check_mark: Si tu vois apparaître « The operation completed successfully », tu peux fermer ce terminal et suivre les instructions ci-dessous :+1:
:x: Si le message qui s’affiche concerne la virtualisation, **demande au prof**
Activer la fonction Virtual Machine Platform sous Windows
Suis les étapes décrites [ici](https://www.configserverfirewall.com/windows-10/please-enable-the-virtual-machine-platform-windows-feature-and-ensure-virtualization-is-enabled-in-the-bios/#:~:text=To%20enable%20WSL%202,%20Open,Windows%20feature%20on%20or%20off.&text=Ensure%20that%20the%20Virtual%20Machine,Windows%20will%20enable%20WSL%202) pour activer Virtual Machine Platform et le sous-système Windows pour Linux
Activer la fonction Hyper-V sous Windows
Suis les étapes décrites [ici](https://winaero.com/enable-use-hyper-v-windows-10/) pour activer le groupe Hyper-V
:information_source: Si tu as Windows 10 **Home edition**, la fonction Hyper-V n'est pas disponible sur ton système d'exploitation. Ce n'est pas bloquant et tu peux continuer à suivre les instructions ci-dessous :ok_hand:
## Ubuntu
### Installation
Si tu as Windows 11, après avoir redémarré ton ordinateur, tu devrais voir une fenêtre de terminal indiquant que WSL poursuit le processus d'installation d'Ubuntu. Lorsque c'est terminé, Ubuntu va se lancer.
Résolution des problèmes pour Windows 10 (uniquement si nécessaire, vérifie avec un TA)
Si l'installation d'Ubuntu ne reprend pas, essaye d'abord à nouveau : relance Powershell ou l'Invite de commandes et exécute la commande `wsl --install` une nouvelle fois.
Si tu as Windows 10, installons Ubuntu via le Microsoft Store :
- Clique sur `Start`
- Saisis `Microsoft Store`
- Clique sur `Microsoft Store` dans la liste
- Recherche `Ubuntu` dans la barre de recherche
- **Sélectionne la version nommée « Ubuntu » sans aucun chiffre**
- Clique sur `Installer`
:warning: N’installe pas **Ubuntu 18.04 LTS** ni **Ubuntu 20.04** !
Désinstaller les mauvaises versions d’Ubuntu
Pour désinstaller une mauvaise version d’Ubuntu, il te suffit d’aller dans la liste des programmes installés de Windows 10 :
- Appuie sur `Windows` + `R`
- Saisis `ms-settings:appsfeatures`
- Appuie sur `Enter`
Trouve le logiciel à désinstaller et clique sur le bouton de désinstallation.
Une fois l’installation terminée, le bouton « Installer » se transforme en bouton « Lancer » ; clique dessus.
### Premier lancement
Au premier lancement, on te demandera de fournir des informations :
- Choisis un **nom d’utilisateur** :
- un mot
- en minuscules
- sans caractères spéciaux
- par exemple : `lewagon` ou ton `prenom`
- Choisis un **mot de passe**
- Confirme ton mot de passe
:warning: Lorsque tu saisiras ton mot de passe, rien ne s’affichera à l’écran ; **c’est normal**. Il s’agit d’une mesure de sécurité permettant de masquer ton mot de passe et sa longueur. Saisis simplement ton mot de passe, puis appuie sur `Enter`.
Tu peux fermer la fenêtre Ubuntu maintenant qu’elle est installée sur ton ordinateur.
### Vérifier la version de WSL sous Ubuntu
- Appuie sur `Windows` + `R`
- Saisis `cmd`
- Appuie sur `Enter`
Saisis la commande suivante :
```bash
wsl -l -v
```
:heavy_check_mark: Si la version de WSL sous Ubuntu est la 2, c’est bon. :+1:
:x: Si la version de WSL sous Ubuntu est la 1, il va falloir passer à la version 2.
Passer de la version 1 à la version 2 de WSL sous Ubuntu
Dans la fenêtre d’invite de commande, saisis :
```bash
wsl --set-version Ubuntu 2
```
:heavy_check_mark: Au bout de quelques secondes, tu devrais voir apparaître le message suivant : `The conversion is complete`.
:x: Si ce n’est pas le cas, il faut vérifier que les fichiers Ubuntu ne sont pas compressés.
Vérifier que les fichiers sont décompressés
- Appuie sur `Windows` + `R`
- Saisis `%localappdata%\Packages`
- Appuie sur `Enter`
- Ouvre le dossier nommé `CanonicalGroupLimited.UbuntuonWindows...`
- Fais un clic droit sur le dossier `LocalState`
- Clique sur `Properties`
- Clique sur `Advanced`
- Vérifie que l’option `Compresser le contenu` n’est **pas** cochée, puis clique sur `Ok`.
Applique les modifications à ce dossier uniquement et réessaie de convertir la version de WSL sous Ubuntu.
:x: Si la conversion ne fonctionne pas, **demande au prof**.
Tu peux maintenant fermer cette fenêtre de terminal.
### Vérifier ton nom d'utilisateur
Tape cette commande dans le terminal Ubuntu :
```bash
whoami
```
Cela devrait renvoyer le nom d'utilisateur que tu as choisi précédemment.
:x: Si cela affiche `root`, **contacte un TA** avant de continuer !
## Visual Studio Code
### Installation
On va maintenant installer l’éditeur de texte [Visual Studio Code](https://code.visualstudio.com).
- Va sur la [page de téléchargement de Visual Studio Code](https://code.visualstudio.com/download).
- Clique sur le bouton « Windows »
- Ouvre le fichier que tu viens de télécharger.
- Installe-le avec quelques options :

Une fois l’installation terminée, lance VS Code.
### Connecter VS Code à Ubuntu
Tu devrais voir un cadre dans le coin inférieur droit de VS Code indiquant qu’il détecte WSL. Accepte l’installation de l’extension de WSL pour VS Code.
:warning: Cette extension est obligatoire pour utiliser VS Code !
```bash
code --install-extension ms-vscode-remote.remote-wsl
```
Then open VS Code from your terminal:
```bash
code .
```
:heavy_check_mark: Si tu vois `WSL: Ubuntu` dans le coin inférieur gauche de la fenêtre VS Code, c'est tout bon :+1:

:x: Sinon, **demande au prof**
## Windows Terminal
### Installation
:information_source: Les instructions suivantes dépendent de ta version de Windows.
Si tu as Windows 11, le Windows Terminal est déjà installé et tu peux passer à la section suivante :point_down:
Si tu as Windows 10, nous allons installer le Windows Terminal, un terminal vraiment moderne.
Windows 10: Installer le Windows Terminal
- Clique sur `Démarrer`
- Saisis `Microsoft Store`
- Clique sur `Microsoft Store` dans la liste
- Recherche `Windows Terminal` dans la barre de recherche
- **Sélectionne Windows Terminal**
- Clique sur `Installer`
:warning: N’installe PAS **Windows Terminal Preview**, uniquement **Windows Terminal** !
Désinstaller la mauvaise version de Windows Terminal
Pour désinstaller une mauvaise version de Windows Terminal, il te suffit d’aller dans la liste des programmes installés de Windows 10 :
- Appuie sur `Windows` + `R`
- Saisis `ms-settings:appsfeatures`
- Appuie sur `Enter`
Trouve le logiciel à désinstaller et clique sur le bouton de désinstallation.
Une fois l’installation terminée, le bouton « Installer » se transforme en bouton « Lancer » ; clique dessus.
### Définir Ubuntu comme terminal par défaut
On va définir Ubuntu comme terminal par défaut de ton application Windows Terminal.
Appuie sur `Ctrl` + `,`
pour ouvrir les paramètres du terminal :

- Remplace le profil par défaut par « Ubuntu »
- Clique sur « Enregistrer »
- Clique sur « Ouvrir le fichier JSON »
La partie à modifier est entourée en rouge :
[Fichier de paramètres JSON de Windows Terminal](images/windows\_terminal\_settings\_json.png)
On va commencer par demander à Ubuntu de démarrer directement dans ton répertoire personnel Ubuntu au lieu du répertoire Windows :
- Recherche `"name": "Ubuntu",`
- Ajoute la ligne suivante après :
```bash
"commandline": "wsl.exe ~",
```
:warning: N’oublie pas la virgule à la fin de la ligne !
On va ensuite désactiver les avertissements pour les commandes de copier-coller entre Windows et Ubuntu :
- Recherche la ligne `"defaultProfile": "{2c4de342-...}"`
- Ajoute la ligne suivante après :
```bash
"warning.multiLinePaste": false,
```
:warning: N’oublie pas la virgule à la fin de la ligne !
Tu peux enregistrer ces modifications en appuyant sur `Ctrl` + `S`
:heavy_check_mark: Ton **Windows Terminal** est maintenant configuré :+1:
Ce terminal a des onglets ; tu peux choisir d’ouvrir un nouvel onglet de terminal en cliquant sur **+** à côté de l’onglet actuel.
**Désormais, chaque fois que l'on fera référence au terminal ou à la console, il s’agira de celui-ci.** N’utilise PLUS aucun autre terminal.
## Extensions VS Code
### Installation
On va maintenant installer quelques extensions utiles à VS Code.
Copie-colle les commandes suivantes dans le terminal :
```bash
code --install-extension ms-vscode.sublime-keybindings
code --install-extension emmanuelbeziat.vscode-great-icons
code --install-extension MS-vsliveshare.vsliveshare
code --install-extension shopify.ruby-lsp
code --install-extension dbaeumer.vscode-eslint
code --install-extension Rubymaniac.vscode-paste-and-indent
code --install-extension alexcvzz.vscode-sqlite
code --install-extension anteprimorac.html-end-tag-labels
code --install-extension marcoroth.herb-lsp
code --install-extension rayhanw.erb-helpers
```
Voici la liste des extensions que tu es en train d'installer :
- [Sublime Text Keymap and Settings Importer](https://marketplace.visualstudio.com/items?itemName=ms-vscode.sublime-keybindings)
- [VSCode Great Icons](https://marketplace.visualstudio.com/items?itemName=emmanuelbeziat.vscode-great-icons)
- [Live Share](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare)
- [Ruby](https://marketplace.visualstudio.com/items?itemName=shopify.ruby-lsp)
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [Paste and Indent](https://marketplace.visualstudio.com/items?itemName=Rubymaniac.vscode-paste-and-indent)
- [SQLite](https://marketplace.visualstudio.com/items?itemName=alexcvzz.vscode-sqlite)
### Fonctionnalités IA de VS Code
VS Code inclut de nombreuses **fonctionnalités d'IA** puissantes, qui sont un excellent outil une fois que vous savez déjà coder.
Cela dit, s'appuyer sur l'IA trop tôt peut masquer des concepts importants et rendre le débogage plus difficile à comprendre. Une fois à l'aise avec les fondamentaux, vous saurez quand et comment utiliser l'IA efficacement — sans lui laisser faire la réflexion à votre place.
Pour le début du bootcamp, nous allons désactiver ces fonctionnalités. Au bon moment du cours, nous les réactiverons afin que vous puissiez les utiliser à bon escient.
Dans **VS Code** :
1. Ouvrez la "Palette de commandes" de VS Code : tapez `Ctrl-Shift-P` (Windows / Linux) ou `Cmd-Shift-P` (macOS).
1. La Palette de commandes s'ouvrira : une petite zone de texte en haut de l'écran. Commencez à taper `aifeatures` jusqu'à voir "Chat: Learn How to Hide AI features". Cliquez dessus.

1. Cela ouvrira les paramètres et affichera l'option "Disable and hide built-in AI features ...". Cochez la case devant cette option.

Plus tard, si vous souhaitez **réactiver** les fonctionnalités d'IA, vous pouvez suivre les mêmes instructions pour décocher la case.
### Configuration de Live Share
[Visual Studio Live Share](https://visualstudio.microsoft.com/services/live-share/) est une extension de VS Code, qui te permet de partager du code dans ton éditeur de texte pour débugger et faire de la programmation en binôme. Configurons-le !
Lance VS Code depuis ton terminal en saisissant `code` et en appuyant sur `Enter`.
Clique sur la petite flèche en bas de la barre de gauche :point_down:

- Clique sur le bouton « Partager », puis sur « GitHub (connecte-toi avec ton compte GitHub) ».
- Une popup t’invitant à te connecter avec GitHub apparaît. Clique sur « Autoriser ».
- Tu arriveras alors sur une page GitHub dans ton navigateur, où on te demandera d’autoriser Visual Studio Code ; clique sur « Continuer », puis « Autoriser GitHub ».
- Il se peut que VS Code affiche d’autres popups ; ferme-les en cliquant sur « OK ».
C’est bon !
## Outils en ligne de commande
### Vérifier la locale
Le concept de "locale" permet de personnaliser les programms en fonction de ta langue et ton pays.
Vérifions que la locale est bien en **anglais** dans le terminal :
```bash
locale
```
Si la commande ne renvoie pas quelque chose qui contient `LANG=en_US.UTF-8`, lance ceci dans un terminal Ubuntu :
```bash
sudo locale-gen en_US.UTF-8
```
Si après, tu reçois un avertissement (`bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf-8)`) dans ton terminal, veuillez faire ce qui suit :
Générer la localisation
Veuillez exécuter ces lignes dans ton terminal.
```bash
sudo update-locale LANG=en_US.UTF8
sudo apt-get update
sudo apt-get install language-pack-en language-pack-en-base manpages
```
### Zsh & Git
Au lieu d’utiliser le [shell](https://fr.wikipedia.org/wiki/Interface_syst%C3%A8me) `bash` par défaut, nous utiliserons `zsh`.
Nous utiliserons aussi [`git`](https://git-scm.com/), un logiciel en ligne de commande utilisé pour la gestion de versions.
Installons-les, avec d'autres outils utiles :
- Ouvre un terminal
- Copie-colle les commandes suivantes :
```bash
sudo apt update
```
```bash
sudo apt install -y curl git imagemagick jq unzip vim zsh
```
Ces commandes te demanderont ton mot de passe ; saisis-le.
:warning: Lorsque tu saisiras ton mot de passe, rien ne s’affichera à l’écran ; **c’est normal**. Il s’agit d’une mesure de sécurité permettant de masquer ton mot de passe et sa longueur. Saisis simplement ton mot de passe, puis appuie sur `Enter`.
### Installation de GitHub CLI
On va maintenant installer la [CLI officielle de GitHub](https://cli.github.com) (Command Line Interface, interface en ligne de commande). Il s’agit d’un logiciel qui te permet d’interagir avec ton compte GitHub via la ligne de commande.
Copie-colle les commandes suivantes dans ton terminal et saisis ton mot de passe s’il t’est demandé :
```bash
sudo apt remove -y gitsome # gh command can conflict with gitsome if already installed
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install -y gh
```
Pour vérifier que `gh` a bien été installé sur ta machine, tu peux exécuter :
```bash
gh --version
```
:heavy_check_mark: Si tu vois apparaître `gh version X.Y.Z (YYYY-MM-DD)`, c’est bon :+1:
:x: Sinon, **demande au la prof**.
## Oh-my-zsh
On va maintenant installer le plug-in `zsh` [Oh My Zsh](https://ohmyz.sh/).
Exécute la commande suivante dans un terminal :
```bash
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```
Si tu vois apparaître la question « Do you want to change your default shell to zsh? ? », appuie sur `Y`
À la fin, ton terminal devrait ressembler à ceci :

:heavy_check_mark: Si c’est le cas, tu peux continuer :+1:
:x: Sinon, **demande au prof**
## Associer ton navigateur par défaut à Ubuntu
Pour que tu puisses interagir avec le navigateur installé sous Windows depuis ton terminal Ubuntu, on doit le définir comme navigateur par défaut.
:warning: Tu dois exécuter au moins une des commandes ci-dessous :
Google Chrome est ton navigateur par défaut
Exécute la commandes :
```bash
ls /mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe
```
Si tu obtiens une erreur du type `ls: cannot access...`, exécute la commande suivante :
```bash
echo "export BROWSER=\"/mnt/c/Program Files/Google/Chrome/Application/chrome.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files/Google/Chrome/Application/chrome.exe'\"" >> ~/.zshrc
```
Sinon, exécute :
```bash
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe'\"" >> ~/.zshrc
```
Mozilla Firefox est ton navigateur par défaut
Exécute la commandes :
```bash
ls /mnt/c/Program\ Files\ \(x86\)/Mozilla\ Firefox/firefox.exe
```
Si tu obtiens une erreur du type `ls: cannot access...`, exécute la commande suivante :
```bash
echo "export BROWSER=\"/mnt/c/Program Files/Mozilla Firefox/firefox.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files/Mozilla Firefox/firefox.exe'\"" >> ~/.zshrc
```
Sinon, exécute :
```bash
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Mozilla Firefox/firefox.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Mozilla Firefox/firefox.exe'\"" >> ~/.zshrc
```
Microsoft Edge est ton navigateur par défaut
Exécute la commandes :
```bash
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe'\"" >> ~/.zshrc
```
Redémarre ton terminal.
Puis vérifie que la commande suivante renvoie « Browser defined 👌 » :
```bash
[ -z "$BROWSER" ] && echo "ERROR: please define a BROWSER environment variable ⚠️" || echo "Browser defined 👌"
```
Si ce n’est pas le cas,
:heavy_check_mark: Si tu vois apparaître ce message, tu peux continuer :+1:
:x: Sinon, choisis un navigateur dans la liste ci-dessus et exécute la commande correspondante. Puis n’oublie pas de réinitialiser ton terminal :
```bash
exec zsh
```
N’hésite pas à **demander au prof**.
## GitHub CLI
CLI est l’acronyme de [Command-line Interface](https://en.wikipedia.org/wiki/Command-line_interface), interface en ligne de commande.
Dans cette section, tu vas installer [GitHub CLI](https://cli.github.com/) pour interagir avec GitHub directement depuis le terminal.
Nous allons utiliser GitHub CLI (`gh`) pour nous connecter à GitHub en utilisant *SSH*, un protocole pour s'authentifier en utilisant des clés SSH au lieu de la fameuse paire nom d'utilisateur et mot de passe.
Elle doit déjà être installée sur ton ordinateur grâce aux commandes précédentes.
Pour **te connecter**, commence par copier-coller la commande suivante dans ton terminal :
:warning: **NE modifie PAS `email`**
```bash
gh auth login -s 'user:email' -w --git-protocol ssh
```
`gh` va te poser quelques questions :
- `Generate a new SSH key to add to your GitHub account?` Appuie sur `Enter` pour demander à gh de générer les clés SSH pour toi.
Si tu as déjà des clés SSH, tu verras à la place `Upload your SSH public key to your GitHub account?` Avec les flèches, sélectionne le chemain de ta clé publique et appuie sur `Enter`.
- `Enter a passphrase for your new SSH key (Optional)`. Saisis un mot de passe dont tu te souviendras. Ce mot de passe sert à protéger ta clé privée enregistrée sur ton disque sur. Ensuite, appuie sur `Enter`.
- `Title for your SSH key`. Tu peux laisser ce qui est proposé par défaut, à savoir "GitHub CLI", appuie sur `Enter`.
Tu obtiendras le résultat suivant :
```bash
! First copy your one-time code: 0EF9-D015
- Press Enter to open github.com in your browser...
```
Sélectionne et copie le code (`0EF9-D015` dans l’exemple), puis appuie sur `Enter`.
Ton navigateur s’ouvrira et te demandera d’autoriser GitHub CLI à utiliser ton compte GitHub. Accepte et patiente un instant.
Reviens au terminal, appuie à nouveau sur `Enter` et voilà.
Pour vérifier que tu es bien connecté, saisis :
```bash
gh auth status
```
:heavy_check_mark: Si tu vois apparaître `Logged in to github.com as `, alors c’est bon :+1:
:x: Sinon, **demande au prof**.
## Dotfiles (configuration standard)
Les hackers adorent perfectionner leur shell et leurs outils.
On va commencer avec une super configuration par défaut fournie par Le Wagon : [`lewagon/dotfiles`](https://github.com/lewagon/dotfiles).
Ta configuration est personnelle ; tu as donc besoin de ton **propre** dépôt de code (repository) pour la sauvegarder. Tu vas donc faire un fork, c’est-à-dire une copie, du dépôt Le Wagon.
Faire un fork consiste à créer un nouveau dépôt dans ton compte GitHub personnel `$GITHUB_USERNAME/dotfiles`, identique au dépôt Le Wagon d’origine et que tu pourras modifier librement.
Ouvre ton terminal et exécute les commandes suivantes :
```bash
export GITHUB_USERNAME=`gh api user | jq -r '.login'`
echo $GITHUB_USERNAME
```
:heavy\_check\_mark: Tu devrais voir apparaître ton nom d’utilisateur GitHub.
:x: Si ce n’est pas le cas, **arrête-toi ici** et demande de l’aide. Il se peut que tu aies rencontré un problème à l’étape précédente (`gh auth`).
Il est temps de faire un fork du dépôt et de le cloner sur ton ordinateur :
```bash
mkdir -p ~/code/$GITHUB_USERNAME && cd $_
gh repo fork lewagon/dotfiles --clone
```
### Programme d'installation des Dotfiles
Exécute le programme d’installation `dotfiles` :
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles
zsh install.sh
```
Vérifie les adresses e-mail associées à ton compte GitHub. Tu devras en choisir une à l’étape suivante :
```bash
gh api user/emails | jq -r '.[].email'
```
:heavy_check_mark: Si tu vois la liste de tes adresses e-mail enregistrées, tu peux continuer :+1:
:x: Sinon, [reconnecte-toi à GitHub](https://github.com/lewagon/setup/blob/master/windows.fr.md#github-cli) avant d'exécuter cette commande à nouveau :point_up:.
### Programme d'installation git
Exécute le programme d’installation de `git` :
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh
```
:point_up: On te **demandera** de fournir ton nom (`FirstName LastName`) et ton adresse e-mail.
:warning: Tu **dois** saisir l’une des adresses e-mail indiquées ci-dessus avec la commande `gh api ...` précédente. Sinon, Kitt ne pourra pas suivre tes progrès. 💡 Sélectionnez l'adresse `@users.noreply.github.com` si vous ne souhaitez pas que votre adresse e-mail apparaisse dans les dépôts publics auxquels vous pourriez contribuer.
**Réinitialise** ton terminal en exécutant :
```bash
exec zsh
```
## Désactiver l’invite de phrase secrète SSH
Tu veux éviter d’avoir à fournir ta phrase secrète chaque fois que tu communiques avec un dépôt de code distant. Pour cela, tu as besoin d’ajouter le plug-in `ssh-agent` à `oh my zsh` :
Commence par ouvrir le fichier `.zshrc` :
```bash
code ~/.zshrc
```
Puis :
- Localise la ligne commençant par `plugins=`
- Ajoute `ssh-agent` à la fin de la liste des plug-ins
La liste doit ressembler à ça :
```bash
plugins=(gitfast last-working-dir common-aliases zsh-syntax-highlighting history-substring-search pyenv ssh-agent)
```
:heavy_check_mark: Enregistre le fichier `.zshrc` à l’aide des touches `Ctrl` + `S` et ferme ton éditeur de texte.
## rbenv
On va maintenant installer [`rbenv`](https://github.com/sstephenson/rbenv), un logiciel qui permet d’installer et de gérer des environnements `ruby`.
Pour commencer, tu dois nettoyer toute installation antérieure éventuelle de Ruby :
```bash
rvm implode && sudo rm -rf ~/.rvm
# If you got "zsh: command not found: rvm", carry on.
# It means `rvm` is not on your computer, that's what we want!
rm -rf ~/.rbenv
```
Puis dans le terminal, exécute :
```bash
sudo apt install -y build-essential tklib zlib1g-dev libssl-dev libffi-dev libxml2 libxml2-dev libxslt1-dev libreadline-dev libyaml-dev
```
```bash
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
```
```bash
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
exec zsh
```
## Ruby
### Installation
Tu peux maintenant installer la dernière version de [ruby](https://www.ruby-lang.org/en/) et en faire la version par défaut.
Exécute cette commande ; cela **peut prendre un moment (5-10 minutes)**
```bash
rbenv install 3.3.5
```
Une fois que l’installation de Ruby est terminée, exécute cette commande pour indiquer au système
d’utiliser la version 3.3.5 par défaut.
```bash
rbenv global 3.3.5
```
**Réinitialise** ton ton terminal et vérifie ta version de Ruby :
```bash
exec zsh
```
Puis exécute :
```bash
ruby -v
```
:heavy_check_mark: Si tu vois apparaître un message commençant par `ruby 3.3.5`, tu peux continuer :+1:
:x: Sinon, **demande au prof**
### Installer des gems
Si tu es en Chine 🇨🇳 clique ici
:warning: Si tu es en Chine, mets à jour la procédure d’installation des gems avec les commandes suivantes.
```bash
# En Chine seulement !
gem sources --remove https://rubygems.org/
gem sources -a https://gems.ruby-china.com/
gem sources -l
# *** SOURCES ACTUELLES ***
# https://gems.ruby-china.com/
# Ruby-china.com doit maintenant figurer dans la liste
```
**Que tu sois en Chine ou non**, continue ici pour installer les gems.
Dans l’environnement ruby, les bibliothèques externes sont appelées des `gems` : ce sont des bouts de code ruby, que tu peux télécharger et exécuter sur ton ordinateur. On va en installer quelques-unes.
Tout d'abord, nous allons mettre à jour `bundler`, ce qui nous permet d'installer des gemmes :
```bash
gem update bundler
```
Copie-colle la commande suivante dans ton terminal :
```bash
gem install colored faker http pry-byebug rake rails:8.1.1 rest-client rspec rubocop-performance sqlite3:2.8.1 activerecord:8.1.1 ruby-lsp
```
:heavy_check_mark: Si tu vois apparaître `xx gems installed`, c’est bon :+1:
:x: Si tu obtiens l’erreur suivante :
```bash
ERROR: While executing gem ... (TypeError)
incompatible marshal file format (can't be read)
format version 4.8 required; 60.33 given
```
Exécute la commande suivante :
```bash
rm -rf ~/.gemrc
```
Exécute à nouveau la commande pour installer les gems.
:warning: N’installe **JAMAIS** une gem avec `sudo gem install` ! Et ce même si tu tombes sur une réponse de Stack Overflow (ou du terminal) t’invitant à le faire.
## Node.js
[Node.js](https://nodejs.org/en/) est un programme d’exécution JavaScript qui permet d’exécuter du code JavaScript dans le terminal. On va l’installer avec [nvm](https://github.com/nvm-sh/nvm), un gestionnaire de versions pour Node.js.
Exécute les commandes suivantes dans ton terminal :
```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | zsh
exec zsh
```
Puis exécute la commande suivante :
```bash
nvm -v
```
Tu devrais voir apparaître une version. Sinon, demande au prof.
On va maintenant installer node :
```bash
nvm install 20.17.0
```
Une fois l’installation terminée, exécute :
```bash
node -v
```
Si tu vois apparaître `v20.17.0`, l'installation a réussi :heavy_check_mark: Tu peux alors exécuter :
```bash
nvm cache clear
```
:x: Sinon, **demande au prof**
## yarn
[`yarn`](https://yarnpkg.com/) est un gestionnaire de paquets, qui permet d’installer des bibliothèques JavaScript. Installons-le :
Exécute les commandes suivantes dans le terminal :
```bash
corepack enable
yarn set version stable
```
```bash
exec zsh
```
⚠️ Si tu rencontres des messages d'erreur, essaye d'exécuter `npm install -g corepack` puis exécute à nouveau les commandes ci-dessus.
Puis exécute la commande suivante :
```bash
yarn -v
```
:heavy_check_mark: Si tu vois apparaître une version, c’est bon :+1:
:x: Sinon, **demande au prof**
## SQLite
Dans quelques semaines, on abordera les bases de données et le SQL. [SQLite](https://sqlite.org/index.html) est un système de gestion de base de données utilisé pour exécuter des requêtes SQL sur des bases de données d'un seul fichier. Installons-le :
Dans un terminal, exécute la commande suivante :
```bash
sudo apt-get install sqlite3 libsqlite3-dev pkg-config
```
Puis exécute celle-ci :
```bash
sqlite3 -version
```
:heavy_check_mark: Si tu vois une version s'afficher, c'est tout bon :+1:
:x: If not, **demande au prof**
## PostgreSQL
Parfois, SQLite n'est pas suffisant et nous aurons besoin d'un outil plus avancé appelé [PostgreSQL](https://www.postgresql.org/), un système de gestion de base de données adapté à la production, puissant et open source.
Installons-le maintenant.
Exécute les commandes suivantes :
```bash
sudo apt install -y postgresql postgresql-contrib libpq-dev build-essential
```
```bash
sudo /etc/init.d/postgresql start
```
```bash
sudo -u postgres psql --command "CREATE ROLE \"`whoami`\" LOGIN createdb superuser;"
```
Tu peux configurer le démarrage automatique de PostgreSQL afin de ne pas avoir à exécuter `sudo /etc/init.d/postgresql start` chaque fois que tu ouvres un nouveau terminal :
```bash
sudo echo "`whoami` ALL=NOPASSWD:/etc/init.d/postgresql start" | sudo tee /etc/sudoers.d/postgresql
```
```bash
sudo chmod 440 /etc/sudoers.d/postgresql
```
```bash
echo "sudo /etc/init.d/postgresql start" >> ~/.zshrc
```
Ouvre un nouveau terminal.
:heavy_check_mark: Si tu vois apparaître le message `* Starting postgresql (via systemctl): postgresql.service` OU `* Starting PostgreSQL 14 database server`, c’est bon :+1:
:x: Sinon, **demande au prof**.
## Vérification
On va maintenant vérifier que tu as tout installé correctement.
Dans ton terminal, exécute la commande suivante :
```bash
exec zsh
```
Puis exécute :
```bash
curl -Ls https://raw.githubusercontent.com/lewagon/setup/master/check.rb > _.rb && ruby _.rb && rm _.rb || rm _.rb
```
:heavy_check_mark: Si tu vois apparaître en vert `Awesome! Your computer is now ready!`, c’est bon :+1:
:x: Sinon, **demande au prof**.
## Kitt
:warning: Si tu as reçu un e-mail du Wagon t’invitant à t’inscrire sur Kitt (notre plateforme pédagogique), tu peux passer cette étape. Suis plutôt les instructions contenues dans l’e-mail que tu as reçu, si tu ne l’as pas déjà fait.
Si tu n’es pas certain de ce que tu dois faire, suis [ce lien](https://kitt.lewagon.com/). Si tu es déjà connecté, tu peux passer cette section. Si tu n’es pas connecté, clique sur `Enter Kitt as a Student`. Si tu réussis à te connecter, tu peux passer cette étape. Sinon, demande au prof si tu aurais dû recevoir un e-mail ou si tu dois suivre les instructions ci-dessous.
Inscris-toi en tant qu’alumni du Wagon sur [kitt.lewagon.com/onboarding](http://kitt.lewagon.com/onboarding). Sélectionne ton batch, connecte-toi avec GitHub et renseigne toutes tes informations.
Le prof vérifiera ensuite avec toi que tu fais bien partie de ce batch. Tu peux lui demander de vérifier dès que tu as fini de remplir le formulaire d’inscription.
Une fois que le prof a vérifié ton profil, consulte ta messagerie. Tu devrais avoir reçu 2 e-mails :
- un de Slack, t’invitant à rejoindre la communauté Slack des anciens étudiants du Wagon (où tu pourras discuter avec tes amis et tous les anciens élèves). Clique sur **Devenir membre** et renseigne toutes les informations ;
- un de GitHub, t’invitant à rejoindre l’équipe `lewagon`. **Accepte** pour accéder aux cours.
## Slack
[Slack](https://slack.com/) est une plateforme de communication assez populaire dans le secteur de la technologie.
### Installation
[Télécharge l’application Slack](https://slack.com/downloads/windows) et installe-la.
:warning: Si tu utilises déjà Slack dans ton navigateur, télécharge et installe **l'application de bureau**, qui comprend toutes les fonctionnalités.
### Paramètres
Lance l’application et connecte-toi à l’organisation `lewagon-alumni`.
Pense à **télécharger une photo de profil** :point_down:

L’idée est de laisser Slack ouvert toute la journée pour partager des liens utiles / demander de l’aide / décider où aller manger, etc.
On va vérifier que tout fonctionne correctement ; pour cela, on va tester ta caméra et ton microphone :
- Ouvre l’application Slack
- Clique sur ta photo de profil en haut à droite
- Clique sur `Preferences` depuis le menu
- Séléctionne `Audio & video` dans la colonne de gauche
- En dessous de `Troubleshooting`, clique sur `Run an audio, video and screensharing test`. Le test va s’ouvrir dans une nouvelle fenêtre
- Vérifie que ton microphone, caméra, et enceintes soient bien séléctionnés, puis clique sur `Start test`

:heavy_check_mark: Une fois le test terminé, tu devrais voir apparaître des messages de succès en vert, au moins pour ton microphone et ta caméra. :+1:
:x: Sinon, **demande au prof**.
Tu peux également installer l’application Slack sur ton téléphone et te connecter à `lewagon-alumni` !
## Paramètres Windows
### Échanger des fichiers entre Windows et Ubuntu
On a besoin d’un moyen simple pour transférer des fichiers de Windows à Ubuntu et inversement.
Pour cela, on va créer des raccourcis vers les répertoires Ubuntu dans l’**explorateur de fichiers** Windows :
- Ouvre l’explorateur de fichiers Windows (ou utilise le raccourci `WIN` + `E`)
- Dans la barre d’adresse, saisis `\\wsl$\` (ou `\\wsl$\Ubuntu` si la première option ne fonctionne pas)
- Tu as désormais accès au système de fichiers Ubuntu
- Parcours le système de fichiers Ubuntu à la recherche des répertoires qui t’intéressent
- Fais glisser les répertoires souhaités dans la barre d’adresse pour créer des raccourcis

### Ouvrir l’explorateur de fichiers Windows à partir du terminal Ubuntu
Un autre moyen pour déplacer les fichiers consiste à ouvrir l’**explorateur de fichiers Windows** à partir du terminal Ubuntu :
- Ouvre un terminal Ubuntu
- Va dans le répertoire que tu souhaites parcourir
- Exécute la commande `explorer.exe .` (ou `wslview .`)
- Si tu obtiens un message d’erreur, exécute `wsl --shutdown` dans un Windows PowerShell et rouvre un terminal Ubuntu

### Trouver ton chemin dans le système de fichiers Ubuntu
Il se peut que tu aies besoin de connaître l’emplacement exact d’un répertoire Windows dans le système de fichiers Ubuntu ou l’inverse.
Pour convertir un chemin Windows en chemin Ubuntu et inversement :
- Ouvre un terminal Ubuntu
- Utilise la commande `wslpath "C:\Program Files"` pour traduire un chemin Windows en chemin Ubuntu
- Utilise la commande `wslpath -w "/home"` pour traduire un chemin Ubuntu en chemin Windows
- La commande `wslpath -w $(pwd)` renvoie le chemin Windows vers le répertoire Ubuntu actuel

### Épingler des applications à ta barre des tâches
Tu utiliseras très souvent la plupart des applications que tu as installées aujourd’hui. Épingle-les à ta barre des tâches pour y accéder en un seul clic !
Pour épingler une application à ta barre des tâches, lance l’application, fais un clic droit sur l’icône dans la barre des tâches pour faire apparaître le menu contextuel et sélectionne « Épingler à la barre des tâches ».

Tu dois épingler :
- ton terminal
- ton explorateur de fichiers
- VS Code
- ton navigateur Internet
- Slack
## La configuration est terminée !
Ton ordinateur est prêt pour [la formation AI Software Development du Wagon](https://www.lewagon.com/web-development-course/full-time) :muscle: :clap:
Profite du bootcamp, tu vas assurer :rocket:
================================================
FILE: windows.md
================================================
# Setup instructions
You will find below the instructions to set up your computer for [Le Wagon AI Software Development course](https://www.lewagon.com/web-development-course/full-time).
Please **read them carefully and execute all commands in the following order**.
If you get stuck, don't hesitate to ask a teacher for help :raising_hand:
You can also have a look at [our cheatsheets](https://github.com/lewagon/setup/tree/master/docs) for common issue fixes and tips :heavy_check_mark:
Let's start :rocket:
## GitHub account
Have you signed up to GitHub? If not, [do it right away](https://github.com/join).
:point_right: **[Upload a picture](https://github.com/settings/profile)** and put your name correctly on your GitHub account. This is important as we'll use an internal dashboard with your avatar. Please do this **now**, before you continue with this guide.

:point_right: **[Enable Two-Factor Authentication (2FA)](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication#configuring-two-factor-authentication-using-text-messages)**. GitHub will send you text messages with a code when you try to log in. This is important for security and also will soon be required in order to contribute code on GitHub.
## Windows version
Before we start, we need to check that the version of Windows installed on your computer is compatible with this setup instructions.
### Windows 10 or Windows 11
> :warning: **Note on Windows 10 and security**
>
> The Le Wagon bootcamp setup works on Windows 10. That said, we highly recommend to upgrade to Windows 11. Since October 14th, 2025, Microsoft has ended support for Windows 10, which means it will no longer receive security updates, potentially putting your machine at risk. For more details, read [Microsoft's guide](https://support.microsoft.com/en-us/windows/windows-10-support-has-ended-on-october-14-2025-2ca8b313-1946-43d3-b55c-2b95b107f281). In case your machine can't run Windows 11, consider switching to Ubuntu.
To be able to set up your computer, you need to have **Windows 10 or Windows 11** installed.
To check your Windows version:
- Press `Windows` + `R`
- Type `winver`
- Press `Enter`
:heavy_check_mark: If the first words of this window are **Windows 11** you're good to go :+1:
If the first words of this window are **Windows 10**, check the **Version number**:
- :heavy_check_mark: If it says at least `2004`, you are good to go :+1:
- :x: If it is below `2004`, you need to run an update.
-
How to install updates?
Open Windows Update:
- Press `Windows` + `R`
- Type `ms-settings:windowsupdate`
- Press `Enter`
- Click on `Check updates`
:heavy_check_mark: If you see a green check mark and the message "You're up to date", you're good to go :+1:
:warning: If you have a red exclamation mark and the message "Update available", please install them and repeat the process until it says that you are up to date :loop:
:x: If you have an error message about Windows not being able to apply updates, please **contact a teacher**.
Activate Windows Update Service to fix Updates
Some antiviruses and pieces of software deactivate the Update service we need, resulting in the error you see. Let's fix that!
- Press `Windows` + `R`
- Type `services.msc`
- Press `Enter`
- Double Click `Windows Update Service`
- Set its `Startup` to `Automatic`
- Click on `Start`
- Click on `Ok`
Then let's try updates again!
Check the version number again:
- Press `Windows` + `R`
- Type `winver`
- Press `Enter`
:heavy_check_mark: If it says at least `2004`, you are good to go :+1:
:x: If it is below `2004`, **contact a TA**.
## Virtualization
We need to ensure that the Virtualization options are enabled in the BIOS of your computer.
For many computers, this is already the case. Let's check:
- Press `Windows` + `R`
- Type `taskmgr`
- Press `Enter`
- Click on the `Performance` tab
- Click on `CPU`

:heavy_check_mark: If you see "Virtualization: Enabled", you're good to go :+1:
:x: If the line is missing or if the virtualization is disabled, please **contact a teacher before trying to activate the Virtualization**
Activate Virtualization
We need to access the BIOS / UEFI of the computer to activate it.
- Press `Windows + R`
- Type `shutdown.exe /r /o /t 1`
- Press `Enter`
- Wait for the computer to shutdown
- Click on `Troubleshoot`
- Click on `Advanced Options`
- Click on `UEFI Firmware Settings`
- Click on `Restart`
You need to activate the virtualization option for your processor here:
- Most of the time, in the advanced settings, the CPU settings, or the Northbridge settings
- The option can be called differently according to your computer:
- Intel: `Intel VT-x`, `Intel Virtualization Technology`, `Virtualization Extensions`, `Vanderpool`...
- AMD: `SVM Mode` or `AMD-V`
- Save the changes after activation and reboot the computer through the appropriate option
## Windows Subsystem for Linux (WSL)
WSL is the development environment we are using to run Ubuntu. You can learn more about WSL [here](https://docs.microsoft.com/en-us/windows/wsl/faq).
We will install WSL 2 and Ubuntu in one command through the Windows Command Prompt.
:warning: In the following instruction, please be aware of the `Ctrl` + `Shift` + `Enter` key stroke to execute **Windows Command Prompt** with administrator privileges instead of just clicking on `Ok`or pressing `Enter`.
- Press `Windows` + `R`
- Type `cmd`
- Press **`Ctrl` + `Shift` + `Enter`**
:warning: You may have to accept the UAC confirmation about the privilege elevation.
A black terminal window will appear:
- Copy the following command (`Ctrl` + `C`)
- Paste it into the terminal window (`Ctrl` + `V` or by right-clicking in the window)
- Run it by pressing `Enter`
```powershell
wsl --install
```
:heavy_check_mark: If the command ran without any error, please restart your computer and continue below :+1:
:x: If you encounter an error message (or if you see some text in red in the window), please **contact a teacher**.
Troubleshooting for Windows 10 (only if needed, check with a TA)
#### For Windows 10 < 2004: install WSL 1 first
:warning: In the following instruction, please be aware of the `Ctrl` + `Shift` + `Enter` key stroke to execute **Windows PowerShell** with administrator privileges instead of just clicking on `Ok`or pressing `Enter`.
- Press `Windows` + `R`
- Type `powershell`
- Press **`Ctrl` + `Shift` + `Enter`**
:warning: You may have to accept the UAC confirmation about the privilege elevation.
A blue terminal window will appear:
- Copy the following commands one by one (`Ctrl` + `C`)
- Paste them into the PowerShell window (`Ctrl` + `V` or by right-clicking in the window)
- Run them by pressing `Enter`
```powershell
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
```
```powershell
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
```
```powershell
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
```
:heavy_check_mark: If all three commands ran without any error, please restart your computer and continue below :+1:
:x: If you encounter an error message (or if you see some text in red in the window), please **contact a teacher**
#### For Windows 10 users running WSL 1: Upgrade to WSL 2
If you are running Windows 10, we will then upgrade WSL to version 2.
Once your computer has restarted, we need to download the WSL2 installer.
- Go to the [download page](https://aka.ms/wsl2kernel)
- Download "WSL2 Linux kernel update package"
- Open the file you've just downloaded
- Click `Next`
- Click `Finish`

:heavy_check_mark: If didn't encounter any error message, you're good to go :+1:
:x: If you encounter the error "This update only applies to machines with the Windows Subsystem for Linux", **right click** on the program and select `uninstall`; you shall be able to install it normally this time.
#### For Windows 10 users running WSL 1: Make WSL 2 the default Windows Subsystem for Linux
If you are running Windows 10, we will set WSL default version to 2.
Now that WSL 2 is installed, let's make it the default version:
- Press `Windows` + `R`
- Type `cmd`
- Press `Enter`
In the window which appears, type:
```bash
wsl --set-default-version 2
```
:heavy_check_mark: If you see "The operation completed successfully", you can close this terminal and continue to follow the instructions below :+1:
:x: If the message you get is about Virtualization, please **contact a teacher**
Enable Virtual Machine Platform Windows feature
Follow the steps described [here](https://www.configserverfirewall.com/windows-10/please-enable-the-virtual-machine-platform-windows-feature-and-ensure-virtualization-is-enabled-in-the-bios/#:~:text=To%20enable%20WSL%202,%20Open,Windows%20feature%20on%20or%20off.&text=Ensure%20that%20the%20Virtual%20Machine,Windows%20will%20enable%20WSL%202) until you enable Virtual Machine Platform and Windows Subsystem for Linux
Enable Hyper-V Windows feature
Follow the steps described [here](https://winaero.com/enable-use-hyper-v-windows-10/) until you enable the group Hyper-V
:information_source: If you are running Windows 10 **Home edition**, Hyper-V feature is not available for your operating system. It's non-blocking and you can still continue to follow the instructions below :ok_hand:
## Ubuntu
### Installation
After restarting you computer, you should see a terminal window saying WSL is resuming the Ubuntu installation process. When it's done, Ubuntu will be launched.
Troubleshooting for Windows 10 (only if needed, check with a TA)
If the Ubuntu installation did not resume, first try it again: launch Powershell or the Command Prompt again and run `wsl --install` again.
If you are running Windows 10, let's install Ubuntu throught the Microsoft Store:
- Click on `Start`
- Type `Microsoft Store`
- Click on `Microsoft Store` in the list
- Search for `Ubuntu` in the search bar
- **Select version without any number, just plain "Ubuntu"**
- Click on `Get`
:warning: Don't install **Ubuntu 18.04 LTS** nor **Ubuntu 20.04**!
Uninstall wrong versions of Ubuntu
To uninstall a wrong version of Ubuntu, you just have to go to the Installed Program List of Windows 10:
- Press `Windows` + `R`
- Type `ms-settings:appsfeatures`
- Press `Enter`
Find the software to uninstall and click on the uninstall button.
Once the installation is finished, the `Get` button becomes a `Open` button: click on it.
### First launch
At first launch, you will be asked some information:
- Choose a **username**:
- one word
- lowercase
- no special characters
- for example: `lewagon` or your `firstname`
- Choose a **password**
- Confirm your password
:warning: When you type your password, nothing will show up on the screen, **that's normal**. This is a security feature to mask not only your password as a whole but also its length. Just type your password and when you're done, press `Enter`.
### Check the WSL version of Ubuntu
- Press `Windows` + `R`
- Type `cmd`
- Press `Enter`
Type the following command:
```bash
wsl -l -v
```
:heavy_check_mark: If the version of Ubuntu WSL is 2, you are good to go :+1:
:x: If the version of Ubuntu WSL is 1, we will need to convert it to version 2.
Convert Ubuntu WSL V1 to V2
In the Command Prompt window, type:
```bash
wsl --set-version Ubuntu 2
```
:heavy_check_mark: After a few seconds, you should get the following message: `The conversion is complete`.
:x: If it does not work, we need to be sure that Ubuntu files are not compressed.
Check for Uncompressed Files
- Press `Windows` + `R`
- Type `%localappdata%\Packages`
- Press `Enter`
- Open the folder named `CanonicalGroupLimited.UbuntuonWindows...`
- Right Click on the `LocalState` folder
- Click on `Properties`
- Click on `Advanced`
- Make sure that the option `Compress content` is **not** ticked, then click on `Ok`.
Apply changes to this folder only and try to convert the Ubuntu WSL version again.
:x: If the conversion still does not work, please **contact a teacher**.
You can close this terminal now.
### Check your username
Type this in the Ubuntu terminal:
```bash
whoami
```
It should return the username you chose before.
:x: It if says `root`, **contact a TA** before continuing!
## Visual Studio Code
### Installation
Let's install [Visual Studio Code](https://code.visualstudio.com) text editor.
- Go to [Visual Studio Code download page](https://code.visualstudio.com/download).
- Click on "Windows" button
- Open the file you have just downloaded.
- Install it with few options:

When the installation is finished, launch VS Code.
### Connecting VS Code to Ubuntu
To make VS Code interact properly with Ubuntu, let's install the [Remote - WSL](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) VS Code extension.
Open your **Ubuntu terminal**.
Copy-paste the following commands in the terminal:
```bash
code --install-extension ms-vscode-remote.remote-wsl
```
Then open VS Code from your terminal:
```bash
code .
```
:heavy_check_mark: If you see `WSL: Ubuntu` in the bottom left corner of the VS Code window, you're good to go :+1:

:x: Otherwise, please **contact a teacher**
## Windows Terminal
### Installation
:information_source: The following instructions depend on your version of Windows.
If you are running Windows 11, the Windows Terminal is already installed and you can proceed to the next section :point_down:
If you are running Windows 10, let's install Windows Terminal, a real modern terminal.
Windows 10: Install Windows Terminal
- Click on `Start`
- Type `Microsoft Store`
- Click on `Microsoft Store` in the list
- Search for `Windows Terminal` in the search bar
- **Select Windows Terminal"**
- Click on `Install`
:warning: DO NOT install **Windows Terminal Preview**, just **Windows Terminal**!
Uninstall wrong version of Windows Terminal
To uninstall a wrong version of Windows Terminal, you just have to go to the Installed Program List of Windows 10:
- Press `Windows` + `R`
- Type `ms-settings:appsfeatures`
- Press `Enter`
Find the software to uninstall and click on the uninstall button.
Once the installation is finished, the `Install` button becomes a `Launch` button: click on it.
### Ubuntu as the default terminal
Let's make Ubuntu the default terminal of your Windows Terminal application.
Press `Ctrl` + `,`
It should open the terminal settings:

- Change the default profile to "Ubuntu"
- Click on "Save"
- Click on "Open JSON file"
You may see an orange circle rather than a penguin as the logo for Ubuntu.
We have circled in red the part you need to add:

First, let's ask Ubuntu to start directly inside your Ubuntu Home Directory instead of the Windows one.
- Place this line inside the { } block that contains "name": "Ubuntu" (like in the screenshot):
```bash
"commandline": "wsl.exe ~",
```
:warning: Do not forget the comma at the end of the line!
Then, let's disable warnings for copy-pasting commands between Windows and Ubuntu:
- Locate the line "defaultProfile": "{2c4de342-...}"
- Add the following line after it:
```bash
"warning.multiLinePaste": false,
```
:warning: Do not forget the comma at the end of the line!
You can save these changes by pressing `Ctrl` + `S`
:heavy_check_mark: Your **Windows Terminal** is now setup :+1:
This terminal has tabs: you can choose to open a new terminal tab by clicking on the **+** next to the current one.
**From now on, every time we will refer to the terminal or the console it will be this one.** DO NOT use any other terminal anymore.
## VS Code Extensions
### Installation
Let's install some useful extensions to VS Code.
Copy-paste the following commands in your terminal:
```bash
code --install-extension ms-vscode.sublime-keybindings
code --install-extension emmanuelbeziat.vscode-great-icons
code --install-extension github.github-vscode-theme
code --install-extension MS-vsliveshare.vsliveshare
code --install-extension shopify.ruby-lsp
code --install-extension dbaeumer.vscode-eslint
code --install-extension Rubymaniac.vscode-paste-and-indent
code --install-extension alexcvzz.vscode-sqlite
code --install-extension anteprimorac.html-end-tag-labels
code --install-extension rayhanw.erb-helpers
```
Here is a list of the extensions you are installing:
- [Sublime Text Keymap and Settings Importer](https://marketplace.visualstudio.com/items?itemName=ms-vscode.sublime-keybindings)
- [VSCode Great Icons](https://marketplace.visualstudio.com/items?itemName=emmanuelbeziat.vscode-great-icons)
- [Live Share](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare)
- [Ruby](https://marketplace.visualstudio.com/items?itemName=shopify.ruby-lsp)
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [Paste and Indent](https://marketplace.visualstudio.com/items?itemName=Rubymaniac.vscode-paste-and-indent)
- [SQLite](https://marketplace.visualstudio.com/items?itemName=alexcvzz.vscode-sqlite)
### VS Code AI Features
VS Code includes many powerful **AI features**, which are a great tool once you already know how to code.
That said, relying on AI too early can hide important concepts and make debugging harder to understand. Once you’re comfortable with the fundamentals, you’ll know when and how to use AI effectively — without letting it do the thinking for you.
For the start of the bootcamp, we’ll disable these features. At the right point in the course, we’ll reenable them so you can put them to good use.
In **VS Code**:
1. Let's open the VS Code "Command **P**alette": type `Ctrl-Shift-P` (Windows / Linux) or `Cmd-Shift-P` (macOS).
1. This will open the Command Palette: a small text box at the top of your screen. Start typing `aifeatures` until you see "Chat: Learn How to Hide AI features". Click on it.

1. This will open the settings, and will show you the option "Disable and hide built-in AI features ...". Tick the checkbox in front of that option.

Later, if you want **to reenable** the AI features, you can follow the same instructions to untick the checkbox.
### Live Share configuration
[Visual Studio Live Share](https://visualstudio.microsoft.com/services/live-share/) is a VS Code extension which allows you to share the code in your text editor for debugging and pair-programming: let's set it up!
Launch VS Code from your terminal by typing `code` and pressing `Enter`.
Click on the little arrow at the bottom of the left bar :point_down:

- Click on the "Share" button, then on "GitHub (Sign in using GitHub account)".
- A popup appears asking you to sign in with GitHub: click on "Allow".
- You are redirected to a GitHub page in you browser asking you to authorize Visual Studio Code: click on "Continue" then "Authorize github".
- VS Code may display additional pop-ups: close them by clicking "OK".
That's it, you're good to go!
## Command line tools
### Check the locale
The locale is a mechanism allowing to customize programs to your language and country.
Let's verify that the default locale is set to English, please type this in the Ubuntu terminal:
```bash
locale
```
If the output does not contain `LANG=en_US.UTF-8`, run the following command in a Ubuntu terminal to install the english locale:
```bash
sudo locale-gen en_US.UTF-8
```
If after, you receive a warning (`bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf-8)`) in your terminal, please do the following:
Generate locale
Please, run this lines in your terminal.
```bash
sudo update-locale LANG=en_US.UTF8
sudo apt-get update
sudo apt-get install language-pack-en language-pack-en-base manpages
```
### Zsh & Git
Instead of using the default `bash` [shell](https://en.wikipedia.org/wiki/Shell_(computing)), we will use `zsh`.
We will also use [`git`](https://git-scm.com/), a command line software used for version control.
Let's install them, along with other useful tools:
- Open an **Ubuntu terminal**
- Copy and paste the following commands:
```bash
sudo apt update
```
```bash
sudo apt install -y curl git imagemagick jq unzip vim zsh tree
```
These commands will ask for your password: type it in.
:warning: When you type your password, nothing will show up on the screen, **that's normal**. This is a security feature to mask not only your password as a whole but also its length. Just type in your password and when you're done, press `Enter`.
### GitHub CLI installation
Let's now install [GitHub official CLI](https://cli.github.com) (Command Line Interface). It's a software used to interact with your GitHub account via the command line.
In your terminal, copy-paste the following commands and type in your password if asked:
```bash
sudo apt remove -y gitsome # gh command can conflict with gitsome if already installed
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
```
```bash
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
```
```bash
sudo apt update
```
```bash
sudo apt install -y gh
```
To check that `gh` has been successfully installed on your machine, you can run:
```bash
gh --version
```
:heavy_check_mark: If you see `gh version X.Y.Z (YYYY-MM-DD)`, you're good to go :+1:
:x: Otherwise, please **contact a teacher**
## Oh-my-zsh
Let's install the `zsh` plugin [Oh My Zsh](https://ohmyz.sh/).
In a terminal execute the following command:
```bash
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```
If asked "Do you want to change your default shell to zsh?", press `Y`
At the end your terminal should look like this:

:heavy_check_mark: If it does, you can continue :+1:
:x: Otherwise, please **ask for a teacher**
## Linking your default browser to Ubuntu
To be sure that you can interact with your browser installed on Windows from your Ubuntu terminal, we need to set it as your default browser there.
:warning: You need to execute at least one of the following commands below:
Google Chrome as your default browser
Run the command:
```bash
ls /mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe
```
Did you get an error like `ls: cannot access...`?
Yes, I had an error
Run the following commands:
```bash
echo "export BROWSER=\"/mnt/c/Program Files/Google/Chrome/Application/chrome.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files/Google/Chrome/Application/chrome.exe'\"" >> ~/.zshrc
```
No, everything was fine
Run the following commands:
```bash
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe'\"" >> ~/.zshrc
```
---
Mozilla Firefox as your default browser
Run the command:
```bash
ls /mnt/c/Program\ Files\ \(x86\)/Mozilla\ Firefox/firefox.exe
```
Did you get an error like `ls: cannot access...`?
Yes, I had an error
Run the following commands:
```bash
echo "export BROWSER=\"/mnt/c/Program Files/Mozilla Firefox/firefox.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files/Mozilla Firefox/firefox.exe'\"" >> ~/.zshrc
```
No, everything was fine
Run the following commands:
```bash
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Mozilla Firefox/firefox.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Mozilla Firefox/firefox.exe'\"" >> ~/.zshrc
```
---
Microsoft Edge as your default browser
Run the commands:
```bash
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe'\"" >> ~/.zshrc
```
---
Restart your terminal.
Then please make sure that the following command returns "Browser defined 👌":
```bash
[ -z "$BROWSER" ] && echo "ERROR: please define a BROWSER environment variable ⚠️" || echo "Browser defined 👌"
```
If it does not,
:heavy_check_mark: If you got this message, you can continue :+1:
:x: If not, choose a browser in the list above and execute the corresponding command. Then don't forget to reset your terminal:
```bash
exec zsh
```
Do not hesitate to **contact a teacher**.
## GitHub CLI
CLI is the acronym of [Command-line Interface](https://en.wikipedia.org/wiki/Command-line_interface).
In this section, we will use [GitHub CLI](https://cli.github.com/) to interact with GitHub directly from the terminal.
It should already be installed on your computer from the previous commands.
We will use the GitHub CLI (`gh`) to connect to GitHub using *SSH*, a protocol to log in using SSH keys instead of the well known username/password pair.
First in order to **login**, copy-paste the following command in your terminal:
:warning: **DO NOT edit the `email`**
```bash
gh auth login -s 'user:email' -w --git-protocol ssh
```
`gh` will ask you few questions:
- `Generate a new SSH key to add to your GitHub account?` Press `Enter` to ask gh to generate the SSH keys for you.
If you already have SSH keys, you will see instead `Upload your SSH public key to your GitHub account?` With the arrows, select your public key file path and press `Enter`.
- `Enter a passphrase for your new SSH key (Optional)`. Type something you want and that you'll remember. It's a password to protect your private key stored on your hard drive. Then press `Enter`.
- `Title for your SSH key`. You can leave it at the proposed "GitHub CLI", press `Enter`.
You will then get the following output:
```bash
! First copy your one-time code: 0EF9-D015
- Press Enter to open github.com in your browser...
```
Select and copy the code (`0EF9-D015` in the example), then press `Enter`.
Your browser will open and ask you to authorize GitHub CLI to use your GitHub account. Accept and wait a bit.
Come back to the terminal, press `Enter` again, and that's it.
To check that you are properly connected, type:
```bash
gh auth status
```
:heavy_check_mark: If you get `Logged in to github.com as `, then all good :+1:
:x: If not, **contact a teacher**.
## Dotfiles (Standard configuration)
Hackers love to refine and polish their shell and tools.
We'll start with a great default configuration provided by Le Wagon: [`lewagon/dotfiles`](https://github.com/lewagon/dotfiles).
As your configuration is personal, you need your **own** repository storing it. So you will **fork** Le Wagon repository.
Forking means that you will create a new repo in your own GitHub account `$GITHUB_USERNAME/dotfiles`, identical to the original Le Wagon one that you will be able to modify at will.
Open your terminal and set a variable for your GitHub username:
```bash
export GITHUB_USERNAME=`gh api user | jq -r '.login'`
```
```bash
echo $GITHUB_USERNAME
```
:heavy_check_mark: You should see your GitHub username printed.
:x: If not, **stop here** and ask for help. There may be a problem with the previous step (`gh auth`).
:warning: Please note that this variable is only set for the time your terminal is open. If you close it before or during the next steps, you need to set it again with the two steps above!
Time to fork the repo and clone it on your computer:
```bash
mkdir -p ~/code/$GITHUB_USERNAME && cd $_
```
```bash
gh repo fork lewagon/dotfiles --clone
```
### Dotfiles installer
Run the `dotfiles` installer:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles
```
```bash
zsh install.sh
```
Check the emails registered with your GitHub Account. You'll need to pick one at the next step:
```bash
gh api user/emails | jq -r '.[].email'
```
:heavy_check_mark: If you see the list of your registered emails, you can proceed :+1:
:x: If not, please [reauthenticate to GitHub](https://github.com/lewagon/setup/blob/master/windows.md#github-cli) before running this command :point_up: again.
### git installer
Run the `git` installer:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh
```
:point_up: This will **prompt** you for your name (`FirstName LastName`) and your email.
:warning: You **need** to put one of the emails listed above thanks to the previous `gh api ...` command. If you don't do that, Kitt won't be able to track your progress. 💡 Select the `@users.noreply.github.com` address if you don't want your email to appear in public repositories you may contribute to.
Please now **reset** your terminal by running:
```bash
exec zsh
```
## Disable SSH passphrase prompt
You don't want to be asked for your passphrase every time you communicate with a distant repository. So, you need to add the plugin `ssh-agent` to `oh my zsh`:
First, open the `.zshrc` file:
```bash
code ~/.zshrc
```
Then:
- Spot the line starting with `plugins=`
- Add `ssh-agent` at the end of the plugins list
:heavy_check_mark: Save the `.zshrc` file with `Ctrl` + `S` and close your text editor.
## rbenv
Let's install [`rbenv`](https://github.com/sstephenson/rbenv), a software to install and manage `ruby` environments.
First, we need to clean up any previous Ruby installation you might have:
```bash
rvm implode && sudo rm -rf ~/.rvm
# If you got "zsh: command not found: rvm", carry on.
# It means `rvm` is not on your computer, that's what we want!
rm -rf ~/.rbenv
```
Then in the terminal, run:
```bash
sudo apt install -y build-essential tklib zlib1g-dev libssl-dev libffi-dev libxml2 libxml2-dev libxslt1-dev libreadline-dev libyaml-dev
```
```bash
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
```
```bash
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
```
```bash
exec zsh
```
## Ruby
### Installation
Now, you are ready to install the latest [ruby](https://www.ruby-lang.org/en/) version and set it as the default version.
Run this command, it will **take a while (5-10 minutes)**
```bash
rbenv install 3.3.5
```
Once the ruby installation is done, run this command to tell the system
to use the 3.3.5 version by default.
```bash
rbenv global 3.3.5
```
**Reset** your terminal and check your Ruby version:
```bash
exec zsh
```
Then run:
```bash
ruby -v
```
:heavy_check_mark: If you see something starting with `ruby 3.3.5` then you can proceed :+1:
:x: If not, **ask a teacher**
### Installing some gems
If you are in China 🇨🇳 click here
:warning: If you are in China, you should update the way we'll install gem with the following commands.
```bash
# China only!
gem sources --remove https://rubygems.org/
gem sources -a https://gems.ruby-china.com/
gem sources -l
# *** CURRENT SOURCES ***
# https://gems.ruby-china.com/
# Ruby-china.com must be in the list now
```
**Everyone, in China or not**, continue here to install gems.
In the ruby world, we call external libraries `gems`: they are pieces of ruby code that you can download and execute on your computer. Let's install some!
First, we'll update `bundler`, which is what lets us install gems:
```bash
gem update bundler
```
In your terminal, copy-paste the following command:
```bash
gem install colored faker http pry-byebug rake rails:8.1.1 rest-client rspec rubocop-performance sqlite3:2.8.1 activerecord:8.1.1 ruby-lsp
```
:heavy_check_mark: If you get `xx gems installed`, then all good :+1:
:x: If you encounter the following error:
```bash
ERROR: While executing gem ... (TypeError)
incompatible marshal file format (can't be read)
format version 4.8 required; 60.33 given
```
Run the following command:
```bash
rm -rf ~/.gemrc
```
Rerun the command to install the gems.
:warning: **NEVER** install a gem with `sudo gem install`! Even if you stumble upon a Stackoverflow answer (or the terminal) telling you to do so.
## Node.js
[Node.js](https://nodejs.org/en/) is a JavaScript runtime to execute JavaScript code in the terminal. Let's install it with [nvm](https://github.com/nvm-sh/nvm), a version manager for Node.js.
In a terminal, execute the following commands:
```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | zsh
```
```bash
exec zsh
```
Then run the following command:
```bash
nvm -v
```
You should see a version. If not, ask a teacher.
Now let's install node:
```bash
nvm install 20.17.0
```
When the installation is finished, run:
```bash
node -v
```
If you see `v20.17.0`, the installation succeeded :heavy_check_mark: You can then run:
```bash
nvm cache clear
```
:x: If not, **contact a teacher**
## yarn
[`yarn`](https://yarnpkg.com/) is a package manager to install JavaScript libraries. Let's install it:
In a terminal, run the following commands:
```bash
corepack enable
yarn set version stable
```
⚠️ If you see any error messages, try running `npm install -g corepack` and then run the commands above again.
```bash
exec zsh
```
Then run the following command:
```bash
yarn -v
```
:heavy_check_mark: If you see a version, you're good :+1:
:x: If not, **ask for a teacher**
## SQLite
In a few weeks, we'll talk about databases and SQL. [SQLite](https://sqlite.org/index.html) is a database engine used to execute SQL queries on single-file databases. Let's install it:
In a terminal, execute the following commands:
```bash
sudo apt-get install sqlite3 libsqlite3-dev pkg-config
```
Then run the following command:
```bash
sqlite3 -version
```
:heavy_check_mark: If you see a version, you're good :+1:
:x: If not, **ask for a teacher**
## PostgreSQL
Sometimes, SQLite is not enough and we will need a more advanced tool called [PostgreSQL](https://www.postgresql.org/), an open-source robust and production-ready database system.
Let's install it now.
Run the following commands:
```bash
sudo apt install -y postgresql postgresql-contrib libpq-dev build-essential
```
```bash
sudo /etc/init.d/postgresql start
```
```bash
sudo -u postgres psql --command "CREATE ROLE \"`whoami`\" LOGIN createdb superuser;"
```
_📝 If you get an error saying `could not change directory to "/home/your_name": Permission denied` that is totally fine, and there's no need to worry 💆 If, on the first run, it says `CREATE ROLE` in the end all worked fine._
You can configure PostgreSQL to autostart, so you don't have to execute `sudo /etc/init.d/postgresql start` each time you open a new terminal:
```bash
sudo echo "`whoami` ALL=NOPASSWD:/etc/init.d/postgresql start" | sudo tee /etc/sudoers.d/postgresql
```
```bash
sudo chmod 440 /etc/sudoers.d/postgresql
```
```bash
echo "sudo /etc/init.d/postgresql start" >> ~/.zshrc
```
Open a new terminal.
:heavy_check_mark: If you see a `* Starting postgresql (via systemctl): postgresql.service` OR `* Starting PostgreSQL 14 database server` message, you're good to go :+1:
:x: If not, **contact a teacher**.
## Check-up
Let's check if you successfully installed everything.
In you terminal, run the following command:
```bash
exec zsh
```
Then run:
```bash
curl -Ls https://raw.githubusercontent.com/lewagon/setup/master/check.rb > _.rb && ruby _.rb && rm _.rb || rm _.rb
```
:heavy_check_mark: If you get a green `Awesome! Your computer is now ready!`, then you're good :+1:
:x: If not, **contact a teacher**.
## Kitt
You should have received an email from Le Wagon inviting you to sign up on [Kitt](https://kitt.lewagon.com) (our learning platform). When submitting your onboarding form on Kitt, you should have received two additional invitations:
- One from Slack, inviting you to the Le Wagon Alumni slack community (where you'll chat with your buddies and all the previous alumni). Click on **Join** and fill the information.
- One from GitHub, inviting you to `lewagon` team. **Accept it** otherwise you won't be able to access the lecture slides.
If you haven't, please contact your teaching team.
## Slack
[Slack](https://slack.com/) is a communication platform pretty popular in the tech industry.
### Installation
[Download the Slack app](https://slack.com/downloads/windows) and install it.
:warning: If you are already using Slack in your browser, please download and install **the desktop app** which is fully featured.
### Settings
Launch the app and sign in to `lewagon-alumni` organization.
Make sure you **upload a profile picture** :point_down:

The idea is that you'll have Slack open all day, so that you can share useful links / ask for help / decide where to go to lunch / etc.
To ensure that everything is working fine for video calls, let's test your camera and microphone:
- Open the Slack app
- Click your profile picture in the top right.
- Select `Preferences` from the menu.
- Click `Audio & video` in the left-side column.
- Below `Troubleshooting`, click `Run an audio, video and screensharing test`. The test will open in a new window.
- Check that your preferred speaker, microphone and camera devices appear in the drop-down menus, then click `Start test`.

:heavy_check_mark: When the test is finished, you should see green "Succeed" messages at least for your microphone and camera. :+1:
:x: If not, **contact a teacher**.
You can also install Slack app on your phone and sign in `lewagon-alumni`!
## Windows settings
### Exchange files between Windows and Ubuntu
We need an easy way to transfer files from Windows to Ubuntu and vice versa.
In order to do that, let's create shortcuts to Ubuntu directories in the Windows **File Explorer**:
- Open the Windows File Explorer (or use the shortcut `WIN` + `E`)
- In the Address Bar, enter `\\wsl$\` (or `\\wsl$\Ubuntu` if it does not work)
- You now have acces to the Ubuntu file system
- Dive into the Ubuntu file system in order to look for directories of interest
- Drag the desired folders into the Address Bar in order to create shortcuts

### Open the Windows File Explorer from the Ubuntu terminal
Another option to move files around is to open the Windows **File Explorer** from the Ubuntu terminal:
- Open an Ubuntu terminal
- Go to the directory you wish to explore
- Run the `explorer.exe .` command (alternatively, use `wslview .`)
- If you get an input output error message, run `wsl --shutdown` in a Windows PowerShell and reopen an Ubuntu terminal

### Find your way in the Ubuntu File System
You might want to figure out the exact location of a Windows directory in the Ubuntu file system, or the other way around.
In order to convert a Windows path to and from an Ubuntu path:
- Open an Ubuntu terminal
- Use the `wslpath "C:\Program Files"` command in order to translate a Windows path into an Ubuntu path
- Use the `wslpath -w "/home"` command in order to translate an Ubuntu path into a Windows path
- In particular, the `wslpath -w $(pwd)` command returns the Windows path of the current Ubuntu directory

### Pin apps to your taskbar
You are going to use most of the apps you've installed today really often. Let's pin them to your taskbar so that they are just one click away!
To pin an app to your taskbar, launch the app, right-click on the icon in the taskbar to bring up the context menu and choose "Pin to taskbar".

You must pin:
- Your terminal
- Your file explorer
- VS Code
- Your Internet browser
- Slack
## Setup completed!
Your computer is now all set for [Le Wagon AI Software Development course](https://www.lewagon.com/web-development-course/full-time) :muscle: :clap:
Enjoy the bootcamp, you will nail it :rocket:
================================================
FILE: windows.pt.md
================================================
# Instruções de configuração
Você encontrará abaixo as instruções para configurar seu computador para o [curso de AI Software Development Le Wagon](https://www.lewagon.com/web-development-course/full-time).
Por favor **leia-os com atenção e execute todos os comandos na seguinte ordem**.
Se você tiver dúvidas, não hesite em pedir ajuda a um professor :raising_hand:
Você também pode dar uma olhada em [nossas cheatsheets](https://github.com/lewagon/setup/tree/master/docs) para soluções e dicas de problemas comuns :heavy_check_mark:
Vamos começar :rocket:
## Conta GitHub
Você se inscreveu no GitHub? Caso contrário, [faça isso imediatamente](https://github.com/join).
:point_right: **[Carregue uma imagem](https://github.com/settings/profile)** e coloque seu nome corretamente em sua conta GitHub. Isso é importante porque usaremos um painel interno com seu avatar. Faça isso **agora**, antes de continuar com este guia.

:point_right: [Ative a Autenticação em Duas Etapas (2FA)](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication#configuring-two-factor-authentication-using-text-messages). O GitHub enviará mensagens de texto com um código quando você tentar fazer login. Isso é importante para a segurança e em breve será necessário para contribuir com código no GitHub.
## Versão do Windows
Antes de começarmos, precisamos verificar se a versão do Windows instalada no seu computador é compatível com estas instruções de configuração.
### Windows 10 ou Windows 11
> :warning: **Nota sobre o Windows 10 e segurança**
>
> O setup do bootcamp Le Wagon funciona no Windows 10. Dito isso, recomendamos fortemente a atualização para o Windows 11. A partir de 14 de outubro de 2025, a Microsoft encerrou o suporte ao Windows 10, o que significa que ele não receberá mais atualizações de segurança, potencialmente deixando sua máquina em risco. Para mais detalhes, leia o guia da Microsoft: https://support.microsoft.com/en-us/windows/windows-10-support-has-ended-on-october-14-2025-2ca8b313-1946-43d3-b55c-2b95b107f281. Caso sua máquina não consiga executar o Windows 11, considere mudar para o Ubuntu.
Para poder configurar seu computador, você precisa ter o **Windows 10 ou Windows 11** instalado.
Para verificar sua versão do Windows:
- Pressione `Windows` + `R`
- Digite `winver`
- Pressione `Enter`
:heavy_check_mark: Se as primeiras palavras desta janela forem **Windows 11** você está pronto para prosseguir :+1:
- :heavy_check_mark: Se as primeiras palavras desta janela forem **Windows 10**, verifique o **Número da versão**::
- :x: Caso contrário, você não poderá prosseguir com esta configuração. Você precisa atualizar.
-
Como instalar as últimas atualizações?
Abra a atualização do Windows:
- Pressione `Windows` + `R`
- Digite `ms-settings:windowsupdate`
- Pressione `Enter`
- Clique em `Verificar atualizações`
:heavy_check_mark: Se você vir uma marca de seleção verde e a mensagem "Você está atualizado", você está pronto para prosseguir :+1:
:warning: Se você tiver um ponto de exclamação vermelho e a mensagem "Atualização disponível", instale-os e repita o processo até que apareça que você está atualizado :loop:
:x: Se você receber uma mensagem de erro sobre o Windows não conseguir aplicar atualizações, **entre em contato com um professor**.
Ative o Windows Update Service para corrigir atualizações
Alguns antivírus e softwares desativam o serviço de atualização de que precisamos, resultando no erro que você vê. Vamos consertar isso!
- Pressione `Windows` + `R`
- Digite `services.msc`
- Pressione `Enter`
- Clique duas vezes em `Serviço de atualização do Windows`
- Defina sua `Inicialização` para `Automático`
- Clique em `Iniciar`
- Clique em `Ok`
Então vamos tentar as atualizações novamente!
Verifique o Número da versão:
- Pressione `Windows` + `R`
- Digite `winver`
- Pressione `Enter`
:heavy_check_mark: Se disser pelo menos `2004`, você está pronto :+1:
:x: Se estiver abaixo de `22004`, por favor **entre em contato com um professor**.
## Virtualização
Precisamos garantir que as opções de virtualização estejam habilitadas no BIOS do seu computador.
Para muitos computadores, este já é o caso. Vamos checar:
- Pressione `Windows` + `R`
- Digite `taskmgr`
- Pressione `Enter`
- Clique na aba `Desempenho`
- Clique em `CPU`

:heavy_check_mark: Se você vir "Virtualização: Ativada", está pronto :+1:
:x: Se a linha estiver faltando ou se a virtualização estiver desabilitada, por favor **entre em contato com um professor antes de tentar ativar a Virtualização**
Ativar virtualização
Precisamos acessar o BIOS/UEFI do computador para ativá-lo.
- Pressione `Windows + R`
- Digite `shutdown.exe /r /o /t 1`
- Pressione `Enter`
- Aguarde o computador desligar
- Clique em `Solucionar problemas`
- Clique em `Opções avançadas`
- Clique em `Configurações de firmware UEFI`
- Clique em `Reiniciar`
Você precisa ativar a opção de virtualização para o seu processador aqui:
- Na maioria das vezes, nas configurações avançadas, nas configurações da CPU ou nas configurações do Northbridge
- A opção pode ter um nome diferente de acordo com o seu computador:
- Intel: `Intel VT-x`, `Tecnologia de virtualização Intel`, `Extensões de virtualização`, `Vanderpool`...
- AMD: `Modo SVM` ou `AMD-V`
- Salve as alterações após a ativação e reinicie o computador através da opção apropriada
## Subsistema Windows para Linux (WSL)
WSL é o ambiente de desenvolvimento que usamos para executar o Ubuntu. Você pode aprender mais sobre WSL [aqui](https://docs.microsoft.com/en-us/windows/wsl/faq).
Instalaremos o WSL 2 e o Ubuntu em um comando através do Windows Command Prompt.
:warning: Nas instruções a seguir, esteja ciente do pressionamento de tecla `Ctrl` + `Shift` + `Enter` para executar o **Windows Command Prompt** com privilégios de administrador em vez de apenas clicar em `Ok` ou pressionar `Enter` .
- Pressione `Windows` + `R`
- Digite `cmd`
- Pressione **`Ctrl` + `Shift` + `Enter`**
:warning: Você pode ter que aceitar a confirmação do UAC sobre a elevação de privilégio.
Uma janela de terminal aparecerá:
- Copie o seguinte comando (`Ctrl` + `C`)
- Cole-o na janela do terminal (`Ctrl` + `V` ou clicando com o botão direito na janela)
- Execute-o pressionando `Enter`
```powershell
wsl --install
```
:heavy_check_mark: Se o comando foi executado sem nenhum erro, reinicie o computador e continue abaixo :+1:
:x: Se você encontrar uma mensagem de erro (ou se vir algum texto em vermelho na janela), por favor **entre em contato com um professor**
Solução de problemas para Windows 10 (apenas se necessário, consulte um professor)
#### Para Windows 10 < 2004: instale o WSL 1 primeiro
:warning: Nas instruções a seguir, esteja ciente do pressionamento de tecla `Ctrl` + `Shift` + `Enter` para executar o **Windows PowerShell** com privilégios de administrador em vez de apenas clicar em `Ok` ou pressionar `Enter` .
- Pressione `Windows` + `R`
- Digite `powershell`
- Pressione **`Ctrl` + `Shift` + `Enter`**
:warning: Você pode ter que aceitar a confirmação do UAC sobre a elevação de privilégio.
Uma janela de terminal azul aparecerá:
- Copie os seguintes comandos um por um (`Ctrl` + `C`)
- Cole-os na janela do PowerShell (`Ctrl` + `V` ou clicando com o botão direito na janela)
- Execute-os pressionando `Enter`
```powershell
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
```
```powershell
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
```
```powershell
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
```
:heavy_check_mark: Se todos os três comandos foram executados sem nenhum erro, reinicie o computador e continue abaixo :+1:
:x: Se você encontrar uma mensagem de erro (ou se vir algum texto em vermelho na janela), por favor **entre em contato com um professor**
#### Para Windows 10 com WSL 1: Atualizar para WSL 2
Se você estiver executando o Windows 10, atualizaremos o WSL para a versão 2.
Assim que o computador for reiniciado, precisamos baixar o instalador WSL2.
- Vá para a [página de download](https://aka.ms/wsl2kernel)
- Baixe o "pacote de atualização do kernel WSL2 Linux"
- Abra o arquivo que você acabou de baixar
- Clique em `Avançar`
- Clique em `Concluir`

:heavy_check_mark: Se não encontrou nenhuma mensagem de erro, você está pronto :+1:
:x: Se você encontrar o erro "Esta atualização se aplica apenas a máquinas com o subsistema Windows para Linux", **clique com o botão direito** no programa e selecione `uninstall`; você poderá instalá-lo normalmente desta vez.
#### Para Windows 10 com WSL 1: Torne o WSL 2 o subsistema Windows padrão para Linux
Se você estiver executando o Windows 10, definiremos a versão padrão do WSL como 2.
Agora que o WSL 2 está instalado, vamos torná-lo a versão padrão:
- Pressione `Windows` + `R`
- Digite `cmd`
- Pressione `Enter`
Na janela que aparece, digite:
```bash
wsl --set-default-version 2
```
:heavy_check_mark: Se você vir "A operação foi concluída com sucesso", você pode fechar este terminal e continuar seguindo as instruções abaixo :+1:
:x: Se a mensagem que você receber for sobre Virtualização, por favor **entre em contato com um professor**
Ativar recurso Windows da Plataforma de Máquina Virtual
Siga as etapas descritas [aqui](https://www.configserverfirewall.com/windows-10/please-enable-the-virtual-machine-platform-windows-feature-and-ensure-virtualization-is-enabled-in- the-bios/#:~:text=To%20enable%20WSL%202,%20Open,Windows%20feature%20on%20or%20off.&text=Garanta%20que%20the%20Virtual%20Machine,Windows%20will%20enable%20WSL %202) até você ativar a Plataforma de Máquina Virtual e o Subsistema Windows para Linux
Ativar recurso Hyper-V do Windows
Siga as etapas descritas [aqui](https://winaero.com/enable-use-hyper-v-windows-10/) até ativar o grupo Hyper-V
:information_source: Se você estiver executando o Windows 10 **Home edition**, o recurso Hyper-V não estará disponível para o seu sistema operacional. Não bloqueia e você ainda pode continuar seguindo as instruções abaixo :ok_hand:
## Ubuntu
### Instalação
Após reiniciar o computador, você deverá ver uma janela de terminal informando que o WSL está retomando o processo de instalação do Ubuntu. Quando terminar, o Ubuntu será lançado.
Solução de problemas para Windows 10 (apenas se necessário, consulte um TA)
Se a instalação do Ubuntu não foi retomada, tente novamente: abra o Powershell ou o Prompt de Comando e execute `wsl --install` novamente.
Se você estiver executando o Windows 10, vamos instalar o Ubuntu através da Microsoft Store:
- Clique em `Iniciar`
- Digite `Microsoft Store`
- Clique em `Microsoft Store` na lista
- Procure por `Ubuntu` na barra de pesquisa
- **Selecione a versão sem nenhum número, simplesmente "Ubuntu"**
- Clique em `Obter`
:warning: Não instale **Ubuntu 18.04 LTS** nem **Ubuntu 20.04**!
Desinstale versões erradas do Ubuntu
Para desinstalar uma versão errada do Ubuntu, basta ir até a Lista de Programas Instalados do Windows 10:
- Pressione `Windows` + `R`
- Digite `ms-settings:appsfeatures`
- Pressione `Enter`
Encontre o software para desinstalar e clique no botão desinstalar.
Assim que a instalação for concluída, o botão `Get` se torna um botão `Open`: clique nele.
### Executando pela primeira vez
Na primeira execução, serão solicitadas algumas informações:
- Escolha um nome de **usuário**:
- uma palavra
- minúsculas
- sem caracteres especiais
- por exemplo: `lewagon` ou seu `nome`
- Escolha uma **senha**
- Confirme sua senha
:warning: Quando você digita sua senha, nada aparecerá na tela, **isso é normal**. Este é um recurso de segurança para mascarar não apenas sua senha como um todo, mas também seu comprimento. Basta digitar sua senha e quando terminar, pressione `Enter`.
Você pode fechar a janela do Ubuntu agora que ele está instalado no seu computador.
### Verifique a versão WSL do Ubuntu
- Pressione `Windows` + `R`
- Digite `cmd`
- Pressione `Enter`
Digite o seguinte comando:
```bash
wsl -l -v
```
:heavy_check_mark: Se a versão do Ubuntu WSL for 2, você está pronto :+1:
:x: Se a versão do Ubuntu WSL for 1, precisaremos convertê-lo para a versão 2.
Converter Ubuntu WSL V1 em V2
Na janela do prompt de comando, digite:
```bash
wsl --set-version Ubuntu 2
```
:heavy_check_mark: Após alguns segundos, você deverá receber a seguinte mensagem: `A conversão foi concluída`.
:x: Se não funcionar, precisamos ter certeza de que os arquivos do Ubuntu não estão compactados.
Verificar arquivos descompactados
- Pressione `Windows` + `R`
- Digite `%localappdata%\Packages`
- Pressione `Enter`
- Abra a pasta chamada `CanonicalGroupLimited.UbuntuonWindows...`
- Clique com o botão direito na pasta `LocalState`
- Clique em `Propriedades`
- Clique em `Avançado`
- Certifique-se de que a opção `Compactar conteúdo` **não** esteja marcada e clique em `Ok`.
Aplique as alterações apenas nesta pasta e tente converter a versão WSL do Ubuntu novamente.
:x: Se a conversão ainda não funcionar, por favor **entre em contato com um professor**.
Agora você pode fechar esta janela do terminal.
### Check your username
Type this in the Ubuntu terminal:
```bash
whoami
```
It should return the username you chose before.
:x: It if says `root`, **contact a TA** before continuing!
## Visual Studio Code
### Instalação
Vamos instalar o editor de texto [Visual Studio Code](https://code.visualstudio.com).
- Vá para a [página de download do Visual Studio Code](https://code.visualstudio.com/download).
- Clique no botão "Windows"
- Abra o arquivo que você acabou de baixar.
- Instale-o com algumas opções:

Quando a instalação for concluída, inicie o VS Code.
### Conectando o código VS ao Ubuntu
Para fazer o VS Code interagir corretamente com o Ubuntu, vamos instalar a extensão [Remote - WSL](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) VS Code.
Abra seu **terminal Ubuntu**.
Copie e cole os seguintes comandos no terminal:
```bash
code --install-extension ms-vscode-remote.remote-wsl
```
Em seguida, abra o VS Code em seu terminal:
```bash
code .
```
:heavy_check_mark: Se você vir `WSL: Ubuntu` no canto inferior esquerdo da janela do VS Code, você está pronto para prosseguir :+1:

:x: Caso contrário, por favor **entre em contato com um professor**
## Terminal do Windows
### Instalação
:information_source: As instruções a seguir dependem da sua versão do Windows.
Se você estiver executando o Windows 11, o Terminal do Windows já está instalado e você pode prosseguir para a próxima seção :point_down:
Se você estiver executando o Windows 10, vamos instalar o Windows Terminal, um terminal realmente moderno.
Windows 10: Instalar Windows Terminal
- Clique em `Iniciar`
- Digite `Microsoft Store`
- Clique em `Microsoft Store` na lista
- Procure por `Windows Terminal` na barra de pesquisa
- **Selecione Terminal do Windows"**
- Clique em `Instalar`
:warning: NÃO instale o **Windows Terminal Preview**, apenas o **Windows Terminal**!
Desinstale a versão errada do Terminal do Windows
Para desinstalar uma versão errada do Terminal Windows, basta ir até a Lista de Programas Instalados do Windows 10:
- Pressione `Windows` + `R`
- Digite `ms-settings:appsfeatures`
- Pressione `Enter`
Encontre o software para desinstalar e clique no botão desinstalar.
Assim que a instalação for concluída, o botão `Instalar` se torna um botão `Iniciar`: clique nele.
### Ubuntu como terminal padrão
Vamos tornar o Ubuntu o terminal padrão do seu aplicativo Windows Terminal.
Pressione `Ctrl` + `,`
Deve abrir as configurações do terminal:

- Altere o perfil padrão para "Ubuntu"
- Clique em "Salvar"
- Clique em "Abrir arquivo JSON"
Você pode ver um círculo laranja em vez de um pinguim como logotipo do Ubuntu.
Temos um círculo em vermelho na parte que você irá alterar:

Primeiro, vamos pedir ao Ubuntu para iniciar diretamente dentro do diretório inicial do Ubuntu, em vez do diretório do Windows:
- Localize a entrada com `"name": "Ubuntu",` e `"hidden": false,`
- Adicione a seguinte linha depois dela:
```bash
"commandline": "wsl.exe ~",
```
:warning: Não esqueça a vírgula no final da linha!
Então, vamos desabilitar o aviso para comandos de copiar e colar entre o Windows e o Ubuntu:
- Localize a linha `"defaultProfile": "{2c4de342-...}"`
- Adicione a seguinte linha depois dela:
```bash
"warning.multiLinePaste": false,
```
:warning: Não esqueça a vírgula no final da linha!
Você pode salvar essas alterações pressionando `Ctrl` + `S`
:heavy_check_mark: Seu **Terminal Windows** agora está configurado :+1:
Este terminal possui abas: você pode optar por abrir uma nova aba do terminal clicando em **+** ao lado da atual.
**De agora em diante, toda vez que nos referirmos ao terminal ou ao console será este.** NÃO utilize mais nenhum outro terminal.
## Extensões do VS Code
### Instalação
Vamos instalar algumas extensões úteis no VS Code.
Copie e cole os seguintes comandos em seu terminal:
```bash
code --install-extension ms-vscode.sublime-keybindings
code --install-extension emmanuelbeziat.vscode-great-icons
code --install-extension github.github-vscode-theme
code --install-extension MS-vsliveshare.vsliveshare
code --install-extension shopify.ruby-lsp
code --install-extension dbaeumer.vscode-eslint
code --install-extension Rubymaniac.vscode-paste-and-indent
code --install-extension alexcvzz.vscode-sqlite
code --install-extension anteprimorac.html-end-tag-labels
code --install-extension marcoroth.herb-lsp
code --install-extension rayhanw.erb-helpers
```
Aqui está uma lista das extensões que você está instalando:
- [Sublime Text Keymap and Settings Importer](https://marketplace.visualstudio.com/items?itemName=ms-vscode.sublime-keybindings)
- [VSCode Great Icons](https://marketplace.visualstudio.com/items?itemName=emmanuelbeziat.vscode-great-icons)
- [Live Share](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare)
- [Ruby](https://marketplace.visualstudio.com/items?itemName=shopify.ruby-lsp)
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [Paste and Indent](https://marketplace.visualstudio.com/items?itemName=Rubymaniac.vscode-paste-and-indent)
- [SQLite](https://marketplace.visualstudio.com/items?itemName=alexcvzz.vscode-sqlite)
### Recursos de IA no VS Code
O VS Code inclui muitos **recursos poderosos de IA**, que são ótimas ferramentas quando você já sabe programar.
Dito isso, confiar na IA muito cedo pode ocultar conceitos importantes e dificultar o entendimento da depuração. Quando você estiver confortável com os fundamentos, saberá quando e como usar a IA de forma eficaz — sem deixar que ela faça o raciocínio por você.
Para o início do bootcamp, vamos desativar esses recursos. No momento certo do curso, os reativaremos para que você possa usá-los bem.
Em **VS Code**:
1. Vamos abrir a "Paleta de Comandos" do VS Code: digite `Ctrl-Shift-P` (Windows / Linux) ou `Cmd-Shift-P` (macOS).
1. Isso abrirá a Paleta de Comandos: uma pequena caixa de texto no topo da tela. Comece a digitar `aifeatures` até ver "Chat: Learn How to Hide AI features". Clique nela.

1. Isso abrirá as configurações e mostrará a opção "Disable and hide built-in AI features ...". Marque a caixa de seleção à frente dessa opção.

Mais tarde, se quiser **reativar** os recursos de IA, você pode seguir as mesmas instruções para desmarcar a caixa.
### Configuração do Live Share
[Visual Studio Live Share](https://visualstudio.microsoft.com/services/live-share/) é uma extensão do VS Code que permite compartilhar o código em seu editor de texto para depuração e programação em pares: vamos configurá-lo acima!
Inicie o VS Code em seu terminal digitando `code` e pressionando `Enter`.
Clique na pequena seta na parte inferior da barra esquerda :point_down:

- Clique no botão "Compartilhar" e depois em "GitHub (faça login usando a conta GitHub)".
- Um pop-up aparece solicitando que você faça login no GitHub: clique em “Permitir”.
- Você é redirecionado para uma página do GitHub em seu navegador solicitando autorização do Visual Studio Code: clique em "Continuar" e depois em "Autorizar github".
- O VS Code pode exibir pop-ups adicionais: feche-os clicando em "OK".
É isso, você está pronto para continuar!
## Ferramentas de linha de comando
### Verifique a localidade
A localidade é um mecanismo que permite personalizar programas de acordo com seu idioma e país.
Vamos verificar se a localidade padrão está definida como inglês, digite isto no terminal do Ubuntu:
```bash
locale
```
Se a saída não contiver `LANG=en_US.UTF-8`, execute o seguinte comando em um terminal Ubuntu para instalar a localidade em inglês:
```bash
sudo locale-gen en_US.UTF-8
```
Se, depois, receberes um aviso (`bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf-8)`) no teu terminal, por favor faz o seguinte:
Gerar localidade
Por favor, executa estas linhas no teu terminal.
```bash
sudo update-locale LANG=en_US.UTF8
sudo apt-get update
sudo apt-get install language-pack-en language-pack-en-base manpages
```
### Zsh e Git
Em vez de usar o `bash` [shell](https://en.wikipedia.org/wiki/Shell_(computing)), usaremos `zsh`.
Também usaremos [`git`](https://git-scm.com/), um software de linha de comando usado para controle de versão.
Vamos instalá-los, juntamente com outras ferramentas úteis:
- Abra um **terminal Ubuntu**
- Copie e cole os seguintes comandos:
```bash
sudo apt update
```
```bash
sudo apt install -y curl git imagemagick jq unzip vim zsh tree
```
Esses comandos solicitarão sua senha: digite-a.
:warning: Quando você digita sua senha, nada aparecerá na tela, **isso é normal**. Este é um recurso de segurança para mascarar não apenas sua senha como um todo, mas também seu comprimento. Basta digitar sua senha e quando terminar, pressione `Enter`.
### Instalação da CLI do GitHub
Vamos agora instalar a [CLI oficial do GitHub](https://cli.github.com) (interface de linha de comando). É um software usado para interagir com sua conta GitHub através da linha de comando.
Em seu terminal, copie e cole os seguintes comandos e digite sua senha, se solicitado:
```bash
sudo apt remove -y gitsome # gh command can conflict with gitsome if already installed
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
```
```bash
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
```
```bash
sudo apt update
```
```bash
sudo apt install -y gh
```
Para verificar se `gh` foi instalado com sucesso em sua máquina, você pode executar:
```bash
gh --version
```
:heavy_check_mark: Se você vir `gh versão X.Y.Z (AAAA-MM-DD)`, está pronto para prosseguir :+1:
:x: Caso contrário, por favor **entre em contato com um professor**
## Oh-My-Zsh
Vamos instalar o plugin `zsh` [Oh My Zsh](https://ohmyz.sh/).
Em um terminal execute o seguinte comando:
```bash
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```
Se for perguntado "Deseja alterar seu shell padrão para zsh?", pressione `Y`
No final seu terminal deverá ficar assim:

:heavy_check_mark: Se isso acontecer, você pode continuar :+1:
:x: Caso contrário, por favor **entre em contato com um professor**
## Vinculando seu navegador padrão ao Ubuntu
Para ter certeza de que você pode interagir com seu navegador instalado no Windows a partir do terminal Ubuntu, precisamos defini-lo como navegador padrão.
:warning: Você precisa executar pelo menos um dos seguintes comandos abaixo:
Google Chrome como navegador padrão
Execute o comando:
```bash
ls /mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe
```
Você recebeu um erro como `ls: não é possível acessar...`?
Sim, ocorreu um erro
Execute os seguintes comandos:
```bash
echo "export BROWSER=\"/mnt/c/Program Files/Google/Chrome/Application/chrome.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files/Google/Chrome/Application/chrome.exe'\"" >> ~/.zshrc
```
Não, estava tudo bem
Execute os seguintes comandos:
```bash
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe'\"" >> ~/.zshrc
```
---
Mozilla Firefox como seu navegador padrão
Execute o comando:
```bash
ls /mnt/c/Program\ Files\ \(x86\)/Mozilla\ Firefox/firefox.exe
```
Você recebeu um erro como `ls: não é possível acessar...`?
Sim, ocorreu um erro
Execute os seguintes comandos:
```bash
echo "export BROWSER=\"/mnt/c/Program Files/Mozilla Firefox/firefox.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files/Mozilla Firefox/firefox.exe'\"" >> ~/.zshrc
```
Não, estava tudo bem
Execute os seguintes comandos:
```bash
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Mozilla Firefox/firefox.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Mozilla Firefox/firefox.exe'\"" >> ~/.zshrc
```
---
Microsoft Edge como navegador padrão
Execute os comandos:
```bash
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe'\"" >> ~/.zshrc
```
---
Reinicie seu terminal.
Em seguida, certifique-se de que o seguinte comando retorne "Browser Defined 👌":
```bash
[ -z "$BROWSER" ] && echo "ERROR: please define a BROWSER environment variable ⚠️" || echo "Browser defined 👌"
```
Se isso não acontecer,
:heavy_check_mark: Se você recebeu esta mensagem, pode continuar :+1:
:x: Caso contrário, escolha um navegador na lista acima e execute o comando correspondente. Então não se esqueça de redefinir seu terminal:
```bash
exec zsh
```
Não hesite em **entrar em contato com um professor**.
## CLI do GitHub
CLI é o acrônimo de [Interface de linha de comando](https://en.wikipedia.org/wiki/Command-line_interface).
Nesta seção, usaremos [GitHub CLI](https://cli.github.com/) para interagir com o GitHub diretamente do terminal.
Usaremos o GitHub CLI (`gh`) para conectar ao GitHub usando *SSH*, um protocolo para fazer login usando chaves SSH em vez do conhecido par nome de usuário/senha.
Ele já deve estar instalado no seu computador a partir dos comandos anteriores.
Primeiro, para **fazer login**, copie e cole o seguinte comando em seu terminal:
:warning: **NÃO edite o `email`**
```bash
gh auth login -s 'user:email' -w --git-protocol ssh
```
`gh` fará algumas perguntas:
- `Generate a new SSH key to add to your GitHub account?` Pressione `Enter` para pedir ao gh para gerar as chaves SSH para você.
Se você já possui chaves SSH, verá `Upload your SSH public key to your GitHub account?` Com as setas, selecione o caminho do arquivo de sua chave pública e pressione `Enter`.
- `Enter a passphrase for your new SSH key (Optional)`. Digite algo que você deseja e que você lembrará. É uma senha para proteger sua chave privada armazenada no disco rígido. Em seguida, pressione `Enter`.
- `Title for your SSH key`. Você pode deixá-lo no "GitHub CLI" proposto, pressione `Enter`.
Você obterá então a seguinte saída:
```bash
! First copy your one-time code: 0EF9-D015
- Press Enter to open github.com in your browser...
```
Selecione e copie o código (`0EF9-D015` no exemplo) e pressione `Enter`.
Seu navegador será aberto e solicitará que você autorize o GitHub CLI a usar sua conta GitHub. Aceite e espere um pouco.
Volte ao terminal, pressione `Enter` novamente e pronto.
Para verificar se você está conectado corretamente, digite:
```bash
gh auth status
```
:heavy_check_mark: Se você estiver `Logado no github.com como `, então tudo bem :+1:
:x: Caso contrário, **entre em contato com um professor**.
## Dotfiles (configuração padrão)
Os hackers adoram refinar e aprimorar sua estrutura e ferramentas.
Começaremos com uma ótima configuração padrão fornecida pelo Le Wagon: [`lewagon/dotfiles`](https://github.com/lewagon/dotfiles).
Como sua configuração é pessoal, você precisa de seu próprio repositório para armazená-la. Então você irá fazer o **fork** do repositório Le Wagon.
Bifurcar significa que você criará um novo repositório em sua própria conta GitHub `$GITHUB_USERNAME/dotfiles`, idêntico ao original do Le Wagon que você poderá modificar à vontade.
Abra seu terminal e defina uma variável para seu nome de usuário GitHub:
```bash
export GITHUB_USERNAME=`gh api user | jq -r '.login'`
```
```bash
echo $GITHUB_USERNAME
```
:heavy_check_mark: Você deverá ver seu nome de usuário do GitHub impresso.
:x: Se não, **pare aqui** e peça ajuda. Pode haver um problema com a etapa anterior (`gh auth`).
:warning: Por favor note que esta variável só é definida para o tempo em que seu terminal está aberto. Se você fechá-lo antes ou durante as próximas etapas, será necessário configurá-lo novamente com as duas etapas acima!
É hora de fazer um fork do repositório e cloná-lo em seu computador:
```bash
mkdir -p ~/code/$GITHUB_USERNAME && cd $_
```
```bash
gh repo fork lewagon/dotfiles --clone
```
### Instalador do Dotfiles
Execute o instalador `dotfiles`:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles
```
```bash
zsh install.sh
```
Verifique os e-mails registrados em sua conta GitHub. Você precisará escolher um na próxima etapa:
```bash
gh api user/emails | jq -r '.[].email'
```
:heavy_check_mark: Se você vir a lista de seus e-mails registrados, você pode prosseguir :+1:
:x: Caso contrário, [reautentique no GitHub](https://github.com/lewagon/setup/blob/master/windows.pt.md#github-cli) antes de executar este comando :point_up: novamente.
### Instalador git
Execute o instalador `git`:
```bash
cd ~/code/$GITHUB_USERNAME/dotfiles && zsh git_setup.sh
```
:point_up: Isso **solicitará** seu nome (`Nome Sobrenome`) e seu e-mail. O email que você escolher será exibido **publicamente** na internet. 💡 Selecione o endereço `@users.noreply.github.com` se você não deseja que seu e-mail apareça em repositórios públicos aos quais você possa contribuir.
:warning: Você **precisa** colocar um dos e-mails listados acima graças ao comando anterior `gh api ...`. Se você não fizer isso, Kitt não conseguirá acompanhar seu progresso.
Agora **reinicie** seu terminal executando:
```bash
exec zsh
```
## Desativar prompt de senha SSH
Você não quer que sua senha seja solicitada sempre que se comunicar com um repositório distante. Então, você precisa adicionar o plugin `ssh-agent` ao `oh my zsh`:
Primeiro, abra o arquivo `.zshrc`:
```bash
code ~/.zshrc
```
Então:
- Identifique a linha que começa com `plugins=`
- Adicione `ssh-agent` no final da lista de plugins
:heavy_check_mark: Salve o arquivo `.zshrc` com `Ctrl` + `S` e feche seu editor de texto.
## rbenv
Vamos instalar o [`rbenv`](https://github.com/sstephenson/rbenv), um software para instalar e gerenciar ambientes `ruby`.
Primeiro, precisamos limpar qualquer instalação anterior do Ruby que você possa ter:
```bash
rvm implode && sudo rm -rf ~/.rvm
# Se você obteve "zsh: comando não encontrado: rvm", continue.
# Significa que `rvm` não está no seu computador, é isso que queremos!
rm -rf ~/.rbenv
```
Então no terminal, execute:
```bash
sudo apt install -y build-essential tklib zlib1g-dev libssl-dev libffi-dev libxml2 libxml2-dev libxslt1-dev libreadline-dev libyaml-dev
```
```bash
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
```
```bash
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
```
```bash
exec zsh
```
## Ruby
### Instalação
Agora, você está pronto para instalar a versão mais recente do [ruby](https://www.ruby-lang.org/en/) e defini-la como a versão padrão.
Execute este comando, **demorará um pouco (5 a 10 minutos)**
```bash
rbenv install 3.3.5
```
Assim que a instalação do Ruby estiver concluída, execute este comando para informar ao sistema
para usar a versão 3.3.5 por padrão.
```bash
rbenv global 3.3.5
```
**Reinicialize** seu terminal e verifique sua versão do Ruby:
```bash
exec zsh
```
Então corra:
```bash
ruby -v
```
:heavy_check_mark: Se você vir algo começando com `ruby 3.3.5` então você pode prosseguir :+1:
:x: Se não, **pergunte a um professor**
### Instalando algumas gems
Se você estiver na China 🇨🇳 clique aqui
:warning: Se você estiver na China, você deve atualizar a forma como instalaremos o gem com os seguintes comandos.
```bash
# Somente China!
fontes de gemas --remove https://rubygems.org/
fontes de gemas -a https://gems.ruby-china.com/
fontes de gemas -l
#***FONTES ATUAIS***
# https://gems.ruby-china.com/
# Ruby-china.com deve estar na lista agora
```
**Todos, na China ou não**, continuem aqui para instalar gems.
No mundo Ruby, chamamos bibliotecas externas de `gems`: são pedaços de código Ruby que você pode baixar e executar em seu computador. Vamos instalar alguns!
No seu terminal, copie e cole o seguinte comando:
```bash
gem install colored faker http pry-byebug rake rails:8.1.1 rest-client rspec rubocop-performance sqlite3:2.8.1 activerecord:8.1.1 ruby-lsp
```
:heavy_check_mark: Se você tiver `xx gems installed`, então tudo bem :+1:
:x: Se você encontrar o seguinte erro:
```bash
ERROR: While executing gem ... (TypeError)
incompatible marshal file format (can't be read)
format version 4.8 required; 60.33 given
```
Execute o seguinte comando:
```bash
rm -rf ~/.gemrc
```
Execute novamente o comando para instalar as gemas.
:warning: **NUNCA** instale uma gem com `sudo gem install`! Mesmo se você encontrar uma resposta do Stackoverflow (ou o terminal) solicitando que você faça isso.
## Node.js
[Node.js](https://nodejs.org/en/) é um tempo de execução JavaScript para executar código JavaScript no terminal. Vamos instalá-lo com [nvm](https://github.com/nvm-sh/nvm), um gerenciador de versões para Node.js.
Em um terminal, execute os seguintes comandos:
```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | zsh
```
```bash
exec zsh
```
Em seguida, execute o seguinte comando:
```bash
nvm -v
```
Você deverá ver uma versão. Se não, pergunte a um professor.
Agora vamos instalar o Node.js:
```bash
nvm install 20.17.0
```
Quando a instalação terminar, execute:
```bash
node -v
```
Se você vir `v20.17.0`, a instalação foi bem-sucedida :heavy_check_mark: Você pode então executar:
```bash
nvm cache clear
```
:x: Caso contrário, **entre em contato com um professor**
## Yarn
[`yarn`](https://yarnpkg.com/) é um gerenciador de pacotes para instalar bibliotecas JavaScript. Vamos instalá-lo:
Em um terminal, execute os seguintes comandos:
```bash
corepack enable
yarn set version stable
```
```bash
exec zsh
```
⚠️ Se vires quaisquer mensagens de erro, tenta executar `npm install -g corepack` e, em seguida, volta a executar os comandos acima.
Em seguida, execute o seguinte comando:
```bash
yarn -v
```
:heavy_check_mark: Se você vir uma versão, você está bem :+1:
:x: Se não, **entre em contato com um professor**
## SQLite
Em algumas semanas falaremos sobre bancos de dados e SQL. [SQLite](https://sqlite.org/index.html) é um mecanismo de banco de dados usado para executar consultas SQL em bancos de dados de arquivo único. Vamos instalá-lo:
Em um terminal, execute os seguintes comandos:
```bash
sudo apt-get install sqlite3 libsqlite3-dev pkg-config
```
Em seguida, execute o seguinte comando:
```bash
sqlite3 -version
```
:heavy_check_mark: Se você vir uma versão, você está bem :+1:
:x: Se não, **peça um professor**
## PostgreSQL
Às vezes, o SQLite não é suficiente e precisaremos de uma ferramenta mais avançada chamada [PostgreSQL](https://www.postgresql.org/), um sistema de banco de dados de código aberto, robusto e pronto para produção.
Vamos instalá-lo agora.
Execute os seguintes comandos:
```bash
sudo apt install -y postgresql postgresql-contrib libpq-dev build-essential
```
```bash
sudo /etc/init.d/postgresql start
```
```bash
sudo -u postgres psql --command "CREATE ROLE \"`whoami`\" LOGIN createdb superuser;"
```
Você pode configurar o PostgreSQL para inicialização automática, para que não precise executar `sudo /etc/init.d/postgresql start` cada vez que abrir um novo terminal:
```bash
sudo echo "`whoami` ALL=NOPASSWD:/etc/init.d/postgresql start" | sudo tee /etc/sudoers.d/postgresql
```
```bash
sudo chmod 440 /etc/sudoers.d/postgresql
```
```bash
echo "sudo /etc/init.d/postgresql start" >> ~/.zshrc
```
Abra um novo terminal.
:heavy_check_mark: Se você vir uma mensagem `* Starting postgresql (via systemctl): postgresql.service` OU `* Starting PostgreSQL 14 database server`, você está pronto para prosseguir :+1:
:x: Caso contrário, **entre em contato com um professor**.
## Checagem
Vamos verificar se você instalou tudo com sucesso.
No seu terminal, execute o seguinte comando:
```bash
exec zsh
```
Então corra:
```bash
curl -Ls https://raw.githubusercontent.com/lewagon/setup/master/check.rb > _.rb && ruby _.rb && rm _.rb || rm _.rb
```
:heavy_check_mark: Se você receber uma mensagem verde `Awesome! Your computer is now ready!`, então você está bem :+1:
:x: Caso contrário, **entre em contato com um professor**.
## Kitt
:warning: Se você recebeu um e-mail do Le Wagon convidando você a se inscrever no Kitt (nossa plataforma de aprendizagem), você pode pular esta etapa com segurança. Em vez disso, siga as instruções no e-mail que você recebeu, caso ainda não tenha feito isso.
Se não tiver certeza sobre o que fazer, siga [este link](https://kitt.lewagon.com/). Se você já estiver logado, pode pular esta seção com segurança. Se você não estiver logado, clique em `Enter Kitt as a Student`. Se você conseguir fazer login, poderá pular esta etapa com segurança. Caso contrário, pergunte a um professor se você deveria ter recebido um e-mail ou siga as instruções abaixo.
Registre-se como Alumni da Le Wagon acessando [kitt.lewagon.com/onboarding](http://kitt.lewagon.com/onboarding). Selecione seu batch, faça login no GitHub e insira todas as suas informações.
Seu professor irá então validar que você realmente faz parte do batch. Você pode pedir que eles façam isso assim que preencher o formulário de registro.
Assim que o professor aprovar seu perfil, acesse sua caixa de entrada de e-mail. Você deve ter 2 e-mails:
- Um do Slack, convidando você para a comunidade Le Wagon Alumni do Slack (onde você conversará com seus amigos e todos os ex-alunos anteriores). Clique em **Inscreva-se** e preencha os dados.
- Um do GitHub, convidando você para a equipe `lewagon`. **Aceite** caso contrário você não conseguirá acessar os slides da aula.
## Slack
[Slack](https://slack.com/) é uma plataforma de comunicação bastante popular na indústria de tecnologia.
### Instalação
[Baixe o aplicativo Slack](https://slack.com/downloads/windows) e instale-o.
:warning: Se você já usa o Slack em seu navegador, baixe e instale **o aplicativo para desktop** que vem com todos os recursos.
### Configurações
Inicie o aplicativo e faça login na organização `lewagon-alumni`.
Certifique-se de **fazer upload de uma foto de perfil** :point_down:

A ideia é que você tenha o Slack aberto o dia todo, para que você possa compartilhar links úteis/pedir ajuda/decidir onde ir almoçar/etc.
Para garantir que tudo está funcionando bem nas videochamadas, vamos testar sua câmera e microfone:
- Abra o aplicativo Slack
- Clique na foto do seu perfil no canto superior direito.
- Selecione `Preferências` no menu.
- Clique em `Áudio e vídeo` na coluna do lado esquerdo.
- Abaixo de `Solução de problemas`, clique em `Executar um teste de áudio, vídeo e compartilhamento de tela`. O teste será aberto em uma nova janela.
- Verifique se seus dispositivos preferidos de alto-falante, microfone e câmera aparecem nos menus suspensos e clique em `Iniciar teste`.

:heavy_check_mark: Quando o teste terminar, você deverá ver mensagens verdes de "Sucesso" pelo menos para seu microfone e câmera. :+1:
:x: Caso contrário, **entre em contato com um professor**.
Você também pode instalar o aplicativo Slack no seu telefone e entrar em `lewagon-alumni`!
## Configurações do Windows
### Troque arquivos entre Windows e Ubuntu
Precisamos de uma maneira fácil de transferir arquivos do Windows para o Ubuntu e vice-versa.
Para fazer isso, vamos criar atalhos para diretórios do Ubuntu no **File Explorer** do Windows:
- Abra o Windows File Explorer (ou use o atalho `WIN` + `E`)
- Na barra de endereços, digite `\\wsl$\` (ou `\\wsl$\Ubuntu` se não funcionar)
- Agora você tem acesso ao sistema de arquivos Ubuntu
- Mergulhe no sistema de arquivos Ubuntu para procurar diretórios de interesse
- Arraste as pastas desejadas para a barra de endereços para criar atalhos

### Abra o Windows File Explorer no terminal Ubuntu
Outra opção para mover arquivos é abrir o Windows **File Explorer** no terminal Ubuntu:
- Abra um terminal Ubuntu
- Vá para o diretório que deseja explorar
- Execute o comando `explorer.exe .` (alternativamente, use `wslview .`)
- Se você receber uma mensagem de erro de entrada e saída, execute `wsl --shutdown` em um Windows PowerShell e reabra um terminal Ubuntu

### Encontre o seu caminho no sistema de arquivos Ubuntu
Você pode querer descobrir a localização exata de um diretório do Windows no sistema de arquivos Ubuntu ou vice-versa.
Para converter um caminho do Windows de e para um caminho do Ubuntu:
- Abra um terminal Ubuntu
- Use o comando `wslpath "C:\Program Files"` para traduzir um caminho do Windows em um caminho do Ubuntu
- Use o comando `wslpath -w "/home"` para traduzir um caminho do Ubuntu em um caminho do Windows
- Em particular, o comando `wslpath -w $(pwd)` retorna o caminho do Windows do diretório atual do Ubuntu

### Fixe aplicativos na sua barra de tarefas
Você usará a maioria dos aplicativos que instalou hoje com muita frequência. Vamos fixá-los na barra de tarefas para que estejam a apenas um clique de distância!
Para fixar um aplicativo na barra de tarefas, inicie o aplicativo, clique com o botão direito no ícone da barra de tarefas para abrir o menu de contexto e escolha “Fixar na barra de tarefas”.

Você deve fixar:
- Seu terminal
- Seu explorador de arquivos
- VS Code
- Seu navegador de Internet
- Slack
## Configuração concluída!
Seu computador agora está pronto para o [curso de AI Software Development Le Wagon](https://www.lewagon.com/web-development-course/full-time) :muscle: :clap:
Aproveite o bootcamp, você vai acertar :rocket: