i-node を使用しているディレクトリを探す
$ find . -xdev -type f | cut -d "/" -f 2 | sort | uniq -c | sort -n
2日前のXMLファイルを削除する
$ find ./ -mtime +2 -name "*.xml" | xargs rm -f
#!/usr/bin/env ruby | |
require "getoptlong" | |
module UnicornCTL | |
class Controller | |
def initialize(args, argv) | |
@args = args | |
@argv = argv | |
end |
test |
#!/usr/bin/env ruby | |
# -*- encoding: utf-8 -*- | |
require 'open-uri' | |
require 'json' | |
class String | |
def blue | |
"\e[34m" + self + "\e[m" | |
end |
#!/bin/bash | |
set -e | |
command_name=`basename $0` | |
function usage() { | |
echo "Usage:" | |
echo " $command_name --username username --org org [OPTIONS]" | |
echo |
sed -e 's/https:\/\/gist.github.com\/\([0-9a-z][0-9a-z]*\).git/[email protected]:\1.git/' |
require 'spec_helper' | |
require 'forwardable' | |
module EmailDoc | |
def self.doc_path | |
Rails.root.join('doc', 'mail') | |
end | |
def self.documents | |
@documents ||= Documents.new |
#!/usr/bin/env ruby | |
require 'open3' | |
require 'optparse' | |
module RunAndNotify | |
def self.parse!(argv) | |
notifiers = [] | |
opt = OptionParser.new | |
opt.on('--notifier NOTIFIER') {|v| |
i-node を使用しているディレクトリを探す
$ find . -xdev -type f | cut -d "/" -f 2 | sort | uniq -c | sort -n
2日前のXMLファイルを削除する
$ find ./ -mtime +2 -name "*.xml" | xargs rm -f
require 'date' | |
# 実際は ActiveSupport の機能をつかう | |
class Date | |
def beginning_of_month | |
self.class.new(self.year, self.month, 1) | |
end | |
end | |
class MonthlyEnumerator < Enumerator |
while; do; echo -n $(date); echo -n ' '; ps l --ppid=$(ps alx | grep unicorn | grep master | awk "{ print \$3 }") | awk "{ print \$10}" | grep R | wc -l; sleep 3; done rbenv:syst |