https://github.com/zonca/jupyterlab_shellcommand_monitor
Toy JupyterLab extensions to watch a shell command
https://github.com/zonca/jupyterlab_shellcommand_monitor
Last synced: 19 days ago
JSON representation
Toy JupyterLab extensions to watch a shell command
- Host: GitHub
- URL: https://github.com/zonca/jupyterlab_shellcommand_monitor
- Owner: zonca
- Created: 2018-03-02T08:56:51.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-13T01:56:46.000Z (almost 8 years ago)
- Last Synced: 2025-01-13T09:24:17.409Z (over 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# jupyterlab_shellcommand_monitor
Run a shell command every minute and display its output in a JupyterLab tab.
E.g. monitor a folder with `ls -lh` or available memory with `free -m`
It is composed by a custom handler notebook server extension, `jup_mon`, this
server extension executes a shell command and returns the output, for example:
```
curl localhost:8888/shell/df/-h
Filesystem Size Used Avail Use% Mounted on
udev 2.0G 12K 2.0G 1% /dev
tmpfs 396M 380K 395M 1% /run
/dev/sda1 20G 9.1G 9.8G 49% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
none 5.0M 4.0K 5.0M 1% /run/lock
none 2.0G 0 2.0G 0% /run/shm
none 100M 8.0K 100M 1% /run/user
```
Then a JupyterLab extension in TypeScript is accessible from the menu,
it calls the server extension and displays the result in a JupyterLab tab.
It should automatically refresh every minute but that is not implemented yet.
## Prerequisites
* JupyterLab
## Installation
```bash
jupyter labextension install jupyterlab_shellcommand_monitor
```
## Development
For a development install (requires npm version 4 or later), do the following in the repository directory:
```bash
npm install
npm run build
jupyter labextension link .
```
To rebuild the package and the JupyterLab app:
```bash
npm run build
jupyter lab build
```