Any more reasons to move to the valley?

The people over at Urban Digital mapped the top 25 web2.0 companies and the result is hardly surprising: 19 out of 25 are located in the valley.

web20_in_the_valley

Hopefully, the valley doesn’t burn down before I aver get the chance to move there…

HTTPS Name-Based Virtual Hosting

Name-based virtual hosting enables webmaster to host multiple websites with different domain names on a single host under a single IP. However, those who wished to protect their virtual sites by SSL/TLS were out of luck because of shortcomings in the original SSL3.0 / TLS1.0 protocol.

The problem is that the mandatory Host: header field, which the client includes in its request to indicate which virtual host it refers to, can only be sent after the TLS/SSL handshake is completed. To support name-based virtual hosting in a SSL session however, the server needs to know the name of the virtual host in question before TLS/SSL connection setup is finished. Hence, even the Apache’s SSL FAQ concludes that “it is impossible”.

Well, it used to be, but things have changed lately. The TLS working group has added the Server Name Indication (aka “SNI”) extension to the TLS protocol.

On the client side, support for SNI has already been implemented in Opera 7.6, Firefox 2.0 and InternetExplorer 7 Beta2

As for the server side, SNI support for Apache is already available through mod_gnutls (check out this Apache+mod_gnutls SSL virtual hosting Howto) and will hopefully soon be incorporated into mod_ssl. If that happens, I will be the first one to adopt it. :-)

Fighting Spam by Reading Books

reCAPTCHA is yet another free CAPTCHA generator that helps fighting SPAM. What sets it apart from other CAPTCHA generators though is the smart way, in which the computing power of the human brain involved in solving CAPTCHAs is “harvested” in order to assist the OCR process in projects that aim to digitalize valuable books.

recaptcha

reCAPTCHA emerged from a project in the CS department at Carnegie Mellon. I installed the wordpress plugin on this blog. Leave a comment to try it out.

Satellite-guided Graduate School selection

Planing on applying for a PhD programm in CS? Forget the usual US college rankings. Just like all the good advice on how to apply for a CS PhD programm. I wouldn’t trust them. They’re all facts, no heart.
Instead, I’d rather have a look on the campus and trust my gut feeling.

A pinch of XSLT here, a little bit of KML there…

I’ve been working on a J2ME “buddy finder” app for some time now. After a while my postgis-enabled database filled with more and more gis objects and I started looking for a quick and easy way to visualize the geo-data. Stumbling upon the article “Turn SQL into XML with PHP” I had an idea: Why not just convert the SQL data to xml, use XSLT to style it like KML and let GoogleEarth to all the visualization work?

Turned out to be quit easy. The PHP code snippet look like this:

$q2x = XML_Query2XML::factory(MDB2::factory('pgsql://_user_:_passwd_@localhost/DB'));
$sql = "SELECT id, login_name, full_name, email, recent_update, invisible, ";
$sql.= " Y(gis_location) as lat, X(gis_location) as lon from users";
$xml = $q2x->getFlatXML($sql, $rootTagName = 'buddies', $rowTagName = 'buddy');
$xsl = new DOMDocument;
$xsl->load('bi2kml.xsl');
$xslp = new XSLTProcessor;
$xslp->importStyleSheet($xsl);
header('Content-Type: application/vnd.google-earth.kml+xml');
echo $xslp->transformToXML($xml);

And this was the XSLT sheet:

<xsl:output method="xml" version="1.0" omit-xml-declaration="no"/>
<xsl:template match="/">
<kml xmlns="http://earth.google.com/kml/2.1">
<xsl:apply-templates/>
</kml>
</xsl:template>
<xsl:template match="buddies">
<Document>
<Style id="buddyIcon">
<Icon><href>images/icon-buddy-on.png</href></Icon>
</Style>
<xsl:apply-templates/>
</Document>
</xsl:template>
<xsl:template match="buddy">
<Placemark>
<styleUrl>#buddyIcon</styleUrl>
<name><xsl:value-of select="./login_name" /></name>
<description>
<xsl:value-of select="./full_name" />
<![CDATA[
<br/>
]]>
<xsl:value-of select="./email" />
</description>
<Point>
<coordinates> <xsl:value-of select="./lon" />, <xsl:value-of select="./lat" />, 0 </coordinates>
</Point>
</Placemark>
</xsl:template>

And this is how the end result looked:

buddies_in_GE

TED talks on YouTube

I was browsing YouTube yesterday and found out that TED, host of a annual conference on “Technology, Entertainment, Design”, started to make videos of some of the presentations available online. Among many interesting talks these two were particularly striking:

One can help but wonder when this kind of cool user interfaces will be available at Best Buy.

Linux Administration with Screen

I was helping out the guys over at wevent.org with their linux server the other day.
Now when ofter login to a linux server via ssh, one of the most useful tools is screen. It’s a command line terminal multiplexer, allowing you to log in and start multiple terminal screens within one ssh session. You can than disconnect from screen (Ctrl+A D) , logout, login later, reconnect to your screen session again ($ screen -r) and resume your work where you left off. It’s also a much better alternative to nohup and proves indispensable if you suffer from tcp disconnects caused for example by a weak wlan signal.

Despite its usefulness, screen doesn’t seem to enjoy a great popularity among linux admins. Probably because in its default configuration there’s no visible indicator if you are currently connected to a screen session or not which is quite confusing.

Include the following one line to your /etc/screenrc

caption always "%{= ck}%D %Y-%m-%d|%{-}%016=%-Lw%?%F%{= rk}
%?%n%50L>%f*%t%{-}%+Lw%-015= %{= gk}|%l%{-}"

and you get a nice caption line similar to the windows taskbar with a date and system load indicator:
screen_session

Instant swap on linux

Is you linux box running out of memory? Paste the following in your root shell for 128Mb instant swap:

  dd if=/dev/zero of=/tmp/SWAP bs=1M count=128 && \
  mkswap /tmp/SWAP && \
  losetup /dev/loop2 /tmp/SWAP && \
  swapon /dev/loop2 ; \
  swapon -s

Celebrating the 5th anniversary of IMPS

From The Infinite Monkey Protocol Suite (IMPS) aka rfc2795 spec:

“Abstract
This memo describes a protocol suite which supports an infinite number of monkeys that sit at an infinite number of typewriters in order to determine when they have either produced the entire works of William Shakespeare or a good television show. The suite includes communications and control protocols for monkeys and the organizations that interact with them.”

Unfortunately, even after five years, we still don’t have a usable implementation…