From 4d9fb664b8ee13b12bd1ea475f5a5c841318b78b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Han=20Seung=20Min=20-=20=ED=95=9C=EC=8A=B9=EB=AF=BC?= Date: Tue, 9 Nov 2021 12:28:34 +0530 Subject: [PATCH 1/6] Fix : recreate the termux guide to adapt the recent changes Termux nodejs-lts changed from v14 to v16 and there are many issues people are facing such as with argon2. Hence I recommend changing it to this install process which is comparably better and has one less issue :^) I've also added some extra things such as installing GO and Python, idk about the TOC tree but this is pretty much it. --- docs/termux.md | 171 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 112 insertions(+), 59 deletions(-) diff --git a/docs/termux.md b/docs/termux.md index db50adf3c8d0..4bf4fc3581e1 100644 --- a/docs/termux.md +++ b/docs/termux.md @@ -10,62 +10,115 @@ -Termux is a terminal application and Linux environment that you can also use to -run code-server from your Android phone. - -## Install - -1. Install Termux from [F-Droid](https://f-droid.org/en/packages/com.termux/). -1. Make sure it's up-to-date: `apt update && apt upgrade` -1. Install required packages: `apt install build-essential python git nodejs-lts yarn` -1. Install code-server: `yarn global add code-server` -1. Run code-server: `code-server` and navigate to localhost:8080 in your browser - -## Upgrade - -To upgrade run: `yarn global upgrade code-server --latest` - -## Known Issues - -The following details known issues and suggested workarounds for using -code-server with Termux. - -### Search doesn't work - -There is a known issue with search not working on Android because it's missing -`bin/rg` ([context](https://github.com/cdr/code-server/issues/1730#issuecomment-721515979)). To fix this: - -1. Install `ripgrep` with `pkg` - - ```sh - pkg install ripgrep - ``` - -1. Make a soft link using `ln -s` - - ```sh - # run this command inside the code-server directory - ln -s $PREFIX/bin/rg ./vendor/modules/code-oss-dev/vscode-ripgrep/bin/rg - ``` - -### Backspace doesn't work - -When using Android's on-screen keyboard, the backspace key doesn't work -properly. This is a known upstream issue: - -- [Issues with backspace in Codespaces on Android (Surface Duo)](https://github.com/microsoft/vscode/issues/107602) -- [Support mobile platforms](https://github.com/xtermjs/xterm.js/issues/1101) - -There are two workarounds. - -**Option 1:** Modify keyboard dispatch settings - -1. Open the Command Palette -2. Search for **Preferences: Open Settings (JSON)** -3. Add `"keyboard.dispatch": "keyCode"` - -The backspace button should work at this point. - -_Thanks to @Nefomemes for the [suggestion](https://github.com/cdr/code-server/issues/1141#issuecomment-789463707)!_ - -**Option 2:** Use a Bluetooth keyboard. +### Install + +1. Get [Termux](https://f-droid.org/en/packages/com.termux/) from **F-Droid**. +2. Install Debian by running the following. + - Also run `termux-setup-storage` to allow storage access or else code-server won't be able to read from `/sdcard/`.\ + If you used the Andronix command \\/ then you may have to edit the `start-debian.sh` script to mount `/sdcard` just as simple as uncommenting the `command+=" -b /sdcard"` line. +> The following command was extracted from [Andronix](https://andronix.app/) you can also use [proot-distro](https://github.com/termux/proot-distro). +```bash +pkg update -y && pkg install wget curl proot tar -y && wget https://raw.githubusercontent.com/AndronixApp/AndronixOrigin/master/Installer/Debian/debian.sh -O debian.sh && chmod +x debian.sh && bash debian.sh +``` +> After Debian is installed the `~ $` will change to `root@localhost`. +3. Run the following commands to setup Debian. +```bash +apt update +apt upgrade -y +apt-get install nano vim sudo curl wget git -y +``` +4. Then create a new user to use later and change its password. +```bash +useradd username -m +passwd username +``` +5. Install [NVM](https://github.com/nvm-sh/nvm) by following the install guide in the README, just a curl/wget command. +6. Set up NVM for multi-user. After installing NVM it automatically adds the necessary commands for it to work but it will only work if you are logged in as root which we do not want (see step 9) so do the following things. + - Copy the lines NVM asks you to run after running the install script. + - Run `nano /root/.bashrc` and comment out those lines by adding a `#` at the start. + - Run `nano /etc/profile` and paste those lines at the end and make sure to replace `$HOME` with `/root` + - Now run `exit` and start Debain again. + +7. After following the instructions and setting up NVM you can now install the [required node version](https://coder.com/docs/code-server/latest/npm#nodejs-version) using `nvm install version_here`. +8. You don't need to install yarn. +9. Now you are ready to install code server but first lets switch users. + - There are many answers on Stack Exchange for why logging in as root is not recommended,\ + but heres a [short article](https://www.howtogeek.com/124950/htg-explains-why-you-shouldnt-log-into-your-linux-system-as-root/) for you. + - Run the following `visudo` to give your user (created in step 4) sudo privileges. + - After executing the command scroll to `User privilege specification` and add `username ALL=(ALL:ALL) ALL`. +10. To switch users run `su - username`. **DO NOT forget to add the `-` between `su` and the username or else the `/etc/profile` file won't be executed,** you may instead follow step 6 but edit the `/etc/bash.bashrc` file intead of `/etc/profile` if you don't want to add a `-` between `su` and username. + +11. To install `code-server` run the following. + +To check the install process (Will not actually install code-server) +```bash +curl -fsSL https://code-server.dev/install.sh | sh -s -- --dry-run +``` +Now if all looks good you can run to install code-server. +```bash +curl -fsSL https://code-server.dev/install.sh | sh +``` +12. Now everytime you run `./start-debian.sh` (or `proot-distro login debian` if you used proot-distro) you can switch to your user `su - username` and run code-server. + +### Upgrade + +1. Remove all previous installs `rm -rf ~/.local/lib/code-server-*` +2. Run the install script again `curl -fsSL https://code-server.dev/install.sh | sh` + +### Known Issues + +#### Git won't work in `/sdcard` + +Issue : Using git in the `/sdcard` directory will fail during cloning/commit/staging/etc...\ +Fix : None\ +Potential Workaround : +1. Create a soft-link from the debian-fs to your folder in `/sdcard` +2. Use git from termux (preferred) + +### Extra + +#### Install GO + +> From https://golang.org/doc/install + +1. Go to https://golang.org/dl/ and copy the downloadlink for `linux arm` and run the following. +```bash +wget download_link +``` +2. Extract the downloaded archive. (This step will erase all previous GO installs make sure to create a backup if you have previously installed GO) +```bash +rm -rf /usr/local/go && tar -C /usr/local -xzf archive_name +``` +3. Run `nano /etc/profile` and add the following line `export PATH=$PATH:/usr/local/go/bin`. +4. Now run `exit` (depending on if you have switched users or not you may have to run `exit` multiple times to get to normal termux shell) and start Debian again. +5. Check if your install was successful by running `go version` + +#### Install Python + +> Run these commands as root + +1. Run the following command to install required packages to build python. +```bash +sudo apt-get update; sudo apt-get install make build-essential libssl-dev zlib1g-dev \ +libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \ +libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev +``` +2. Install [pyenv](https://github.com/pyenv/pyenv/) from [pyenv-installer](https://github.com/pyenv/pyenv-installer) by running. +```bash +curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash +``` +3. Run `nano /etc/profile` and add the following +```bash +export PYENV_ROOT="/root/.pyenv" +export PATH="$HOME/.pyenv/bin:$PATH" +eval "$(pyenv init --path)" +eval "$(pyenv virtualenv-init -)" +``` +4. Exit start Debian again. +5. Run `pyenv versions` to list all installable versions. +6. Run `pyenv install version` to install the desired python version. +> The build process may take some time (an hour or 2 depending on your device). +7. Run `touch /root/.pyenv/version && echo "your_version_here" > /root/.pyenv/version` +8. (You may have to start Debian again) Run `python3 -V` to verify if PATH works or not. +> If `python3` doesnt work but pyenv says thst the install was successfull in step 6 then try running `$PYENV_ROOT/versions/your_version/bin/python3`. +9. You can now swith users by `su - username` and try runnning `python3 -V` and `pip -V` to check if it works or not. From ba0a6c931954148d04ed30aca385c4aa0068ddce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Han=20Seung=20Min=20-=20=ED=95=9C=EC=8A=B9=EB=AF=BC?= Date: Wed, 10 Nov 2021 13:06:50 +0530 Subject: [PATCH 2/6] yarn-fmt and minor typos https://github.com/cdr/code-server/pull/4472#issuecomment-964752180 --- docs/termux.md | 85 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 54 insertions(+), 31 deletions(-) diff --git a/docs/termux.md b/docs/termux.md index 4bf4fc3581e1..e3a04cd7d98d 100644 --- a/docs/termux.md +++ b/docs/termux.md @@ -5,60 +5,71 @@ - [Install](#install) - [Upgrade](#upgrade) - [Known Issues](#known-issues) - - [Search doesn't work](#search-doesnt-work) - - [Backspace doesn't work](#backspace-doesnt-work) + - [Git won't work in `/sdcard`](#git-wont-work-in-sdcard) +- [Extra](#extra) + - [Install GO](#install-go) + - [Install Python](#install-python) ### Install 1. Get [Termux](https://f-droid.org/en/packages/com.termux/) from **F-Droid**. -2. Install Debian by running the following. - - Also run `termux-setup-storage` to allow storage access or else code-server won't be able to read from `/sdcard/`.\ +2. Install Debian by running the following. - Run `termux-setup-storage` to allow storage access, or else code-server won't be able to read from `/sdcard`.\ If you used the Andronix command \\/ then you may have to edit the `start-debian.sh` script to mount `/sdcard` just as simple as uncommenting the `command+=" -b /sdcard"` line. -> The following command was extracted from [Andronix](https://andronix.app/) you can also use [proot-distro](https://github.com/termux/proot-distro). + > The following command was extracted from [Andronix](https://andronix.app/) you can also use [proot-distro](https://github.com/termux/proot-distro). + ```bash pkg update -y && pkg install wget curl proot tar -y && wget https://raw.githubusercontent.com/AndronixApp/AndronixOrigin/master/Installer/Debian/debian.sh -O debian.sh && chmod +x debian.sh && bash debian.sh ``` -> After Debian is installed the `~ $` will change to `root@localhost`. -3. Run the following commands to setup Debian. + +> After Debian is installed the `~ $` will change to `root@localhost`. 3. Run the following commands to setup Debian. + ```bash apt update apt upgrade -y apt-get install nano vim sudo curl wget git -y ``` + 4. Then create a new user to use later and change its password. + ```bash useradd username -m passwd username ``` + 5. Install [NVM](https://github.com/nvm-sh/nvm) by following the install guide in the README, just a curl/wget command. -6. Set up NVM for multi-user. After installing NVM it automatically adds the necessary commands for it to work but it will only work if you are logged in as root which we do not want (see step 9) so do the following things. - - Copy the lines NVM asks you to run after running the install script. - - Run `nano /root/.bashrc` and comment out those lines by adding a `#` at the start. - - Run `nano /etc/profile` and paste those lines at the end and make sure to replace `$HOME` with `/root` - - Now run `exit` and start Debain again. +6. Set up NVM for multi-user. After installing NVM it automatically adds the necessary commands for it to work, but it will only work if you are logged in as root; which we do not want (see step 9) so do the following things. + + - Copy the lines NVM asks you to run after running the install script. + - Run `nano /root/.bashrc` and comment out those lines by adding a `#` at the start. + - Run `nano /etc/profile` and paste those lines at the end and make sure to replace `$HOME` with `/root` + - Now run `exit` and start Debain again. 7. After following the instructions and setting up NVM you can now install the [required node version](https://coder.com/docs/code-server/latest/npm#nodejs-version) using `nvm install version_here`. 8. You don't need to install yarn. -9. Now you are ready to install code server but first lets switch users. - - There are many answers on Stack Exchange for why logging in as root is not recommended,\ - but heres a [short article](https://www.howtogeek.com/124950/htg-explains-why-you-shouldnt-log-into-your-linux-system-as-root/) for you. - - Run the following `visudo` to give your user (created in step 4) sudo privileges. - - After executing the command scroll to `User privilege specification` and add `username ALL=(ALL:ALL) ALL`. -10. To switch users run `su - username`. **DO NOT forget to add the `-` between `su` and the username or else the `/etc/profile` file won't be executed,** you may instead follow step 6 but edit the `/etc/bash.bashrc` file intead of `/etc/profile` if you don't want to add a `-` between `su` and username. +9. Now you are ready to install code-server, but let's switch users first. + - There are many answers on Stack Exchange for why logging in as root is not recommended,\ + but here's a [short article](https://www.howtogeek.com/124950/htg-explains-why-you-shouldnt-log-into-your-linux-system-as-root/) for you. + - Run the following `visudo` to give your user (created in step 4) sudo privileges. + - After executing the command, scroll to `User privilege specification` and add `username ALL=(ALL:ALL) ALL`. +10. To switch users, run `su - username`. **DO NOT forget to add the `-` between `su` and the username or, else the `/etc/profile` file won't be executed,** you may instead follow step 6 but edit the `/etc/bash.bashrc` file instead of `/etc/profile` if you don't want to add a `-` between `su` and username. 11. To install `code-server` run the following. To check the install process (Will not actually install code-server) + ```bash curl -fsSL https://code-server.dev/install.sh | sh -s -- --dry-run ``` -Now if all looks good you can run to install code-server. + +If all looks good, you can run to install code-server. + ```bash curl -fsSL https://code-server.dev/install.sh | sh ``` -12. Now everytime you run `./start-debian.sh` (or `proot-distro login debian` if you used proot-distro) you can switch to your user `su - username` and run code-server. + +12. Every time you run `./start-debian.sh` (or `proot-distro login debian` if you used proot-distro), you can switch to your user `su - username` and run code-server. ### Upgrade @@ -71,7 +82,8 @@ curl -fsSL https://code-server.dev/install.sh | sh Issue : Using git in the `/sdcard` directory will fail during cloning/commit/staging/etc...\ Fix : None\ -Potential Workaround : +Potential Workaround : + 1. Create a soft-link from the debian-fs to your folder in `/sdcard` 2. Use git from termux (preferred) @@ -81,16 +93,20 @@ Potential Workaround : > From https://golang.org/doc/install -1. Go to https://golang.org/dl/ and copy the downloadlink for `linux arm` and run the following. +1. Go to https://golang.org/dl/ and copy the download link for `linux arm` and run the following. + ```bash wget download_link ``` -2. Extract the downloaded archive. (This step will erase all previous GO installs make sure to create a backup if you have previously installed GO) + +2. Extract the downloaded archive. (This step will erase all previous GO installs, make sure to create a backup if you have previously installed GO) + ```bash rm -rf /usr/local/go && tar -C /usr/local -xzf archive_name ``` + 3. Run `nano /etc/profile` and add the following line `export PATH=$PATH:/usr/local/go/bin`. -4. Now run `exit` (depending on if you have switched users or not you may have to run `exit` multiple times to get to normal termux shell) and start Debian again. +4. Now run `exit` (depending on if you have switched users or not, you may have to run `exit` multiple times to get to normal termux shell) and start Debian again. 5. Check if your install was successful by running `go version` #### Install Python @@ -98,27 +114,34 @@ rm -rf /usr/local/go && tar -C /usr/local -xzf archive_name > Run these commands as root 1. Run the following command to install required packages to build python. + ```bash -sudo apt-get update; sudo apt-get install make build-essential libssl-dev zlib1g-dev \ -libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \ -libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev +sudo apt-get update +sudo apt-get install make build-essential libssl-dev zlib1g-dev \ + libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \ + libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev ``` + 2. Install [pyenv](https://github.com/pyenv/pyenv/) from [pyenv-installer](https://github.com/pyenv/pyenv-installer) by running. + ```bash curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash ``` + 3. Run `nano /etc/profile` and add the following + ```bash export PYENV_ROOT="/root/.pyenv" -export PATH="$HOME/.pyenv/bin:$PATH" +export PATH="/root/.pyenv/bin:$PATH" eval "$(pyenv init --path)" eval "$(pyenv virtualenv-init -)" ``` + 4. Exit start Debian again. 5. Run `pyenv versions` to list all installable versions. 6. Run `pyenv install version` to install the desired python version. -> The build process may take some time (an hour or 2 depending on your device). + > The build process may take some time (an hour or 2 depending on your device). 7. Run `touch /root/.pyenv/version && echo "your_version_here" > /root/.pyenv/version` 8. (You may have to start Debian again) Run `python3 -V` to verify if PATH works or not. -> If `python3` doesnt work but pyenv says thst the install was successfull in step 6 then try running `$PYENV_ROOT/versions/your_version/bin/python3`. -9. You can now swith users by `su - username` and try runnning `python3 -V` and `pip -V` to check if it works or not. + > If `python3` doesn't work but pyenv says that the install was successful in step 6 then try running `$PYENV_ROOT/versions/your_version/bin/python3`. +9. You can now switch users by `su - username` and try running `python3 -V` and `pip -V` to check if it works or not. From 6172acd1566d87eff95873c4bfb07f7e2fab68f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Han=20Seung=20Min=20-=20=ED=95=9C=EC=8A=B9=EB=AF=BC?= Date: Thu, 11 Nov 2021 00:58:31 +0530 Subject: [PATCH 3/6] Fix : replace unnecessary steps to be linked to a guide --- docs/termux.md | 61 ++++++++++++++++++++------------------------------ 1 file changed, 24 insertions(+), 37 deletions(-) diff --git a/docs/termux.md b/docs/termux.md index e3a04cd7d98d..f9db9e586abd 100644 --- a/docs/termux.md +++ b/docs/termux.md @@ -7,23 +7,25 @@ - [Known Issues](#known-issues) - [Git won't work in `/sdcard`](#git-wont-work-in-sdcard) - [Extra](#extra) - - [Install GO](#install-go) + - [Install Go](#install-go) - [Install Python](#install-python) -### Install +## Install 1. Get [Termux](https://f-droid.org/en/packages/com.termux/) from **F-Droid**. -2. Install Debian by running the following. - Run `termux-setup-storage` to allow storage access, or else code-server won't be able to read from `/sdcard`.\ - If you used the Andronix command \\/ then you may have to edit the `start-debian.sh` script to mount `/sdcard` just as simple as uncommenting the `command+=" -b /sdcard"` line. - > The following command was extracted from [Andronix](https://andronix.app/) you can also use [proot-distro](https://github.com/termux/proot-distro). +2. Install Debian by running the following. + - Run `termux-setup-storage` to allow storage access, or else code-server won't be able to read from `/sdcard`.\ + If you used the Andronix command then you may have to edit the `start-debian.sh` script to mount `/sdcard` just as simple as uncommenting the `command+=" -b /sdcard"` line. + > The following command was extracted from [Andronix](https://andronix.app/) you can also use [proot-distro](https://github.com/termux/proot-distro). + > After Debian is installed the `~ $` will change to `root@localhost`. ```bash pkg update -y && pkg install wget curl proot tar -y && wget https://raw.githubusercontent.com/AndronixApp/AndronixOrigin/master/Installer/Debian/debian.sh -O debian.sh && chmod +x debian.sh && bash debian.sh ``` -> After Debian is installed the `~ $` will change to `root@localhost`. 3. Run the following commands to setup Debian. +3. Run the following commands to setup Debian. ```bash apt update @@ -31,54 +33,40 @@ apt upgrade -y apt-get install nano vim sudo curl wget git -y ``` -4. Then create a new user to use later and change its password. - -```bash -useradd username -m -passwd username -``` - -5. Install [NVM](https://github.com/nvm-sh/nvm) by following the install guide in the README, just a curl/wget command. -6. Set up NVM for multi-user. After installing NVM it automatically adds the necessary commands for it to work, but it will only work if you are logged in as root; which we do not want (see step 9) so do the following things. +4. Install [NVM](https://github.com/nvm-sh/nvm) by following the install guide in the README, just a curl/wget command. +5. Set up NVM for multi-user. After installing NVM it automatically adds the necessary commands for it to work, but it will only work if you are logged in as root; which we do not want (see step 9) so do the following things. - Copy the lines NVM asks you to run after running the install script. - Run `nano /root/.bashrc` and comment out those lines by adding a `#` at the start. - Run `nano /etc/profile` and paste those lines at the end and make sure to replace `$HOME` with `/root` - Now run `exit` and start Debain again. -7. After following the instructions and setting up NVM you can now install the [required node version](https://coder.com/docs/code-server/latest/npm#nodejs-version) using `nvm install version_here`. -8. You don't need to install yarn. -9. Now you are ready to install code-server, but let's switch users first. - - There are many answers on Stack Exchange for why logging in as root is not recommended,\ - but here's a [short article](https://www.howtogeek.com/124950/htg-explains-why-you-shouldnt-log-into-your-linux-system-as-root/) for you. - - Run the following `visudo` to give your user (created in step 4) sudo privileges. - - After executing the command, scroll to `User privilege specification` and add `username ALL=(ALL:ALL) ALL`. -10. To switch users, run `su - username`. **DO NOT forget to add the `-` between `su` and the username or, else the `/etc/profile` file won't be executed,** you may instead follow step 6 but edit the `/etc/bash.bashrc` file instead of `/etc/profile` if you don't want to add a `-` between `su` and username. - -11. To install `code-server` run the following. - -To check the install process (Will not actually install code-server) +6. After following the instructions and setting up NVM you can now install the [required node version](https://coder.com/docs/code-server/latest/npm#nodejs-version) using `nvm install version_here`. +7. To install `code-server` run the following. + > To check the install process (Will not actually install code-server) + > If it all looks good, you can install code-server by running the second command ```bash curl -fsSL https://code-server.dev/install.sh | sh -s -- --dry-run ``` -If all looks good, you can run to install code-server. - ```bash curl -fsSL https://code-server.dev/install.sh | sh ``` -12. Every time you run `./start-debian.sh` (or `proot-distro login debian` if you used proot-distro), you can switch to your user `su - username` and run code-server. +8. You can now start code server by simply running `code-server`. + +> Consider using a new user instead of root, read [here](https://www.howtogeek.com/124950/htg-explains-why-you-shouldnt-log-into-your-linux-system-as-root/) why using root is not recommended.\ +> Learn how to add a user [here](https://gist.github.com/arHSM/62242c343efc2827861ddc38e485d7df). -### Upgrade +## Upgrade 1. Remove all previous installs `rm -rf ~/.local/lib/code-server-*` 2. Run the install script again `curl -fsSL https://code-server.dev/install.sh | sh` -### Known Issues +## Known Issues -#### Git won't work in `/sdcard` +### Git won't work in `/sdcard` Issue : Using git in the `/sdcard` directory will fail during cloning/commit/staging/etc...\ Fix : None\ @@ -87,9 +75,9 @@ Potential Workaround : 1. Create a soft-link from the debian-fs to your folder in `/sdcard` 2. Use git from termux (preferred) -### Extra +## Extra -#### Install GO +### Install Go > From https://golang.org/doc/install @@ -109,7 +97,7 @@ rm -rf /usr/local/go && tar -C /usr/local -xzf archive_name 4. Now run `exit` (depending on if you have switched users or not, you may have to run `exit` multiple times to get to normal termux shell) and start Debian again. 5. Check if your install was successful by running `go version` -#### Install Python +### Install Python > Run these commands as root @@ -144,4 +132,3 @@ eval "$(pyenv virtualenv-init -)" 7. Run `touch /root/.pyenv/version && echo "your_version_here" > /root/.pyenv/version` 8. (You may have to start Debian again) Run `python3 -V` to verify if PATH works or not. > If `python3` doesn't work but pyenv says that the install was successful in step 6 then try running `$PYENV_ROOT/versions/your_version/bin/python3`. -9. You can now switch users by `su - username` and try running `python3 -V` and `pip -V` to check if it works or not. From becdb3a886f070a15ef4322d1d585b2a0bd201e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Han=20Seung=20Min=20-=20=ED=95=9C=EC=8A=B9=EB=AF=BC?= Date: Thu, 11 Nov 2021 01:31:44 +0530 Subject: [PATCH 4/6] Change from private gist to a section in Extra --- docs/termux.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/termux.md b/docs/termux.md index f9db9e586abd..35557444139b 100644 --- a/docs/termux.md +++ b/docs/termux.md @@ -7,6 +7,7 @@ - [Known Issues](#known-issues) - [Git won't work in `/sdcard`](#git-wont-work-in-sdcard) - [Extra](#extra) + - [Create a new user](#create-a-new-user) - [Install Go](#install-go) - [Install Python](#install-python) @@ -57,7 +58,7 @@ curl -fsSL https://code-server.dev/install.sh | sh 8. You can now start code server by simply running `code-server`. > Consider using a new user instead of root, read [here](https://www.howtogeek.com/124950/htg-explains-why-you-shouldnt-log-into-your-linux-system-as-root/) why using root is not recommended.\ -> Learn how to add a user [here](https://gist.github.com/arHSM/62242c343efc2827861ddc38e485d7df). +> Learn how to add a user [here](#create-a-new-user). ## Upgrade @@ -77,6 +78,19 @@ Potential Workaround : ## Extra +### Create a new user + +To create a new user follow these simple steps - + +1. Create a new user by running `useradd username -m`. +2. Change the password by running `passwd username`. +3. Give your new user sudo access by runnning `visudo`, scroll down to `User privilege specification` and add the following line after root `username ALL=(ALL:ALL) ALL`. +4. Now edit the `/etc/passwd` file with your commadline editor of choice and at the end of the line that specifies your user change `/bin/sh` to `/bin/bash`. +5. Now switch users, by running `su - username` + +- Remember the `-` betweeen `su` and username is required to execute `/etc/profile`,\ + since `/etc/profile` may have some necessary things to be executed you should always add a `-`. + ### Install Go > From https://golang.org/doc/install From d530c32791f3c126da42c239578ffd61a50058b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Han=20Seung=20Min=20-=20=ED=95=9C=EC=8A=B9=EB=AF=BC?= Date: Thu, 11 Nov 2021 02:28:26 +0530 Subject: [PATCH 5/6] Remove reference to non-existent step --- docs/termux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/termux.md b/docs/termux.md index 35557444139b..009447dcada0 100644 --- a/docs/termux.md +++ b/docs/termux.md @@ -35,7 +35,7 @@ apt-get install nano vim sudo curl wget git -y ``` 4. Install [NVM](https://github.com/nvm-sh/nvm) by following the install guide in the README, just a curl/wget command. -5. Set up NVM for multi-user. After installing NVM it automatically adds the necessary commands for it to work, but it will only work if you are logged in as root; which we do not want (see step 9) so do the following things. +5. Set up NVM for multi-user. After installing NVM it automatically adds the necessary commands for it to work, but it will only work if you are logged in as root; which we do not wanto do the following things. - Copy the lines NVM asks you to run after running the install script. - Run `nano /root/.bashrc` and comment out those lines by adding a `#` at the start. From 3d686664e575febc58cd19b3b76d75a14f1d5564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Han=20Seung=20Min=20-=20=ED=95=9C=EC=8A=B9=EB=AF=BC?= Date: Thu, 11 Nov 2021 10:24:44 +0530 Subject: [PATCH 6/6] ready to merge! --- docs/termux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/termux.md b/docs/termux.md index 009447dcada0..8a9b7a87034d 100644 --- a/docs/termux.md +++ b/docs/termux.md @@ -35,7 +35,7 @@ apt-get install nano vim sudo curl wget git -y ``` 4. Install [NVM](https://github.com/nvm-sh/nvm) by following the install guide in the README, just a curl/wget command. -5. Set up NVM for multi-user. After installing NVM it automatically adds the necessary commands for it to work, but it will only work if you are logged in as root; which we do not wanto do the following things. +5. Set up NVM for multi-user. After installing NVM it automatically adds the necessary commands for it to work, but it will only work if you are logged in as root; - Copy the lines NVM asks you to run after running the install script. - Run `nano /root/.bashrc` and comment out those lines by adding a `#` at the start.