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
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
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 (...) |
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
# forward connections from src=* to remote_host:8001 to localhost:8002 | |
ssh -R \*:8001:localhost:8002 user@remote_host |
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
How can I listen on ports 80 and 443? Do I have to run as root? | |
On Linux, you can use setcap to grant your binary the permission to bind low ports: | |
$ sudo setcap cap_net_bind_service=+ep /path/to/your/binary |
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
#!/bin/bash | |
# call this script with an email address (valid or not). | |
# like: | |
# ./makecert.sh joe@random.com | |
mkdir certs | |
rm certs/* | |
echo "make server cert" | |
openssl req -new -nodes -x509 -out certs/server.pem -keyout certs/server.key -days 3650 -subj "/C=DE/ST=NRW/L=Earth/O=Random Company/OU=IT/CN=www.random.com/emailAddress=$1" | |
echo "make client cert" | |
openssl req -new -nodes -x509 -out certs/client.pem -keyout certs/client.key -days 3650 -subj "/C=DE/ST=NRW/L=Earth/O=Random Company/OU=IT/CN=www.random.com/emailAddress=$1" |