Skip to content

UserNotes:joebwan

Joseph F. Berghof III edited this page May 4, 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

Dev Locally (for mac)

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

$ GLIDERLABS=~/go/src/github.com/gliderlabs
$ mkdir -p $GLIDERLABS && cd $GLIDERLABS
$ git clone [email protected]:gliderlabs/cmd.git && cd cmd
$ brew tap
homebrew/bundle
homebrew/core
homebrew/dupes
$ brew bundle
Installing go
Installing glide
Installing make
$ 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.

Clone this wiki locally