Skip to content

Instantly share code, notes, and snippets.

/*
* Copyright (C) 2015 Yoshinori Isogai
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@shiraji
shiraji / mac_nano_sec.sh
Created July 8, 2015 02:55
display nano sec on mac
python -c'import time; print repr(time.time())'
#!/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'
{
"name": "jenkins",
"default_attributes": { },
"override_attributes": {
"java": {
"install_flavor": "oracle",
"jdk_version": "6",
"oracle": {
"accept_oracle_download_terms": "true"
}