Support sandboxing languages like Elixir, Haskell

The previous commit foreshadows this change. This also introduces so changes for
the Docker tooling.
This commit is contained in:
William Carroll 2019-04-02 21:29:46 +01:00
parent c88f3da4ac
commit 8220336205
2 changed files with 20 additions and 4 deletions

View file

@ -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"

View file

@ -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