Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

About this user

« Newer Snippets
Older Snippets »
2 total  XML / RSS feed 

Lighttpd redirect www to no www

Catch all requests for www.domain.tld and redirect to domain.tld

$HTTP["host"] =~ "^www\.(.*)" {
   url.redirect = ( "^/(.*)" => "http://%1/$1" )
}

cURL Response Times

Determine response times of a URL with cURL.


echo "`curl -s -o /dev/null -w '%{time_starttransfer}-%{time_pretransfer}' http://www.domain.com/`"|bc

curl -w '\nLookup time:\t%{time_namelookup}\nConnect time:\t%{time_connect}\nPreXfer time:\t%{time_pretransfer}\nStartXfer time:\t%{time_starttransfer}\n\nTotal time:\t%{time_total}\n' -o /dev/null -s http://www.domain.com/
« Newer Snippets
Older Snippets »
2 total  XML / RSS feed