<?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>Tony Virelli - Web Developer - HTML, xHTML, PHP, MySQL, JavaScript</title>
	<atom:link href="http://tonyvirelli.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://tonyvirelli.com</link>
	<description>Tony Virelli - I share the information I have dealing with web design, technology, the internet and more</description>
	<lastBuildDate>Tue, 31 Jan 2012 14:57:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Asterisk cdr_adaptive_odbc Trouble</title>
		<link>http://tonyvirelli.com/blog/asterisk-cdr_adaptive_odbc-trouble/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=asterisk-cdr_adaptive_odbc-trouble</link>
		<comments>http://tonyvirelli.com/blog/asterisk-cdr_adaptive_odbc-trouble/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 14:56:54 +0000</pubDate>
		<dc:creator>John Hass</dc:creator>
				<category><![CDATA[Asterisk]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[asterisk]]></category>
		<category><![CDATA[cdr_adaptive_odbc]]></category>
		<category><![CDATA[odbc]]></category>

		<guid isPermaLink="false">http://tonyvirelli.com/?p=629</guid>
		<description><![CDATA[So I have been fighting for two days straight on an issue in Asterisk with cdr_adaptive_odbc saying: cdr_adaptive_odbc.c:686 odbc_log: Column type -9 (field &#8216;wavve:cdr:clid&#8217;) is unsupported at this time. It would repeat this message for all my varchar columns, and of course wouldn&#8217;t insert any data, I googled every combination of everything I could think [...]]]></description>
			<content:encoded><![CDATA[<p>So I have been fighting for two days straight on an issue in Asterisk with cdr_adaptive_odbc saying:<br />
cdr_adaptive_odbc.c:686 odbc_log: Column type -9 (field &#8216;wavve:cdr:clid&#8217;) is unsupported at this time.</p>
<p>It would repeat this message for all my varchar columns, and of course wouldn&#8217;t insert any data, I googled every combination of everything I could think of and the closest I came to was this: <a href="https://issues.asterisk.org/jira/browse/ASTERISK-18278">https://issues.asterisk.org/jira/browse/ASTERISK-18278</a> Now I don&#8217;t want to talk bad about the Asterisk/Digium guys but from my experience the guys working on the ODBC part of Asterisk can kind of be short with the users. Take this blob of text for example:<br />
<span id="more-629"></span></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">; On Wednesday <span style="color: #000000;">10</span> September <span style="color: #000000;">2008</span> <span style="color: #000000;">21</span>:<span style="color: #000000;">11</span>:<span style="color: #000000;">16</span> Tilghman Lesher wrote:
;
; I thought that the sample cdr_adaptive_odbc.conf was rather <span style="color: #c20cb9; font-weight: bold;">clear</span>, but
; apparently not.</pre></div></div>

<p>I mean come on guys what value does this sentence bring to anything.</p>
<p>Anyways here is how I fixed it.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">show table status</pre></div></div>

<p>I noticed that the Collation was utf8_general_ci I had a feeling that this was wrong so I ran:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">alter table cdr CONVERT TO CHARACTER SET latin1;</pre></div></div>

<p>and bingo, after a module reload I was storing all the cdr data in MySQL</p>
<p>I Hope this saves people some time.</p>
<p>Keep on trucking and have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://tonyvirelli.com/blog/asterisk-cdr_adaptive_odbc-trouble/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Alternating Row Color with PHP!</title>
		<link>http://tonyvirelli.com/blog/simple-alternating-row-color-with-php/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=simple-alternating-row-color-with-php</link>
		<comments>http://tonyvirelli.com/blog/simple-alternating-row-color-with-php/#comments</comments>
		<pubDate>Thu, 23 Jun 2011 15:20:07 +0000</pubDate>
		<dc:creator>Tony Virelli</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[alternate]]></category>
		<category><![CDATA[alternating]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[row color]]></category>

		<guid isPermaLink="false">http://tonyvirelli.com/?p=599</guid>
		<description><![CDATA[If you have ever do table data and want to alternate the row colors here is a super simple way to do that using PHP. First you need to declare your variables. So since we are doing Alternating Colors I will use $ac as my var. &#60;?php $ac = 0; ?&#62; Then in your &#60;tr&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>If you have ever do table data and want to alternate the row colors here is a super simple way to do that using PHP.<br />
<span id="more-599"></span><br />
First you need to declare your variables. So since we are doing <span style="text-decoration: underline;">A</span>lternating <span style="text-decoration: underline;">C</span>olors I will use $ac as my var.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$ac</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Then in your &lt;tr&gt; tag it is as simple as adding this code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;tr bgcolor=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$ac</span><span style="color: #339933;">++%</span><span style="color:#800080;">2</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>?<span style="color: #0000ff;">&quot;#EBEBEB&quot;</span><span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;#FFFFFF&quot;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;</pre></div></div>

<p>Another way you could do it is to declare a class:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;tr class=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$ac</span><span style="color: #339933;">++%</span><span style="color:#800080;">2</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>?<span style="color: #0000ff;">&quot;odd&quot;</span><span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;even&quot;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://tonyvirelli.com/blog/simple-alternating-row-color-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Digg v4 &#8211; I got invite codes!</title>
		<link>http://tonyvirelli.com/blog/new-digg-v4-i-got-invite-codes/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=new-digg-v4-i-got-invite-codes</link>
		<comments>http://tonyvirelli.com/blog/new-digg-v4-i-got-invite-codes/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 02:48:25 +0000</pubDate>
		<dc:creator>Tony Virelli</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[digg]]></category>
		<category><![CDATA[invite]]></category>
		<category><![CDATA[new]]></category>

		<guid isPermaLink="false">http://tonyvirelli.com/?p=589</guid>
		<description><![CDATA[Want an invite code to the new Digg.com? Of course you do! I got 4 more invites left! I am going to post the link below and the first 4 lucky people who click the link WIN! (Sorry would have had 5 but had to give one to John!) Invite Code Link: http://new.digg.com/login/bd4e2a073cfea23691b29eb6a85be8a07 (You have [...]]]></description>
			<content:encoded><![CDATA[<p>Want an invite code to the new Digg.com? Of course you do!<br />
<span id="more-589"></span><br />
I got 4 more invites left! I am going to post the link below and the first 4 lucky people who click the link WIN! (Sorry would have had 5 but had to give one to John!)</p>
<p>Invite Code Link:<br />
http://new.digg.com/login/bd4e2a073cfea23691b29eb6a85be8a07  (You have to copy and paste it. Don&#8217;t want any bots clicking the link and wasting it!)</p>
<p>If you you get an account via my link above leave a comment to let me know!</p>
<p><!--2c77de14c55e40afb5f2e9db727629a8--></p>
]]></content:encoded>
			<wfw:commentRss>http://tonyvirelli.com/blog/new-digg-v4-i-got-invite-codes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fix ShadowBox.js In Internet Explorer 8</title>
		<link>http://tonyvirelli.com/slider/fix-shadowbox-js-in-internet-explorer-8/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=fix-shadowbox-js-in-internet-explorer-8</link>
		<comments>http://tonyvirelli.com/slider/fix-shadowbox-js-in-internet-explorer-8/#comments</comments>
		<pubDate>Tue, 25 May 2010 18:03:23 +0000</pubDate>
		<dc:creator>Tony Virelli</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[ie8]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[shadow]]></category>
		<category><![CDATA[shadowbox]]></category>

		<guid isPermaLink="false">http://tonyvirelli.com/?p=580</guid>
		<description><![CDATA[So at my office we use ShadowBox a lot. Well with the release of Internet Explorer 8 our sites that use ShadowBox no longer worked. Oh, they worked in IE6, IE7, FireFox, Chrome, Safari &#038; Opera, but not in IE8 (a.k.a. The Broken Browser!). So after some Googling around I found this tip: 1. Go [...]]]></description>
			<content:encoded><![CDATA[<p>So at my office we use <a href="http://www.shadowbox-js.com/" target="_blank">ShadowBox</a> a lot.</p>
<p>Well with the release of Internet Explorer 8 our sites that use ShadowBox no longer worked. Oh, they worked in IE6, IE7, FireFox, Chrome, Safari &#038; Opera, but not in IE8 (a.k.a. The Broken Browser!).<br />
<span id="more-580"></span><br />
So after some Googling around I found this tip:</p>
<p>1. Go to your path where skin.css is on your server: */skin/classic/<br />
2. Open skin.css and add the following lines:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#shadowbox_title</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#shadowbox_info</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>So there you have it! ShadowBox should work in IE8 for you now!</p>
]]></content:encoded>
			<wfw:commentRss>http://tonyvirelli.com/slider/fix-shadowbox-js-in-internet-explorer-8/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Make 007 Jealous With RSA Encryption</title>
		<link>http://tonyvirelli.com/slider/make-007-jealous-with-rsa-encryption/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=make-007-jealous-with-rsa-encryption</link>
		<comments>http://tonyvirelli.com/slider/make-007-jealous-with-rsa-encryption/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 22:50:17 +0000</pubDate>
		<dc:creator>John Hass</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[Encryption]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[RSA]]></category>

		<guid isPermaLink="false">http://tonyvirelli.com/?p=558</guid>
		<description><![CDATA[Make 007 Jealous Public/Private encryption is not a new thing, did you know you can use my favorite swiss army knife to send secret messages to your friends…. Scratch that, I don&#8217;t have any friends… Perl Makes this easy with a little module calls Crypt::RSA, yes RSA is under fire for security blah blah, I [...]]]></description>
			<content:encoded><![CDATA[<p>Make 007 Jealous</p>
<p>Public/Private encryption is not a new thing, did you know you can use my favorite swiss army knife to send secret messages to your friends…. Scratch that, I don&#8217;t have any friends…  Perl Makes this easy with a little module calls Crypt::RSA, yes RSA is under fire for security blah blah, I don&#8217;t care, it&#8217;s still secure, because Mr. S&#8217;s (yes it&#8217;s a dudes name) I can&#8217;t pronounce nor spell, I know it will be fairly decent, I am almost about sure Mr. S should be Dr. S, but that just sounds evil, so without further ado, public/private key encryption with perl.<br />
<span id="more-558"></span><br />
Two people in this Article Tony and John, John wants all correspondence encrypted Tony Encrypts.</p>
<p>I am on my new Mac now, so your mileage may very….</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-MCPAN</span> <span style="color: #660033;">-e</span> shell
<span style="color: #c20cb9; font-weight: bold;">install</span> Crypt::RSA</pre></div></div>

<p>it asks you about a ton of dependencies, don&#8217;t do what your high school guidance counselor told you and just say yes.</p>
<p>Create something to make the keys</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span>
<span style="color: #000000; font-weight: bold;">use</span> Crypt<span style="color: #339933;">::</span><span style="color: #006600;">RSA</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$rsa</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Crypt<span style="color: #339933;">::</span><span style="color: #006600;">RSA</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">eq</span> <span style="color: #ff0000;">&quot;--makekeys&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$public</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$private</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$rsa</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">keygen</span><span style="color: #009900;">&#40;</span> 
				Size <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">2048</span><span style="color: #339933;">,</span>
				Filename <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">&quot;keylock&quot;</span><span style="color: #339933;">,</span>
				<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066;">exit</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The start of out program generate our rsa key, keylock.private (and keep this private, no touchy no sendy) and keylock.private, send this to everyone</p>
<p>ok send the public key to tony, so he can send us a message….  Tony should create the message now</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">eq</span> <span style="color: #ff0000;">&quot;--createmessage&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #0000ff;">$key</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$message</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">#open the key</span>
	<span style="color: #0000ff;">$akey</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Crypt<span style="color: #339933;">::</span><span style="color: #006600;">RSA</span><span style="color: #339933;">::</span><span style="color: #006600;">Key</span><span style="color: #339933;">::</span><span style="color: #006600;">Public</span> <span style="color: #009900;">&#40;</span>	Filename <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">&quot;$key&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$output</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$rsa</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">encrypt</span><span style="color: #009900;">&#40;</span>Message <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">$message</span><span style="color: #339933;">,</span>Key<span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">$akey</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">||</span> <span style="color: #000066;">die</span> <span style="color: #0000ff;">$rsa</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">errstr</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066;">open</span> ENC<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;&gt;message&quot;</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #0000ff;">$!</span><span style="color: #339933;">;</span>
	<span style="color: #000066;">binmode</span> ENC<span style="color: #339933;">;</span>
	<span style="color: #000066;">print</span> ENC <span style="color: #0000ff;">$output</span><span style="color: #339933;">;</span>
	<span style="color: #000066;">exit</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>One thing that was a gotcha for me was writing the file, I forgot to tell perl to write it binary, since the encryption is all binary, we must write it so.  We now have a file called &#8220;message&#8221; if you try to edit the file, it&#8217;s all gobble gook.  Tony can now send you this message, and only you can read it, but how?</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">eq</span> <span style="color: #ff0000;">&quot;--readmessage&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #0000ff;">$key</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$message</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000066;">open</span> FILE<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;$message&quot;</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #0000ff;">$!</span><span style="color: #339933;">;</span> 
	<span style="color: #000066;">binmode</span> FILE<span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$buf</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$data</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$n</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$n</span> <span style="color: #339933;">=</span> <span style="color: #000066;">read</span> FILE<span style="color: #339933;">,</span> <span style="color: #0000ff;">$data</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #0000ff;">$buf</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">$data</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> 
	<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span>FILE<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
	<span style="color: #0000ff;">$akey</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Crypt<span style="color: #339933;">::</span><span style="color: #006600;">RSA</span><span style="color: #339933;">::</span><span style="color: #006600;">Key</span><span style="color: #339933;">::</span><span style="color: #006600;">Private</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">read</span><span style="color: #009900;">&#40;</span>Filename <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">&quot;$key&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$output</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$rsa</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">decrypt</span><span style="color: #009900;">&#40;</span>Cyphertext <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">&quot;$buf&quot;</span><span style="color: #339933;">,</span>Key <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">$akey</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">||</span> <span style="color: #000066;">die</span> <span style="color: #0000ff;">$rsa</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">errstr</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066;">print</span> <span style="color: #0000ff;">$output</span> <span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000066;">exit</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>So now we read the file &#8220;message&#8221; in using our private key, since Tony encrypted the message with our public key, we can now read it with the private key….  So how does this work?</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">John-Hasss-Mac-Pro:~ john$ .<span style="color: #000000; font-weight: bold;">/</span>keylock.pl <span style="color: #660033;">--makekeys</span>
John-Hasss-Mac-Pro:~ john$ .<span style="color: #000000; font-weight: bold;">/</span>keylock.pl <span style="color: #660033;">--createmessage</span> keylock.public <span style="color: #ff0000;">&quot;007 would be so jealous&quot;</span>
John-Hasss-Mac-Pro:~ john$ <span style="color: #c20cb9; font-weight: bold;">cat</span> message 
?????u?????מ?n???-<span style="color: #000000; font-weight: bold;">@</span>?l?Q??<span style="color: #7a0874; font-weight: bold;">&#41;</span>??~<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000;">3</span>?<span style="color: #ff0000;">&quot;h2??=,??3??݁/m?s?[?M)?F?}?|ߩJ????k;?7??i???D?\w;?U??ʬ??y7ǳ??&amp;?]pXv?-???E@&quot;</span>X?E?HH0?<span style="color: #7a0874; font-weight: bold;">&#40;</span>S?<span style="color: #ff0000;">&quot;?`?,?R??7???ϳ
  ??Ցh???촇??K??Rs??uxs;??r^΀?G?????5??W??Y???4Y??_~?(YͷӍr\űeĥr??John-Hasss-Mac-Pro:~ john$ 
John-Hasss-Mac-Pro:~ john$ 
John-Hasss-Mac-Pro:~ john$ ./keylock.pl --readmessage keylock.private message
007 would be so jealous
John-Hasss-Mac-Pro:~ john$</span></pre></div></div>

<p>Welcome to the magic of public private key encryption!</p>
<p>Have fun!</p>
<a class="downloadlink" href="http://tonyvirelli.com/downloads/keylock.zip" title=" downloaded 26 times" >keylock.zip (26)</a>
]]></content:encoded>
			<wfw:commentRss>http://tonyvirelli.com/slider/make-007-jealous-with-rsa-encryption/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Clearing Out Postfix Deferred Mail Queue</title>
		<link>http://tonyvirelli.com/slider/clearing-out-postfix-deferred-mail-queue/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=clearing-out-postfix-deferred-mail-queue</link>
		<comments>http://tonyvirelli.com/slider/clearing-out-postfix-deferred-mail-queue/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 17:06:16 +0000</pubDate>
		<dc:creator>Tony Virelli</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[mail queue]]></category>
		<category><![CDATA[mailq]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[postfix]]></category>

		<guid isPermaLink="false">http://tonyvirelli.com/?p=550</guid>
		<description><![CDATA[I had a bit of a situation with my Postfix Mail Queue. Mail stopped sending and the queue built up. When I did a mailq I found a lot of double-bounce@domain.com emails in my queue. I knew it would take forever for those to clear and get the good mail flowing again. So after doing [...]]]></description>
			<content:encoded><![CDATA[<p>I had a bit of a situation with my Postfix Mail Queue. Mail stopped sending and the queue built up. When I did a mailq I found a lot of double-bounce@domain.com emails in my queue. I knew it would take forever for those to clear and get the good mail flowing again.<br />
<span id="more-550"></span><br />
So after doing some searching on Google I found this site:<br />
<a href="http://www.cyberciti.biz/tips/howto-postfix-flush-mail-queue.html">http://www.cyberciti.biz/tips/howto-postfix-flush-mail-queue.html</a></p>
<p>It has some of the common Postfix commands, but what interested me was the Perl script to delete mailqs that matched regular expressions.</p>
<p><strong>postfix-delete.pl script</strong></p>
<p>The following script deletes all mail from the mailq which matches the regular expression specified as the first argument.</p>
<p><em>(Credit: Vivek Gite of cyberciti.biz.  His credit: Credit: ??? &#8211; I found it on old good newsgroup)</em></p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span>
&nbsp;
<span style="color: #0000ff;">$REGEXP</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span> <span style="color: #339933;">||</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;no email-adress given (regexp-style, e.g. bl.*<span style="color: #000099; font-weight: bold;">\@</span>yahoo.com)!&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">@data</span> <span style="color: #339933;">=</span> <span style="color: #000066;">qx</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@data</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/^(\w+)(\*|\!)?\s/</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #0000ff;">$queue_id</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$1</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$queue_id</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/$REGEXP/i</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #0000ff;">$Q</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$queue_id</span><span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
      <span style="color: #0000ff;">$queue_id</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#open(POSTSUPER,&quot;|cat&quot;) || die &quot;couldn't open postsuper&quot; ;</span>
<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>POSTSUPER<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;|postsuper -d -&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;couldn't open postsuper&quot;</span> <span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">keys</span> <span style="color: #0000ff;">%Q</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000066;">print</span> POSTSUPER <span style="color: #ff0000;">&quot;$_<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span>POSTSUPER<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>For example, delete all queued messages from or to the domain called double-bounce@domain.com, enter:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>postfix-delete.pl double-bounce<span style="color: #000000; font-weight: bold;">@</span>domain.com</pre></div></div>

<p>Delete all queued messages that contain the word &#8220;xyz&#8221; in the e-mail address:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>postfix-delete.pl xyz</pre></div></div>

<p>For more information about this script make sure and checkout <a href="http://www.cyberciti.biz/tips/howto-postfix-flush-mail-queue.html">http://www.cyberciti.biz/tips/howto-postfix-flush-mail-queue.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tonyvirelli.com/slider/clearing-out-postfix-deferred-mail-queue/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Where Is My Candidate</title>
		<link>http://tonyvirelli.com/portfolio/where-is-my-candidate/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=where-is-my-candidate</link>
		<comments>http://tonyvirelli.com/portfolio/where-is-my-candidate/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 07:53:28 +0000</pubDate>
		<dc:creator>Tony Virelli</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[candidate]]></category>
		<category><![CDATA[google map]]></category>
		<category><![CDATA[map]]></category>
		<category><![CDATA[politics]]></category>

		<guid isPermaLink="false">http://tonyvirelli.com/?p=546</guid>
		<description><![CDATA[Find the upcoming locations of the politicians you want to follow. I utilized the Google Maps API for this project. Visit WhereIsMyCandidate.com]]></description>
			<content:encoded><![CDATA[<p>Find the upcoming locations of the politicians you want to follow.</p>
<p>I utilized the Google Maps API for this project.</p>
<p><a href="http://whereismycandidate.com">Visit WhereIsMyCandidate.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tonyvirelli.com/portfolio/where-is-my-candidate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Conference Craze</title>
		<link>http://tonyvirelli.com/portfolio/conference-craze/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=conference-craze</link>
		<comments>http://tonyvirelli.com/portfolio/conference-craze/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 07:47:02 +0000</pubDate>
		<dc:creator>Tony Virelli</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[phone]]></category>
		<category><![CDATA[talk]]></category>
		<category><![CDATA[voice]]></category>

		<guid isPermaLink="false">http://tonyvirelli.com/?p=541</guid>
		<description><![CDATA[Conference Craze Conference Service provides you with instant unlimited automated and free conferencing calls that take place on regular telephone lines. No computer or internet access required! The conference call services are available 24/7 with no scheduling and an 800 number is available for your convenience. INSTANT, UNLIMITED, AUTOMATED, AND FREE CONFERENCING Visit ConferenceCraze.com]]></description>
			<content:encoded><![CDATA[<p>Conference Craze Conference Service provides you with instant unlimited automated and free conferencing calls that take place on regular telephone lines.</p>
<p>No computer or internet access required! The conference call services are available 24/7 with no scheduling and an 800 number is available for your convenience.</p>
<p><strong>INSTANT, UNLIMITED, AUTOMATED, AND FREE CONFERENCING</strong></p>
<p><a href="http://conferencecraze.com">Visit ConferenceCraze.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tonyvirelli.com/portfolio/conference-craze/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Improve Droid Sound Quality</title>
		<link>http://tonyvirelli.com/slider/improve-droid-sound-quality/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=improve-droid-sound-quality</link>
		<comments>http://tonyvirelli.com/slider/improve-droid-sound-quality/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 18:16:02 +0000</pubDate>
		<dc:creator>Tony Virelli</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[call quality]]></category>
		<category><![CDATA[cell phone]]></category>
		<category><![CDATA[droid]]></category>
		<category><![CDATA[mobile]]></category>

		<guid isPermaLink="false">http://tonyvirelli.com/?p=535</guid>
		<description><![CDATA[Today I got a text message from a reader wanting to know how to improve the sound quality of their droid. Here is a quick step-by-step guide to doing that. However, keep in mind that sound quality is a thing of opinion and results may very! Click the phone icon Dial ##7764726 Click the Green [...]]]></description>
			<content:encoded><![CDATA[<p>Today I got a text message from a reader wanting to know how to improve the sound quality of their droid.</p>
<p>Here is a quick step-by-step guide to doing that. However, keep in mind that sound quality is a thing of opinion and results may very!<br />
<span id="more-535"></span></p>
<ol>
<li>Click the phone icon</li>
<li>Dial ##7764726</li>
<li>Click the Green Phone Icon or Call Button</li>
<li>You will then be asked for a SPC password</li>
<li>Enter 000000  (That is 6 Zeros)</li>
<li>Then click the Verify button</li>
<li>You will then see the programming Menu</li>
<li>Select option 04 or whatever option is titled &#8220;Vocode&#8221;</li>
<li>By default the option &#8220;EVRC&#8221; should be selected</li>
<li>To &#8220;improve&#8221; call quality select &#8220;EVRC-B&#8221; and click Apply</li>
<li>Then click the back button on the phone</li>
<li>Your phone will then reboot</li>
<li>When it comes back up you are done!</li>
</ol>
<p>So now you can be the judge as to whether or not your call quality is better.</p>
<p>Be advised that this will cause your battery to drain faster&#8230; yes, even faster than it already does!</p>
]]></content:encoded>
			<wfw:commentRss>http://tonyvirelli.com/slider/improve-droid-sound-quality/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update Your Website Copyright With Some Simple PHP</title>
		<link>http://tonyvirelli.com/slider/update-your-website-copyright-with-some-simple-php/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=update-your-website-copyright-with-some-simple-php</link>
		<comments>http://tonyvirelli.com/slider/update-your-website-copyright-with-some-simple-php/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 07:00:24 +0000</pubDate>
		<dc:creator>Tony Virelli</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[copyright]]></category>
		<category><![CDATA[year]]></category>

		<guid isPermaLink="false">http://tonyvirelli.com/?p=521</guid>
		<description><![CDATA[Ok, so every year web designers have the all dreaded task of updating the copyright on their designs. This isn&#8217;t so bad if you work for 1 company, but if you work for a design firm like I do and have tons of clients websites to update it can be a time eating task. So [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, so every year web designers have the all dreaded task of updating the copyright on their designs. This isn&#8217;t so bad if you work for 1 company, but if you work for a design firm like I do and have tons of clients websites to update it can be a time eating task.<br />
<span id="more-521"></span><br />
So to fix this problem I wrote this super small, super easy bit of code. It&#8217;s nothing special, but it gets the job done.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$startYear</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">2010</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Enter the starting year of the copyright.</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$startYear</span> <span style="color: #339933;">&lt;</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Y&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$startYear</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Y&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$startYear</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>And for the function lovers</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">function</span> updateCopyright<span style="color: #009900;">&#40;</span><span style="color: #000088;">$startYear</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$startYear</span> <span style="color: #339933;">&lt;</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Y&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$startYear</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Y&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$startYear</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
//Usage: Copyright &amp;copy; <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> updateCopyright<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">2010</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> Company Name</pre></div></div>

<p>There ya go!</p>
<p>Isn&#8217;t making your life easier fun!? I sure think so!</p>
]]></content:encoded>
			<wfw:commentRss>http://tonyvirelli.com/slider/update-your-website-copyright-with-some-simple-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

