From 4e1c4d678914c195d2195ac4ac4b4ea7053fbbc8 Mon Sep 17 00:00:00 2001 From: Nathan Stilwell Date: Wed, 27 Jul 2016 17:53:55 -0400 Subject: [PATCH 1/4] add some stuff to atlas --- plugins/atlas/atlas.plugin.zsh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/plugins/atlas/atlas.plugin.zsh b/plugins/atlas/atlas.plugin.zsh index f9959bde7..db3270875 100644 --- a/plugins/atlas/atlas.plugin.zsh +++ b/plugins/atlas/atlas.plugin.zsh @@ -43,6 +43,24 @@ function atlas_map { fi } +function atlas_show { + if [ -d "/Users/nstilwell/.hosts" ] && [ -e "/Users/nstilwell/.hosts/$1" ]; then + head -n 4 /etc/hosts; + else + echo "Atlas not initialized"; + atlas_usage; + fi +} + +function atlas_list { + if [ -d "/Users/nstilwell/.hosts" ] && [ -e "/Users/nstilwell/.hosts/$1" ]; then + ls ~/.hosts; + else + echo "Atlas not initialized"; + atlas_usage; + fi +} + function atlas { if [ -z "$1" ]; then atlas_usage; @@ -50,5 +68,7 @@ function atlas { [ "$1" = "new" ] && atlas_new "$2"; [ "$1" = "init" ] && atlas_init; [ "$1" = "map" ] && atlas_map "$2"; + [ "$1" = "show" ] && atlas_show; + [ "$1" = "list" ] && atlas_list; fi } From 635df8dd6c0ae29b745216e4bec4271e4ca77672 Mon Sep 17 00:00:00 2001 From: Nathan Stilwell Date: Thu, 28 Jul 2016 10:31:13 -0400 Subject: [PATCH 2/4] update usageg --- plugins/atlas/atlas.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/atlas/atlas.plugin.zsh b/plugins/atlas/atlas.plugin.zsh index db3270875..7a3b2f9ea 100644 --- a/plugins/atlas/atlas.plugin.zsh +++ b/plugins/atlas/atlas.plugin.zsh @@ -8,6 +8,8 @@ function atlas_usage { new Create new hosts map file init Create ~/.hosts to store host maps in map link /etc/hosts to map supplying map name + list show what host configs exist + show show which config is linked USAGE From 3cfcd5c3e2f517c0ce55b7a411650c518524fcfb Mon Sep 17 00:00:00 2001 From: Nathan Stilwell Date: Thu, 8 Sep 2016 10:23:17 -0400 Subject: [PATCH 3/4] better list for atlas --- plugins/atlas/atlas.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/atlas/atlas.plugin.zsh b/plugins/atlas/atlas.plugin.zsh index 7a3b2f9ea..b34970f98 100644 --- a/plugins/atlas/atlas.plugin.zsh +++ b/plugins/atlas/atlas.plugin.zsh @@ -56,7 +56,7 @@ function atlas_show { function atlas_list { if [ -d "/Users/nstilwell/.hosts" ] && [ -e "/Users/nstilwell/.hosts/$1" ]; then - ls ~/.hosts; + ls -F ~/.hosts | grep -v /$; else echo "Atlas not initialized"; atlas_usage; From 1e53f82cbabcfb6a1b3db52a76c908f2aca4276c Mon Sep 17 00:00:00 2001 From: Nathan Stilwell Date: Fri, 23 Dec 2016 12:46:56 -0500 Subject: [PATCH 4/4] updating some docker stuff --- plugins/dock/dock.plugin.zsh | 42 +++--------------------------------- 1 file changed, 3 insertions(+), 39 deletions(-) diff --git a/plugins/dock/dock.plugin.zsh b/plugins/dock/dock.plugin.zsh index e5b9727e1..d790fad08 100644 --- a/plugins/dock/dock.plugin.zsh +++ b/plugins/dock/dock.plugin.zsh @@ -4,7 +4,6 @@ cat <<-USAGE usage: dock clean Remove all stopped containers - info Info on Docker setup help show Docker cheat sheet USAGE } @@ -15,53 +14,17 @@ function dock_clean { [ "$1" = "images" ] && docker rmi $(docker images -q); } -function dock_info { -cat <<-INFO - You are (probably) running docker locally on a Mac using Docker Toolbox. - - Docker Machine is the new boot2docker thing. You have a virtual machine - created called 'default'. You can check the status by running. - - docker-machine status default - - If it's not 'Running', you can bring it up with docker-machine start - - You should have this in your profile: - - ### Docker - export DOCKER_TLS_VERIFY="1" - export DOCKER_HOST="tcp://192.168.99.100:2376" - export DOCKER_CERT_PATH="/Users/nathan/.docker/machine/machines/default" - export DOCKER_MACHINE_NAME="default" - - and, you should have this in your /etc/hosts - - ## Docker Machine - 192.168.99.100 docker d - - So, you can access local running containers, by going to: - - http://d: -INFO -} - function dock_help { cat <<-HELP # list local images docker images - # build a tagged docker docker image; + # build a tagged docker image; docker build -t ; - ## Example: - docker build -t chicksphotocracy/photoop:latest . - # run a docker image as a daemon on a port; docker run -d --name -p ; - ## Example: - docker run -t -i -p 5678:5678 chicksphotocracy/photoop:1.9.0 - # run bash in a container; docker exec -ti bash; @@ -71,6 +34,8 @@ cat <<-HELP # remove a container docker rm + # view logs from a container + docker logs -f HELP } @@ -79,7 +44,6 @@ function dock () { dock_usage; else [ "$1" = "clean" ] && dock_clean "$2" - [ "$1" = "info" ] && dock_info [ "$1" = "help" ] && dock_help fi }