Skip to content

Instantly share code, notes, and snippets.

🍢

Matt (Murahashi Kenichi) sanemat

🍢
Block or report user

Report or block sanemat

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
@sanemat
sanemat / hubot-lightning-talks.md
Last active Aug 29, 2015
Hubot Lightning Talks
View hubot-lightning-talks.md

Hubot Lightning Talks

日時

未定

場所

未定

コンテンツ

1本3分のLT * 10~

@sanemat
sanemat / wercker-postgres-json-type.md
Created Jul 21, 2014
wercker-postgres-json-type
View wercker-postgres-json-type.md

I met ERROR: type "json" does not exist

rake aborted!
ActiveRecord::StatementInvalid: PG::UndefinedObject: ERROR:  type "json" does not exist
LINE 1: ...ULT 0 NOT NULL, "job_class" text NOT NULL, "args" json DEFAU...

with:

View clear-job-with-que.rb
class JobQueue
def self.clear(job_class, *args)
case
when job_class == RepoSynchronizationJob
user_id = args.first[:user_id]
sql = <<-"EOQ".strip_heredoc
DELETE FROM que_jobs
WHERE
job_class = #{ActiveRecord::Base.connection.quote(job_class)}
AND
@sanemat
sanemat / install-fluentd.txt
Created Aug 11, 2014
For ubuntu 14.04 and td-agent2
View install-fluentd.txt
# fluentd
curl -L http://packages.treasure-data.com/debian/RPM-GPG-KEY-td-agent | sudo apt-key add -
sudo apt-add-repository 'deb http://packages.treasuredata.com/2/ubuntu/trusty/ trusty contrib'
sudo apt-get -yq update
sudo apt-get -yq install td-agent
sudo service td-agent configtest
sudo service td-agent restart
View rails-job.md

Rails and job queue

Use case

Action mailer, api request, ...

TL;DR

Use sucker_punch. If you already use redis, why don't you use sidekiq(or resque). If you have a few resources (and if you have enough time) and IF YOU WANT TO BE 'HITOBASHIRA', using que is one option.

@sanemat
sanemat / tachikomaio-with-github-travis-ci-ecosystem.md
Last active Aug 29, 2015
Tachikoma.io with GitHub, Travis CI ecosystem
View tachikomaio-with-github-travis-ci-ecosystem.md

Tachikoma.io with GitHub, Travis CI ecosystem

sanemat sanemat_AT_tachikoma.io

Use Case

Your are a user of OSS(Open Source Software).

You met below:

@sanemat
sanemat / docker-upstart.conf
Created Aug 14, 2014
Parse docker upstart log, for v1 format
View docker-upstart.conf
<source>
type tail
tag docker.host.house
path /var/log/upstart/docker.log
pos_file /var/log/td-agent/docker-upstart.log.pos
format multiline
format_firstline /\\A\\d{4}\\/\\d{2}\\/\\d{2}\\s\\d{2}:\\d{2}:\\d{2}/
format1 /\\A(?<time>\\d{4}\\/\\d{2}\\/\\d{2}\\s\\d{2}:\\d{2}:\\d{2})\\s*(?<head>\[^\\r\\n\]+)/
# FIXME: [identifier.method()]
View tachikoma-io-travis-ci-meetup.html
<!-- === begin markdown block ===
generated by markdown 1.1.1 on Ruby 2.1.2 (2014-05-08) [x86_64-darwin13.0]
on 2014-09-04 02:09:42 +0900 with Markdown engine kramdown (1.3.3)
using options {}
-->
<link href="z.css" rel="stylesheet" />
<link href="http://fonts.googleapis.com/css?family=Lato" rel="stylesheet" type="text/css" />
@sanemat
sanemat / Vagrantfile
Created Aug 21, 2014
Tachikoma.io host's vagrant file
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = '2'
Dotenv.load
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.omnibus.chef_version = '11.12.8'
@sanemat
sanemat / mask.conf
Created Aug 28, 2014
Use fluent-plugin-record-reformer
View mask.conf
<match docker.containers.**>
type record_reformer
tag reformed.${tag}
<record>
message ${message.gsub(%r(://[\\w:-]{20,}), '://MASKED')}
</record>
</match>
You can’t perform that action at this time.