Skip to content

Instantly share code, notes, and snippets.

@TakiTake
TakiTake / cicd.sa.yaml
Last active April 5, 2021 18:46
[Tekton] Promote image Task. Support multiple docker-registry secrets for same registry.
apiVersion: v1
kind: ServiceAccount
metadata:
name: cicd
namespace: stg
secrets:
- name: cicd-token-j87sc
- name: docker-creds-dev
- name: docker-creds-stg
@TakiTake
TakiTake / Jenkinsfile
Created October 17, 2019 13:22
Exec multiple nested stages in parallel
pipeline {
agent none
options {
skipDefaultCheckout()
skipStagesAfterUnstable()
}
stages {
stage("parent") {
parallel {
stage('Build and Test Linux') {
@TakiTake
TakiTake / patch.sh
Created April 3, 2019 02:38
Update selector of Kubernetes Service
#!/bin/bash -eu
KUBECTL=kubectl
SERVICE=nginx
TOBE_SELECTOR=$1
function validateSelector() {
PODS=$($KUBECTL get pods --ignore-not-found=true --selector=app=$TOBE_SELECTOR)
if [ -z "$PODS" ]; then
echo "No resources found with --selector=app=${TOBE_SELECTOR}"
@TakiTake
TakiTake / nginx.conf
Created March 12, 2019 01:33
redirect by country code sample
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@TakiTake
TakiTake / localhost
Last active October 22, 2017 15:03
Inventory file for Vagrant
[vagrant]
127.0.0.1
[vagrant:vars]
ansible_user=vagrant
ansible_port=2222
ansible_ssh_private_key_file=~/src/github.com/matsuu/vagrant-isucon/isucon5-qualifier-standalone/.vagrant/machines/default/virtualbox/private_key
@TakiTake
TakiTake / .gitignore
Last active January 4, 2017 00:42
fabric8
kubeconfig
@TakiTake
TakiTake / dein.toml
Created November 6, 2016 14:56
~/.config/nvim/init.vim & ~/.vim/rc/dein.toml
[[plugins]]
repo = 'Shougo/dein.vim'
[[plugins]]
repo = 'zchee/deoplete-go'
build = 'make'
depends = 'Shougo/deoplete.nvim'
on_i = 1
on_ft = 'go'
hook_source = '''
#!/usr/bin/env bash
__run_rake() {
local docker_image="takitake/rubyalpine-nokogiri-preinstalled"
local host_src_volume="${PWD}"
local container_dest_volume="/work"
docker run \
--volume="${host_src_volume}:${container_dest_volume}" \
--workdir="${container_dest_volume}" \
#!/usr/bin/env elixir
defmodule Reader do
def read do
case IO.gets("N: ") do
data ->
String.strip(data) |> String.to_integer
end
end
end
@TakiTake
TakiTake / .vimrc
Last active December 22, 2015 01:12
Light weight vimrc
set nocompatible
" curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
call plug#begin('~/.vim/plugged')
" Color
Plug 'altercation/vim-colors-solarized'
" Unite
Plug 'Shougo/vimproc.vim'