Skip to content

Instantly share code, notes, and snippets.

@juanignaciosl
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juanignaciosl/34fd83cbf9d28281886b to your computer and use it in GitHub Desktop.
Save juanignaciosl/34fd83cbf9d28281886b to your computer and use it in GitHub Desktop.
tmux cartodb workspace
#!/bin/bash
SESSIONNAME="cartodb_workspace"
tmux has-session -t $SESSIONNAME &> /dev/null
if [ "$?" != "0" ]; then
tmux new-session -s $SESSIONNAME -n script -d
tmux split-window -h -t $SESSIONNAME -t 0
tmux split-window -h -t $SESSIONNAME -t 1
tmux split-window -v -t $SESSIONNAME -t 0
tmux split-window -v -t $SESSIONNAME -t 1
tmux split-window -v -t $SESSIONNAME -t 2
tmux split-window -v -t $SESSIONNAME -t 2
tmux send-keys -t 0 "cd /vagrant && bundle exec rails s -p 3000" C-m
tmux send-keys -t 3 "cd /cartodb-central && bundle exec rails s -p 4000" C-m
tmux send-keys -t 6 "cd /vagrant && redis-server" C-m
tmux send-keys -t 1 "cd /vagrant && bundle exec script/resque" C-m
tmux send-keys -t 4 "cd /cartodb-central && bundle exec script/resque" C-m
tmux send-keys -t 2 "cd /Windshaft-cartodb && node app.js development" C-m
tmux send-keys -t 5 "cd /CartoDB-SQL-API; node app.js development" C-m
fi
tmux attach -t $SESSIONNAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment