Just got a Christmas present from Motive Interactive. This will actually go great on my new bar in the basement. Thanks Ryan!

The whole fiasco with Gawker’s (largest blogging network I know of) passwords being leaked just reminds me of this XKCD comic. Pretty much in the comic he was going to make a fake service, like an image sharing site or something, and then get people to sign up. One of the biggest security wholes is a problem in most humans, memory. We like to reuse passwords across multiple sites, which allows this type of attack to occur. The people who hacked gawker’s passwords were smart enough to start brute forcing these username/password combinations on other sites like twitter. They could then use the account to spam followers. Image what kind of financial accounts they recovered!
Today I saw this list of top Gawker passwords released. While these passwords don’t surprise me, they are pretty amusing. One thing that I noticed is that the author pointed out people who used gawker website names as their password. I think they were pointing out how stupid it is, but actually it’s the opposite. Think about it, I bet you those people didn’t reuse their username and password on another site. It’s almost a full proof password for public sites. The only thing it needs is a salt, something added to the password to make sure it is unique.
To keep yourself safe I would recommend using some type of password scheme for public sites. Choose something like the first 4 letters of a site + a salt you can remember. So my salt for this example will be 32#@. So if i was logging into gawker I would know my password is gawk32#@. Simple to remember, secure, and NOT reused on any other site!
This is an Amazon Associate hook I made real quick for Link Farm Evolution. Basically it calls the Amazon API and does a search for whatever key word you specify, then picks a random result to make a post out of. To use this in LFE simple add the tag [amazon(keywordhere)].
One thing to note is that you will need to apply for the Amazon Associates program. Also you will need access to the AmazonAPI. You will need to add your Amazon apikey, private key, and amazon associates tag at the bottom of this file.
*having issue with the syntax highlighting right now, just copy everything in the php tags, save as amazon.php and upload this to your “contentsources” folder within lfe*
<?php
class amazon_csv
{
public $url;
public $user;
public $pass;
public $apikey;
public $apiprivate;
public $apitag;
/*----Set initial variables-----------------------------------------------------*/
function __construct($apikey,$apiprivate,$apitag)
{
$this->apikey = $apikey;
$this->apiprivate = $apiprivate;
$this->apitag = $apitag;
}
/*---Perform item search---------------------------------------------------------------*/
public function ItemSearch($term,$index = 'All',$page = 1)
{
$params = array(
"AssociateTag="=>$this->apitag,
"Operation"=>"ItemSearch",
"Keywords"=>$term,
"SearchIndex"=>$index,
"ResponseGroup"=>"Large",
"ItemPage"=>$page
);
//Generated an amazon secuirty token using aws_signed_request
$request = $this->aws_signed_request('com', $params, $this->apikey, $this->apiprivate);
$session = curl_init($request);
curl_setopt($session, CURLOPT_HEADER, false);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($session);
curl_close($session);
$parsed_xml = simplexml_load_string($response);
return $this->ParseResults($parsed_xml,$term,$page);
}
/*---- Parse the results returned from an amazon search and return the post array ----------------------------*/
public function ParseResults($parsed_xml,$term,$page)
{
//echo "starting parse <br/>";
$numOfItems = $parsed_xml->Items->TotalResults;
$totalPages = $parsed_xml->Items->TotalPages;
if($numOfItems>0){
$i = 1;
foreach($parsed_xml->Items->Item as $current){
$asin = $asin = $current->ASIN;
$image = $current->MediumImage->URL;
$temptitle = $current->ItemAttributes->Title;
$price = $current->Offers->Offer->OfferListing->Price->FormattedPrice;
$details = $current->EditorialReviews->EditorialReview->Content;
$posttext = "<a href='http://www.amazon.com/gp/product/$asin?ie=UTF8&tag=";
$posttext .= $this->apitag;
$posttext .= "&linkCode=as2&camp=1789&creative=9325&creativeASIN=$asin'>";
$posttext .="<img src='$image' alt='$title' /></a><br>";
$posttext .= "<img style='border:none !important; margin:0px !important;' src='http://www.assoc-amazon.com/e/ir?t=";
$posttext .= $this->api-tag;
$posttext .= "&l=as2&o=1&a=$asin' border='0' alt='' width='1' height='1' />";
$posttext .= "<p>$details</p>";
$posttext .= "<h3><a href='http://www.amazon.com/gp/product/$asin?ie=UTF8&tag=";
$posttext .= $this->apitag;
$posttext .= "&linkCode=as2&camp=1789&creative=9325&creativeASIN=$asin'>$price - Buy This Item at Amazon.com</a>";
$posttext .= "<img src='http://www.assoc-amazon.com/e/ir?t=";
$posttext .= $this->apitag;
$posttext .= "&l=as2&o=1&a=$asin' width='1' height='1' border='0' alt='' style='border:none !important; margin:0px !important;' /></h3>";
//get similar product links
if(isset($current->SimilarProducts->SimilarProduct)){
$posttext .= "<br/><h2>Related Items</h2>";
$posttext .= "<ul>";
foreach($current->SimilarProducts->SimilarProduct as $product){
$prodasin = $product->ASIN;
$prodtitle = $product->Title;
$posttext .= "<li><a href='http://www.amazon.com/gp/product/$prodasin?ie=UTF8&tag=" .$this->apitag.
"&linkCode=as2&camp=1789&creative=9325&creativeASIN=$prodasin'>$prodtitle</a><img src='http://www.assoc-amazon.com/e/ir?t=" .$this->apitag. "&l=as2&o=1&a=$prodasin' width='1' height='1' border='0' alt=''
style='border:none !important; margin:0px !important;' /></li>";
}
$posttext .= "</ul>";
}
//$posts[0] = 'asin,image,title,price,details,posttext';
$title = $temptitle[0];
$title = utf8_decode($title);
$content = utf8_decode($posttext);
$tags = utf8_decode($tags);
$details = str_replace(array("\r", "\n", "\t"), '', $details);
$posttext = str_replace(array("\r", "\n", "\t"), '', $posttext);
//$posts[$i] = "$asin,$image,$title,$price,$details,$posttext";
$posts[$i] = "$posttext";
$i++;
}
return $posts;
}else{
print("<span style='color:red;'>No matches found on page $page.</span><br/>");
}
}
/*---This function generate secure amazon transactions. Fucking stupid -------------------------*/
function aws_signed_request($region, $params, $public_key, $private_key)
{
// some paramters
$method = "GET";
$host = "ecs.amazonaws.".$region;
$uri = "/onca/xml";
// additional parameters
$params["Service"] = "AWSECommerceService";
$params["AWSAccessKeyId"] = $public_key;
// GMT timestamp
$params["Timestamp"] = gmdate("Y-m-d\TH:i:s\Z");
// API version
$params["Version"] = "2009-03-31";
// sort the parameters
ksort($params);
// create the canonicalized query
$canonicalized_query = array();
foreach ($params as $param=>$value)
{
$param = str_replace("%7E", "~", rawurlencode($param));
$value = str_replace("%7E", "~", rawurlencode($value));
$canonicalized_query[] = $param."=".$value;
}
$canonicalized_query = implode("&", $canonicalized_query);
// create the string to sign
$string_to_sign = $method."\n".$host."\n".$uri."\n".$canonicalized_query;
// calculate HMAC with SHA256 and base64-encoding
$signature = base64_encode(hash_hmac("sha256", $string_to_sign, $private_key, True));
// encode the signature for the request
$signature = str_replace("%7E", "~", rawurlencode($signature));
// create request
$request = "http://".$host.$uri."?".$canonicalized_query."&Signature=".$signature;
return $request;
}
}
function amazon($keyword = '') {
//run and tell dat
$apikey = 'YOUR-API-KEY-HERE';
$apiprivate = 'YOUR-API-PRIVATE';
$apitag = 'YOUR-AMAZON-ASSOCIATE-TAG';
$wp = new amazon_csv($apikey,$apiprivate,$apitag);
$posts = $wp->ItemSearch($keyword);
//pick a random result
$rand_keys = array_rand($posts, 2);
echo $posts[$rand_keys[0]] . "\n";
}
?>

comments