HTTP tools

Quick one-page serving web server

while true; do
    echo -e "HTTP/1.1 200 OK\nContent-Type: text/html\n\
Content-Length: $(du -b index.html | awk '{print $1}')\n\
Connection: close\n\n $(cat index.html)\r\n" |
    nc -lp 8888
    sleep 1


Build a directory listing of your entire site, sorted by mod time.

tree -I index.html --matchdirs -t -H <base url> \
     -T "Dir Listing" --noreport . > tree.html

Create an html directory listing for your entire site.

tree -R -L 1 --dirsfirst -H <base url> \
     -T "Dir Listing" --noreport . > tree.html


Log into site via HTTP POST and save cookie.

curl --cookie-jar cookie.txt '' \
    -d "user=<user>&password=<password>"'

Download via the previusly saved cookie. Follow any redirect.

curl --cookie cookie.txt --location \
    "" -O 

Other HTTP POST alternatives:

curl -v <url> -d @data_post.txt
w3m -post data_post.txt <url>

Questions, comments? Connect.