Skip to content

Instantly share code, notes, and snippets.

@jradek
Last active January 21, 2020 13:06
Show Gist options
  • Save jradek/42aac7c218c64f020e49a0b5c313aede to your computer and use it in GitHub Desktop.
Save jradek/42aac7c218c64f020e49a0b5c313aede to your computer and use it in GitHub Desktop.
######################################################################
# merge without checkout [link](https://stackoverflow.com/a/17722977)
#
# Merge local branch 'devel' into local branch master,
# without having to checkout master first.
# Here `.` means to use the local repository as the "remote":
#
git fetch . devel:master
# update master branch when beeing on a different branch, e.g. devel
git fetch origin master:master
######################################################################
# Ssh port forward [link](https://unix.stackexchange.com/a/83812)
#
ssh -f -L 16006:127.0.0.1:16006 <remote_host> sleep 10;
######################################################################
# Running remote jupyter notebook
# [See also](https://coderwall.com/p/ohk6cg/remote-access-to-ipython-notebooks-via-ssh)
# [See also](https://www.reddit.com/r/IPython/comments/9asjwp/run_jupyter_on_ssh_and_turn_off_my_local_computer/e4ybz20)
# on remote machine
remote > jupyter-notebook --no-browser --port=8889
# on local machine
localhost > ssh -N -f -L localhost:8889:localhost:8889 <remote_host>
######################################################################
# Find out, which user started a container
# [See also](https://superuser.com/a/1250401)
#
docker inspect $(docker ps -q) --format '{{.Config.User}} {{.Name}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment