Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
#対象の曜日を指定。0が日曜日。
targetDay=2
#曜日取得
day=`date +%w`
#対象の曜日までの日数
numOfdays=`expr $targetDay - $day`
#対象の日付を取得
date=`date -d "$numOfdays days" +"%Y-%m-%d"`
#!/bin/sh
yum -y install ruby
yum -y install ruby-devel
yum -y install rubygems
gem update --system 1.8.25
gem install chef --no-rdoc --no-ri
gem install rake
gem install knife-solo
#check version
// テキストエディタ色設定 Ver3
[SakuraColor]
C[BRC]=0,1,000080,000000,0
C[CMT]=1,0,008000,000000,0
C[CTL]=1,0,00ffff,000000,0
C[DFA]=0,0,ff00ff,000000,0
C[DFC]=0,0,ff00ff,000000,0
C[DFD]=0,0,ff00ff,000000,0
C[EOF]=1,0,81f1fe,000000,0
#!/bin/sh
{
srcDir="/usr/local/src"
installDir="/usr/local"
yamlFileExt=".tar.gz"
yaml="yaml-0.1.4"
yamlFileName=$yaml$yamlFileExt
yamlHTML="http://pyyaml.org/download/libyaml/$yamlFileName"
#!/bin/sh
#get GitHub user name if it is not provided
if [ $# -lt 1 ]; then
echo -n "Enter GitHub user name: "
read _githubUsername
else
_githubUsername=$1
fi
#! /usr/local/bin/ruby
require 'thor'
class Test < Thor
class_option :help, :type => :boolean, :aliases => '-h', :desc => 'Thor test'
default_task :execute
desc "execute [OPTION]", "Test execute"
option :production, :type => :boolean, :aliases => '-p', :desc => "Run production DB server"
option :number, :type => :numeric, :aliases => '-n', :default => 3, :desc => "test number"
@shiraji
shiraji / my_thor.rb
Last active December 17, 2015 22:49
#! /usr/local/bin/ruby
########################################################################
#
# Rubyのバッチ処理でよく使うであろう処理が書かれたクラス。
# よく使うオプションをclass_optionに設定し、
# このクラスを継承したクラスで利用できるようになっている。
#
########################################################################
require 'thor'
@shiraji
shiraji / prepare_jenkins.sh
Created June 16, 2013 16:36
いちいち、berkshelfをキックして、chef-soloをキックするのが面倒だったので・・・
#!/bin/sh
# get cookbooks using berkshelf
berks install --path cookbooks
# run chef-solo
if [ "$?" = "0" ] then
chef-solo -c solo.rb -j nodes/chef.json
fi
{
"name": "jenkins",
"default_attributes": { },
"override_attributes": {
"java": {
"install_flavor": "oracle",
"jdk_version": "6",
"oracle": {
"accept_oracle_download_terms": "true"
}
{
"run_list": "role[jenkins]"
}