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 March 21, 2024 13:39
Example of Envoy TCP Proxy
@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
Last active January 21, 2024 14:52
Watching build mode on Create React App

Create React App does not provide watching build mode oficially (#1070).

This script provides watching build mode for an external tool such as Chrome Extensions or Firebase app.

How to Use

Create a React app.

Put the script into scripts/watch.js.

@int128
int128 / README.md
Last active January 17, 2024 07:55
Transparent proxy for Docker containers

Transparent proxy for Docker containers

If the Docker host is placed inside a proxy server, it needs to add the proxy configuration to each Dockerfile such as ENV http_proxy.

Following allows transparent access from the container to outside without any proxy configuration.

  1. Set up the transparent proxy
  2. Apply iptables rule for the transparent proxy
@int128
int128 / RequestAndResponseLoggingFilter.java
Last active January 13, 2024 10:46
Spring Web filter for logging request and response
/*
Copyright 2017 Hidetake Iwata
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@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 / main.go
Created March 20, 2018 07:45
Read and write Kubernetes client config (~/.kube/config) in Go
package main
import (
"log"
"os"
"github.com/mitchellh/go-homedir"
"k8s.io/client-go/tools/clientcmd"
)
@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 / post.md
Last active August 7, 2021 04:24
How to use Ruby on Cygwin

How to use Ruby on Cygwin

It is strongly recommended to run on Linux or OS X. Maybe many problems will happen.

Prerequisite

  • Cygwin
  • apt-cyg
  • http_proxy is set if needed
@int128
int128 / google-apps-script.js
Created April 4, 2015 06:49
Google Apps Script Template
/**
* @OnlyCurrentDoc Limits the script to only accessing the current spreadsheet.
*/
/**
* A function that takes a single input value and returns a single value.
* Returns a simple concatenation of Strings.
*
* @param {String} name A name to greet.
* @return {String} A greeting.