Skip to content

Instantly share code, notes, and snippets.

View hfm's full-sized avatar

Okumura Takahiro hfm

View GitHub Profile
ngx_mrubyのbuild.shを実行中に出たエラー
- redis/vedisではなくmemcachedを使用
- CentOS 6.6 x86_64
- libmemcached-develはインストール済み
以下ビルド中のエラー文
CC build/mrbgems/mruby-memcached/src/mrb_memcached.c -> build/host/mrbgems/mruby-memcached/src/mrb_memcached.o
@hfm
hfm / yarikata.md
Created December 10, 2014 08:40
Puppet入ってないvagrantboxに,shell provisioningでpuppetを入れて,puppet provisionもやる方法
  1. vagrantのshell provisioningでpuppetをインストール
  2. puppet provisioningでmanifests適応

多分chefも同じ要領で出来る. わざわざconfiguration management toolsがインストールされたboxを用意するのは不毛なので,これでいいと思う. パッケージのバージョンがアップデートしても対応可能なところも魅力の1つ.

Vagrant.configure("2") do |config|
  config.vm.box = "hfm4/centos6"
@hfm
hfm / cent6-build-mysql-5.0.96.sh
Created December 11, 2014 21:35
CentOS6用のMySQL 5.0.96をビルドするための1枚のシェルスクリプト(vagrant環境等で使うことをオススメします)
#!/bin/sh
# MySQL 5.0.96 for CentOS 6
#
set -e
set -x
# install for rpmbuild
sudo yum -y groupinstall "Development Tools"
sudo yum -y install rpm-build gperf readline-devel zlib-devel time
sudo yum -y remove redhat-rpm-config
#include <stdio.h>
#include <unistd.h>
int main()
{
execl("/usr/bin/cal", "cal", "1", "2020", (char *)0);
printf("hello world\n");
return 0;
}
" Original: https://github.com/rcmdnk/vim-markdown/blob/mod/syntax/markdown.vim
" Vim syntax file
" Language: Markdown
" Maintainer: Ben Williams <benw@plasticboy.com>
" URL: http://plasticboy.com/markdown-vim-mode/
" Remark: Uses HTML syntax file
" TODO: Handle stuff contained within stuff (e.g. headings within blockquotes)
" Read the HTML syntax to start with
[Unit]
Description=Rails App (with Unicorn)
[Service]
WorkingDirectory=/path/to/wd
User=rails_user
Group=nobody
Environment=RAILS_ENV=production
SyslogIdentifier=rails-with-unicorn
PIDFile=/path/to/unicorn.pid
@hfm
hfm / debug.log
Last active August 29, 2015 14:25
CentOS 7 の vagrant (HOME=/home/vagrant) ユーザでの実行。
* git を既にインストールされている
$ bundle exec itamae ssh --vagrant recipe.rb --log-level=DEBUG
INFO : Starting Itamae...
DEBUG : Executing `mkdir -p /tmp/itamae_tmp`...
DEBUG : exited with 0
DEBUG : Executing `chmod 777 /tmp/itamae_tmp`...
DEBUG : exited with 0
INFO : Recipe: /private/tmp/vag/recipe.rb
DEBUG : user[app]
--- a/lib/itamae/backend.rb
+++ b/lib/itamae/backend.rb
@@ -169,6 +169,8 @@ def build_command(commands, options)
command = commands
end
+ command = "cd / && #{command}"
+
cwd = options[:cwd]
if cwd

git version 1.8.3.1

git/builtin/clone.c

// git/builtin/clone.c
int cmd_clone(int argc, const char **argv, const char *prefix)
{
	...
require 'tempfile'
require 'fileutils'
`ag -vl "^date": content/post/`.split.each do |path|
date = File.basename(path).scan(/\d{4}-\d{2}-\d{2}/).first
date_format = "date: #{date}\n"
tmpfile = Tempfile.new('post')
begin
File.open(path, 'r') do |f|