Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
- remove logo.png\n- update frontmatter\n - add root.md
  • Loading branch information
Christian Ramirez committed Dec 25, 2024
1 parent 8dda8aa commit 14d5dae
Show file tree
Hide file tree
Showing 15 changed files with 39 additions and 36 deletions.
46 changes: 23 additions & 23 deletions computing_resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ title: Computing Resources
subtitle: Technical guides for commonly used software tools
author: Christian S. Ramirez
---
## Secure Jupyter
### Why?
# Secure Jupyter
## Why?
HTTPS encrypts data between your browser and JupyterLab to prevent eavesdropping/tampering, while password authentication ensures only authorized users can access your notebooks and execute code on your system.
### Setting up your HTTPS and `jupyter_server_config.py`
#### Make jupyter password and `certfile` directory
## Setting up your HTTPS and `jupyter_server_config.py`
### Make jupyter password and `certfile` directory
```
mkdir -p ~/.jupyter/certfiles
jupyter lab --generate-config
jupyter lab password
```
#### Create your private (.key) and public key (.pem)
### Create your private (.key) and public key (.pem)
Make sure to replace `HOSTNAME` with the machine you are on (i.e. z014).
```
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
Expand All @@ -22,7 +22,7 @@ openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
-subj "/CN=HOSTNAME"
chmod 600 ~/.jupyter/certfiles/jupyter.key
```
#### Add config options to your `jupyter_server_conifg.py`
### Add config options to your `jupyter_server_conifg.py`
Make sure to replace `HOSTNAME` with the machine you are on (i.e. z014) and `USERNAME` with your username.
```
c.ServerApp.certfile = '/Users/USERNAME/.jupyter/certfiles/jupyter.pem'
Expand All @@ -44,18 +44,18 @@ As opposed to:
```
singularity exec --writable -B /data,/zata /zata/zippy/$(whoami)/bin/bioinformatics jupyter lab --port=8888 --ip=HOSTNAME --no-browser --notebook-dir=/data/GROUP/$(whoami)
```
## Screen
### Why?
# Screen
## Why?
Screen allows you to manage multiple terminal sessions within a single window and keeps processes running even if your connection drops, making it useful running remote jobs.
#### Commonly used screen options and shortcuts
##### Options
### Commonly used screen options and shortcuts
#### Options
```
screen -S [name] # Start new named session
screen -ls # List sessions
screen -r [name] # Reattach to session
screen -d -r # Detach existing and reattach here
```
##### Shortcut keys
#### Shortcut keys
```
Ctrl-a + c # Create new window
Ctrl-a + " # List/select windows
Expand All @@ -67,8 +67,8 @@ Ctrl-a + | # Split vertical
Ctrl-a + <TAB> # Switch split regions
Ctrl-a + X # Close active split
```
#### All screen command flags and shortcuts
##### Options
### All screen command flags and shortcuts
#### Options
```
-a # Force all capabilities into each window’s termcap.
-A -[r|R] # Adapt all windows to the new display width & height.
Expand Down Expand Up @@ -96,7 +96,7 @@ Ctrl-a + X # Close active split
-x # Attach to a not detached screen. (Multi display mode).
-X # Execute as a screen command in the specified session.
```
##### Shortcut keys
#### Shortcut keys
```
Ctrl-a + c # Create a new window.
Ctrl-a + " # Window selector
Expand All @@ -114,14 +114,14 @@ Ctrl-a + d # Detach a screen session without stopping it.
Ctrl-a + r # Reattach a detached screen session.
Ctrl-a + <ESC> # Start the copy mode.
```
## tmux (alternative to screen)
### [cheatsheet](https://tmuxcheatsheet.com/)
## Local Development
### micromamba
# tmux (alternative to screen)
## [cheatsheet](https://tmuxcheatsheet.com/)
# Local Development
## micromamba
Micromamba is a standalone version of Mamba which is an alternative to Conda. Refer to the installation instructions [here](https://mamba.readthedocs.io/en/latest/installation/micromamba-installation.html).
### `python -m venv` Wrapper
## `python -m venv` Wrapper
This wrapper script simplifies the usage of `python -m venv` for creating native python virtual environments. This is especially handy if you are using Homebrew on MacOS since, by default, Homebrew disallows the usage of pip in the global environment.
#### Wrapper Script
### Wrapper Script
Add the following to your `.zshrc` or `.bashrc`:
```
# Usage
Expand Down Expand Up @@ -184,16 +184,16 @@ rmvenv() {
}
```
Make sure to run `source ~/.bashrc` or `source ~/.zshrc` after adding the script.
## UMass SCI Cluster
# UMass SCI Cluster
Please refer to the [getting started page](https://hpc.umassmed.edu/doc/index.php?title=Getting_started) on the HPC wiki at `hpc.umassmed.edu`. Make sure that you are connected to the UMMS network (on-premises) or [[VPN|Getting Started#computing-access##vpn-setup]].
### Useful bash aliases
## Useful bash aliases
Add the following to you bashrc.
```
alias gpu='bsub -q gpu -gpu "num=1:gmodel=TeslaV100_SXM2_32GB" -W 1440 -n 10 -R "rusage[mem=8000]" -R "span[hosts=1]" -Is bash'
alias cpu='bsub -q interactive -n 10 -R "rusage[mem=8000]" -R "span[hosts=1]" -Is bash'
```
Run `source ~/.bashrc`. Now, by running `gpu` or `cpu` in the terminal, you can now reserve a gpu and cpu for 24 hours and start an interactive bash shell.
### Monitor GPU usage
## Monitor GPU usage
Say you are running a gpu intensive program. If you want to make sure you program is still running based on the gpu usage, you can run `watch -n 1 nvidia-smi` in the terminal. You should see something like this:
```
Thu Dec 19 15:04:21 2024
Expand Down
Binary file removed dark_mode_logo.png
Binary file not shown.
13 changes: 6 additions & 7 deletions getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ authors:
---
# Computing Access


## iTerm2 (Mac)
If you are on Mac, I prefer to user [iTerm2](https://iterm2.com/) as opposed to the stock terminal, it supports multiple tabs, is much more customizable, and has many additional features.

Expand Down Expand Up @@ -60,13 +59,13 @@ Host z010 z011 z012 z013 z014
`ssh [email protected]`

If it's your first time, you will be prompted to scan the QR code with any two-factor authentication app. You should also be prompted to change your password.
***
🔴 **IMPORTANT** 🔴 Save this QR code somewhere!
***
```{important}
Save this QR code somewhere!
```
I personally recommend using Microsoft Authenticator, since this is the 2FA app used by your UMass Microsoft account. However, it may also be convenient to choose a 2FA app that has a desktop client.
***
🔴 **IMPORTANT** 🔴 From this point forward, every time you login, you will provide your password + two-factor code with no spaces.
***
```{important}
From this point forward, every time you login, you will provide your password + two-factor code with no spaces.
```
From bastion, you can then `ssh` into any of the ZLab servers:
```
ssh HOSTNAME
Expand Down
Binary file removed images/citations.png
Binary file not shown.
Binary file removed images/equations.gif
Binary file not shown.
Binary file removed images/export-pdf.png
Binary file not shown.
Binary file removed images/frontmatter-after.png
Binary file not shown.
Binary file removed images/frontmatter-before.png
Binary file not shown.
Binary file removed images/interactive.gif
Binary file not shown.
Binary file removed images/pdf-two-column.png
Binary file not shown.
Binary file removed images/structured-data.gif
Binary file not shown.
4 changes: 2 additions & 2 deletions learning_resources.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Computing Resources
subtitle: Technical guides for commonly used software tools
title: Learning Resources
subtitle: Curated collection of bioinformatics learning materials
author: Christian S. Ramirez
---
# Foundation Skills
Expand Down
Binary file removed light_mode_logo.png
Binary file not shown.
7 changes: 3 additions & 4 deletions myst.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ version: 1
site:
options:
favicon: favicon.ico
logo: light_mode_logo.png
logo_dark: dark_mode_logo.png
logo_text: ZLab Wiki
template: book-theme
project:
github: https://github.com/christian728504/zlabwiki
id: 8965acc4-b9cd-4f25-a3f5-2ca202b40f79

toc:
# Auto-generated by `myst init --write-toc`
- file: root.md
- file: getting_started.md
- file: computing_resources.md
- file: getting_started.md
- file: learning_resources.md

5 changes: 5 additions & 0 deletions root.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# ZLab Wiki
Draft of the ZLab Wiki. Intended for onboarding new students into the lab, by providing tutorials and guides about common software used in our lab research.

```{tableofcontents}
```

0 comments on commit 14d5dae

Please sign in to comment.