romkatv / Dotfiles Public
Programming Languages
Installation
Github Setup
This needs to be done once per user.
Set up dotfiles-public repo.
- Go to https://github.com/romkatv/dotfiles-public and click Fork.
- Replace "romkatv" and "[email protected]" in
.gitconfigof the newly created fork with your own data. You can do it thrugh the GitHub web UI.
Set up dotfiles-private repo.
- Go to https://github.com/new and create an empty
dotfiles-privaterepo. Make it private.
Set up ssh keys.
- Generate a pair of ssh keys --
rsa_idandrsa_id.pub-- and addrsa_id.pubto github.com. See https://help.github.com/en/articles/connecting-to-github-with-ssh for details. Use a strong passphrase. - Backup
rsa_idin a secure persistent storage system. For example, in your password manager.
Windows Setup
Windows Preparation
This needs to be done once per Windows installation. You don't need to repeat these steps when reinstalling Ubuntu.
- Open PowerShell as Administrator and run:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
- Reboot if prompted.
- Install chocolatey from https://chocolatey.org/install.
- Open PowerShell as Administrator and run:
choco.exe install -y microsoft-windows-terminal vcxsrv
- Run Start > XLaunch.
- Click Next.
- Click Next.
- Uncheck Primary Selection. Click Next.
- Click Save Configuration and save
config.xlaunchin yourStartupfolder at%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup. - Click Finish.
WSL Removal
Follow these steps to remove your Linux distro with all files (applications, settings, home directory, etc.). You can recreate it by following WSL Installation guide below.
- Find out the name of your default distro by running the following command from PowerShell:
wsl.exe --list
- Delete a distro:
wsl.exe --unregister DISTRO
WSL Installation
These steps allow you to recreate the whole WSL environment. Before proceeding, delete the current distro if you have it. See WSL Removal.
- Download
id_rsainto the WindowsDownloadsfolder. It's OK if it's downloaded asid_rsa.txt. - Go to https://www.microsoft.com/en-us/p/ubuntu-2004-lts/9n6svws3rx71 and install Ubuntu 20.04 LTS.
- Click Start > Ubuntu. If you get an error, remove Ubuntu via Add or remove programs and install it again. Once Start > Ubuntu is working, create a new user.
- Type this (change the value of
GITHUB_USERNAMEif it's not the same as your WSL username):
GITHUB_USERNAME=$USER bash -c \
"$(curl -fsSL 'https://raw.githubusercontent.com/romkatv/dotfiles-public/master/bin/bootstrap-machine.sh')"
- Say
Yeswhen prompted to terminate WSL. - Run Start > Windows Terminal.
- Press Ctrl+,.
- Replace the content of
settings.jsonwith this. Change "romkatv" to your WSL username.
Optional: Windows Defender Exclusion
- Run Start > Windows Security.
- Click Virus & threat protection.
- Click Manage settings under Virus & threat protection settings.
- Click Add or remove exclusions under Exclusions.
- Click Add an exclusion > Folder.
- Select
%USERPROFILE%\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc.
Maintenance
Run this command occasionally.
sync-dotfiles && bash ~/bin/setup-machine.sh && z4h update #maintenance
Pro tip: Copy-paste this whole command including the comment. Next time when you decide to run maintenance tasks, press Ctrl+R and type #maintenance. This is how you can "tag" commands and easily find them later. You can apply more than one "tag". Technically, everything after # is a comment.
