diff options
author | Franck Cuny <franck.cuny@gmail.com> | 2016-11-21 20:34:57 -0800 |
---|---|---|
committer | Franck Cuny <franck.cuny@gmail.com> | 2016-11-21 20:34:57 -0800 |
commit | 05e10917e71e71740579a77ca142a2bdf4c2ee43 (patch) | |
tree | ef3bccd2700ade3a543149c6c01ee2e8e4e439e9 | |
parent | [Emacs] remove another TAB. (diff) | |
download | emacs.d-05e10917e71e71740579a77ca142a2bdf4c2ee43.tar.gz |
[bin] Add a script to run docker-machine with GCP.
This script is to interact with a remote VM for Docker, running in GCP.
-rwxr-xr-x | bin/docker-gcp | 67 | ||||
-rw-r--r-- | tmux.conf | 56 |
2 files changed, 123 insertions, 0 deletions
diff --git a/bin/docker-gcp b/bin/docker-gcp new file mode 100755 index 0000000..3136fee --- /dev/null +++ b/bin/docker-gcp @@ -0,0 +1,67 @@ +#!/bin/bash + +GCP_PROJECT=${1:-fcuny-devel} +DOCKER_MACHINE_NAME=${2:-gcp} + +COMMAND=$1 + +usage() { + echo "$0: [create|start|stop|status]" >&2 + exit 1 +} + +__create() { + docker-machine create "${DOCKER_MACHINE_NAME}" \ + -d google \ + --google-project="${GCP_PROJECT}" \ + --google-machine-type n1-highcpu-4 +} + +__start() { + docker-machine start "${DOCKER_MACHINE_NAME}" +} + +__stop() { + docker-machine stop "${DOCKER_MACHINE_NAME}" +} + +__status() { + docker-machine status "${DOCKER_MACHINE_NAME}" +} + +__ssh() { + docker-machine ssh "${DOCKER_MACHINE_NAME}" +} + +__scp() { + echo "This is not implemented yet." + exit 2 +} + +if [[ -z "${COMMAND}" ]]; then + usage +fi + +case "${COMMAND}" in + create) + __create + ;; + start) + __start + ;; + stop) + __stop + ;; + status) + __status + ;; + ssh) + __ssh + ;; + scp) + __scp + ;; + *) + usage + ;; +esac diff --git a/tmux.conf b/tmux.conf new file mode 100644 index 0000000..57cdddc --- /dev/null +++ b/tmux.conf @@ -0,0 +1,56 @@ +# Prefix +set-option -g prefix C-z +unbind-key C-b +bind C-t send-prefix + +set -s escape-time 1 + +# Color +set-option -g default-terminal xterm + +# View +set-option -g status-interval 5 +set-option -g status-left-length 16 +set-option -g status-right-length 50 + +set-option -g status-bg colour41 +set-option -g status-fg colour232 +set-option -g status-attr bold +set-option -g status-left '[%H:%M]' +set-option -g status-right '[#h###S:#I:#P]' +set-option -g status-right-fg red +set-option -g status-right-bg white +set-window-option -g window-status-current-bg white +set-window-option -g window-status-current-attr bold + +# move pain like Vim +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +bind l select-pane -R + +bind-key c new-window -c "#{pane_current_path}" + +# split window +bind _ split-window -v -c "#{pane_current_path}" +bind | split-window -h -c "#{pane_current_path}" + +# move last window +bind C-z last-window +bind o last-pane + +# Option +set-window-option -g mode-keys vi +set-window-option -g automatic-rename off + +# resize pain +bind -r H resize-pane -L 2 +bind -r L resize-pane -R 2 +bind -r J resize-pane -D 2 +bind -r K resize-pane -U 2 + +# logging +bind-key Q pipe-pane "exec cat >> $HOME/tmux-#S-#W-#I.log" \; display-message 'Started logging to tmux-#S-#W-#I.log' +bind-key q pipe-pane \; display-message 'Finish logging to tmux-#S-#W-#I.log' + +bind i display-panes |