Skip to content

Instantly share code, notes, and snippets.

@yuya-takeyama
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuya-takeyama/9043945 to your computer and use it in GitHub Desktop.
Save yuya-takeyama/9043945 to your computer and use it in GitHub Desktop.
集中
# 集中したいときに実行するやつ
BASEDIR = 'C:\WINDOWS\system32\drivers\etc'
open File.join(BASEDIR, 'hosts'), 'w' do |hosts|
hosts.puts(open(File.join(BASEDIR, 'hosts.template')).read)
hosts.puts(open(File.join(BASEDIR, 'hosts.template_to_focus')).read)
end
# 元々の hosts ファイルをこの名前で保存しておく
127.0.0.1 b.hatena.ne.jp
127.0.0.1 www.facebook.com
127.0.0.1 github.com
127.0.0.1 twitter.com
127.0.0.1 blog.yuyat.jp
# 集中しなくてもいいときに実行するやつ
BASEDIR = 'C:\WINDOWS\system32\drivers\etc'
open File.join(BASEDIR, 'hosts'), 'w' do |hosts|
hosts.puts(open(File.join(BASEDIR, 'hosts.template')).read)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment