Skip to content

Instantly share code, notes, and snippets.

View udhos's full-sized avatar
👾
Wondering

udhos

👾
Wondering
  • São Paulo, Brazil
View GitHub Profile
@udhos
udhos / nc.go
Created March 28, 2018 20:18 — forked from suconghou/nc.go
nc golang
package main
import (
"fmt"
"io"
"net"
"os"
"sync"
)
@udhos
udhos / playbook-staticweb.yml
Last active May 17, 2018 21:49
ansible/playbook-staticweb.yml
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:
@udhos
udhos / go_scp.go
Created May 8, 2018 01:00 — forked from jedy/go_scp.go
an example of scp in golang
// 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`
@udhos
udhos / syncOnce.go
Created May 11, 2018 00:39
sync.Once
// https://golang.org/pkg/sync/#Once
package main
import (
"fmt"
"sync"
)
func main() {
@udhos
udhos / gobetween.service
Created May 17, 2018 17:40
gobetween.service
$ 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
@udhos
udhos / golang_tcplistener_setdeadline.go
Created May 25, 2018 20:59
golang_tcplistener_setdeadline
package main
import (
"log"
"net"
"time"
)
func main() {
@udhos
udhos / go-build.sh
Created June 5, 2018 00:50 — forked from sivel/go-build.sh
Ansible Binary Golang Module
go build helloworld.go
GOOS=windows GOARCH=amd64 go build helloworld.go
@udhos
udhos / github-and-go-forking-pull-requests-and.html
Last active October 19, 2018 22:16
github-and-go-forking-pull-requests-and.html
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
@udhos
udhos / apigee-load-balancing-spec
Created November 26, 2018 14:06
apigee-load-balancing-spec
swagger: '2.0'
info:
version: "0.0.12"
title: Load Balancing
description: |
Load Balancing API
basePath: /load-balancing
@udhos
udhos / github_token_golang
Created November 28, 2018 15:33
github token + go
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 (...)