Skip to content

Instantly share code, notes, and snippets.

View masutaka's full-sized avatar

Takashi Masuda masutaka

View GitHub Profile
#!/usr/bin/env ruby
require 'net/http'
require 'xmlrpc/client'
# http://d.hatena.ne.jp/snaka72/20110702/1309595184
# slobby patch for Hatena bookmark API
module Net
module HTTPHeader
alias :old_hash :[]
@masutaka
masutaka / gist:8920206
Created February 10, 2014 17:16
php-fpm.conf v5.5.9 diff
diff --git a/etc/php-fpm.conf b/etc/php-fpm.conf
index 00d3c1b..de7639a 100644
--- a/etc/php-fpm.conf
+++ b/etc/php-fpm.conf
@@ -145,8 +145,8 @@
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
; will be used.
-user = nobody
-group = nobody
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.php.php-fpm</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<false/>
@masutaka
masutaka / gist:8920342
Last active August 29, 2015 13:56
nginx.conf v1.4.4 diff
--- /usr/local/etc/nginx/nginx.conf.default 2014-05-06 17:15:02.000000000 +0900
+++ /usr/local/etc/nginx/nginx.conf 2014-06-20 11:33:03.000000000 +0900
@@ -33,7 +33,7 @@
#gzip on;
server {
- listen 8080;
+ listen 80;
server_name localhost;
@masutaka
masutaka / gist:9084742
Last active August 29, 2015 13:56
rm-local-branches
#!/bin/sh
BASE_BRANCH=master
if [ -n "$1" -a "$1" != "-f" ]; then
BASE_BRANCH=$1
shift
fi
if [ "$1" = "-f" ]; then
DO=1
@masutaka
masutaka / rbenv.rb
Created April 7, 2014 14:59
A Chef recipe for rbenv
git '/home/masutaka/.rbenv' do
repository 'git@github.com:sstephenson/rbenv.git'
reference 'master'
user 'masutaka'
group 'masutaka'
action :sync
end
directory '/home/masutaka/.rbenv/plugins' do
owner 'masutaka'
@masutaka
masutaka / Capfile
Last active August 29, 2015 14:00
Capistrano3 Task of masutaka.net
# Load DSL and Setup Up Stages
require 'capistrano/setup'
# Includes default deployment tasks
require 'capistrano/deploy'
# Includes tasks from other gems included in your Gemfile
#
# For documentation on these, see for example:
#
@masutaka
masutaka / Vagrantfile
Created May 17, 2014 09:08
$ vagrant up --provider=aws
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@masutaka
masutaka / Gemfile
Last active August 29, 2015 14:02 — forked from tmd45/Gemfile
source 'https://rubygems.org'
ruby '2.1.0'
gem 'i18n'
gem 'activesupport'
gem 'octokit'
@masutaka
masutaka / Vagrantfile
Created September 14, 2014 10:39
CI Chef recipes using Wercker + Vagrant + AWS + serverspec
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define :local do |local|
local.vm.box = "ubuntu/trusty64"
local.vm.network "private_network", ip: "192.168.50.13"