Supermind Search Consulting Blog 
Solr - Elasticsearch - Big Data

Introducing SolrTutorial.com

Posted by Kelvin on 02 Oct 2011 | Tagged as: Lucene / Solr / Elasticsearch / Nutch

Just launched a Solr tutorial website, a site styled after my LuceneTutorial.com but tailored towards Solr users. It also includes high-level overviews to Solr for non-programmers, such as Solr for Managers and Solr for SysAdmins.

Delete directories older than x days

Posted by Kelvin on 04 Aug 2011 | Tagged as: Ubuntu

Great for cleaning up log directories. find . -maxdepth 1 -mtime +14 -type d -exec rm -fr {} \; Change 14 to the required age in days.

HOWTO: Collect WebDriver HTTP Request and Response Headers

Posted by Kelvin on 22 Jun 2011 | Tagged as: crawling, programming, Lucene / Solr / Elasticsearch / Nutch

WebDriver, is a fantastic Java API for web application testing. It has recently been merged into the Selenium project to provide a friendlier API for programmatic simulation of web browser actions. Its unique property is that of executing web pages on web browsers such as Firefox, Chrome, IE etc, and the subsequent programmatic access of […]

Solr 3.2 released!

Posted by Kelvin on 22 Jun 2011 | Tagged as: programming, Lucene / Solr / Elasticsearch / Nutch, crawling

I'm a little slow off the block here, but I just wanted to mention that Solr 3.2 had been released! Get your download here: http://www.apache.org/dyn/closer.cgi/lucene/solr Solr 3.2 release highlights include Ability to specify overwrite and commitWithin as request parameters when using the JSON update format TermQParserPlugin, useful when generating filter queries from terms returned from […]

Classical learning curves for some editors

Posted by Kelvin on 20 Jun 2011 | Tagged as: programming

PHP function to send an email with file attachment

Posted by Kelvin on 11 Jun 2011 | Tagged as: programming, PHP

Courtesy of http://www.finalwebsites.com/forums/topic/php-e-mail-attachment-script function mail_attachment($filename, $path, $mailto, $from_mail, $from_name, $replyto, $subject, $message) { $file = $path.$filename; $file_size = filesize($file); $handle = fopen($file, "r"); $content = fread($handle, $file_size); fclose($handle); $content = chunk_split(base64_encode($content)); $uid = md5(uniqid(time())); $name = basename($file); $header = "From: ".$from_name." <".$from_mail.">\r\n"; $header .= "Reply-To: ".$replyto."\r\n"; $header .= "MIME-Version: 1.0\r\n"; $header .= "Content-Type: multipart/mixed; boundary=\"".$uid."\"\r\n\r\n"; […]

Determine if a server supports Gzip compression

Posted by Kelvin on 06 Jun 2011 | Tagged as: Ubuntu

echo "Size WITHOUT accepting gzip" curl http://www.supermind.org –silent –write-out "size_download=%{size_download}\n" –output /dev/null echo "Size WITH accepting gzip" curl http://www.supermind.org –silent -H "Accept-Encoding: gzip,deflate" –write-out "size_download=%{size_download}\n" –output /dev/null You can of course substitute the URL with a different one. On my site, this is what I get: $curl http://www.supermind.org –silent –write-out "size_download=%{size_download}\n" –output /dev/null $size_download=10560 $curl […]

HOWTO: Add gzip support to Squid 3.1 in Ubuntu

Posted by Kelvin on 06 Jun 2011 | Tagged as: Ubuntu

The squid3 deb that's available in the apt repos don't come configured with ecap support, which is required to support serving of gzip-compressed pages to clients. In a network environment where the majority of traffic is wireless (like where I live), reducing the payload of internal network requests will have a positive impact on performance. […]

How to revert a svn commit

Posted by Kelvin on 23 May 2011 | Tagged as: programming

I recently had to revert a svn commit of a developer who was absolutely CLUELESS about how subversion works and ended up undoing a bunch of my changes. ARGH! I decided to rollback ALL her changes and let her reapply the commits. Here's how to do it: svn merge -r [current revision]:[last good revision] . […]

Using sed to delete lines from a file

Posted by Kelvin on 21 May 2011 | Tagged as: Ubuntu

Delete line containing foo sed -i '/foo/d' filename.txt Delete last line sed -i '$d' filename.txt

« Previous PageNext Page »