<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Quite a Bright Light &#187; Uncategorized</title>
	<atom:link href="http://www.quitebrightlight.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.quitebrightlight.com</link>
	<description></description>
	<lastBuildDate>Mon, 10 May 2010 19:40:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Drupal 6: adding and modifying html using javascript</title>
		<link>http://www.quitebrightlight.com/2010/02/drupal-6-adding-and-modifying-html-using-javascript/</link>
		<comments>http://www.quitebrightlight.com/2010/02/drupal-6-adding-and-modifying-html-using-javascript/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 21:29:40 +0000</pubDate>
		<dc:creator>jefke</dc:creator>
				<category><![CDATA[Drupal]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Websites]]></category>

		<guid isPermaLink="false">http://www.quitebrightlight.com/?p=58</guid>
		<description><![CDATA[


A while ago, I had a simple website, with a simple js script for calculating a price based on some user input. The script uses an updater function that, after all required choices have been made (radio buttons), calculates the final price and shows the price. It does this by adding html to a predefined [...]]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript"><!--
google_ad_client = "pub-0445421940264769";
google_ad_slot = "7713378196";
google_ad_width = 468;
google_ad_height = 15;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p>A while ago, I had a simple website, with a simple js script for calculating a price based on some user input. The script uses an updater function that, after all required choices have been made (radio buttons), calculates the final price and shows the price. It does this by adding html to a predefined &#8216;price div&#8217;  (price.innerHTML = &#8220;&#8230;&#8221;) and setting it&#8217;s height from 0 to &#8216;auto&#8217;. Nothing fancy, but worked quite nice.<br />
Upon changing the website for a Drupal site, I was confronted with implementing the js within Drupal. And even though it wasn&#8217;t really hard, it took me a while to figure it out, so I thought I&#8217;d share my findings, hoping they would be useful to somebody. </p>
<p>First of all, I created a normal page within Drupal. The downside of the method (to some people) is that I had to enable PHP for the page input. But as I am the only person ever seeing an input form on this particular site, I didn&#8217;t care too much. For adding the required js (and some extra css for that page), I used: </p>
<div class="insertcode">drupal_add_js(&#8217;sites/all/js/prices.js&#8217;); drupal_add_js(&#8217;sites/all/js/updater.js&#8217;);<br />
drupal_set_html_head(&#8216;&lt;script type=&#8221;text/javascript&#8221;><br />
window.onload = function() {<br />
includePrices();<br />
};</script><br />
');<br />
drupal_add_css(path_to_theme().'/prices.css', 'theme', 'all', TRUE);<br />
$styles = drupal_get_css();
</div>
<p>And then I added an html form which calls the updater function on each click. This makes it possible to have the second choice customers have to make depend on the first choice they make.</p>
<div class="insertcode">
&lt;div onclick="update();" id="priceform"><br />
&lt;div onclick="update();" id="house_type"><br />
&lt;form id="typeform"><br />
    Type house:<br />
    &lt;input type="radio" value="1" ...<br />
&lt;/form><br />
...
</div>
<p>Works like a charm for me...</p>
]]></content:encoded>
			<wfw:commentRss>http://www.quitebrightlight.com/2010/02/drupal-6-adding-and-modifying-html-using-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arch Linux: bash: /etc/init.d/vboxdrv: No such file or directory</title>
		<link>http://www.quitebrightlight.com/2009/09/arch-linux-bash-etcinit-dvboxdrv-no-such-file-or-directory/</link>
		<comments>http://www.quitebrightlight.com/2009/09/arch-linux-bash-etcinit-dvboxdrv-no-such-file-or-directory/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 19:02:54 +0000</pubDate>
		<dc:creator>jefke</dc:creator>
				<category><![CDATA[Arch]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Virtualbox]]></category>

		<guid isPermaLink="false">http://www.quitebrightlight.com/?p=34</guid>
		<description><![CDATA[


After a kernel upgrade, Virtualbox instructs you to run &#8220;/etc/init.d/vboxdrv setup&#8221; as root. When you try this on Arch, you get an error message, however: 
bash: /etc/init.d/vboxdrv: No such file or directory
Turns out that on Arch, there&#8217;s a different path to follow. As root, do: 

/usr/bin/vbox_build_module

Followed by:

modprobe -r vboxdrv

And you should be set! Still, if [...]]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript"><!--
google_ad_client = "pub-0445421940264769";
google_ad_slot = "7713378196";
google_ad_width = 468;
google_ad_height = 15;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<br />
After a kernel upgrade, Virtualbox instructs you to run &#8220;/etc/init.d/vboxdrv setup&#8221; as root. When you try this on Arch, you get an error message, however: </p>
<div class="konsole">bash: /etc/init.d/vboxdrv: No such file or directory</div>
<p>Turns out that on Arch, there&#8217;s a different path to follow. As root, do: </p>
<div class="konsole">
/usr/bin/vbox_build_module
</div>
<p>Followed by:</p>
<div class="konsole">
modprobe -r vboxdrv
</div>
<p>And you should be set! Still, if you&#8217;re not, please don&#8217;t hold me responsible. Everything you do as root is your own responsibility!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.quitebrightlight.com/2009/09/arch-linux-bash-etcinit-dvboxdrv-no-such-file-or-directory/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>IP based redirect for bots using .htaccess</title>
		<link>http://www.quitebrightlight.com/2009/04/ip-based-redirect-for-bots-usin-htaccess/</link>
		<comments>http://www.quitebrightlight.com/2009/04/ip-based-redirect-for-bots-usin-htaccess/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 21:01:53 +0000</pubDate>
		<dc:creator>jefke</dc:creator>
				<category><![CDATA[Drupal]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.quitebrightlight.com/?p=22</guid>
		<description><![CDATA[Like all of us &#8211; I think &#8211; I really hate comment spammers. I really hate unruly bots, actually. I really do. If you start keeping stats of visitors on your site, you&#8217;ll quickly spot bots crawling all over your site, searching for all sorts of ways to epxloit your website. They look for email [...]]]></description>
			<content:encoded><![CDATA[<p>Like all of us &#8211; I think &#8211; I really hate comment spammers. I really hate unruly bots, actually. I really do. If you start keeping stats of visitors on your site, you&#8217;ll quickly spot bots crawling all over your site, searching for all sorts of ways to epxloit your website. They look for email addresses, they try to submit spam comments, they try to find ways to enter your database, they do everything but help you. They are leeches. They stink. I really don&#8217;t like them&#8230;</p>
<p>Luckily, there are different ways to handle bots as well. If you&#8217;re using a .htacces file, for example, you can add a snippet to block the vermin based on their IP address. An idea I liked even better is to <a href="http://amifamousnow.com/how-to/howto-htaccess-ip-redirect-to-any-site/" onclick="pageTracker._trackPageview('/outgoing/amifamousnow.com/how-to/howto-htaccess-ip-redirect-to-any-site/?referer=');">redirect the bots</a> to a site that tries to reeducate the bots. You never know. </p>
<p>In stead of redirecting the bots to a governement site where they can take a seat and follow a hands-on course on cyber crimes, another good idea is to send the little bastards to a <a href="http://www.americanbeaconfunds.com/contact/spam/trap.html" onclick="pageTracker._trackPageview('/outgoing/www.americanbeaconfunds.com/contact/spam/trap.html?referer=');">spam trap page</a>. Gives me visions of all bots in the world swimming around in a pool of interlinked spam pages, never able to get out by them selves. Heaven&#8230;</p>
<p>So that&#8217;s what I do now, I redirect the bots to a spam trap. Typing in the IP&#8217;s in the required format for the .htaccess file, however, can be a PITA. Therefore, I wrote a little script to generate the .htaccess snippet based on a list of IP&#8217;s in their normal format. The .htaccess format itself comes from <a href="http://amifamousnow.com/how-to/howto-htaccess-ip-redirect-to-any-site/" onclick="pageTracker._trackPageview('/outgoing/amifamousnow.com/how-to/howto-htaccess-ip-redirect-to-any-site/?referer=');">Am I Famous Now</a>. Insert the URL where you want to send the bots to or leave the one I use, insert the IP&#8217;s of the bots and push the button:</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-0445421940264769";
google_ad_slot = "7713378196";
google_ad_width = 468;
google_ad_height = 15;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<br />
<script type="text/javascript" src="http://www.quitebrightlight.com/wp-includes/js/jquery/jquery.form.js"></script><br />
<script type="text/javascript"> function createhtaccess() {
  var queryString = jQuery("#IPform").formToArray();
  jQuery("#IPresult").load("/scripts/IPredirect.php", queryString);
  jQuery("#IPresult").addClass("insertcode");
  }
  </script></p>
<form id="IPform">
<strong>The URL to refer the bots to:</strong></p>
<div class='field'>
<TEXTAREA name="URL" id="URL" rows="2" cols="60">http://www.americanbeaconfunds.com/contact/spam/trap.html</TEXTAREA>
</div>
<p><strong>The IP&#8217;s to refer (one per line):</strong></p>
<div class='field'>
<TEXTAREA name="IPs" id="IPs" rows="10" cols="60">xxx.xxx.xxx.xxx</TEXTAREA>
</div>
<input type=button value='generate .htaccess snippet' onclick='createhtaccess();' />
</form>
<div name = 'IPresult' id = 'IPresult'></div>
<p>Copy paste the snippet into your .htaccess file, and you&#8217;re all set. (WATCH OUT: if you don&#8217;t know what you&#8217;re doing, messing with .htaccess can wreck your site in a second. Don&#8217;t blame me. I told you.) This works fine, ofcourse, when you can easily keep track of the bots. When you have huge traffic on your site, you probably have a huge number of bots visiting it as well. In that case, you&#8217;re probably better of with a lean and mean, fully automated and integrated bot trapping/blocking device like <a href="http://www.kloth.net/internet/bottrap.php" onclick="pageTracker._trackPageview('/outgoing/www.kloth.net/internet/bottrap.php?referer=');">this</a> or <a href="http://www.kloth.net/internet/bottrap.php" onclick="pageTracker._trackPageview('/outgoing/www.kloth.net/internet/bottrap.php?referer=');">this</a></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-0445421940264769";
google_ad_slot = "7713378196";
google_ad_width = 468;
google_ad_height = 15;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.quitebrightlight.com/2009/04/ip-based-redirect-for-bots-usin-htaccess/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
