Skip to content

Instantly share code, notes, and snippets.

Hidetake Iwata int128

Block or report user

Report or block int128

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@int128
int128 / kube-apiserver.sh
Created Aug 16, 2019
Typical arguments of kube-apiserver built by kops on aws
View kube-apiserver.sh
mkfifo /tmp/pipe;
(tee -a /var/log/kube-apiserver.log < /tmp/pipe & ) ;
exec /usr/local/bin/kube-apiserver
--allow-privileged=true
--anonymous-auth=false
--apiserver-count=1
--authorization-mode=RBAC
--basic-auth-file=/srv/kubernetes/basic_auth.csv
@int128
int128 / script.groovy
Created Mar 20, 2019
Create a ZIP/JAR file in Groovy
View script.groovy
/**
* Create a ZIP/JAR file with given contents.
*
* @param destination destination file
* @param contents map of filename and content
*/
void createZIP(File destination, Map<String, String> contents) {
destination.withOutputStream {
new ZipOutputStream(it).withStream { zip ->
contents.each { filename, content ->
@int128
int128 / client.go
Created Aug 24, 2018
HTTPS client with CA certificate in Go
View client.go
package main
import (
"crypto/tls"
"crypto/x509"
"io/ioutil"
"log"
"net/http"
)
@int128
int128 / README.md
Last active Jun 28, 2018
AWS CodeBuild, GitBucket and GitLab
View README.md

AWS CodeBuild to GitBucket access

GET /USER/REPO/info/refs?service=git-upload-pack HTTP/1.1" 301
GET /git/USER/REPO/info/refs?service=git-upload-pack HTTP/1.1" 200
POST /git/USER/REPO/git-upload-pack HTTP/1.1" 200
GET /USER/REPO/info/refs?service=git-upload-pack HTTP/1.1" 301
GET /git/USER/REPO/info/refs?service=git-upload-pack HTTP/1.1" 200
POST /api/v3/repos/USER/REPO/statuses/1c99b9292c2bec3f31fa67456797b10ec8405ef5 HTTP/1.1" 401
POST /api/v3/repos/USER/REPO/statuses/1c99b9292c2bec3f31fa67456797b10ec8405ef5 HTTP/1.1" 401
@int128
int128 / README.md
Created Jun 22, 2018
GitLab SAML SSO with Keycloak
View README.md

GitLab SAML SSO with Keycloak

Keycloak

  1. Open your Keycloak realm.
  2. Import keycloak-gitlab.json.
  3. Fix URLs of the client.

GitLab

@int128
int128 / README.md
Created Jun 2, 2018
Stop processes in Kubernetes master node built with kops
View README.md
sudo systemctl stop docker-healthcheck.timer
sudo systemctl stop docker
sudo systemctl stop kubelet
sudo systemctl stop protokube

sudo systemctl --all shows:

@int128
int128 / main.go
Created Mar 23, 2018
Shutdown HTTP server by requesting specific URL in Golang
View main.go
package main
import (
"context"
"fmt"
"log"
"net/http"
)
func main() {
@int128
int128 / main.go
Created Mar 20, 2018
Read and write Kubernetes client config (~/.kube/config) in Go
View main.go
package main
import (
"log"
"os"
"github.com/mitchellh/go-homedir"
"k8s.io/client-go/tools/clientcmd"
)
@int128
int128 / main.go
Created Mar 19, 2018
OpenID Connect auth code flow with Go
View main.go
package main
import (
"crypto/rand"
"encoding/binary"
"fmt"
"github.com/coreos/go-oidc"
"golang.org/x/oauth2"
)
@int128
int128 / kubernetes-dashboard-proxy.yaml
Last active Oct 3, 2018
Access Kubernetes Dashboard via OpenID Connect Proxy
View kubernetes-dashboard-proxy.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: kubernetes-dashboard-proxy
namespace: kube-system
spec:
replicas: 1
template:
metadata:
labels:
You can’t perform that action at this time.