Skip to content

UserNotes:joebwan

Joseph F. Berghof III edited this page May 3, 2017 · 63 revisions

A simple vpn/firewall troubleshooting case: send a ping from an external network to my device:

$ cat onepingonly 
#!cmd alpine bash
#!/bin/bash
ping -c 1 $MYHOST

$ cat onepingonly | ssh [email protected] :create onepingonly
Creating command... done

$ ssh [email protected] :env onepingonly set MYHOST=www.google.com
Setting MYHOST on onepingonly... done

$ ssh [email protected] onepingonly 
PING www.google.com (172.217.3.36): 56 data bytes
64 bytes from 172.217.3.36: seq=0 ttl=47 time=1.648 ms

--- www.google.com ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 1.648/1.648/1.648 ms

Try connecting on a specific port:

$ cat connectonport 
#!cmd alpine bash
#!/bin/bash
telnet $MYHOST $PORT <<HEREDOC
quit
HEREDOC
echo "no errors for connectonport" && exit 0

$ cat connectonport | ssh [email protected] :create connectonport
Creating command... done

$ ssh [email protected] :env connectonport set MYHOST=www.google.com
Setting MYHOST on connectonport... done

$ ssh [email protected] :env connectonport set PORT=80
Setting PORT on connectonport... done

$ ssh [email protected] :env connectonport
PORT:         80
MYHOST:   www.google.com

$ ssh [email protected] connectonport 
no errors for connectonport

How long can my script live?

$ cat sandsofthehourglass 
#!cmd alpine bash
#!/bin/bash
count="0"
while [ "1" -gt 0 ] 
do
 sleep 1;
 count=$[$count+1]
 echo -n "$count "
done

$ cat sandsofthehourglass | ssh [email protected] :create sandsofthehourglass 
Creating command... done

$ ssh [email protected] sandsofthehourglass 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
 28 29 maximum runtime exceded

I'm new to 'go' but they're all the same right?

# I'm using a mac - linux/winders will require different install/setup
$ brew install golang
$ brew install glide

## These could have been replaced with cloning 
## to the expected location with something similar to: 
## $ git clone $URI ~/github.com/go/src/github.com/gliderlabs/cmd
$ PROPER=~/go/src/github.com/gliderlabs
$ mkdir -p $PROPER && mv $my_git_projects_dir/cmd $PROPER/
$ cd $PROPER/cmd && glide install
$ make clean && make build

NOTE: Until I moved the cmd.git directory under the expected ~/go/src/github.com/gliderlabs location I was plagued by missing packages.


https://github.com/gliderlabs/cmd/wiki/UserNotes%3Achief has good high-level info on all of the various auth0, git hub token... etc. deps for setting up your environment. At the moment there is lots of activity in the #cmd slack channel on local dev/testing. Be sure to check in there too.

Clone this wiki locally