Skip to content

Commit

Permalink
organize content
Browse files Browse the repository at this point in the history
shifted around some things
  • Loading branch information
Christian Ramirez committed Jan 8, 2025
1 parent 4bfbaa6 commit 4f4718c
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 225 deletions.
223 changes: 0 additions & 223 deletions computing_resources.md

This file was deleted.

41 changes: 41 additions & 0 deletions getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,47 @@ USERNAME@HOSTNAME # Username and server address to login to
```
You can then open your notebook server in your favorite web browser by navigating to http://127.0.0.1:8888/lab.
````{dropdown} Optional
## Configuring JupyterLab for HTTPS
### Make jupyter password and `certfile` directory
```bash
mkdir -p ~/.jupyter/certfiles
jupyter lab --generate-config
jupyter lab password
```
### Create your private (.key) and public key (.pem)
Make sure to replace `HOSTNAME` with the machine you are on (i.e. z014).
```bash
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
-keyout ~/.jupyter/certfiles/jupyter.key \
-out ~/.jupyter/certfiles/jupyter.pem \
-subj "/CN=HOSTNAME"
chmod 600 ~/.jupyter/certfiles/jupyter.key
```
### 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.
```python
c.ServerApp.certfile = '/Users/USERNAME/.jupyter/certfiles/jupyter.pem'
c.ServerApp.keyfile = '/Users/USERNAME/.jupyter/certfiles/jupyter.key'
c.ServerApp.ip = 'HOSTNAME'
c.ServerApp.port = 8888
c.ServerApp.allow_remote_access = True
c.ServerApp.password_required = True
c.ServerApp.config_file = '/Users/USERNAME/.jupyter/jupyter_server_config.json'
c.ServerApp.notebook_dir = '/data/GROUP/USERNAME'
```
Now start jupyter lab using your preferred method. [See Getting Started](getting_started.md) if you are unsure. Navigate to `https://127.0.0.1:8888/lab`. If this is you first time doing this, your browser may return a self-signed certificate warning. Ignore this error, and connect to the url. Now you can login using the password you made at the beginning.
Defining our config options in `jupyter_server_config.py` allows you be less declarative when starting jupyter in the terminal. For example, when using singularity we can start jupyter lab with:
```bash
singularity exec --writable -B /data,/zata /zata/zippy/$(whoami)/bin/bioinformatics jupyter lab
```
As opposed to:
```bash
singularity exec --writable -B /data,/zata /zata/zippy/$(whoami)/bin/bioinformatics jupyter lab --port=8888 --ip=HOSTNAME --no-browser --notebook-dir=/data/GROUP/$(whoami)
```
````
## Common issues with JupyterLab
### Unable to delete files
This is an issue that has come up before. To fix, you first need to find you jupyter config file. It will most likely be located at `/home/USERNAME/.jupyter`. First, change into that directory:
Expand Down
10 changes: 10 additions & 0 deletions learning_resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,31 @@ While there are many ways to go about this, here are some suggestions on how to
Once you have a handle on the basics, I strongly advise moving on to learning specific python libraries (i.e. numpy, pandas, tensorflow, pytorch, etc). While continuing to gain proficiency in python itself is good, most of the work in our lab will exclusively involve certain libraries which have their own learning curves.
> [DataCamp](https://app.datacamp.com/) is a great place to start learning these libraries (ask Zhiping for access), but as before -- chose whatever learning material best suits you!
## Command Line Basics
First start with learning the basics of Linux [here](https://linuxjourney.com/). I suggest only completing the "Grasshopper" courses, as these cover most of what you need to know. After you've gotten a good grasp of the basics, then move on to learning bash scripting [here](https://exercism.org/tracks/bash). While bash scripting is useful, know when to grab for fully-featured programming language as you requirements become more complex.
> [Bash Cheatsheet](https://devhints.io/bash)
## CLI Text Editor
Sometime you may need to quickly edit a config file or make changes to you .bashrc file. In these cases, the quickest way is almost always to use a CLI text editor.

### `vim`
`vim` has more functionality and configurability. However, it notoriously has a steep learning curve. Here is [a good tutorial](https://github.com/iggredible/Learn-Vim/blob/master/ch00_read_this_first.md) if you are interested.

### A Quick `vim` Tutorial

#### Basic Navigation
- `h/j/k/l` - Move cursor left/down/up/right
- `w/b` - Jump forward/backward by word
- `0/$` - Move to start/end of line
- `gg/G` - Go to first/last line

#### Modes
- `i` - Enter insert mode before cursor
- `a` - Enter insert mode after cursor
- `ESC` or `CTRL+[` - Return to normal mode
- `v` - Enter visual mode for selection

#### Essential Commands
- `:w` - Save file
- `:q` - Quit (`:q!` to force quit without saving)
Expand All @@ -39,6 +46,7 @@ Sometime you may need to quickly edit a config file or make changes to you .bash
- `dd` - Delete line
- `yy` - Copy line
- `p` - Paste after cursor

#### Text Operations
- `x` - Delete character
- `dw` - Delete word
Expand All @@ -48,7 +56,9 @@ Sometime you may need to quickly edit a config file or make changes to you .bash
- `:%s/old/new/g` - Replace all occurrences

You can find a more in-depth tutorial [here](https://github.com/iggredible/Learn-Vim/blob/master/ch00_read_this_first.md) if you are interested.

## Version Control

### Git
The official Git documentation includes a tutorial [here](https://git-scm.com/docs/gittutorial).

Expand Down
3 changes: 1 addition & 2 deletions myst.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ project:
github: https://github.com/weng-lab/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: software_tools.md
- file: learning_resources.md

0 comments on commit 4f4718c

Please sign in to comment.