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
rsync -t -r --exclude='*.svn*' FROM_DIR/* TO_DIR/ |
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/sh | |
USERNAME=<username> | |
ADMINGROUP='wheel' | |
AUTHKEYS=<authkeys> | |
useradd -m $USERNAME | |
usermod -G $ADMINGROUP $USERNAME | |
mkdir -p /home/$USERNAME/.ssh | |
echo $AUTHKEYS > /home/$USERNAME/.ssh/authorized_keys | |
chown -R $USERNAME:$USERNAME /home/$USERNAME | |
chmod 700 /home/$USERNAME/.ssh |
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
source "https://rubygems.org" | |
gem "rspec" | |
gem "capybara-mechanize" , "1.0.1" |
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
page.driver.browser.agent.add_auth("https://example.com/" ,"usename","password") |
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
count = 0 | |
japanese_char = /(?:\p{Hiragana}|\p{Katakana}|[一-龠々])/ | |
# ファイルの指定 | |
targets = Dir.glob(TARGET_FILES) | |
# このエンコーディング以外はとばす | |
target_encodings = %w(UTF-8 Shift_JIS CP932) | |
targets.each{|t| | |
encoding = %x(nkf -g #{t}).chomp | |
if target_encodings.include? encoding |
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
Spork.prefork do | |
... | |
RSpec.configure do |config| | |
.... | |
# for database_clener | |
config.before(:suite) do | |
DatabaseCleaner.clean_with(:truncation,{:except => %w{except_tables}}) | |
DatabaseCleaner.strategy = :transaction | |
end |
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
find /etc -type f -newer /root/install.log | xargs ls -alrt |
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
class ApplicationController < ActionController::Base | |
protect_from_forgery | |
before_filter :set_locale | |
protected | |
def set_locale | |
logger.debug "* Accept-Language: #{request.env['HTTP_ACCEPT_LANGUAGE']}" | |
I18n.locale = params[:locale] || | |
extract_locale_from_accept_language_header || |
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
-- safeモードでmysql起動してから /usr/bin/mysqld_safe --user=root --skip-grant-tables | |
UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root'; | |
FLUSH PRIVILEGES; |
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
# tramp+zshではうまく動かないときの設定 | |
case "$TERM" in | |
dumb | emacs) | |
PROMPT="%m:%~> " | |
unsetopt zle | |
;; | |
esac |
OlderNewer