Skip to content

Instantly share code, notes, and snippets.

Avatar

Hidetake Iwata int128

View GitHub Profile
@int128
int128 / README.md
Last active Feb 20, 2022
GraphQL query to find PRs in commit history of a sub tree in a repository
View README.md

associatedPullRequestsInCommitHistoryOfSubTree

This query returns a list of pull request in the commit history of a sub tree in a repository.

Problem to solve

Let us think about a monorepo, for example,

@int128
int128 / README.md
Last active Apr 29, 2022
Example of Envoy TCP Proxy
View README.md
@int128
int128 / query.graphql
Created Sep 30, 2020
Get files in a repository using GitHub GraphQL
View query.graphql
query {
repository(owner: "int128", name: "kubelogin") {
defaultBranchRef {
target {
... on Commit {
file(path: "/.github/workflows") {
type
object {
... on Tree {
entries {
@int128
int128 / Dockerfile
Last active Jan 10, 2020
GitHub Actions to build and push a Docker image to GitHub Packages Registry
View Dockerfile
FROM alpine:3.11
ARG VERSION
#TODO: add steps
@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: