# Set up new computer with Ubuntu
## From the web
**1password**: Download `deb` file from the website and then run `sudo apt install ./1password-latest.deb`
**Brave browser**: Download from website, set as main browser.
**Sign into Github**:
+ Sign in, make an [ssh key](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent)
+ [Add to github](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account)
**Starship prompt**
+ Install [NerdFont](https://www.nerdfonts.com/font-downloads) like FiraCode, move to `./fonts`
+ Go [starship.rs](starship.rs) and follow the instructions
**Kitty terminal**
+ Install from [here](https://sw.kovidgoyal.net/kitty/binary/)
+ Add relevant things to path: `sudo ln -s ~/.local/kitty.app/bin/kitty /usr/local/bin/kitty` (also `kitten`)
**Conda**. Install miniconda and poetry
```shell=
mkdir -p ~/installs # if not available
cd ~/installs
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh # follow instructions
# sometimes the following will be necessary
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r
```
**Dropbox** from [here](https://www.dropbox.com/en_GB/install-linux). If possible, install in the `/data` folder
## From `apt`
Run the following command:
```shell=
sudo apt install build-essential imagemagick pcmanfm rofi conky tldr neovim texlive libreoffice -y
```
Finish with `tldr -u` to update the database for `tldr`.
| Name | id for `apt` | Description |
| -------- | -------- | -------- |
| Build Essentials | `build-essential`| C, C++, etc |
| ImageMagick | `imagemagick` | Utils for image analysis |
| pcmanfm | `pcmanfm` | File manager |
| rofi | `rofi` | Run prompt |
| conky | `conky` | Graphics and stuff |
| tldr | `tldr` | Easier `man` pages |
| NeoVim | `neovim` | Text editor |
| TeX Live | `texlive` | LaTeX libraries |
| LibreOffice | `libreoffice` | Office |
(Hopefully) optionals
```shell=
sudo apt install qtwayland5 -y
```
## Rust/cargo utils
Go [here](https://doc.rust-lang.org/cargo/getting-started/installation.html). Once installed, add to the path with:
```shell
. "$HOME/.cargo/env"
```
Install the following:
```shell
cargo install exa fd-find ripgrep bat
```
Add the following to the `.bashrc` file
```
alias exa='exa -la --group-directories-first'
```
## From snap
**VSCode** `sudo snap install code --classic`
**Slack** `sudo snap install slack`
## From Github
### **myconfig**
```shell
git clone git@github.com:alonsoJASL/myconfig.git
```
+ Copy config folder`cp -R rofi ~/.config/`
+ Move Starship TOML `cp starship.toml`
+ KITTY: move contents from `kitty` to `~/.config/kitty/`
+ CONKY: move contents from `conky` to `~/.config/conky`, then setup conky as startup application `$HOME/.config/conky/start_conky.sh`
+ BASHRC: get whatever is needed from `.bashrc` file.
+ COLORSCRIPT: apply the patch
### (OPTIONALS) Colorscript and Wallpapers
If you haven't, do `mkdir -p ~/.installs`, and inside do:
```shell
git clone https://gitlab.com/dwt1/shell-color-scripts.git
git clone https://gitlab.com/dwt1/wallpapers.git
```
For `colorscript`, do a `sudo ln -s PATH/colorscript.sh /usr/local/bin/colorscript`. Add the line to the `.bashrc`
```shell
colorscript -r
```
# Important development configs
These come after you've installed everything else. By this, make sure you have a `~/dev` and an `~/installs` folders. Inside `dev`
```
➜ ls ~/dev/
build myconfig python src
```
## cemrg-heartbuilder
```shell=
cd python/
git clone git@github.com:OpenHeartDevelopers/cemrg-heartbuilder.git
cd cemrg-heartbuilder/
conda create -n cemrg-heartbuilder python=3.10 -y
conda activate cemrg-heartbuilder
poetry config virtualenvs.create false --local
poetry install
./setup.sh
```
## imatools
```shell=
git clone git@github.com:alonsoJASL/imatools.git
cd imatools/
conda env create -f environment.yaml
conda activate imatools
poetry install
./setup.sh
```
## meshtool
```shell=
git clone https://bitbucket.org/aneic/meshtool.git
cd meshtool/
make
# then link it to /usr/local/bin
sudo ln -s $(pwd)/meshtool /usr/local/bin/meshtool
```
## itk-snap (and c3d)
Download and move the compressed file to the `~/installs` folder
```shell=
mv ~/Downloads/itksnap-4.2.2-20241202-Linux-x86_64.tar.gz ~/installs/
cd ~/installs
tar xvf itksnap-4.2.2-20241202-Linux-x86_64.tar.gz # Extract
```
Create an `alias` on your `.bashrc` pointing to the binaries for `itksnap` and `c3d`. A symlink does not work in this context.
## Paraview
```shell=
mv ~/Downloads/ParaView-5.13.3-MPI-Linux-Python3.10-x86_64.tar.gz ~/installs/
cd ~/installs
tar ParaView-5.13.3-MPI-Linux-Python3.10-x86_64.tar.gz
cd ParaView-5.13.3-MPI-Linux-Python3.10-x86_64/bin
sudo ln -s $(pwd)/paraview /usr/local/bin/paraview
```
## Meshalyzer
```shell=
sudo apt install libfuse-dev
mv ~/Downloads/Meshalyzer-5.4-x86_64.AppImage ~/installs/
cd ~/installs
mkdir Meshalyzer
mv Meshalyzer-5.4-x86_64.AppImage Meshalyzer/
cd Meshalyzer
chmod +x Meshalyzer-5.4-x86_64.AppImage
sudo ln -s $(pwd)/Meshalyzer-5.4-x86_64.AppImage /usr/local/bin/meshalyzer
```
## CemrgApp
Follow the instructions in the [wiki](https://github.com/OpenHeartDevelopers/CemrgApp/wiki/Build-CemrgApp-from-Scratch)
## Docker
Follow the instructions in the [docs](https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository)
# Shortcuts
+ <kbd>SUPER</kbd>+<kbd>R</kbd> : `rofi show -run -normal-window`
+ <kbd>SUPER</kbd>+<kbd>W</kbd> : `rofi show -window -normal-window`
+ <kbd>SUPER</kbd>+<kbd>Return</kbd> : `kitty`
+ <kbd>SUPER</kbd>+<kbd>Q</kbd> : Exchange for the one that closes apps
+ <kbd>SUPER</kbd>+<kbd>F</kbd> : Opemn `pcmanfm`
# Optional
Remove the dock on Ubuntu: `sudo apt remove gnome-shell-extension-ubuntu-dock`
Fix Nvidia driver from nouveau (ew) to nvidia:
```shell=
ubuntu-drivers devices
# Install the recommended driver
sudo ubuntu-drivers autoinstall
# OR if you want to be more specific (check output from step 2):
# sudo apt install nvidia-driver-535
sudo reboot
```
Once you rebooted, check
```shell=
nvidia-smi
lsmod | grep nouveau # should be empty
```
# Imperial-specific
## Login to computer through ssh
### Setup (only do once)
You need to install [OPKSSH](https://github.com/openpubkey/opkssh)
```bash=
# LINUX
curl -L https://github.com/openpubkey/opkssh/releases/latest/download/opkssh-linux-amd64 -o opkssh
chmod +x opkssh
# macOS
curl -L https://github.com/openpubkey/opkssh/releases/latest/download/opkssh-osx-amd64 -o opkssh
chmod +x opkssh
```
Initialise:
```bash=
./opkssh login --create-config
```
You'll need to install the imperial config file and save it to the `config.yml` that got created in the previous step:
```bash=
curl https://rhn.cc.ic.ac.uk/install/scripts/standalone/sshgw/opkssh/config.yml -o ~/.opk/config.yml
```
### Every time you want to log in
> Certificate lasts 24 hours, so you need to do this pretty much every time
```bash=
opkssh login
```
Follow instructions, you'll authenticate on the browser. This will create a pair of files in your `~/.ssh` folder (called `id_ecdsa`).
Now, you can log in:
```bash=
ssh <username>@opkssh.ic.ac.uk -i ~/.ssh/id_ecdsa
```