Skip to content

Instantly share code, notes, and snippets.

View int128's full-sized avatar

Hidetake Iwata int128

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

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 August 31, 2024 16:28
Example of Envoy TCP Proxy
@int128
int128 / query.graphql
Created September 30, 2020 07:31
Get files in a repository using GitHub 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 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 / 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 22, 2018 06:57
GitLab SAML SSO with Keycloak

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 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: