Skip to content

Instantly share code, notes, and snippets.

@hakobera
hakobera / influxdb_visualization_tools.md
Last active March 25, 2016 23:47
InfluxDB の可視化ツール比較
@hakobera
hakobera / papertrail.conf
Created June 12, 2014 07:12
.ebextensions for Papertrail
packages:
yum:
gcc-c++: []
make: []
ruby-devel: []
openssl-devel: []
rubygems:
remote_syslog: []
@hakobera
hakobera / mackerel.config.yml
Last active April 24, 2017 05:32
Setup Mackerel for AWS Elastic Beanstalk
packages:
rpm:
mackerel: "http://yum.mackerel.io/centos/x86_64/mackerel-agent-0.7.0-1.noarch.rpm"
files:
/etc/mackerel-agent/mackerel-agent.conf:
mode: "00644"
owner: root
group: root
encoding: plain
# Credits:
# Jason Pirkey, Táve Corporation, http://www.tave.com/
# Jeremy Mickelson, https://github.com/CyborgMaster
# See http://help.papertrailapp.com/kb/hosting-services/amazon-elastic-beanstalk
packages:
yum:
rubygems: []
ruby-devel: []
@hakobera
hakobera / nodejs-vs-avatarjs.txt
Created March 27, 2014 08:13
Node.js vs Avatar.js
$ git clone https://github.com/hakobera/nodejs-vs-avatarjs
$ cd nodejs-vs-avatarjs
$ ./prepare.sh
$ ./benchmark.sh
<< 1. Calc fibonacci >>
[Run on Node.js]
fibonacci(10) x 1,234,754 ops/sec ±2.14% (86 runs sampled)
fibonacci(20) x 10,170 ops/sec ±2.63% (84 runs sampled)
fibonacci(30) x 71.90 ops/sec ±3.99% (63 runs sampled)
#
# Fluent
#
# Copyright (C) 2011 FURUHASHI Sadayuki
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#!/bin/bash
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
###############################################
# To use:
# wget https://raw.github.com/gist/2776679/04ca3bbb9f085b192f6aca945120fe12d59f15f9/install-redis.sh
# chmod 777 install-redis.sh
# ./install-redis.sh
###############################################
echo "*****************************************"
warning: You ran 'git add' with neither '-A (--all)' or '--ignore-removal',
whose behaviour will change in Git 2.0 with respect to paths you removed.
Paths like 'aaa.txt' that are
removed from your working tree are ignored with this version of Git.
* 'git add --ignore-removal <pathspec>', which is the current default,
ignores paths you removed from your working tree.
* 'git add --all <pathspec>' will let you also record the removals.
@hakobera
hakobera / md2html.rb
Created January 5, 2013 05:29
Send markdown document to Kindle. Required: ruby-1.9, kindlegen, [gem]action_mailer, [gem]makrdown and Gmail account Usage: md2kindle [your-markdown-document]
#! /usr/bin/env ruby
require 'markdown'
src_file = ARGV[0]
File.open(src_file) do |src|
content = Markdown.new(src.read).to_html
template = DATA.read
puts template.gsub(/#\{content\}/, content)
@hakobera
hakobera / app.js
Created December 21, 2012 01:10 — forked from anonymous/app.js
var http = require('http'),
fs = require('fs'),
url = require('url'),
mime = require('mime'),
domain = require('domain');
var server = http.createServer(function (req, res) {
var uri = url.parse(req.url, true),
filename = __dirname + '/public' + uri.pathname;