diff options
author | William Carroll <wpcarro@gmail.com> | 2019-04-02T20·29+0100 |
---|---|---|
committer | William Carroll <wpcarro@gmail.com> | 2019-04-02T20·29+0100 |
commit | 8220336205226432c9fc3ca77f8f21c7af32f908 (patch) | |
tree | 30daae42e98ce4f3fd33494f0a3ad12c13611726 | |
parent | c88f3da4acc79bb4d570c0469d25263f96ed0925 (diff) |
Support sandboxing languages like Elixir, Haskell
The previous commit foreshadows this change. This also introduces so changes for the Docker tooling.
-rw-r--r-- | configs/shared/zsh/aliases.zsh | 6 | ||||
-rw-r--r-- | configs/shared/zsh/functions.zsh | 18 |
2 files changed, 20 insertions, 4 deletions
diff --git a/configs/shared/zsh/aliases.zsh b/configs/shared/zsh/aliases.zsh index a6d05a78469c..f7ab6ca04dd0 100644 --- a/configs/shared/zsh/aliases.zsh +++ b/configs/shared/zsh/aliases.zsh @@ -13,6 +13,8 @@ # mercurial: hg # aptitude: apt # chrome: c +# elixir: ex +# haskell: hk # # Supported qualifiers: # hidden: h @@ -69,14 +71,12 @@ alias dkps="docker ps" alias dkpsa="docker ps -a" alias dkrm="docker rm" alias dkrmi="docker rmi" -alias dkrit="docker run -it" alias dkrd="docker run -d" alias dki="docker images" # Java alias jvsh='CLASSPATH=$(fd \\.jar$ ~pro/jars | tr \\n :) jshell' - # Elixir alias m="mix" alias mc="mix compile" @@ -86,6 +86,7 @@ alias tism="MIX_ENV=test iex -S mix" alias mdg="mix deps.get" alias mdu="mix deps.update" alias mdup="mix docker.up" +alias sandbox_ex='dkish elixir iex' # depends on the docker aliases # GPG alias gpged='gpg --edit-key wpcarro@gmail.com' @@ -132,6 +133,7 @@ alias se="stack exec --" alias sc="stack clean" # alias st="stack test" # blocks suckless-terminal alias haddocks='open "$(stack path --local-doc-root)/index.html"' +alias sandbox_hk='dkish haskell ghci' # Kubernetes alias kc="kubectl" diff --git a/configs/shared/zsh/functions.zsh b/configs/shared/zsh/functions.zsh index 26f81a3ca656..645426cd9044 100644 --- a/configs/shared/zsh/functions.zsh +++ b/configs/shared/zsh/functions.zsh @@ -64,12 +64,26 @@ apts() { } # Docker -dsh() { +dkcsh() { # Drop into a Docker shell. Shell defaults to /bin/bash. + # `dkcsh` stands for DocKer Container SHell. + # Usage: dkcsh container=$1 cmd=${2-/bin/bash} - docker exec -it "${container}" "${cmd}" + docker exec -it "$container" "$cmd" +} + +dkish() { + # Runs a Docker container with `/usr/bin/env bash`. + # `dkish` stands for DocKer Image SHell. + # Note: This defers from `dksh`, which accepts a container instead of an + # image. + # Usage: dkrit <container_name> [command] + image=$1 + cmd=${2-/bin/bash} + + docker run -it "$image" "$cmd" } # Emacs |