Skip to content

Instantly share code, notes, and snippets.

View int128's full-sized avatar

Hidetake Iwata int128

View GitHub Profile
@int128
int128 / kubernetes-dashboard-proxy.yaml
Last active February 24, 2021 00:58
Access Kubernetes Dashboard via OpenID Connect Proxy
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: kubernetes-dashboard-proxy
namespace: kube-system
spec:
replicas: 1
template:
metadata:
labels:
@int128
int128 / Dockerfile
Last active January 10, 2020 01:07
GitHub Actions to build and push a Docker image to GitHub Packages Registry
FROM alpine:3.11
ARG VERSION
#TODO: add steps
@int128
int128 / kube-apiserver.sh
Created August 16, 2019 02:26
Typical arguments of kube-apiserver built by kops on aws
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 March 20, 2019 05:13
Create a ZIP/JAR file in 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 August 24, 2018 02:48
HTTPS client with CA certificate in Go
package main
import (
"crypto/tls"
"crypto/x509"
"io/ioutil"
"log"
"net/http"
)
@int128
int128 / httpd.conf
Created December 25, 2012 10:16
Apache configuration for HTTP/HTTPS forward proxy
Listen *:9090
<VirtualHost *:9090>
ProxyRequests on
AddDefaultCharset off
AllowCONNECT 443
<Proxy *>
Order deny,allow
Deny from all
</Proxy>
# allows HTTPS via CONNECT
@int128
int128 / README.md
Last active June 28, 2018 12:18
AWS CodeBuild, GitBucket and GitLab

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 June 2, 2018 13:28
Stop processes in Kubernetes master node built with kops
sudo systemctl stop docker-healthcheck.timer
sudo systemctl stop docker
sudo systemctl stop kubelet
sudo systemctl stop protokube

sudo systemctl --all shows:

@int128
int128 / README.md
Created September 26, 2014 06:36
Enable stone repeater on systemd

Enable stone repeater on systemd

Prerequisite:

  • CentOS 7
  • Development Tools
    • yum groupinstall 'Development tools'
@int128
int128 / gist:14255ff1b1ed11ce1f661a7d35954c2b
Created October 26, 2016 10:18
How to execute a remote command on the Jenkins Script Console
import hudson.util.RemotingDiagnostics;
def node = 'node-name'
def command = 'uname -a'
println RemotingDiagnostics.executeGroovy("""
def p = '$command'.execute()
p.waitFor()
println p.in.text