Skip to content

Instantly share code, notes, and snippets.

View yuuki's full-sized avatar

Yuuki TSUBOUCHI yuuki

View GitHub Profile
@wsargent
wsargent / docker_cheat.md
Last active August 31, 2023 12:10
Docker cheat sheet
@dopiaza
dopiaza / slackpost
Created September 5, 2013 12:33
Post a message to a Slack channel
#!/bin/bash
# Usage: slackpost <token> <channel> <message>
# Enter the name of your slack host here - the thing that appears in your URL:
# https://slackhost.slack.com/
slackhost=PUT_YOUR_HOST_HERE
token=$1

Docker Overview

こんな人に有効

  • Linux 使ってるけど vagrant とか Virtual Box とか時間かかってめんどい
  • VM 作りまくって何が何だかわからなくなった
  • Warden が動かない, Buildpack なにそれおいしいの?
  • Go!

note: Ubuntu 12.04 (linux-image-3.8.0-23-generic) 使ってます。 Kernel 3.5 以前では安定しない模様。

FROM centos
RUN curl -L http://www.opscode.com/chef/install.sh | bash
ADD ./chef-repo /root/chef-repo
RUN cd /root/chef-repo; chef-solo -c solo.rb -j ./nodes/localhost.json
@jjmaestro
jjmaestro / whisper-calculator.py
Last active November 26, 2019 07:13
whisper-calculator.py: Calculates the size of the whisper storage for the given retention (in frequency:history format)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def archive_to_bytes(archive):
def to_seconds(s):
SECONDS_IN_A = {
's': 1,
'm': 1 * 60,
'h': 1 * 60 * 60,
@yuitowest
yuitowest / install_vagrant_vmware_fusion.md
Last active December 15, 2015 20:19
Vagrantが1.1でVMware Fusion向けプラグインを公開したので試した。

Vagrantの最新版をインストール

$ vagrant -v
Vagrant version 1.1.5
@kazeburo
kazeburo / gist:5087266
Created March 5, 2013 01:23
micro benchmark about urlmap
#!/usr/bin/env perl
use strict;
use warnings;
use HTTP::Request::Common;
use HTTP::Message::PSGI;
use Plack::Test;
use Plack::Builder;
use Benchmark qw/cmpthese timethese/;
use File::Spec;
@Songmu
Songmu / MyApp::DB.pm
Last active December 14, 2015 12:29
Tengの最近の雛形
package MyApp::DB;
use 5.016;
use warnings;
use utf8;
use Time::Piece::Plus;
use Class::Method::Modifiers;
use Teng::Schema::Loader;
use MyApp::DB::ResultSet;
use MyApp::Exception;
package Amon2::Plugin::Model;
use strict;
use warnings;
use Module::Find;
use Try::Tiny;
our $VERSION = '0.01';
sub init {
my ($class, $context_class, $config) = @_;
@rosylilly
rosylilly / gist:3401612
Created August 20, 2012 06:40
先輩と覚える HTTP ステータスコード

先輩に学ぶ HTTP Status Code

超雑にまとめました。修正してください。

登場人物

  • アプリケーション先輩: いつも忙しい。横に広がるのが得意(デブじゃない)。
  • 後輩: 頼んでばっかしで役に立たない。
  • サーバー先輩: アプリケーション先輩と仲がいい。Unix Socket でつながるくらい仲良し。
  • プロクシ先輩: アプリケーション先輩とかサーバー先輩と後輩の間を取り持って代わりに伝えたりしてくれる。たまに勝手にレスポンスを書き換える。