Skip to content

Instantly share code, notes, and snippets.

Tatsuru WATANABE tatsuru

Block or report user

Report or block tatsuru

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:8837289
%type 通知の種類
%sname 相手の名前
%fname ファイル名
%fpath ファイルのパス?
%smessage メッセージ
%fsize ファイルサイズ
%sskype ?
@tatsuru
tatsuru / Dockerfile
Created Apr 16, 2014
ikachan dockerfile
View Dockerfile
# Ikachan Dockerfile
FROM tatsuru/debian
RUN apt-get update
RUN apt-get install -y build-essential curl libssl-dev
RUN curl -s https://raw.githubusercontent.com/tagomoris/xbuild/master/perl-install > /tmp/perl-install
RUN bash /tmp/perl-install 5.18.2 /opt/perl-5.18
View app.psgi
use Plack::Builder;
my $app = sub {
return [ 200, [ 'Content-Type' => 'text/plain' ], [ 'Hello World' ] ];
};
builder {
enable "ServerStatus::Lite", path => '/server-status', allow => ['127.0.0.1'], scoreboard => '/dev/shm/server-status', counter_file => '/tmp/counter_file';
$app;
};
View gist:70437490e1fb1bb0c7df
#!/usr/bin/env ruby
require 'json'
def parse(uri)
JSON.parse `curl #{uri}`.gsub("/*\n * This file is intended for use only on aws.amazon.com. We do not guarantee its availability or accuracy.\n *\n * Copyright 2014 Amazon.com, Inc. or its affiliates. All rights reserved.\n */\ncallback({",'{').gsub("\);", '').gsub(/([a-zA-Z]+):/, '"\1":')
end
table = {
:light => parse('http://a0.awsstatic.com/pricing/1/ec2/previous-generation/light_linux.min.js'),
@tatsuru
tatsuru / x240battery.sh
Last active Aug 29, 2015
X240 Battery Plugin for Mackerel.io
View x240battery.sh
#!/bin/bash
#
# [plugin.metrics.battery]
# command = "/path/to/x240battery.sh"
#
LANG=C
if [ x$MACKEREL_AGENT_PLUGIN_META = x1 ]; then
cat <<EOF
View .psqlrc
\timing on
\set HISTSIZE 1000000
\pset pager off
View GCE.txt
- GCE 個人アカウント作る。$300 無料すごい
- なんか既にプロジェクトがあった。前に作ったGAEっぽい
- gcutil deprecated って言われてた https://cloud.google.com/compute/docs/gcutil/
-- のでこっちでやる https://cloud.google.com/compute/docs/gcloud-compute/#install
-- gcutil を PATH から消せとか zshrc への追加とかいろいろやってくれて便利
- startup-script 便利
-- gcloud compute instances create test01 --metadata startup-script="apt update; apt install -y nginx-full" --image debian-8
- metadata https://cloud.google.com/compute/docs/metadata
-- 変なヘッダつけないと 403
--- curl -H "Metadata-Flavor: Google" http://metadata/computeMetadata/v1/instance/disks/0/mode
@tatsuru
tatsuru / dot.notify_tumblr.yaml
Created Jul 17, 2011
Tumblr Desktop Notification with libnotify
View dot.notify_tumblr.yaml
cache:
directory: /home/tatsuru/.tumblr-cache
max: 1000
dashboard:
limit: 10
check_interval: 30
notify_timeout: 30
text_length: 100
@tatsuru
tatsuru / split_gif.rb
Created Jul 20, 2011
Generate divided gif animation for Thumblr
View split_gif.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'RMagick'
def split(src, n)
width = src.columns
height = src.rows
crop_list = []
@tatsuru
tatsuru / count_tumblr.rb
Created Aug 29, 2011
count tumblr posts/day
View count_tumblr.rb
#!/usr/bin/env ruby
require 'tumblife'
require 'yaml'
if ARGV.length < 2
puts "Usage: count_tumblr.rb blogname outfile [limit]"
exit 0
end
You can’t perform that action at this time.