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 / RequestAndResponseLoggingFilter.java
Last active Jan 12, 2020
Spring Web filter for logging request and response
View RequestAndResponseLoggingFilter.java
import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.web.filter.OncePerRequestFilter;
import org.springframework.web.util.ContentCachingRequestWrapper;
import org.springframework.web.util.ContentCachingResponseWrapper;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
@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 / README.md
Last active Jan 9, 2020
Watching build mode on Create React App
View README.md

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 Dec 27, 2019
Transparent proxy for Docker containers
View README.md

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 / 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 / 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 / post.md
Last active Jun 28, 2019
How to use Ruby on Cygwin
View post.md

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 / 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 / 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:
@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"
)
You can’t perform that action at this time.