This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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/ |
NewerOlder