Skip to content

Instantly share code, notes, and snippets.

@jaytxrx
Created February 3, 2019 16:35
Show Gist options
  • Select an option

  • Save jaytxrx/69b333ce5e46638ecc53768773a1cc05 to your computer and use it in GitHub Desktop.

Select an option

Save jaytxrx/69b333ce5e46638ecc53768773a1cc05 to your computer and use it in GitHub Desktop.
tmux fastai error
#!/bin/bash
SESSIONNAME="fastai"
TAB3="jupyter"
TAB2="shell"
TAB1="overview"
DEFAULTTAB=$TAB2
tmux has-session -t $SESSIONNAME &> /dev/null
#if not existing, lets create one
if [ $? != 0 ]
then
#create a new session and name the window(tab) in it using -n
#detaching is needed as in the last line will attach to it
tmux new-session -s $SESSIONNAME -n $TAB1 -d
#split vertically
tmux split-window -v
tmux send-keys -t 0 "watch -n 1 nvidia-smi" C-m
tmux send-keys -t 1 "htop" C-m
#open a second window(tab)
tmux new-window -t $SESSIONNAME:2 -n $TAB2
tmux new-window -t $SESSIONNAME:3 -n $TAB3
#tmux send-keys -t 0 "cd course-v3/nbs; jupyter notebook --ip=$ipa" C-m
tmux send-keys -t 0 "python -c \"import fastai; print(fastai.__version__)\"" C-m
#default window you want to see when entering the session
tmux select-window -t $SESSIONNAME:$DEFAULTTAB
fi
tmux attach -t $SESSIONNAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment