-
This is a numbered list.
-
I'm going to include a fenced code block as part of this bullet:
Code More Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Get current swap usage for all running processes | |
# Erik Ljungstrom 27/05/2011 | |
# Updated: 2013-11-13 Yuichiro Saito | |
SUM=0 | |
OVERALL=0 | |
for DIR in `find /proc/ -maxdepth 1 -type d | egrep "^/proc/[0-9]"` ; do | |
PID=`echo $DIR | cut -d / -f 3` | |
PROGNAME=`ps -p $PID -o comm --no-headers` | |
for SWAP in `grep Swap $DIR/smaps 2>/dev/null| awk '{ print $2 }'` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: | |
# 1. Drop this file into lib/capistrano/remote_cache_with_project_root_strategy.rb | |
# 2. Add the following to your Capfile: | |
# require 'capistrano/git' | |
# require './lib/capistrano/remote_cache_with_project_root_strategy' | |
# 3. Add the following to your config/deploy.rb | |
# set :git_strategy, RemoteCacheWithProjectRootStrategy | |
# set :project_root, 'subdir/path' | |
# Define a new SCM strategy, so we can deploy only a subdirectory of our repo. |
tl;dr IdotabaのGemfileは"全プレ"になりました。ご笑納ください。→ Gemfile
rebuild.fmのep36でお知らせさせていただきました、Idobataの最新版Gemfileプレゼントをお届けいたします。 過日はIdobata会議01への多数のご参加ありがとうございました。おかげさまで盛況なミートアップとなりました。 (当日会場を提供いただいたEngine Yardさまのブログにて、Idobata会議01当日の様子がまとめられています。ありがとうございます!)
ためしてないけど、こんなかんじでできるのでは。
/etc/sysconfig/td-agent
export BUNDLE_BIN_PATH=/opt/td-agent/embedded/bin/bundle
export BUNDLE_GEMFILE=/etc/td-agent/Gemfile
export RUBYOPT=-rbundler/setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/ruby | |
require 'rubygems' | |
require 'httpclient' | |
require 'clockwork' | |
include Clockwork | |
module Clockwork |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sq_escape(str) | |
str.split(/\'/).map{|s| "'#{s}'"}.join("\\'") | |
end | |
sq_escape {"breakfast"=>"Bill's"}.to_json | |
#=> "'{\"breakfast\":\"Bill'\\''s\"}'" | |
puts sq_escape {"breakfast"=>"Bill's"}.to_json | |
#=> '{"breakfast":"Bill'\''s"}' | |
# # on bash | |
# $ echo '{"breakfast":"Bill'\''s"}' |
OlderNewer