exposure

Image taken from page 123 of '[Footprints of the Lion, and other stories of travel ... With ... illustrations from photographs, etc.]'

Editing the bash_profile:

In VIM editor press’i’ key to edit the file

  • esc : w to write the file
  • esc : x to close the file

vim ~/.bash_profile

  • alias wmtrav=’sudo ruby  ~/RubymineProjects/Ruby/script/http_server.rb /Volumes/trav/’
  • alias wmdrop=’sudo ruby  ~/RubymineProjects/Ruby/script/http_server.rb ~/Dropbox/’
  • alias wm2g=’sudo ruby  ~/RubymineProjects/Ruby/script/http_server.rb /Volumes/2g/’
  • alias wmbt=’sudo ruby  ~/RubymineProjects/Ruby/script/http_server.rb /Volumes/BTbook/’

http_server.rb

require ‘webrick’

root = ARGV[0]
# root = File.expand_path ‘/Volumes/trav/’
# root = File.expand_path ‘~/Dropbox/’
server = WEBrick::HTTPServer.new(
:DoNotReverseLookup => true,
:Port => 80,
:DocumentRoot => root,
:BindAddress => “0.0.0.0”
)

trap ‘INT’ do server.shutdown end
server.start

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s