# local bash
$ docker run -ti -p 8000:15000 -p 8080:15001 vitess/base bash
# in the docker bash
$ export VTROOT=/vt
$ export VTDATAROOT=$HOME/vtdataroot
$ cd $VTROOT/src/github.com/youtube/vitess/examples/local
$ ./zk-up.sh
$ ./vtctld-up.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "encoding/json" | |
| "net/http" | |
| "github.com/gin-gonic/gin" | |
| ) | |
| func main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import "fmt" | |
| type H map[string]interface{} | |
| type Context map[string]interface{} | |
| func main() { | |
| var h H |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "net" | |
| ) | |
| func main() { | |
| _, netIp, _ := net.ParseCIDR("192.168.0.0/25") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "os/exec" | |
| ) | |
| func main() { | |
| runCmd("mkdir", "repo") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| docker-machine restart default | |
| if [[ $(docker-machine url default) =~ ^tcp://(.+):(.+)$ ]]; then | |
| IP=${BASH_REMATCH[1]} | |
| PORT=${BASH_REMATCH[2]} | |
| else | |
| exit 1 | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import "fmt" | |
| import "os" | |
| import "os/signal" | |
| import "syscall" | |
| func main() { | |
| sigs := make(chan os.Signal, 1) | |
| done := make(chan bool, 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # docker build --force-rm --no-cache -t img/reichat . | |
| # docker run -d --restart unless-stopped -p 8001:10133 -e TITLE='Illust Chat' --name name-reichat img/reichat | |
| FROM node | |
| RUN npm install -g reichat | |
| EXPOSE 10133 | |
| CMD ["reichat"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function FindProxyForURL(url, host) { | |
| if (shExpMatch(host, '*.homestead.app')) { | |
| return 'PROXY homestead.app'; | |
| } | |
| if (shExpMatch(host, 'homestead.app')) { | |
| return 'PROXY homestead.app'; | |
| } | |
| return 'DIRECT'; |