<?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>Why So Scared &#187; tidbit</title>
	<atom:link href="http://www.whysoscared.com/category/tidbit/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.whysoscared.com</link>
	<description>A blog about; Programming, Music and Random Stuff</description>
	<lastBuildDate>Thu, 10 Jun 2010 02:43:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Vodaphone UK MMS Contract Settings</title>
		<link>http://www.whysoscared.com/vodaphone-uk-mms-contract-settings/</link>
		<comments>http://www.whysoscared.com/vodaphone-uk-mms-contract-settings/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 12:27:53 +0000</pubDate>
		<dc:creator>Juo</dc:creator>
				<category><![CDATA[tidbit]]></category>

		<guid isPermaLink="false">http://www.whysoscared.com/?p=341</guid>
		<description><![CDATA[APN: wap.vodafone.co.uk
Username: wap
Password: wap
MMSC: http://mms.vodafone.co.uk/servlets/mms/
MMS Proxy: 212.183.137.012 (note the leading zero in the last octet)
MMS Max Message Size: (blank)
MMS UA Prof URL: (blank)

]]></description>
			<content:encoded><![CDATA[<p>APN: wap.vodafone.co.uk<br />
Username: wap<br />
Password: wap<br />
MMSC: <a style="font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; color: #333333; text-decoration: underline; padding: 0px; margin: 0px; border: 0px initial initial;" href="http://mms.vodafone.co.uk/servlets/mms/" target="_blank">http://mms.vodafone.co.uk/servlets/mms/</a><br />
MMS Proxy: 212.183.137.012 (note the leading zero in the last octet)<br />
MMS Max Message Size: (blank)<br />
MMS UA Prof URL: (blank)</p>
<p><a href="http://www.whysoscared.com/wp-content/uploads/2009/11/MMS_Screenshot.jpg"><img class="aligncenter size-full wp-image-342" title="MMS_Screenshot" src="http://www.whysoscared.com/wp-content/uploads/2009/11/MMS_Screenshot.jpg" alt="MMS_Screenshot" width="320" height="480" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.whysoscared.com/vodaphone-uk-mms-contract-settings/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Parse MusicBrainz XML with jQuery</title>
		<link>http://www.whysoscared.com/parse-musicbrainz-jquery/</link>
		<comments>http://www.whysoscared.com/parse-musicbrainz-jquery/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 21:17:22 +0000</pubDate>
		<dc:creator>Juo</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[tidbit]]></category>

		<guid isPermaLink="false">http://www.whysoscared.com/?p=324</guid>
		<description><![CDATA[For a project I&#8217;m working on to help people make posts over at http://www.warez-dnb.com/ i&#8217;ve been looking into parsing MusicBrainz, I thought id make a quick post to discuss the challenges and solutions I&#8217;ve come up with so far.
&#60;html&#62;
 &#60;head&#62;
 &#60;script type="text/javascript" src="jquery.js"&#62;&#60;/script&#62;
 &#60;script type="text/javascript"&#62;
 $(document).ready(function(){
	$.ajax({
		type: "GET",
		url: "http://www.warez-dnb.com/test/getid.php?name=Caspa",
		dataType: "xml",
		success: function(xml) {
			$(xml).find('artist-list').each(function() {

				alert($(this).find("name").text());
			});
		}
	});
 });
 &#60;/script&#62;
 &#60;/head&#62;
 [...]]]></description>
			<content:encoded><![CDATA[<p>For a project I&#8217;m working on to help people make posts over at http://www.warez-dnb.com/ i&#8217;ve been looking into parsing MusicBrainz, I thought id make a quick post to discuss the challenges and solutions I&#8217;ve come up with so far.</p>
<pre style="font-family: 'Bitstream Vera Sans Mono', Monaco, 'Courier New', monospace; font-size: 9pt; line-height: 1.3em; margin-top: 0em;"><span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">&lt;</span>html<span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">&gt;</span>
 <span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">&lt;</span>head<span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">&gt;</span>
 <span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">&lt;</span>script type<span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">=</span><span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #00a33f;">"text/javascript"</span> src<span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">=</span><span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #00a33f;">"jquery.js"</span><span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">&gt;</span><span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">&lt;</span>/script<span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">&gt;</span>
 <span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">&lt;</span>script type<span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">=</span><span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #00a33f;">"text/javascript"</span><span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">&gt;</span>
 <span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">$</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">(</span><span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #a535ae;">document</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">)</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">.</span>ready<span style="padding-top: 0.2em; padding-bottom: 0.1em;">(</span><span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">function</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">(</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">)</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">{</span>
	<span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">$</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">.</span>ajax<span style="padding-top: 0.2em; padding-bottom: 0.1em;">(</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">{</span>
		type: <span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #00a33f;">"GET"</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">,</span>
		url: <span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #00a33f;">"http://www.warez-dnb.com/test/getid.php?name=Caspa"</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">,</span>
		dataType: <span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #00a33f;">"xml"</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">,</span>
		<span style="padding-top: 0.2em; padding-bottom: 0.1em;"><span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #21439c;">success</span>: <span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">function</span>(<span style="padding-top: 0.2em; padding-bottom: 0.1em;">xml</span>)</span> <span style="padding-top: 0.2em; padding-bottom: 0.1em;">{</span>
			<span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">$</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">(</span>xml<span style="padding-top: 0.2em; padding-bottom: 0.1em;">)</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">.</span><span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #a535ae;">find</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">(</span><span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #00a33f;">'artist-list'</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">)</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">.</span>each<span style="padding-top: 0.2em; padding-bottom: 0.1em;">(</span><span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">function</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">(</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">)</span> <span style="padding-top: 0.2em; padding-bottom: 0.1em;">{</span>

				<span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #a535ae;">alert</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">(</span><span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">$</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">(</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">this</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">)</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">.</span><span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #a535ae;">find</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">(</span><span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #00a33f;">"name"</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">)</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">.</span><span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #a535ae;">text</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">(</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">)</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">)</span>;
			<span style="padding-top: 0.2em; padding-bottom: 0.1em;">}</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">)</span>;
		<span style="padding-top: 0.2em; padding-bottom: 0.1em;">}</span>
	<span style="padding-top: 0.2em; padding-bottom: 0.1em;">}</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">)</span>;
<span style="padding-top: 0.2em; padding-bottom: 0.1em;"> }</span><span style="padding-top: 0.2em; padding-bottom: 0.1em;">)</span>;
<span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;"> &lt;</span>/script<span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">&gt;</span>
 <span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">&lt;</span>/head<span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">&gt;</span>
 <span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">&lt;</span>body<span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">&gt;</span>

 <span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">&lt;</span>/body<span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">&gt;</span>
<span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">&lt;</span>/html<span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">&gt;</span></pre>
<pre style="font-family: 'Bitstream Vera Sans Mono', Monaco, 'Courier New', monospace; font-size: 9pt; line-height: 1.3em; margin-top: 0em;"><span style="color: #ff5600;">
</span></pre>
<pre style="font-family: 'Bitstream Vera Sans Mono', Monaco, 'Courier New', monospace; font-size: 9pt; line-height: 1.3em; margin-top: 0em;"><span style="color: #ff5600;"><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; line-height: 19px; white-space: normal; font-size: 13px;"><span style="color: #00a33f;">

</span></span></span></span></pre>
<p>This is the index.html file and jQuery code, its pretty simple, I was just testing that I could get a valid connection, then parsing the XML within artist-list and outputting anything that has the XML tag name</p>
<p>One question that might arise from looking at this code is why the url is hosted at warez-dnb, jQuery wont let you import XML from a remote web host, it has to be from the local server, i&#8217;ve written an extremely simple PHP function that will query musicbrainz and copy the result it gets to host it locally.</p>
<pre style="font-family: 'Bitstream Vera Sans Mono', Monaco, 'Courier New', monospace; font-size: 9pt; line-height: 1.3em; margin-top: 0em;"><span style="padding-top: 0.2em; padding-bottom: 0.1em;">&lt;?php
<span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #919191;">// Set your return content type</span>
<span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #a535ae;">header</span>(<span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #00a33f;">'<span style="padding-top: 0.2em; padding-bottom: 0.1em;">Content-type: application/xml</span>'</span>);

<span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #919191;">// Website url to open</span>
<span style="padding-top: 0.2em; padding-bottom: 0.1em;">$daurl</span> <span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">=</span> <span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #00a33f;">'<span style="padding-top: 0.2em; padding-bottom: 0.1em;">http://musicbrainz.org/ws/1/artist/?type=xml&amp;name=</span>'</span> <span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">.</span> <span style="padding-top: 0.2em; padding-bottom: 0.1em;">$_GET</span>[<span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #00a33f;">"<span style="padding-top: 0.2em; padding-bottom: 0.1em;">name</span>"</span>];

<span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #919191;">// Get that website's content</span>
<span style="padding-top: 0.2em; padding-bottom: 0.1em;">$handle</span> <span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">=</span> <span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #a535ae;">fopen</span>(<span style="padding-top: 0.2em; padding-bottom: 0.1em;">$daurl</span>, <span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #00a33f;">"<span style="padding-top: 0.2em; padding-bottom: 0.1em;">r</span>"</span>);

<span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #919191;">// If there is something, read and return</span>
<span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">if</span> (<span style="padding-top: 0.2em; padding-bottom: 0.1em;">$handle</span>) {
    <span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">while</span> (<span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">!</span><span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #a535ae;">feof</span>(<span style="padding-top: 0.2em; padding-bottom: 0.1em;">$handle</span>)) {
        <span style="padding-top: 0.2em; padding-bottom: 0.1em;">$buffer</span> <span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #ff5600;">=</span> <span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #a535ae;">fgets</span>(<span style="padding-top: 0.2em; padding-bottom: 0.1em;">$handle</span>, <span style="padding-top: 0.2em; padding-bottom: 0.1em;">4096</span>);
        <span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #a535ae;">echo</span> <span style="padding-top: 0.2em; padding-bottom: 0.1em;">$buffer</span>;
    }
    <span style="padding-top: 0.2em; padding-bottom: 0.1em; color: #a535ae;">fclose</span>(<span style="padding-top: 0.2em; padding-bottom: 0.1em;">$handle</span>);
}
<span style="padding-top: 0.2em; padding-bottom: 0.1em;">?</span>&gt;</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.whysoscared.com/parse-musicbrainz-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Terminal Command Mac Create RAR Archives</title>
		<link>http://www.whysoscared.com/terminal-command-mac-create-rar-archives/</link>
		<comments>http://www.whysoscared.com/terminal-command-mac-create-rar-archives/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 21:47:59 +0000</pubDate>
		<dc:creator>Juo</dc:creator>
				<category><![CDATA[tidbit]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.whysoscared.com/?p=298</guid>
		<description><![CDATA[If you want to pack your files into RAR&#8217;s then use this simple Terminal command
rar a -v100000 MySplitRarArchive
rar a -v100000 MySplitRarArchive
where -vxx is the file size of each of the RAR files in kb&#8217;s

]]></description>
			<content:encoded><![CDATA[<p>If you want to pack your files into RAR&#8217;s then use this simple Terminal command</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">rar a -v100000 MySplitRarArchive</div>
<blockquote><p>rar a -v100000 MySplitRarArchive</p></blockquote>
<p>where -vxx is the file size of each of the RAR files in kb&#8217;s</p>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.whysoscared.com/terminal-command-mac-create-rar-archives/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Change CNAME in WHM</title>
		<link>http://www.whysoscared.com/change-cname-in-whm/</link>
		<comments>http://www.whysoscared.com/change-cname-in-whm/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 23:18:05 +0000</pubDate>
		<dc:creator>Juo</dc:creator>
				<category><![CDATA[tidbit]]></category>

		<guid isPermaLink="false">http://www.whysoscared.com/?p=294</guid>
		<description><![CDATA[I wanted my domain to work with MobileMe, here&#8217;s how to do it if you have WHM.
1. Login to WHM.
2. Click on &#8220;Edit DNS zone&#8221;.
3. Choose the domain name for which you wish to edit CNAME record.
5. Choose record type that is prefixed with &#8220;www&#8221; with CNAME in the drop down box.
6. Enter Value/Destination in [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted my domain to work with MobileMe, here&#8217;s how to do it if you have WHM.</p>
<p>1. Login to WHM.<br />
2. Click on &#8220;Edit DNS zone&#8221;.<br />
3. Choose the domain name for which you wish to edit CNAME record.<br />
5. Choose record type that is prefixed with &#8220;www&#8221; with CNAME in the drop down box.<br />
6. Enter Value/Destination in last text box.<br />
7. Click Save button to submit the changes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.whysoscared.com/change-cname-in-whm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SMF 2.0 Custom Button in &quot;Start new topic&quot;</title>
		<link>http://www.whysoscared.com/smf-2-0-custom-button-in-start-new-topic/</link>
		<comments>http://www.whysoscared.com/smf-2-0-custom-button-in-start-new-topic/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 18:25:27 +0000</pubDate>
		<dc:creator>Juo</dc:creator>
				<category><![CDATA[SMF]]></category>
		<category><![CDATA[tidbit]]></category>

		<guid isPermaLink="false">http://www.whysoscared.com/?p=284</guid>
		<description><![CDATA[With the help of SMF forum member Arantor I was able to add a custom button to my Simple Machines Forum 2.0 (Warez-DnB)
To add a custom button you need to make an edit in the Sources/Subs-Editor.php file.
Locate
// The below array makes it dead easy to add images to this control. Add it to the array [...]]]></description>
			<content:encoded><![CDATA[<p>With the help of SMF forum member <a href="http://www.simplemachines.org/community/index.php?action=profile;u=53626">Arantor</a> I was able to add a custom button to my Simple Machines Forum 2.0 (Warez-DnB)</p>
<p>To add a custom button you need to make an edit in the <em>Sources/Subs-Editor.php</em> file.</p>
<p>Locate<br />
<code>// The below array makes it dead easy to add images to this control. Add it to the array and everything else is done for you!<br />
$context['bbc_tags'] = array();<br />
$context['bbc_tags'][] = array(</code></p>
<p>You can now see how a button is made up within SMF 2.0 for this example we will use the [img] button. <img class="alignnone" title="SMF IMG" src="http://www.warez-dnb.com/Themes/Mc_Dult21/images/bbc/img.gif" alt="" width="23" height="22" /></p>
<p><code>'img' =&gt; array('code' =&gt; 'img', 'before' =&gt; '[img]', 'after' =&gt; '[/img]', 'description' =&gt; $txt['image']),</code></p>
<p>You can see how this is made up, to add your own function (in the case of Warez-DnB a button that will atomically copy in the text [img]http://images.my-domain.com/nocd.png[/img]</p>
<p>I added</p>
<p><code>'noimg' =&gt; array('code' =&gt; 'noimg', 'before' =&gt;  '[img]http://images.warez-dnb.com/nocd.png', 'after' =&gt; '[/img]', 'description' =&gt; $txt['No picture']),<br />
</code></p>
<p>You&#8217;ll also want to add the button within your theme&#8217;s images/bbc folder that needs to be the same file name as the function, in this case &#8220;noimg.gif&#8221; <img class="alignnone" title="No Img" src="http://www.warez-dnb.com/Themes/Mc_Dult21/images/bbc/noimg.gif" alt="" width="23" height="22" /></p>
<p>Simple stuff but handy to know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.whysoscared.com/smf-2-0-custom-button-in-start-new-topic/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Making Leopard 10.5 PHP Ready</title>
		<link>http://www.whysoscared.com/making-leopard-10-5-php-ready/</link>
		<comments>http://www.whysoscared.com/making-leopard-10-5-php-ready/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 10:30:56 +0000</pubDate>
		<dc:creator>Juo</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[tidbit]]></category>

		<guid isPermaLink="false">http://www.whysoscared.com/?p=196</guid>
		<description><![CDATA[I&#8217;m a Ruby on Rails &#8216;man&#8217;, but recently thanks to Warez-DnB I&#8217;ve increasingly been exposed to PHP. To make the built in Apache server on Leopard 10.5 PHP Ready follow these simple steps

Edit the httpd.conf file, at /private/etc/apache2/httpd.conf
Edit the file (you can use Pico &#8220;sudo pico httpd.conf&#8221;) and search for LoadModule php5_module
Uncomment the line that says [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a Ruby on Rails &#8216;man&#8217;, but recently thanks to Warez-DnB I&#8217;ve increasingly been exposed to PHP. To make the built in Apache server on Leopard 10.5 PHP Ready follow these simple steps</p>
<ol>
<li>Edit the httpd.conf file, at <strong>/private/etc/apache2/httpd.conf</strong></li>
<li>Edit the file (you can use Pico &#8220;<strong>sudo pico httpd.conf&#8221;</strong>) and search for <strong>LoadModule php5_module</strong></li>
<li>Uncomment the line that says <strong>#LoadModule php5_module </strong>(Delete the #)</li>
<li>Save</li>
<li>Stop and start the web server in the control panel</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.whysoscared.com/making-leopard-10-5-php-ready/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Forbidden 403 error in Leopard 10.5</title>
		<link>http://www.whysoscared.com/forbidden-403-error-in-leopard10-5/</link>
		<comments>http://www.whysoscared.com/forbidden-403-error-in-leopard10-5/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 00:00:25 +0000</pubDate>
		<dc:creator>Juo</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[tidbit]]></category>

		<guid isPermaLink="false">http://www.whysoscared.com/?p=188</guid>
		<description><![CDATA[When turning on web sharing on 10.5 I had an error message
Forbidden: 403 ErrorYou dont have permissions to access localhost/~juo
Strange I thought, the fix is pretty simple though.

Edit the httpd.conf file, at /private/etc/apache2/httpd.conf
Edit the file (you can use Pico &#8220;sudo pico httpd.conf&#8221;) and search for &#60;Directory /&#62;
Change the line that says Deny from all to Allow from all
Save
Stop [...]]]></description>
			<content:encoded><![CDATA[<p>When turning on web sharing on 10.5 I had an error message</p>
<blockquote><p>Forbidden: 403 Error<br style="padding: 0px; margin: 0px;" />You dont have permissions to access localhost/~juo</p></blockquote>
<p>Strange I thought, the fix is pretty simple though.</p>
<ol>
<li>Edit the httpd.conf file, at <strong>/private/etc/apache2/httpd.conf</strong></li>
<li>Edit the file (you can use Pico &#8220;<strong>sudo pico httpd.conf&#8221;</strong>) and search for &lt;<strong>Directory /&gt;</strong></li>
<li>Change the line that says <strong>Deny from all</strong> to <strong>Allow from all</strong></li>
<li>Save</li>
<li>Stop and start the web server in the control panel</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.whysoscared.com/forbidden-403-error-in-leopard10-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Batch Rename Suffixes or Prefixes Terminal</title>
		<link>http://www.whysoscared.com/batch-rename-suffixes-prefixes-terminal/</link>
		<comments>http://www.whysoscared.com/batch-rename-suffixes-prefixes-terminal/#comments</comments>
		<pubDate>Sun, 28 Jun 2009 23:25:24 +0000</pubDate>
		<dc:creator>Juo</dc:creator>
				<category><![CDATA[tidbit]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.whysoscared.com/?p=160</guid>
		<description><![CDATA[Someone on a forum I regular asked how to batch rename suffixes within the terminal.
So The filenames;
filename.rar
filename2.rar
filename3.rar
Could have a suffix added like this;
filename_[sitename].rar
filename2_[sitename].rar
filename3_[sitename].rar
Suffix
for i in *.rar; do mv &#8220;$i&#8221; &#8220;`basename $i .rar`_[sitename].rar&#8221;; done

Prefix
find *.rar -exec mv {} [sitename]_{} \;
]]></description>
			<content:encoded><![CDATA[<p>Someone on a forum I regular asked how to batch rename suffixes within the terminal.</p>
<p>So The filenames;<br />
filename.rar<br />
filename2.rar<br />
filename3.rar</p>
<p>Could have a suffix added like this;<br />
filename_[sitename].rar<br />
filename2_[sitename].rar<br />
filename3_[sitename].rar</p>
<h4>Suffix</h4>
<blockquote><p>for i in *.rar; do mv &#8220;$i&#8221; &#8220;`basename $i .rar`_[sitename].rar&#8221;; done
</p></blockquote>
<h4>Prefix</h4>
<blockquote><p>find *.rar -exec mv {} [sitename]_{} \;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.whysoscared.com/batch-rename-suffixes-prefixes-terminal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP function check if a file (or url exists)</title>
		<link>http://www.whysoscared.com/php-function-check-if-a-file-or-url-exists/</link>
		<comments>http://www.whysoscared.com/php-function-check-if-a-file-or-url-exists/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 21:41:54 +0000</pubDate>
		<dc:creator>Juo</dc:creator>
				<category><![CDATA[tidbit]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.whysoscared.com/?p=129</guid>
		<description><![CDATA[While doing some scripting for Warez-DnB (for a new feature that ill talk more about soon) I needed a script that would check if a file on the server existed.
The PHP code below does this job perfectly, returning a boolean TRUE if the file is found and FALSE if it isn&#8217;t .

function url_exists($url) {
// Version [...]]]></description>
			<content:encoded><![CDATA[<p>While doing some scripting for <a href="http://warez-dnb.com/" target="_blank">Warez-DnB</a> (for a new feature that ill talk more about soon) I needed a script that would check if a file on the server existed.</p>
<p>The PHP code below does this job perfectly, returning a boolean TRUE if the file is found and FALSE if it isn&#8217;t .</p>
<blockquote>
<div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">function url_exists($url) {</div>
<div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">// Version 4.x supported</div>
<div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">$handle   = curl_init($url);</div>
<div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">if (false === $handle)</div>
<div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">{</div>
<div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">return false;</div>
<div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">}</div>
<div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">curl_setopt($handle, CURLOPT_HEADER, false);</div>
<div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">curl_setopt($handle, CURLOPT_FAILONERROR, true);  // this works</div>
<div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">curl_setopt($handle, CURLOPT_HTTPHEADER, Array(&#8221;User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.15) Gecko/20080623 Firefox/2.0.0.15&#8243;) ); // request as if Firefox</div>
<div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">curl_setopt($handle, CURLOPT_NOBODY, true);</div>
<div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">curl_setopt($handle, CURLOPT_RETURNTRANSFER, false);</div>
<div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">$connectable = curl_exec($handle);</div>
<div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">curl_close($handle);</div>
<div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">return $connectable;</div>
<div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">}</div>
</blockquote>
<blockquote><p>function url_exists($url) {</p>
<p>// Version 4.x supported</p>
<p>$handle   = curl_init($url);</p>
<p>if (false === $handle)</p>
<p>{</p>
<p>return false;</p>
<p>}</p>
<p>curl_setopt($handle, CURLOPT_HEADER, false);</p>
<p>curl_setopt($handle, CURLOPT_FAILONERROR, true);  // this works</p>
<p>curl_setopt($handle, CURLOPT_HTTPHEADER, Array(&#8221;User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.15) Gecko/20080623 Firefox/2.0.0.15&#8243;) ); // request as if Firefox</p>
<p>curl_setopt($handle, CURLOPT_NOBODY, true);</p>
<p>curl_setopt($handle, CURLOPT_RETURNTRANSFER, false);</p>
<p>$connectable = curl_exec($handle);</p>
<p>curl_close($handle);</p>
<p>return $connectable;</p>
<p>}</p></blockquote>
<p>I thought someone else might find it useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.whysoscared.com/php-function-check-if-a-file-or-url-exists/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP Image Watermarking</title>
		<link>http://www.whysoscared.com/php-image-watermarking/</link>
		<comments>http://www.whysoscared.com/php-image-watermarking/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 14:13:45 +0000</pubDate>
		<dc:creator>Juo</dc:creator>
				<category><![CDATA[tidbit]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.whysoscared.com/?p=107</guid>
		<description><![CDATA[If you&#8217;ve ever wanted to watermark images on your website, this neat script will be just what you&#8217;re looking for.
The watermark image is held in a separate file, rather than having to actually edit each image with your watermark, save and upload, this script will serve the watermark to the user on the image as [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve ever wanted to watermark images on your website, this neat script will be just what you&#8217;re looking for.</p>
<div id="attachment_108" class="wp-caption alignright" style="width: 147px"><a href="http://www.whysoscared.com/wp-content/uploads/2009/06/watermark.png"><img class="size-full wp-image-108" src="http://www.whysoscared.com/wp-content/uploads/2009/06/watermark.png" alt="Warez-DnB watermark" width="137" height="119" /></a><p class="wp-caption-text">The Warez-DnB Watermark</p></div>
<p>The watermark image is held in a separate file, rather than having to actually edit each image with your watermark, save and upload, this script will serve the watermark to the user on the image as  and when its requested.</p>
<p>I like this approach to watermarking because no only is it much easier than editing each picture individually it also means with FTP access you still have an original image intact without the watermark. Only users connecting via HTTP will see the watermarked version.</p>
<p>This also allows for ultimate flexibility, if for whatever reason you decide to change the site logo, its as simple as replacing one image file and <em>every</em> image hosted will have the new watermark.</p>
<p><span id="more-107"></span></p>
<p>Save this simple PHP script below as &#8220;<a href="http://pastie.org/private/g1asingn98laxfugbu6etw" target="_blank">watermark.php</a>&#8221;</p>
<p>The final stage is uploading the watermark.php file and image into the directory you want watermarking to take place. In the case of Warez-DnB this is in h<a href="http://www.warez-dnb.com/grabs/">ttp://www.warez-dnb.com/grabs/</a></p>
<p>The final step is an edit to the .htaccess file</p>
<blockquote><p><code>RewriteEngine On<br />
RewriteCond %{REQUEST_FILENAME} -f<br />
RewriteRule \.(gif|jpeg|jpg|png)$ watermark.php [QSA,NC]</code></p></blockquote>
<p>If you wanted to use the directory /images/ you should now have</p>
<p>/images/watermark.php<br />
/images/watermark.png<br />
/images/.htaccess</p>
<p>Now start uploading some images to /images/ and all is done.</p>
<p>Example <a href="http://www.warez-dnb.com/grabs/71a3007301fbd4349e99d85d7afd1c3b.png" target="_blank">http://www.warez-dnb.com/grabs/71a3007301fbd4349e99d85d7afd1c3b.png</a></p>
<p>Enjoy <img src='http://www.whysoscared.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.whysoscared.com/php-image-watermarking/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
