This file contains 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" | |
"io" | |
"net" | |
"os" | |
"sync" | |
) |
This file contains 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
Usage: | |
ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -e 'host_key_checking=False' -i ansible/hosts ansible/playbook-staticweb.yml --key-file keyfile --extra-vars repo_crede | |
ntials=user:pwd | |
more ansible/hosts | |
--- | |
- hosts: Web | |
vars: | |
workspace: "{{ lookup('env','WORKSPACE') }}" | |
tasks: |
This file contains 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
// https://blogs.oracle.com/janp/entry/how_the_scp_protocol_works | |
package main | |
import ( | |
"fmt" | |
"golang.org/x/crypto/ssh" | |
) | |
const privateKey = `content of id_rsa` |
This file contains 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
// https://golang.org/pkg/sync/#Once | |
package main | |
import ( | |
"fmt" | |
"sync" | |
) | |
func main() { |
This file contains 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
$ more gobetween.service | |
[Unit] | |
Description=Gobetween Load Balancer Service | |
[Service] | |
Type=simple | |
User=root | |
WorkingDirectory=/home/cliqruser | |
ExecStart=/home/cliqruser/gobetween -c /home/cliqruser/gobetween.toml |
This file contains 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 ( | |
"log" | |
"net" | |
"time" | |
) | |
func main() { |
This file contains 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
go build helloworld.go | |
GOOS=windows GOARCH=amd64 go build helloworld.go |
This file contains 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
Question: how do you handle pull requests from different GitHub repositories? | |
Source: github-and-go-forking-pull-requests-and.html | |
1. Fork the repository github.com/orig/cooltool to github.com/fork/cooltool | |
2. Get the original repository: go get github.com/orig/cooltool | |
3. Add a remote to your forked repository: git remote add fork https://github.com/fork/cooltool.git |
This file contains 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
swagger: '2.0' | |
info: | |
version: "0.0.12" | |
title: Load Balancing | |
description: | | |
Load Balancing API | |
basePath: /load-balancing |
This file contains 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
1 Generate GITHUB TOKEN here https://github.com/settings/tokens | |
2 export GITHUB_TOKEN=xxx | |
3 git config --global url."https://${GITHUB_TOKEN}:x-oauth-basic@github.com/mycompany".insteadOf "https://github.com/mycompany" | |
4 go get (...) |