Skip to content

Instantly share code, notes, and snippets.

@nakamasato
nakamasato / rails_guides_to_epub.rb
Created August 8, 2012 13:46 — forked from mackato/rails_guides_to_epub.rb
Ruby on Rails Guides ePub convert ruby script
require 'rubygems'
require 'nokogiri'
require 'eeepub'
DOC_TITLE = 'Ruby on Rails Guides'
def get_pages(src_dir)
index_file = File.join(src_dir, 'index.html')
section = nil
pages = [{ :section => section, :title => DOC_TITLE, :path => index_file }]
@nakamasato
nakamasato / file0.txt
Created October 5, 2015 17:34
PandasのDataFrameをgroupごとにプロットする。 ref: http://qiita.com/gymnstcs/items/0c651566944c64e5efcb
%matplotlib inline
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import matplotlib
matplotlib.style.use('ggplot')#これでggplotのような画像ができる。
@nakamasato
nakamasato / file0.txt
Last active August 20, 2016 11:06
rails 4.2, paperclip, Jcropを使ってユーザが写真切り取りし保存する機能をつける ref: http://qiita.com/gymnstcs/items/69d319a6415a53a6576e
//= require jquery.Jcrop
### Keybase proof
I hereby claim:
* I am nakamasato on github.
* I am nakamasato (https://keybase.io/nakamasato) on keybase.
* I have a public key ASB8pOqfh8lncTt7tmeZpMGeNnE4-RBfF-gcq7FzB_jdGQo
To claim this, I am signing this object:
@nakamasato
nakamasato / pod-monitor-rabbitmq.yaml
Last active July 1, 2021 23:00
Kubernetes HPA with custom metrics (RabbitMQ and Prometheus)
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
namespace: monitoring
name: rabbitmq
spec:
podMetricsEndpoints:
- interval: 15s
port: prometheus
path: /metrics
@nakamasato
nakamasato / rabbitmq-consumer-hpa.yaml
Last active July 1, 2021 23:07
Kubernetes HPA with custom metrics (RabbitMQ and Prometheus)
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
name: rabbitmq-consumer
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: rabbitmq-consumer
minReplicas: 1
@nakamasato
nakamasato / _helpers.tpl
Created July 4, 2021 02:26
Helm helpers example
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "helm-example.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
@nakamasato
nakamasato / Values.yaml
Created July 4, 2021 02:33
Helm Value example
nginx:
image:
repository: nginx
pullPolicy: IfNotPresent
tag: ""
@nakamasato
nakamasato / values-prod.yaml
Created July 4, 2021 02:51
Helm values for specific env
replicaCount: 2
nginx:
image:
repository: nginx
pullPolicy: IfNotPresent
tag: "1.15.2"
@nakamasato
nakamasato / kustomization.yaml
Created July 4, 2021 04:41
kustomize example base kustomization.yaml
commonLabels:
app: kustomize-example
resources:
- deployment.yaml
- configmap.yaml
- service.yaml
- secret.yaml
configMapGenerator:
- name: kustomize-example-nginx
files: