Skip to content

Instantly share code, notes, and snippets.

View naokirin's full-sized avatar

naokirin(Naoki Hayashida) naokirin

View GitHub Profile
void setup() {
Serial.begin(9600);
pinMode(0, INPUT);
}
bool on = false;
bool keep = false;
void loop() {
int val = analogRead(A0);
int BUTTON_PIN = 0;
int MAX_NUM_PIN = A0;
int OUTPUT_PIN = 5;
int button = LOW;
bool started = false;
bool end = false;
int max = 6;
int count = 0;
int value = 0;
@naokirin
naokirin / Stackdriver.md
Created December 6, 2017 04:31
Stackdriverについて
@naokirin
naokirin / kubernetes.md
Last active November 27, 2018 13:18
k8sの調査リスト
@naokirin
naokirin / Dockerコンテナ上のログ集約に関するまとめ.md
Last active August 5, 2023 18:41
Dockerコンテナ上のログ集約に関するまとめ

検討するための情報

Dockerコンテナ上のログを集約する方法

  • コンテナの内部で集約する
    • e.g. fluentd、rsyslog等を各コンテナ内に立てる
    • e.g. 単純にファイルに保存する
  • コンテナの外部で集約する
    • e.g. ホスト側にfluentd、rsyslog等を起動して、各コンテナがマウントしたログファイルをtail等で読む
  • e.g. ホスト側にマウントしてファイルに保存する
@naokirin
naokirin / 0_reuse_code.js
Created June 10, 2017 09:39
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#!/usr/bin/python -u
import sys
import os
import getopt
from supervisor import childutils
from datetime import datetime
class ProcessStateNotifier:
using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(MeshFilter))]
public class MeshInformation : Editor
{
public override void OnInspectorGUI()
{
var filter = target as MeshFilter;
string message = "Triangles: " + filter.sharedMesh.triangles.Length / 3 + " Vertices: " + filter.sharedMesh.vertices.Length;
@naokirin
naokirin / GizmosMeshNormalDrawer.cs
Last active May 23, 2016 02:33
UnityのSceneビューでメッシュの法線を表示する
using UnityEngine;
using System.Linq;
public static class GizmosArrowDrawer
{
public static void Draw(Vector3 pos, Vector3 direction, float arrowHeadLength = 0.25f, float arrowHeadAngle = 20.0f)
{
Gizmos.DrawRay(pos, direction);
Vector3 right = Quaternion.LookRotation(direction) * Quaternion.Euler(0, 180 + arrowHeadAngle, 0) * new Vector3(0, 0, 1);
au BufNewFile,BufRead *.rb,*.haml,*.erb,*.slim set nowrap tabstop=2 shiftwidth=2
au BufNewFile,BufRead *.cpp,*.h,*.hpp,*.cc set nowrap tabstop=4 shiftwidth=4