Skip to content

Instantly share code, notes, and snippets.

View linyows's full-sized avatar

Tomohisa Oda linyows

View GitHub Profile
@linyows
linyows / ruby-init.sh
Last active August 29, 2015 14:25
ruby-init.sh
#!/bin/bash
brew update
brew install readline openssl autoconf pkg-config
git clone git@github.com:sstephenson/rbenv.git ~/.rbenv
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash
git clone https://github.com/sstephenson/rbenv-default-gems.git ~/.rbenv/plugins/rbenv-default-gems
@linyows
linyows / revisions.task
Created January 28, 2015 03:29
Capistrano3 各リビジョンを俯瞰するやつ
namespace :deploy do
task :revisions do
on roles(:all), in: :parallel do |host|
puts "#{host}: #{capture(:tail, '-n 1', revision_log)}"
end
end
end
[deploy@api02 ~]$ cat ~/.ssh/authorized_keys | grep akrmiya@P
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDYBrYF9hD2mciI4svtOTo5bQjRhdpIZ+OJyku6N8fHpZ87B2evRW7fpgPS46CrtOF+8IoKeZ2frBGcOmf2goCoXDxJucZ39pkMlqI55k4pBnlWy+spShuPd+LodEMpJCKXlXZtnEIjBrOdgtQo/PFNi2j0IfMxb3ZuQuiwYM/r2urS8fQkueAcNSdMIJgyVYzRzYVSW2VObsTjyimyaA9wsK GdiscjFLeDOttGjkwUm1aG8+XCFym8icqlvKp8CwSIl2AC0xZQsgpsiEmCnLMpEt+uURc64Ojqm9qTgrKI3RbIy65q5IxRBEz6Vt5E7Nrh+78zthMwRCgFLYrss0dr akrmiya@PMAC033J.local
http://ghe.tokyo.pb/akrmiya.keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDYBrYF9hD2mciI4svtOTo5bQjRhdpIZ+OJyku6N8fHpZ87B2evRW7fpgPS46CrtOF+8IoKeZ2frBGcOmf2goCoXDxJucZ39pkMlqI55k4pBnlWy+spShuPd+LodEMpJCKXlXZtnEIjBrOdgtQo/PFNi2j0IfMxb3ZuQuiwYM/r2urS8fQkueAcNSdMIJgyVYzRzYVSW2VObsTjyimyaA9wsKGdiscjFLeDOttGjkwUm1aG8+XCFym8icqlvKp8CwSIl2AC0xZQsgpsiEmCnLMpEt+uURc64Ojqm9qTgrKI3RbIy65q5IxRBEz6Vt5E7Nrh+78zthMwRCgFLYrss0dr
@linyows
linyows / cloud_front_log_analyzing.rb
Created September 18, 2014 05:26
CloudFrontのログからUAだけをsortして表示
#!/usr/bin/env ruby
log = File.read './E1ZEGDWBQZMV1Z.2014-09-16-13.hf802CqY'
array_log = log.split("\n").map { |v| v = v.split("\t") }
user_agents = array_log.map { |v| v[10][0..100] if v[10].is_a?(String) }.compact
ua_with_count = user_agents.each_with_object({}) do |ua, memo|
if memo.empty? || memo[ua].nil?
memo[ua] = 1
else
@linyows
linyows / main.go
Last active August 29, 2015 14:06
S3のリソースのhttpヘッダーにcache系追加
package main
import (
"bufio"
"fmt"
"os"
"runtime"
"sync"
"time"
@linyows
linyows / aws.rb
Last active August 29, 2015 14:06
S3のリソースのhttpヘッダーにcache系追加
#!/usr/bin/env ruby
require 'aws-sdk-core'
require 'parallel'
require 'active_support/time'
require 'awesome_print'
ENV['AWS_ACCESS_KEY_ID'] = 'xxxxxxxxxxxxxxx'
ENV['AWS_SECRET_ACCESS_KEY'] = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
@linyows
linyows / ruby-init.sh
Last active January 3, 2016 17:59
rbenv or plugins setup script for me
#!/bin/bash
brew update
brew install readline openssl curl-ca-bundle
git clone git@github.com:sstephenson/rbenv.git ~/.rbenv
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash
git clone https://github.com/sstephenson/rbenv-default-gems.git ~/.rbenv/plugins/rbenv-default-gems
@linyows
linyows / file0.txt
Created August 21, 2013 02:59
Mac上のstandaloneなrbenvで日本語文字化けとssl証明書エラーがでないようにする方法 ref: http://qiita.com/linyows@github/items/04c1be6bcd2da3cf3f1c
$ brew update
$ brew install readline openssl curl-ca-bundle
$ env RUBY_CONFIGURE_OPTS="--with-readline-dir=`brew --prefix readline` --with-openssl-dir=`brew --prefix openssl`" rbenv install <version>
@linyows
linyows / test.md
Created July 14, 2013 07:52
test gist description

hello word

this is a test.

hi

  • aaa
  • bbb
#!/bin/bash
cd /var/lib/jenkins/plugins/embeddable-build-status/status
wget -O success.png https://raw2.github.com/badges/shields/master/static/travis/travis_passing.png
wget -O failure.png https://raw2.github.com/badges/shields/master/static/travis/travis_failing.png
wget -O running.png https://raw2.github.com/badges/shields/master/static/travis/travis_pending.png
wget -O unknown.png https://raw2.github.com/badges/shields/master/static/travis/travis_unknown.png
wget -O unknown.png https://raw2.github.com/badges/shields/master/static/travis/travis_unknown.png