Skip to content

Instantly share code, notes, and snippets.

View futoase's full-sized avatar
🐱
Focusing

Keiji Matsuzaki futoase

🐱
Focusing
  • Japan
View GitHub Profile
@futoase
futoase / gist:8662651
Last active January 4, 2016 18:48
Docker 社内勉強会

Docker 社内勉強会

Dockerというコンテナ仮想技術が、2013年ごろから ウェッブ界隈で騒がれています。

自分も使ってみたいなーと思って観測するだけにとどめていたのですが この度本格導入に向けてあれこれ調べてみました。

Dockerの"本当の"正しい運用の仕方は不明ですが、(今も開発中で運用手順が変わるおそれが...) 「今わかっている運用の仕方」「そもそもDockerとはなにか」

@futoase
futoase / gist:9106229
Last active August 29, 2015 13:56
少しずつためていこう

ログファイルをgzipで圧縮しましょう

find *.log -type f ! -iname '*.gz' -exec gzip '{}' \;

サーバ〜

while true; do { echo -e 'HTTP/1.1 200 OK\r\n'; cat message.txt; echo $(uname -a); echo ""; echo $(date +"%Y-%m-%d %I:%M:%S"); } | nc -l 8080; done
@futoase
futoase / gist:9166660
Created February 23, 2014 04:03
Write of FSR data to microSD card.
#include <SPI.h>
#include <SD.h>
#define FSR_PIN 0
const int chipSelect = 4;
void setup()
{
// Open serial communications and wait for port to open:
@futoase
futoase / gist:9319422
Created March 3, 2014 06:21
tailing of the application log.
package main
import (
"github.com/ActiveState/tail"
"regexp"
"fmt"
"os"
)
func main() {
@futoase
futoase / gist:9319851
Created March 3, 2014 07:10
publish message to idobata
package main
import (
"fmt"
"net/http"
"net/url"
"bytes"
)
var IDOBATA = "{{.idobata_url}}"
@futoase
futoase / Vagrantfile
Last active August 29, 2015 13:56
td-agentをインストール 且つ 仮想マシン 2つ
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
$install_td_agent = <<EOF
curl -L http://toolbelt.treasuredata.com/sh/install-ubuntu-precise.sh | sh
EOF
$install_packages = <<EOF
#define SENSORPIN 0
#define SPEAKER 2
#define DULATION 300
#define THRESHOLD 80
#define TONE_C 262
#define TONE_D 294
#define TONE_E 330
#define TONE_F 349
#define TONE_G 392
@futoase
futoase / Gemfile
Created March 5, 2014 05:22
fluent-formatを使ってidobataにtd-agent.confの内容を送る ref: http://qiita.com/futoase/items/b1015f5d69a09f3d83d8
source 'https://rubygems.org/'
gem 'fssm'
gem 'fluent-format'
@futoase
futoase / gist:9500115
Created March 12, 2014 03:14
rootパスワードをすでに設定してるのかどうかの既知確認的なもの
mysql -h localhost -u root -N -B -e "select exists(select password from mysql.user where user = 'root' and host = 'localhost' and password = PASSWORD('hoge'));"