View regex_all.c
#include <stdio.h>
#include <stdlib.h>
#include <regex.h>
#include <string.h>
// Unatched: 0
// Matched: 1
int octopass_match(char *str, char *pattern, char **matched)
{
int res;
View notify_opend_pull-requests_to_slack.rb
require 'octokit'
require 'netrc'
require 'json'
# Config
channel = '#development'
mention = '@dev'
slack_token = 'xoxb-xxxxxx-xxxxxxxxxxxxxxxxxxxx'
repos = %w(
our-org/our-project1
View .rubocop.yml
# target_version:
# rubocop v0.34.2
# 自動生成されるものはチェック対象から除外する
AllCops:
Exclude:
- "vendor/**/*" # rubocop config/default.yml
- "db/schema.rb"
DisplayCopNames: true
View 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
View revisions.task
namespace :deploy do
task :revisions do
on roles(:all), in: :parallel do |host|
puts "#{host}: #{capture(:tail, '-n 1', revision_log)}"
end
end
end
View gist:0eb760be14ca878694ef
[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
View cloud_front_log_analyzing.rb
#!/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
View main.go
package main
import (
"bufio"
"fmt"
"os"
"runtime"
"sync"
"time"
View aws.rb
#!/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'
View ruby-init.sh
#!/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