This is very useful Ruby command to share your local folder with everyone on the same network.
Thanks to Rohan! As we were working on something and he wanted me to share my local folder quickly.
Rohan shared this Ruby command with me and since then every now and then I am using it in office to share stuff with teams. Command is:
ruby -rwebrick -e 'WEBrick::HTTPServer.new(:Port=>PORT_NUMBER,:DocumentRoot=>”DIRECTORY_PATH").start' e.g. ruby -rwebrick -e 'WEBrick::HTTPServer.new(:Port=>2121,:DocumentRoot=>”/home/public/picture").start'
PORT_NUMBER - Port to listen a request
DIRECTORY_PATH - Root Path of the server file
Then check your ip address using command
ifconfig e.g. > ifconfig inet 220.127.116.11 netmask 0xffffff00 broadcast 18.104.22.168
Now you are all set and can share url -> http://your_ip_address:PORT_NUMBER
e.g. For above mentioned sample url will be http://22.214.171.124:2121