Skip to content

Instantly share code, notes, and snippets.

SSH agent forwarding and screen

When connecting to a remote server via SSH it is often convenient to use SSH agent forwarding so that you don't need a separate keypair on that server for connecting to further servers.

This is enabled by adding the

ForwardAgent yes

option to any of your Host entries in ~/.ssh/config (or alternatively with the -A option). Don't set this option in a wildcard Host * section since any user on the remote server that can bypass file permissions can now als use keys loaded in your SSH agent. So only use this with hosts you trust.

@manics
manics / README.md
Last active January 20, 2021 10:14
IDR release stats
@manics
manics / README.md
Last active September 10, 2019 18:56
Run a Jupyter Notebook on BinderHub non-interactively from the command line

Run a Jupyter Notebook on BinderHub non-interactively from the command line

The notebook should contain a cell starting with # Parameters:

Example:

./binderhub-exec.py \
    gist/manics/421f2927bb1dbdbc00754a7669eb3f69/master \
    idr-image.ipynb \

IMAGE_ID=4495402

@manics
manics / README.md
Last active September 6, 2019 19:37

Connect to OMERO, passing parameters as URL query parameters

Binder

This notebook requires the parameters host, username, passwd

If you already have a notebook opened you can pass the parameters by adding this query string to the URL in your browser:

?host='HOST'&username='USERNAME'&passwd='PASSWD'

or

@manics
manics / README.md
Last active January 20, 2021 10:23
Create a montage of images from the IDR
@manics
manics / idr-image.ipynb
Last active September 5, 2019 23:01
Example of fetching IDR image metadata
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@manics
manics / README.md
Last active January 20, 2021 11:02
@manics
manics / README.md
Last active September 17, 2022 12:51
Zero2JupyterHub Helm config with LDAP UID
@manics
manics / README.md
Last active September 22, 2023 23:19
Example mybinder postgresql server

mybinder/repo2docker PostgreSQL server

Binder

Example mybinder repo with a built-in PostgreSQL server.

@manics
manics / lsof-parse.py
Created January 25, 2018 16:08
Parse the output of `lsof -F`
#!/usr/bin/env python
# Convert the output of `lsof -F` into PID USER CMD OBJ
import sys
rs = []
pid = -1
cmd = ''
user = ''
for line in sys.stdin: