From ec391ed9e6ca948877aaa92daf014723bb2f29f2 Mon Sep 17 00:00:00 2001 From: Daniel Thoren Date: Mon, 19 Feb 2024 19:14:35 +0100 Subject: [PATCH] :memo: doc wsl start from #5 --- README.md | 96 +++++++++++++++++++++---------------------------------- 1 file changed, 37 insertions(+), 59 deletions(-) diff --git a/README.md b/README.md index d779845..dd72050 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,9 @@ This repo is an extension of [dannydannydanny/methodology](https://github.com/Da * add server-sync make-rule for ip-upload python cronjob * add server-sync make-rule for server ip fetching (and writing...) * **refine install scripts** - * :bug: fix `/tmp/dotfiles` being wiped (install somewhere else) - * :memo: redirect logging from install scripts to `/tmp/??` - * :goal_net: add error handling in install scripts (if one crashes, stop or print successes and fails at the end) + * :memo: add logging (to `/tmp/??`) + * :goal_net: add [error handling](https://tecadmin.net/bash-error-detection-and-handling-tips-and-tricks/) + (if one crashes, stop or continue print summary at the end) * :art: check for `nvim checkhealth` status * make tmux nice: https://www.youtube.com/watch?v=DzNmUNvnB04 * **low-level configs:** @@ -60,94 +60,72 @@ This repo is an extension of [dannydannydanny/methodology](https://github.com/Da ### WSL -* install [wsl](https://docs.microsoft.com/en-us/windows/wsl/install#install-wsl-command) + WSL specifics - ``` wsl --install --web-download -d Debian # # /dev/null` - * `echo "generateResolvConf = false" | sudo tee -a /etc/wsl.conf > /dev/null` - * overwrite resolv.conf: - * add content `echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf > /dev/null` - * add private folder symlink: `ln -s -f /mnt/c/Users//Private ~/Private` +# update wsl +wsl --update --web-download +# launch debian in the home directory +wsl ~ -### Debian +# stabilize wsl.conf (so it doesn't overwrite `resolv.conf` in next step) +sudo touch /etc/wsl.conf +echo [network] | sudo tee -a /etc/wsl.conf > /dev/null +echo generateResolvConf = false | sudo tee -a /etc/wsl.conf > /dev/null -Once debian is running: - -``` -# upgdate + upgrade packages +# fix WSL nameserver +echo 'nameserver 8.8.8.8' | sudo tee -a /etc/resolv.conf > /dev/null sudo apt update && sudo apt upgrade -y -# the following installs aren't necessary in codespace 🤔 -sudo apt install -y git curl # dotfiles deps -sudo apt install -y build-essential ncurses-dev # tmux dep +# install dependencies for dotfiles installation +sudo apt install -y git curl -# ssh cloning is available after dotfiles installation - clone to /tmp/ for now -git clone https://github.com/DannyDannyDanny/dotfiles.git /tmp/dotfiles && cd /tmp/dotfiles/ -bash install.sh +# install dependencies for tmux +sudo apt install -y build-essential ncurses-dev ``` - -### setup github - +### Clone repo SSH method +Skip this if you don't plan on getting SSH access to github repos and clone with HTTP instead +#### generate ssh ``` ssh-keygen -q -t ed25519 -N '' -f ~/.ssh/id_ed25519_github <</dev/null 2>&1 -echo 'older machines might not support ed25519, then use RSA with 4096 bit key' -echo 'ssh-keygen -q -t rsa -b 4096 -N '' -f ~/.ssh/id_rsa_github <</dev/null 2>&1' +# echo 'older machines might not support ed25519, then use RSA with 4096 bit key' +# echo 'ssh-keygen -q -t rsa -b 4096 -N '' -f ~/.ssh/id_rsa_github <</dev/null 2>&1' -echo 'add ssh to key to github' -echo 'cat ~/.ssh/id_*_github.pub' -echo 'go to https://github.com/settings/ssh/new and add key as -' - -# pause because user needs to add key before we continue -read -rsp $'Press any key to continue...\n' -n1 key +# add the output to https://github.com/settings/ssh/new +cat ~/.ssh/id_*_github.pub +# add to https://github.com/settings/ssh/new +``` +#### activate ssh +``` echo 'adding key to ssh-agent' eval `ssh-agent -s` # not just ssh-agent -s ssh-add ~/.ssh/id_*_github -echo 'private repos can now be cloned via ssh' -echo 'repos can now be pushed to via ssh' -``` -#### dotfiles repo via ssh - -``` -echo 'clone and git config dotfiles repo' +# download dotfiles repo git clone git@github.com:DannyDannyDanny/dotfiles.git +# config git cd dotfiles git config user.name "DannyDannyDanny" git config user.email "dth@taiga.ai" git config pull.rebase false cd .. - ``` -* remove section from ubuntu.md -* change install script(s) to download file to `/tmp/` instead of working directory -* consider adding [more error handling](https://tecadmin.net/bash-error-detection-and-handling-tips-and-tricks/) to install scripts + +### Clone repo HTTP method +``` +git clone https://github.com/DannyDannyDanny/dotfiles.git +``` ### add sshd persistency