# Let's create (or add to) our SSH client configuration file.
"
echo Host *.chtc.wisc.edu
# Turn ControlMaster on
ControlMaster auto
# ControlMaster connection will persist
# for 2 hours of idleness, after which
# it will disconnect
ControlPersist 2h
# Where to store files that represent
# the ControlMaster persistent connections
ControlPath ~/.ssh/connections/%r@%h:%p" >> ~/.ssh/config
11 Installing Linux
11.1 Install OS
https://ubuntu.com/tutorials/install-ubuntu-desktop#1-overview
11.2 Install key support apps
sudo apt install git
sudo apt install vim
11.3 R
Following this website
- sudo apt-get update
- wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
- to verify key type: gpg –show-keys /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
- sudo apt-get update
- sudo apt-get install r-base r-base-core r-recommended r-base-dev
- sudo apt install libcurl4-openssl-dev
- sudo apt install libfontconfig1-dev
- sudo apt install libxml2-dev
- sudo apt install libharfbuzz-dev libfribidi-dev
- sudo apt install libssl-dev
- sudo apt install libtiff5-dev
- sudo apt install libfreetype6-dev
- sudo apt install libpng-dev
- libjpeg-dev
Then install RStudio by getting current deb file from their website
Then install key packages
- devtools
- tidyverse
For more info if problems
https://www.r-bloggers.com/2022/08/installation-of-r-4-2-on-ubuntu-22-04-1-lts-and-tips-for-spatial-packages/
https://www.digitalocean.com/community/tutorials/how-to-install-r-on-ubuntu-22-04
https://computingforgeeks.com/how-to-install-r-and-rstudio-on-ubuntu-debian-mint/
and for updates of R version, see https://docs.posit.co/resources/install-r
11.4 Quarto
Download latest version of Quarto
install using
sudo apt install <package path>
orsudo dpkg -i <package path>
https://docs.posit.co/resources/install-quarto/
https://www.cyberciti.biz/faq/how-to-install-curl-command-on-a-ubuntu-linux/
11.5 Zotero
sudo apt update
sudo apt upgrade
sudo snap install zotero-snap
After zotero is installed, you can synch to the Addiction Research Lab library. Go to menu edit:preferences:synch
. Username is jjccurtin. Ask John or Susan for the password.
11.6 Slack
Slack is easily installed from the Ubuntu Software Center. Open up the software center. Search for Slack. Install. Done.
11.6.1 pdfs
sudo snap install evince
for viewing pdfssudo apt-get install qpdf
for manipulating pdfs (e.g., extract pages)also consider sudo apt install poppler-utils and then and for
pdftotext filname.pdf
11.7 Global Protect
11.8 Meld Merge for file diffs
- install from terminal:
sudo apt install meld
- or download and install meld merge
- add the following to your .gitconfig file
[diff]
tool = meld
[difftool]
prompt = false
[difftool "meld"]
cmd = meld "$LOCAL" "$REMOTE"
# The order of the Meld GUI window panes can be controlled by the order of $LOCAL and $REMOTE in cmd
11.9 CSV
https://www.tadviewer.com/
https://www.moderncsv.com/
11.11 Set up SSH Client and Server
https://ubuntu.com/server/docs/service-openssh
11.12 Creating SSH passkeys
You can create an ssh key to ssh without the need to provide username and password. In our lab, these are useful to ssh to CHTC or for git shh to GitHub.
To create the key
Open a terminal and type
ssh-keygen -t ed25519
.Accept the defaults by repeatedly pressing enter and this will create a key with defauult names .ssh/id_ed25519, and .ssh/id_ed25519.pub.
After creating the keys, you may need to change their permissions.
chmod 644 id_ed25519.pub
chmod 600 id_ed25519
To use this key with CHTC
- Create or edit personal CHTC configuration file at ~/.ssh/config. Run the following at the terminal:
- In the same ~/.ssh/config directory, make a folder called connections
mkdir -p ~/.ssh/connections
Open the public key file (id_25519.pub) and copy the content.
SSH to CTHC
ssh netid@submit-1.chtc.wisc.edu
Create or edit .ssh/authorized_keys
Paste your public key info at the end of this file.
To use this key with Github
Go to your settings (point at your profile picture and select settings.
Select SSH and GPG Keys
Click New SSH Key, give it a title, and paste the public key info into Key box.
For more info
https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
https://github.com/settings/keys
https://www.beyondtrust.com/blog/entry/ssh-key-management-overview-6-best-practices
11.13 Sound mixer settings
install pavucontrol to get mic on zoom to work
alsamixer from terminal may help
11.14 VNC for Remote Access
https://kb.wisc.edu/biochem/it/page.php?id=127360
11.15 SSH to office computer
https://linuxhint.com/enable-use-ssh-ubuntu/
use username for hostname
11.15.1 X11 forwarding
X11 forwarding is used in SSH to display GUI for app (e.g., rstudio) on remote computer (e.g., office computer). To enable X11 forwarding, need to edit /etc/ssh/sshd_config on remote computer to indicate: - X11Forwarding yes
May also want to set - X11DisplayOffset 10
- X11UseLocalhost yes
- TCPKeepAlive yes
May need to install xauth on remote computer.
Need to use -X flag with ssh from local computer. Can then open GUI for remote app (e.g.. rstudio)
11.15.2 VNC
Documentation on how to install tightvnc on host.
Start vncserver on host with specific resolution:
vncserver -geometry 2560x1080 -depth 24
On client, can use Remmina with SSH.
11.16 Customize CLI prompt
This will set up a green prompt with relative path for current directory.
PS1=“$ (https://github.com/cknadler/vim-anywhere) - more info
11.17 Vim in bash
- https://blog.sanctum.geek.nz/vi-mode-in-bash/
11.18 Github Copilot for CLI
- https://github.com/cli/cli/blob/trunk/docs/install_linux.md
- gh auth login
- gh extension install github/gh-copilot
11.19 Git Command Line for Windows
If you want to run some cli programs (e.g., sftp, ssh, git) and limited bash on a Windows compoter, install Git Bash.
This is NOT needed if you are installing Linux as your OS.