<?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&#187; John Hass</title>
	<atom:link href="http://tonyvirelli.com/author/john8675309/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>2</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 34 times" >keylock.zip (34)</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>Using NMAP To Detect Server Type</title>
		<link>http://tonyvirelli.com/slider/using-nmap-to-detect-server-type/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=using-nmap-to-detect-server-type</link>
		<comments>http://tonyvirelli.com/slider/using-nmap-to-detect-server-type/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 14:33:55 +0000</pubDate>
		<dc:creator>John Hass</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[evil]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[msrpc]]></category>
		<category><![CDATA[nmap]]></category>
		<category><![CDATA[Service Pack 2]]></category>
		<category><![CDATA[smb]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://tonyvirelli.com/?p=295</guid>
		<description><![CDATA[When you talk power utilities on any *nix it&#8217;s hard to skip nmap. Ever since it&#8217;s introduction nmap has been used for good and evil. If you&#8217;ve ever had a server hacked chances are they used nmap or some sort of nmap code to get the job done. Just how easy is it to detect [...]]]></description>
			<content:encoded><![CDATA[<p>When you talk power utilities on any *nix it&#8217;s hard to skip nmap. Ever since it&#8217;s introduction nmap has been used for good and evil. If you&#8217;ve ever had a server hacked chances are they used nmap or some sort of nmap code to get the job done.  Just how easy is it to detect the server type from nmap? Try my windows 2003 server (I know kick me in the nuts and call me sally).<br />
<span id="more-295"></span></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nmap</span> <span style="color: #660033;">-A</span> <span style="color: #660033;">-T4</span> 192.168.10.1</pre></div></div>

<p>it took over a minute to get the results, but here is what I got.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Starting Nmap <span style="color: #000000;">5.00</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span> http:<span style="color: #000000; font-weight: bold;">//</span>nmap.org <span style="color: #7a0874; font-weight: bold;">&#41;</span> at <span style="color: #000000;">2009</span>-<span style="color: #000000;">12</span>-<span style="color: #000000;">15</span> <span style="color: #000000;">15</span>:<span style="color: #000000;">42</span> CST
Interesting ports on server1.local.example.com <span style="color: #7a0874; font-weight: bold;">&#40;</span>192.168.10.1<span style="color: #7a0874; font-weight: bold;">&#41;</span>:
Not shown: <span style="color: #000000;">963</span> closed ports
PORT      STATE SERVICE       VERSION
<span style="color: #000000;">21</span><span style="color: #000000; font-weight: bold;">/</span>tcp    open  <span style="color: #c20cb9; font-weight: bold;">ftp</span>           Microsoft ftpd
<span style="color: #000000;">25</span><span style="color: #000000; font-weight: bold;">/</span>tcp    open  smtp          Microsoft ESMTP 6.0.3790.3959
<span style="color: #000000; font-weight: bold;">|</span>  smtp-commands: EHLO example.com Hello <span style="color: #7a0874; font-weight: bold;">&#91;</span>192.168.10.34<span style="color: #7a0874; font-weight: bold;">&#93;</span>, TURN, SIZE, ETRN, PIPELINING, DSN, ENHANCEDSTATUSCODES, 8bitmime, BINARYMIME, CHUNKING, VRFY, X-EXPS GSSAPI NTLM LOGIN, X-EXPS=LOGIN, AUTH GSSAPI NTLM LOGIN, <span style="color: #007800;">AUTH</span>=LOGIN, X-LINK2STATE, XEXCH50
<span style="color: #000000; font-weight: bold;">|</span>_ HELP This server supports the following commands: HELO EHLO STARTTLS RCPT DATA RSET MAIL QUIT HELP AUTH TURN ETRN BDAT VRFY
<span style="color: #000000;">80</span><span style="color: #000000; font-weight: bold;">/</span>tcp    open  http          Microsoft IIS webserver <span style="color: #000000;">6.0</span>
<span style="color: #000000; font-weight: bold;">|</span>_ html-title: Under Construction
<span style="color: #000000;">110</span><span style="color: #000000; font-weight: bold;">/</span>tcp   open  pop3          MS Exchange <span style="color: #000000;">2003</span> pop3d 6.5.7638.1
<span style="color: #000000; font-weight: bold;">|</span>_ pop3-capabilities: USER EXPIRE<span style="color: #7a0874; font-weight: bold;">&#40;</span>NEVER<span style="color: #7a0874; font-weight: bold;">&#41;</span> UIDL PIPELINING TOP SASL<span style="color: #7a0874; font-weight: bold;">&#40;</span>NTLM<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000;">135</span><span style="color: #000000; font-weight: bold;">/</span>tcp   open  msrpc         Microsoft Windows RPC
<span style="color: #000000;">139</span><span style="color: #000000; font-weight: bold;">/</span>tcp   open  netbios-ssn
<span style="color: #000000;">143</span><span style="color: #000000; font-weight: bold;">/</span>tcp   open  imap          Microsoft Exchange Server <span style="color: #000000;">2003</span> imapd 6.5.7638.1
<span style="color: #000000; font-weight: bold;">|</span>_ imap-capabilities: LOGIN-REFERRALS IMAP4 <span style="color: #007800;">AUTH</span>=NTLM IMAP4rev1 MAILBOX-REFERRALS UIDPLUS LITERAL+ IDLE NAMESPACE CHILDREN
<span style="color: #000000;">445</span><span style="color: #000000; font-weight: bold;">/</span>tcp   open  microsoft-ds  Microsoft Windows <span style="color: #000000;">2003</span> microsoft-ds
<span style="color: #000000;">593</span><span style="color: #000000; font-weight: bold;">/</span>tcp   open  ncacn_http    Microsoft Windows RPC over HTTP <span style="color: #000000;">1.0</span>
<span style="color: #000000;">691</span><span style="color: #000000; font-weight: bold;">/</span>tcp   open  resvc         Microsoft Exchange routing server 6.5.7638.138.1
<span style="color: #000000;">993</span><span style="color: #000000; font-weight: bold;">/</span>tcp   open  tcpwrapped
<span style="color: #000000;">995</span><span style="color: #000000; font-weight: bold;">/</span>tcp   open  tcpwrapped
<span style="color: #000000;">1037</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  msrpc         Microsoft Windows RPC
<span style="color: #000000;">1073</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  msrpc         Microsoft Windows RPC
<span style="color: #000000;">1074</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  msrpc         Microsoft Windows RPC
<span style="color: #000000;">1076</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  msrpc         Microsoft Windows RPC
<span style="color: #000000;">1088</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  msrpc         Microsoft Windows RPC
<span style="color: #000000;">1089</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  msrpc         Microsoft Windows RPC
<span style="color: #000000;">1137</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  msrpc         Microsoft Windows RPC
<span style="color: #000000;">1801</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  unknown
<span style="color: #000000;">2103</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  msrpc         Microsoft Windows RPC
<span style="color: #000000;">2105</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  msrpc         Microsoft Windows RPC
<span style="color: #000000;">2107</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  msrpc         Microsoft Windows RPC
<span style="color: #000000;">3389</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  microsoft-rdp Microsoft Terminal Service
<span style="color: #000000;">4343</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  ssl<span style="color: #000000; font-weight: bold;">/</span>http      Microsoft IIS webserver <span style="color: #000000;">6.0</span>
<span style="color: #000000; font-weight: bold;">|</span>_ sslv2: server still supports SSLv2
<span style="color: #000000; font-weight: bold;">|</span>  http-auth: HTTP Service requires authentication
<span style="color: #000000; font-weight: bold;">|</span>    Auth <span style="color: #7a0874; font-weight: bold;">type</span>: Negotiate
<span style="color: #000000; font-weight: bold;">|</span>_   Auth <span style="color: #7a0874; font-weight: bold;">type</span>: NTLM
<span style="color: #000000; font-weight: bold;">|</span>_ html-title: You are not authorized to view this page
<span style="color: #000000;">5900</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  vnc           VNC <span style="color: #7a0874; font-weight: bold;">&#40;</span>protocol <span style="color: #000000;">3.8</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000;">6001</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  ncacn_http    Microsoft Windows RPC over HTTP <span style="color: #000000;">1.0</span>
<span style="color: #000000;">6002</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  ncacn_http    Microsoft Windows RPC over HTTP <span style="color: #000000;">1.0</span>
<span style="color: #000000;">6004</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  ncacn_http    Microsoft Windows RPC over HTTP <span style="color: #000000;">1.0</span>
<span style="color: #000000;">8080</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  http          Microsoft IIS webserver <span style="color: #000000;">6.0</span>
<span style="color: #000000; font-weight: bold;">|</span>  http-auth: HTTP Service requires authentication
<span style="color: #000000; font-weight: bold;">|</span>    Auth <span style="color: #7a0874; font-weight: bold;">type</span>: Negotiate
<span style="color: #000000; font-weight: bold;">|</span>_   Auth <span style="color: #7a0874; font-weight: bold;">type</span>: NTLM
<span style="color: #000000; font-weight: bold;">|</span>_ html-title: You are not authorized to view this page
<span style="color: #000000;">8181</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  http          Apache Tomcat<span style="color: #000000; font-weight: bold;">/</span>Coyote JSP engine <span style="color: #000000;">1.1</span>
<span style="color: #000000; font-weight: bold;">|</span>_ html-title: Site doesn<span style="color: #ff0000;">'t have a title (text/html).
8443/tcp  open  ssl/http      Apache Tomcat/Coyote JSP engine 1.1
|_ html-title: Site doesn'</span>t have a title <span style="color: #7a0874; font-weight: bold;">&#40;</span>text<span style="color: #000000; font-weight: bold;">/</span>html<span style="color: #7a0874; font-weight: bold;">&#41;</span>.
<span style="color: #000000;">9000</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  http          Veritas backup <span style="color: #7a0874; font-weight: bold;">exec</span> continuous protection httpd
<span style="color: #000000; font-weight: bold;">|</span>_ html-title: Site doesn<span style="color: #ff0000;">'t have a title (text/xml).
9001/tcp  open  http          Veritas backup exec continuous protection httpd
|_ html-title: Site doesn'</span>t have a title <span style="color: #7a0874; font-weight: bold;">&#40;</span>text<span style="color: #000000; font-weight: bold;">/</span>plain<span style="color: #7a0874; font-weight: bold;">&#41;</span>.
<span style="color: #000000;">9002</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  http          Veritas backup <span style="color: #7a0874; font-weight: bold;">exec</span> continuous protection httpd <span style="color: #7a0874; font-weight: bold;">&#40;</span>unauthorized<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">|</span>_ html-title: Site doesn<span style="color: #ff0000;">'t have a title (text/html).
9003/tcp  open  http          Veritas backup exec continuous protection httpd (unauthorized)
|_ html-title: Site doesn'</span>t have a title <span style="color: #7a0874; font-weight: bold;">&#40;</span>text<span style="color: #000000; font-weight: bold;">/</span>plain<span style="color: #7a0874; font-weight: bold;">&#41;</span>.
<span style="color: #000000;">10000</span><span style="color: #000000; font-weight: bold;">/</span>tcp open  backupexec    Veritas Backup Exec <span style="color: #000000;">9.0</span>
Service Info: OS: Windows
Host script results:
<span style="color: #000000; font-weight: bold;">|</span>  smb-os-discovery: Windows Server <span style="color: #000000;">2003</span> <span style="color: #000000;">3790</span> Service Pack <span style="color: #000000;">2</span>
<span style="color: #000000; font-weight: bold;">|</span>  LAN Manager: Windows Server <span style="color: #000000;">2003</span> <span style="color: #000000;">5.2</span>
<span style="color: #000000; font-weight: bold;">|</span>  Name: example\SERVER1
<span style="color: #000000; font-weight: bold;">|</span>_ System <span style="color: #000000; font-weight: bold;">time</span>: <span style="color: #000000;">2009</span>-<span style="color: #000000;">12</span>-<span style="color: #000000;">15</span> <span style="color: #000000;">15</span>:<span style="color: #000000;">38</span>:06 UTC-<span style="color: #000000;">6</span>
<span style="color: #000000; font-weight: bold;">|</span>_ nbstat: NetBIOS name: SERVER1, NetBIOS user: , NetBIOS MAC: 00:<span style="color: #000000;">11</span>:<span style="color: #000000;">43</span>:e3:d5:f2
Service detection performed. Please report any incorrect results at http:<span style="color: #000000; font-weight: bold;">//</span>nmap.org<span style="color: #000000; font-weight: bold;">/</span>submit<span style="color: #000000; font-weight: bold;">/</span> .
Nmap <span style="color: #000000; font-weight: bold;">done</span>: <span style="color: #000000;">1</span> IP address <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1</span> host up<span style="color: #7a0874; font-weight: bold;">&#41;</span> scanned <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000;">68.23</span> seconds</pre></div></div>

<p>Surely this can&#8217;t work in Windows Server 2008?</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Starting Nmap <span style="color: #000000;">5.00</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span> http:<span style="color: #000000; font-weight: bold;">//</span>nmap.org <span style="color: #7a0874; font-weight: bold;">&#41;</span> at <span style="color: #000000;">2009</span>-<span style="color: #000000;">12</span>-<span style="color: #000000;">15</span> <span style="color: #000000;">15</span>:<span style="color: #000000;">47</span> CST
Interesting ports on server.local.example.com <span style="color: #7a0874; font-weight: bold;">&#40;</span>192.168.10.5<span style="color: #7a0874; font-weight: bold;">&#41;</span>:
Not shown: <span style="color: #000000;">970</span> closed ports
PORT     STATE SERVICE       VERSION
<span style="color: #000000;">25</span><span style="color: #000000; font-weight: bold;">/</span>tcp   open  smtp          Microsoft ESMTP
<span style="color: #000000; font-weight: bold;">|</span>  smtp-commands: EHLO exchange.example.com Hello <span style="color: #7a0874; font-weight: bold;">&#91;</span>192.168.10.34<span style="color: #7a0874; font-weight: bold;">&#93;</span>, SIZE <span style="color: #000000;">41943040</span>, PIPELINING, DSN, ENHANCEDSTATUSCODES, AUTH, 8BITMIME, BINARYMIME, CHUNKING, XEXCH50
<span style="color: #000000; font-weight: bold;">|</span>_ HELP This server supports the following commands: HELO EHLO STARTTLS RCPT DATA RSET MAIL QUIT HELP AUTH BDAT
<span style="color: #000000;">80</span><span style="color: #000000; font-weight: bold;">/</span>tcp   open  http          Microsoft IIS webserver <span style="color: #000000;">7.0</span>
<span style="color: #000000; font-weight: bold;">|</span>_ html-title: <span style="color: #000000;">403</span> - Forbidden: Access is denied.
<span style="color: #000000;">88</span><span style="color: #000000; font-weight: bold;">/</span>tcp   open  kerberos-sec  Microsoft Windows kerberos-sec
<span style="color: #000000;">110</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  pop3          MS Exchange <span style="color: #000000;">2007</span> pop3d
<span style="color: #000000; font-weight: bold;">|</span>_ pop3-capabilities: USER SASL<span style="color: #7a0874; font-weight: bold;">&#40;</span>NTLM GSSAPI PLAIN<span style="color: #7a0874; font-weight: bold;">&#41;</span> TOP UIDL
<span style="color: #000000;">135</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  msrpc         Microsoft Windows RPC
<span style="color: #000000;">139</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  netbios-ssn
<span style="color: #000000;">143</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  imap          Microsoft Exchange <span style="color: #000000;">2007</span> imapd
<span style="color: #000000; font-weight: bold;">|</span>_ imap-capabilities: IMAP4rev1 <span style="color: #007800;">AUTH</span>=GSSAPI LITERAL+ IMAP4 <span style="color: #007800;">AUTH</span>=NTLM <span style="color: #007800;">AUTH</span>=PLAIN NAMESPACE IDLE
<span style="color: #000000;">389</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  ldap
<span style="color: #000000;">443</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  ssl<span style="color: #000000; font-weight: bold;">/</span>http      Microsoft IIS webserver <span style="color: #000000;">7.0</span>
<span style="color: #000000; font-weight: bold;">|</span>_ sslv2: server still supports SSLv2
<span style="color: #000000; font-weight: bold;">|</span>_ html-title: IIS7
<span style="color: #000000;">445</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  microsoft-ds  Microsoft Windows <span style="color: #000000;">2003</span> microsoft-ds
<span style="color: #000000;">464</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  kpasswd5?
<span style="color: #000000;">587</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  smtp          Microsoft ESMTP
<span style="color: #000000; font-weight: bold;">|</span>  smtp-commands: EHLO exchange.example.com Hello <span style="color: #7a0874; font-weight: bold;">&#91;</span>192.168.10.34<span style="color: #7a0874; font-weight: bold;">&#93;</span>, SIZE <span style="color: #000000;">41943040</span>, PIPELINING, DSN, ENHANCEDSTATUSCODES, AUTH GSSAPI NTLM, 8BITMIME, BINARYMIME, CHUNKING
<span style="color: #000000; font-weight: bold;">|</span>_ HELP This server supports the following commands: HELO EHLO STARTTLS RCPT DATA RSET MAIL QUIT HELP AUTH BDAT
<span style="color: #000000;">593</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  ncacn_http    Microsoft Windows RPC over HTTP <span style="color: #000000;">1.0</span>
<span style="color: #000000;">636</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  tcpwrapped
<span style="color: #000000;">993</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  imaps?
<span style="color: #000000;">995</span><span style="color: #000000; font-weight: bold;">/</span>tcp  open  pop3s?
<span style="color: #000000;">1025</span><span style="color: #000000; font-weight: bold;">/</span>tcp open  msrpc         Microsoft Windows RPC
<span style="color: #000000;">1026</span><span style="color: #000000; font-weight: bold;">/</span>tcp open  msrpc         Microsoft Windows RPC
<span style="color: #000000;">1027</span><span style="color: #000000; font-weight: bold;">/</span>tcp open  msrpc         Microsoft Windows RPC
<span style="color: #000000;">1029</span><span style="color: #000000; font-weight: bold;">/</span>tcp open  msrpc         Microsoft Windows RPC
<span style="color: #000000;">1030</span><span style="color: #000000; font-weight: bold;">/</span>tcp open  ncacn_http    Microsoft Windows RPC over HTTP <span style="color: #000000;">1.0</span>
<span style="color: #000000;">1031</span><span style="color: #000000; font-weight: bold;">/</span>tcp open  msrpc         Microsoft Windows RPC
<span style="color: #000000;">1048</span><span style="color: #000000; font-weight: bold;">/</span>tcp open  msrpc         Microsoft Windows RPC
<span style="color: #000000;">3268</span><span style="color: #000000; font-weight: bold;">/</span>tcp open  ldap
<span style="color: #000000;">3269</span><span style="color: #000000; font-weight: bold;">/</span>tcp open  tcpwrapped
<span style="color: #000000;">3389</span><span style="color: #000000; font-weight: bold;">/</span>tcp open  microsoft-rdp Microsoft Terminal Service
<span style="color: #000000;">6001</span><span style="color: #000000; font-weight: bold;">/</span>tcp open  ncacn_http    Microsoft Windows RPC over HTTP <span style="color: #000000;">1.0</span>
<span style="color: #000000;">6002</span><span style="color: #000000; font-weight: bold;">/</span>tcp open  ncacn_http    Microsoft Windows RPC over HTTP <span style="color: #000000;">1.0</span>
<span style="color: #000000;">6004</span><span style="color: #000000; font-weight: bold;">/</span>tcp open  ncacn_http    Microsoft Windows RPC over HTTP <span style="color: #000000;">1.0</span>
<span style="color: #000000;">2</span> services unrecognized despite returning data. If you know the service<span style="color: #000000; font-weight: bold;">/</span>version, please submit the following fingerprints at http:<span style="color: #000000; font-weight: bold;">//</span>www.insecure.org<span style="color: #000000; font-weight: bold;">/</span>cgi-bin<span style="color: #000000; font-weight: bold;">/</span>servicefp-submit.cgi :
==============NEXT SERVICE FINGERPRINT <span style="color: #7a0874; font-weight: bold;">&#40;</span>SUBMIT INDIVIDUALLY<span style="color: #7a0874; font-weight: bold;">&#41;</span>==============
SF-Port993-TCP:<span style="color: #007800;">V</span>=<span style="color: #000000;">5.00</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #007800;">I</span>=<span style="color: #000000;">7</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #007800;">D</span>=<span style="color: #000000;">12</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">15</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #007800;">Time</span>=4B2803DB<span style="color: #000000; font-weight: bold;">%</span><span style="color: #007800;">P</span>=x86_64-unknown-linux-gnu
SF:<span style="color: #000000; font-weight: bold;">%</span>r<span style="color: #7a0874; font-weight: bold;">&#40;</span>NULL,<span style="color: #000000;">20</span>,<span style="color: #ff0000;">&quot;\*\x20BYE\x20Connection\x20is\x20closed\.\x2014<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
==============NEXT SERVICE FINGERPRINT <span style="color: #7a0874; font-weight: bold;">&#40;</span>SUBMIT INDIVIDUALLY<span style="color: #7a0874; font-weight: bold;">&#41;</span>==============
SF-Port995-TCP:<span style="color: #007800;">V</span>=<span style="color: #000000;">5.00</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #007800;">I</span>=<span style="color: #000000;">7</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #007800;">D</span>=<span style="color: #000000;">12</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">15</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #007800;">Time</span>=4B2803DB<span style="color: #000000; font-weight: bold;">%</span><span style="color: #007800;">P</span>=x86_64-unknown-linux-gnu
SF:<span style="color: #000000; font-weight: bold;">%</span>r<span style="color: #7a0874; font-weight: bold;">&#40;</span>NULL,1F,<span style="color: #ff0000;">&quot;-ERR\x20Connection\x20is\x20closed\.\x2013<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
Service Info: Host: exchange.example.com; OS: Windows
Host script results:
<span style="color: #000000; font-weight: bold;">|</span>_ nbstat: NetBIOS name: SERVER, NetBIOS user: , NetBIOS MAC: 00:<span style="color: #000000;">22</span>:<span style="color: #000000;">19</span>:<span style="color: #000000;">54</span>:ea:4d
<span style="color: #000000; font-weight: bold;">|</span>  smb-os-discovery: Windows Server <span style="color: #7a0874; font-weight: bold;">&#40;</span>R<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">2008</span> Standard <span style="color: #000000;">6001</span> Service Pack <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">|</span>  LAN Manager: Windows Server <span style="color: #7a0874; font-weight: bold;">&#40;</span>R<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">2008</span> Standard <span style="color: #000000;">6.0</span>
<span style="color: #000000; font-weight: bold;">|</span>  Name: example\SERVER
<span style="color: #000000; font-weight: bold;">|</span>_ System <span style="color: #000000; font-weight: bold;">time</span>: <span style="color: #000000;">2009</span>-<span style="color: #000000;">12</span>-<span style="color: #000000;">15</span> <span style="color: #000000;">15</span>:<span style="color: #000000;">42</span>:<span style="color: #000000;">39</span> UTC-<span style="color: #000000;">6</span></pre></div></div>

<p>And Next time, don&#8217;t call me Shirley!</p>
<p>Now I am sure Linux is immune to this though!</p>
<p>Now I don&#8217;t want to brag, but all the linux servers first responded with</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Starting Nmap <span style="color: #000000;">5.00</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span> http:<span style="color: #000000; font-weight: bold;">//</span>nmap.org <span style="color: #7a0874; font-weight: bold;">&#41;</span> at <span style="color: #000000;">2009</span>-<span style="color: #000000;">12</span>-<span style="color: #000000;">15</span> <span style="color: #000000;">15</span>:<span style="color: #000000;">53</span> CST
All <span style="color: #000000;">1000</span> scanned ports on 192.168.10.20 are filtered
Service detection performed. Please report any incorrect results at http:<span style="color: #000000; font-weight: bold;">//</span>nmap.org<span style="color: #000000; font-weight: bold;">/</span>submit<span style="color: #000000; font-weight: bold;">/</span> .
Nmap <span style="color: #000000; font-weight: bold;">done</span>: <span style="color: #000000;">1</span> IP address <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1</span> host up<span style="color: #7a0874; font-weight: bold;">&#41;</span> scanned <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000;">32.04</span> seconds</pre></div></div>

<p>This was from default Ubuntu installs, eventually I did a scan on our webserver</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;">Starting Nmap <span style="color: #cc66cc;">5.00</span> <span style="color: #009900;">&#40;</span> http<span style="color: #339933;">://</span>nmap<span style="color: #339933;">.</span>org <span style="color: #009900;">&#41;</span> at <span style="color: #cc66cc;">2009</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">12</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">15</span> <span style="color: #cc66cc;">15</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">54</span> CST
Interesting ports on mail<span style="color: #339933;">.</span>sipmeeting<span style="color: #339933;">.</span>com <span style="color: #009900;">&#40;</span>example<span style="color: #339933;">.</span>com<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>
Not shown<span style="color: #339933;">:</span> <span style="color: #cc66cc;">988</span> closed ports
PORT     STATE SERVICE   VERSION
<span style="color: #cc66cc;">21</span><span style="color: #339933;">/</span>tcp   <span style="color: #000066;">open</span>  ftp       ProFTPD 1<span style="color: #339933;">.</span>3<span style="color: #339933;">.</span>0a
<span style="color: #cc66cc;">22</span><span style="color: #339933;">/</span>tcp   <span style="color: #000066;">open</span>  ssh       OpenSSH <span style="color: #cc66cc;">4.6</span> <span style="color: #009900;">&#40;</span>protocol <span style="color: #cc66cc;">1.99</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">|</span>_ sshv1<span style="color: #339933;">:</span> Server supports SSHv1
<span style="color: #339933;">|</span>  ssh<span style="color: #339933;">-</span>hostkey<span style="color: #339933;">:</span> <span style="color: #cc66cc;">2048</span> da<span style="color: #339933;">:</span>5e<span style="color: #339933;">:</span>f2<span style="color: #339933;">:</span>1e<span style="color: #339933;">:</span><span style="color: #cc66cc;">63</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">47</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">14</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">29</span><span style="color: #339933;">:</span>bd<span style="color: #339933;">:</span>f9<span style="color: #339933;">:</span>e3<span style="color: #339933;">:</span>ca<span style="color: #339933;">:</span>aa<span style="color: #339933;">:</span>4e<span style="color: #339933;">:</span>2b<span style="color: #339933;">:</span><span style="color: #cc66cc;">20</span> <span style="color: #009900;">&#40;</span>RSA1<span style="color: #009900;">&#41;</span>
<span style="color: #339933;">|</span>  <span style="color: #cc66cc;">1024</span> 4a<span style="color: #339933;">:</span>6d<span style="color: #339933;">:</span>a3<span style="color: #339933;">:</span><span style="color: #cc66cc;">75</span><span style="color: #339933;">:</span>d9<span style="color: #339933;">:</span>8d<span style="color: #339933;">:</span>c8<span style="color: #339933;">:</span>dc<span style="color: #339933;">:</span><span style="color: #cc66cc;">32</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">82</span><span style="color: #339933;">:</span>6d<span style="color: #339933;">:</span><span style="color: #cc66cc;">81</span><span style="color: #339933;">:</span>d8<span style="color: #339933;">:</span><span style="color: #cc66cc;">39</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">81</span><span style="color: #339933;">:</span>d4 <span style="color: #009900;">&#40;</span>DSA<span style="color: #009900;">&#41;</span>
<span style="color: #339933;">|</span>_ <span style="color: #cc66cc;">2048</span> <span style="color: #cc66cc;">92</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">90</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">42</span><span style="color: #339933;">:</span>06<span style="color: #339933;">:</span><span style="color: #cc66cc;">61</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">70</span><span style="color: #339933;">:</span>f8<span style="color: #339933;">:</span>a0<span style="color: #339933;">:</span><span style="color: #cc66cc;">38</span><span style="color: #339933;">:</span>f6<span style="color: #339933;">:</span>2c<span style="color: #339933;">:</span><span style="color: #cc66cc;">54</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">27</span><span style="color: #339933;">:</span>b2<span style="color: #339933;">:</span>2b<span style="color: #339933;">:</span>a8 <span style="color: #009900;">&#40;</span>RSA<span style="color: #009900;">&#41;</span>
<span style="color: #cc66cc;">25</span><span style="color: #339933;">/</span>tcp   <span style="color: #000066;">open</span>  smtp      Sendmail 8<span style="color: #339933;">.</span>14<span style="color: #339933;">.</span>1<span style="color: #339933;">/</span>8<span style="color: #339933;">.</span>14<span style="color: #339933;">.</span>1
<span style="color: #339933;">|</span>  smtp<span style="color: #339933;">-</span>commands<span style="color: #339933;">:</span> EHLO mail<span style="color: #339933;">.</span>example<span style="color: #339933;">.</span>com Hello <span style="color: #009900;">&#91;</span>1<span style="color: #339933;">.</span>1<span style="color: #339933;">.</span>1<span style="color: #339933;">.</span>1<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> pleased to meet you<span style="color: #339933;">,</span> ENHANCEDSTATUSCODES<span style="color: #339933;">,</span> PIPELINING<span style="color: #339933;">,</span> 8BITMIME<span style="color: #339933;">,</span> SIZE<span style="color: #339933;">,</span> DSN<span style="color: #339933;">,</span> ETRN<span style="color: #339933;">,</span> AUTH DIGEST<span style="color: #339933;">-</span>MD5 CRAM<span style="color: #339933;">-</span>MD5<span style="color: #339933;">,</span> DELIVERBY<span style="color: #339933;">,</span> HELP
<span style="color: #339933;">|</span>_ HELP 2<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>0 This is sendmail version 8<span style="color: #339933;">.</span>14<span style="color: #339933;">.</span>1 2<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>0 Topics<span style="color: #339933;">:</span> 2<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>0 HELO EHLO MAIL RCPT DATA 2<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>0 RSET NOOP QUIT HELP VRFY 2<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>0 EXPN VERB ETRN DSN AUTH 2<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>0 STARTTLS 2<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>0 For more info <span style="color: #000000; font-weight: bold;">use</span> <span style="color: #ff0000;">&quot;HELP &quot;</span><span style="color: #339933;">.</span> 2<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>0 To report bugs in the implementation see 2<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>0 http<span style="color: #339933;">://</span>www<span style="color: #339933;">.</span>sendmail<span style="color: #339933;">.</span>org<span style="color: #339933;">/</span>email<span style="color: #339933;">-</span>addresses<span style="color: #339933;">.</span>html 2<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>0 For <span style="color: #000066;">local</span> information <span style="color: #000066;">send</span> email to Postmaster at your site<span style="color: #339933;">.</span> 2<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>0 End of HELP info
<span style="color: #cc66cc;">37</span><span style="color: #339933;">/</span>tcp   <span style="color: #000066;">open</span>  <span style="color: #000066;">time</span>      <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">32</span> bits<span style="color: #009900;">&#41;</span>
<span style="color: #cc66cc;">80</span><span style="color: #339933;">/</span>tcp   <span style="color: #000066;">open</span>  http      Apache httpd 2<span style="color: #339933;">.</span>2<span style="color: #339933;">.</span>4 <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>Unix<span style="color: #009900;">&#41;</span> DAV<span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span> PHP<span style="color: #339933;">/</span>5<span style="color: #339933;">.</span>2<span style="color: #339933;">.</span>4<span style="color: #009900;">&#41;</span>
<span style="color: #339933;">|</span>  html<span style="color: #339933;">-</span>title<span style="color: #339933;">:</span> Online Global Resource
<span style="color: #339933;">|</span>_ Requested resource was http<span style="color: #339933;">://</span>example<span style="color: #339933;">.</span>com<span style="color: #339933;">/</span>src<span style="color: #339933;">/</span>login<span style="color: #339933;">.</span>php
<span style="color: #cc66cc;">110</span><span style="color: #339933;">/</span>tcp  <span style="color: #000066;">open</span>  pop3      Openwall popa3d
<span style="color: #339933;">|</span>_ pop3<span style="color: #339933;">-</span>capabilities<span style="color: #339933;">:</span> capa
<span style="color: #cc66cc;">111</span><span style="color: #339933;">/</span>tcp  <span style="color: #000066;">open</span>  rpcbind
<span style="color: #339933;">|</span>  rpcinfo<span style="color: #339933;">:</span>
<span style="color: #339933;">|</span>  <span style="color: #cc66cc;">100000</span>  <span style="color: #cc66cc;">2</span>        <span style="color: #cc66cc;">111</span><span style="color: #339933;">/</span>udp  rpcbind
<span style="color: #339933;">|</span>  <span style="color: #cc66cc;">100011</span>  <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span>      <span style="color: #cc66cc;">929</span><span style="color: #339933;">/</span>udp  rquotad
<span style="color: #339933;">|</span>  <span style="color: #cc66cc;">100003</span>  <span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">3</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">4</span>   <span style="color: #cc66cc;">2049</span><span style="color: #339933;">/</span>udp  nfs
<span style="color: #339933;">|</span>  <span style="color: #cc66cc;">100024</span>  <span style="color: #cc66cc;">1</span>      <span style="color: #cc66cc;">55627</span><span style="color: #339933;">/</span>udp  status
<span style="color: #339933;">|</span>  <span style="color: #cc66cc;">100021</span>  <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">3</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">4</span>  <span style="color: #cc66cc;">55629</span><span style="color: #339933;">/</span>udp  nlockmgr
<span style="color: #339933;">|</span>  <span style="color: #cc66cc;">100005</span>  <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">3</span>  <span style="color: #cc66cc;">55630</span><span style="color: #339933;">/</span>udp  mountd
<span style="color: #339933;">|</span>  <span style="color: #cc66cc;">100000</span>  <span style="color: #cc66cc;">2</span>        <span style="color: #cc66cc;">111</span><span style="color: #339933;">/</span>tcp  rpcbind
<span style="color: #339933;">|</span>  <span style="color: #cc66cc;">100011</span>  <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span>      <span style="color: #cc66cc;">932</span><span style="color: #339933;">/</span>tcp  rquotad
<span style="color: #339933;">|</span>  <span style="color: #cc66cc;">100003</span>  <span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">3</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">4</span>   <span style="color: #cc66cc;">2049</span><span style="color: #339933;">/</span>tcp  nfs
<span style="color: #339933;">|</span>  <span style="color: #cc66cc;">100024</span>  <span style="color: #cc66cc;">1</span>      <span style="color: #cc66cc;">50902</span><span style="color: #339933;">/</span>tcp  status
<span style="color: #339933;">|</span>  <span style="color: #cc66cc;">100021</span>  <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">3</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">4</span>  <span style="color: #cc66cc;">51522</span><span style="color: #339933;">/</span>tcp  nlockmgr
<span style="color: #339933;">|</span>_ <span style="color: #cc66cc;">100005</span>  <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">3</span>  <span style="color: #cc66cc;">60993</span><span style="color: #339933;">/</span>tcp  mountd
<span style="color: #cc66cc;">143</span><span style="color: #339933;">/</span>tcp  <span style="color: #000066;">open</span>  imap      UW imapd <span style="color: #cc66cc;">2004.357</span>
<span style="color: #339933;">|</span>_ imap<span style="color: #339933;">-</span>capabilities<span style="color: #339933;">:</span> BINARY THREAD<span style="color: #339933;">=</span>ORDEREDSUBJECT IMAP4REV1 STARTTLS LOGIN<span style="color: #339933;">-</span>REFERRALS UNSELECT SCAN SASL<span style="color: #339933;">-</span>IR THREAD<span style="color: #339933;">=</span>REFERENCES MAILBOX<span style="color: #339933;">-</span>REFERRALS SORT AUTH<span style="color: #339933;">=</span>LOGIN LITERAL<span style="color: #339933;">+</span> IDLE NAMESPACE MULTIAPPEND
<span style="color: #cc66cc;">587</span><span style="color: #339933;">/</span>tcp  <span style="color: #000066;">open</span>  smtp      Sendmail 8<span style="color: #339933;">.</span>14<span style="color: #339933;">.</span>1<span style="color: #339933;">/</span>8<span style="color: #339933;">.</span>14<span style="color: #339933;">.</span>1
<span style="color: #339933;">|</span>  smtp<span style="color: #339933;">-</span>commands<span style="color: #339933;">:</span> EHLO mail<span style="color: #339933;">.</span>example<span style="color: #339933;">.</span>com Hello <span style="color: #009900;">&#91;</span>1<span style="color: #339933;">.</span>1<span style="color: #339933;">.</span>1<span style="color: #339933;">.</span>1<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> pleased to meet you<span style="color: #339933;">,</span> ENHANCEDSTATUSCODES<span style="color: #339933;">,</span> PIPELINING<span style="color: #339933;">,</span> 8BITMIME<span style="color: #339933;">,</span> SIZE<span style="color: #339933;">,</span> DSN<span style="color: #339933;">,</span> AUTH DIGEST<span style="color: #339933;">-</span>MD5 CRAM<span style="color: #339933;">-</span>MD5<span style="color: #339933;">,</span> DELIVERBY<span style="color: #339933;">,</span> HELP
<span style="color: #339933;">|</span>_ HELP 2<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>0 This is sendmail version 8<span style="color: #339933;">.</span>14<span style="color: #339933;">.</span>1 2<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>0 Topics<span style="color: #339933;">:</span> 2<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>0 HELO EHLO MAIL RCPT DATA 2<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>0 RSET NOOP QUIT HELP VRFY 2<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>0 EXPN VERB ETRN DSN AUTH 2<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>0 STARTTLS 2<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>0 For more info <span style="color: #000000; font-weight: bold;">use</span> <span style="color: #ff0000;">&quot;HELP &quot;</span><span style="color: #339933;">.</span> 2<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>0 To report bugs in the implementation see 2<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>0 http<span style="color: #339933;">://</span>www<span style="color: #339933;">.</span>sendmail<span style="color: #339933;">.</span>org<span style="color: #339933;">/</span>email<span style="color: #339933;">-</span>addresses<span style="color: #339933;">.</span>html 2<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>0 For <span style="color: #000066;">local</span> information <span style="color: #000066;">send</span> email to Postmaster at your site<span style="color: #339933;">.</span> 2<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>0 End of HELP info
<span style="color: #cc66cc;">2000</span><span style="color: #339933;">/</span>tcp <span style="color: #000066;">open</span>  callbook<span style="color: #339933;">?</span>
<span style="color: #cc66cc;">2049</span><span style="color: #339933;">/</span>tcp <span style="color: #000066;">open</span>  rpcbind
<span style="color: #cc66cc;">3306</span><span style="color: #339933;">/</span>tcp <span style="color: #000066;">open</span>  mysql     MySQL 5<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>37
<span style="color: #339933;">|</span>  mysql<span style="color: #339933;">-</span>info<span style="color: #339933;">:</span> Protocol<span style="color: #339933;">:</span> <span style="color: #cc66cc;">10</span>
<span style="color: #339933;">|</span>  Version<span style="color: #339933;">:</span> 5<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>37
<span style="color: #339933;">|</span>  Thread ID<span style="color: #339933;">:</span> <span style="color: #cc66cc;">2757516</span>
<span style="color: #339933;">|</span>  Some Capabilities<span style="color: #339933;">:</span> Connect with DB<span style="color: #339933;">,</span> Compress<span style="color: #339933;">,</span> Transactions<span style="color: #339933;">,</span> Secure Connection
<span style="color: #339933;">|</span>  Status<span style="color: #339933;">:</span> Autocommit
<span style="color: #339933;">|</span>_ Salt<span style="color: #339933;">:</span> qD<span style="color: #0000ff;">@R</span><span style="color: #0000ff;">\V</span><span style="color: #009900;">&#123;</span><span style="color: #339933;">,</span>c2kG_<span style="color: #339933;">+</span>SA<span style="color: #339933;">/</span>b<span style="color: #666666; font-style: italic;">#%</span>
Service Info<span style="color: #339933;">:</span> Host<span style="color: #339933;">:</span> mail<span style="color: #339933;">.</span>example<span style="color: #339933;">.</span>com<span style="color: #339933;">;</span> OS<span style="color: #339933;">:</span> Unix
Service detection performed<span style="color: #339933;">.</span> Please report any incorrect results at http<span style="color: #339933;">://</span>nmap<span style="color: #339933;">.</span>org<span style="color: #339933;">/</span>submit<span style="color: #339933;">/</span> <span style="color: #339933;">.</span>
Nmap done<span style="color: #339933;">:</span> <span style="color: #cc66cc;">1</span> IP address <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span> host up<span style="color: #009900;">&#41;</span> scanned in <span style="color: #cc66cc;">31.31</span> seconds</pre></div></div>

<p>It was only able to detect Unix not Slackware Linux. Have fun and don&#8217;t do anything I wouldn&#8217;t do!</p>
]]></content:encoded>
			<wfw:commentRss>http://tonyvirelli.com/slider/using-nmap-to-detect-server-type/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>URL Shortening, for the Faint of Heart</title>
		<link>http://tonyvirelli.com/slider/url-shortening-for-the-faint-of-heart/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=url-shortening-for-the-faint-of-heart</link>
		<comments>http://tonyvirelli.com/slider/url-shortening-for-the-faint-of-heart/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 14:30:53 +0000</pubDate>
		<dc:creator>John Hass</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[bit.ly]]></category>
		<category><![CDATA[short]]></category>
		<category><![CDATA[shorten]]></category>
		<category><![CDATA[shortner]]></category>
		<category><![CDATA[url]]></category>

		<guid isPermaLink="false">http://tonyvirelli.com/?p=312</guid>
		<description><![CDATA[Hello, Hello, Hello. Quick tut on bit.ly in PHP, nothing more nothing less (and yes I said PHP not Perl like I am so fond of). In order to use this code you need a bit.ly account. Visit http://bit.ly/account/register?rd=/ to get a login and a API Key. Here is the function: &#60;?php function shortenURL&#40;$url&#41; &#123; [...]]]></description>
			<content:encoded><![CDATA[<p>Hello, Hello, Hello.  Quick tut on bit.ly in PHP, nothing more nothing less (and yes I said PHP not Perl like I am so fond of). In order to use this code you need a bit.ly account. Visit <a href="http://bit.ly/account/register?rd=/">http://bit.ly/account/register?rd=/</a> to get a login and a API Key.<br />
<span id="more-312"></span><br />
Here is the function:</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> shortenURL<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$login</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;yourlogin&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$apikey</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;your api key&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$newurl</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://api.bit.ly/shorten?version=2.0.1&amp;longUrl=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$url</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&amp;login=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$login</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&amp;apiKey=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$apikey</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #990000;">json_decode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$newurl</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$error</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$content</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;errorCode&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$error</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: #000088;">$newurl</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$content</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;results&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;shortUrl&quot;</span><span style="color: #009900;">&#93;</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: #000088;">$newurl</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$newurl</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>Just include this file in any script and call</p>
<p>and boom it&#8217;s shortened.</p>
<p>Merry Christmas you filthy animal.</p>
]]></content:encoded>
			<wfw:commentRss>http://tonyvirelli.com/slider/url-shortening-for-the-faint-of-heart/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Test Your Network With Ping</title>
		<link>http://tonyvirelli.com/slider/test-your-network-with-ping/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=test-your-network-with-ping</link>
		<comments>http://tonyvirelli.com/slider/test-your-network-with-ping/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 14:30:05 +0000</pubDate>
		<dc:creator>John Hass</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[ping]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://tonyvirelli.com/?p=289</guid>
		<description><![CDATA[Ping is a great utility to use to test if a server is up or if a server is responding in the correct time, but what if you could use ping to actually test your network infrastructure. Lets call it a &#8220;poor mans test&#8221;. Linux ping allows you to specify the number of bytes that [...]]]></description>
			<content:encoded><![CDATA[<p>Ping is a great utility to use to test if a server is up or if a server is responding in the correct time, but what if you could use ping to actually test your network infrastructure.  Lets call it a <em>&#8220;poor mans test&#8221;</em>.</p>
<p>Linux ping allows you to specify the number of bytes that are sent to the server your pinging.<br />
<span id="more-289"></span></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ping</span> <span style="color: #660033;">-s</span>  127.0.0.1</pre></div></div>

<p>The maximum packet size it 65507, this is 63.9990234 kilobytes, not a very big packet at all, but what if you sent hundreds of them a second?</p>
<p>Enter ping flood.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ping</span> <span style="color: #660033;">-s</span> <span style="color: #000000;">65507</span> <span style="color: #660033;">-f</span> 127.0.0.1</pre></div></div>

<p>To quote the ping man page:</p>
<blockquote><p>Flood ping. For every ECHO_REQUEST sent a period &#8220;.&#8221; is printed, while for ever ECHO_REPLY received a backspace is printed.  This provides a rapid display of how  many  packets are being dropped.  If interval is not given, it sets interval to zero and outputs packets as fast as they come back or one hundred times per second, whichever is more.  Only the super-user may use this option with zero interval.</p></blockquote>
<p>Here is an example of the output</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ping</span> 192.168.10.27 <span style="color: #660033;">-s</span> <span style="color: #000000;">65507</span> <span style="color: #660033;">-f</span>
PING 192.168.10.27 <span style="color: #7a0874; font-weight: bold;">&#40;</span>192.168.10.27<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">65507</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">65535</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> bytes of data.
.
<span style="color: #660033;">---</span> 192.168.10.27 <span style="color: #c20cb9; font-weight: bold;">ping</span> statistics <span style="color: #660033;">---</span>
<span style="color: #000000;">267</span> packets transmitted, <span style="color: #000000;">266</span> received, <span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">%</span> packet loss, <span style="color: #000000; font-weight: bold;">time</span> 4321ms
rtt min<span style="color: #000000; font-weight: bold;">/</span>avg<span style="color: #000000; font-weight: bold;">/</span>max<span style="color: #000000; font-weight: bold;">/</span>mdev = <span style="color: #000000;">11.476</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">14.489</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">30.344</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">5.301</span> ms, pipe <span style="color: #000000;">3</span>, ipg<span style="color: #000000; font-weight: bold;">/</span>ewma <span style="color: #000000;">16.245</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">11.551</span> ms</pre></div></div>

<p>If I had lost a packet it should show a packet loss. As you can see, the server is sitting on the same switch as my desktop. It dropped 0 packets and had a rtt of 11.476 ms.</p>
<p><strong>Not bad!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://tonyvirelli.com/slider/test-your-network-with-ping/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH Key Sharing</title>
		<link>http://tonyvirelli.com/slider/ssh-key-sharing/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ssh-key-sharing</link>
		<comments>http://tonyvirelli.com/slider/ssh-key-sharing/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 14:30:27 +0000</pubDate>
		<dc:creator>John Hass</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[key]]></category>
		<category><![CDATA[sharing]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://tonyvirelli.com/?p=286</guid>
		<description><![CDATA[SSH allows you to do key sharing which allows you to log into a machine without typing your password, or even for that matter, having a password at all. Best of all, it does the key sharing completely encrypted, so the chance of you losing your keys in the process is very unlikely. In my [...]]]></description>
			<content:encoded><![CDATA[<p>SSH allows you to do key sharing which allows you to log into a machine without typing your password, or even for that matter, having a password at all. Best of all, it does the key sharing completely encrypted, so the chance of you losing your keys in the process is very unlikely.</p>
<p>In my example I have 2 machines. A desktop and server.  I want to be able to connect to server without entering my password.<br />
<span id="more-286"></span><br />
On Desktop (there is no need to be root)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh-keygen</span> <span style="color: #660033;">-b</span> <span style="color: #000000;">2048</span> <span style="color: #660033;">-t</span> rsa</pre></div></div>

<p>A message will prompt you for the location: leave it the default.<br />
The next menu will ask you for a pass phrase: leave it blank.<br />
Leave the next pass phrase blank as well.</p>
<p>Your keys will now be generated in ~/.ssh<br />
you can &#8220;cd ~/.ssh&#8221;<br />
type &#8220;cat id_rsa.pub&#8221;<br />
You will now see your public key this is the key you share with everyone.  The other is your private you share this with no one.</p>
<p>The next step is to get your key over to server</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">scp</span> id_rsa.pub username<span style="color: #000000; font-weight: bold;">@</span>server:~<span style="color: #000000; font-weight: bold;">/</span>username_id_rsa.pub</pre></div></div>

<p>Then you must put the info in ~/.ssh/authorized_keys2</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh</span> username<span style="color: #000000; font-weight: bold;">@</span>server <span style="color: #ff0000;">&quot;cat ~/username_id_rsa.pub &gt;&gt; ~/.ssh/authorized_keys2&quot;</span></pre></div></div>

<p>You will now be able to ssh to server without entering your password.</p>
]]></content:encoded>
			<wfw:commentRss>http://tonyvirelli.com/slider/ssh-key-sharing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using SSH To Get Around Those Pesky Firewalls</title>
		<link>http://tonyvirelli.com/slider/using-ssh-to-get-around-those-pesky-firewalls/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=using-ssh-to-get-around-those-pesky-firewalls</link>
		<comments>http://tonyvirelli.com/slider/using-ssh-to-get-around-those-pesky-firewalls/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 14:30:34 +0000</pubDate>
		<dc:creator>John Hass</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[tunnel]]></category>
		<category><![CDATA[vnc]]></category>

		<guid isPermaLink="false">http://tonyvirelli.com/?p=282</guid>
		<description><![CDATA[Firewalls are important for safety on the internet, but sometimes they just get in the way, so why not remedy that by using what you can to your advantage. At my home I am required to have an SSH connection back to the office. The office is able to connect to all of our remote [...]]]></description>
			<content:encoded><![CDATA[<p>Firewalls are important for safety on the internet, but sometimes they just get in the way, so why not remedy that by using what you can to your advantage. At my home I am required to have an SSH connection back to the office. The office is able to connect to all of our remote sites, but  I am not able to have VNC to my home, so I must tunnel VNC. In order to do that I do a SSH local port forward</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh</span> john<span style="color: #000000; font-weight: bold;">@</span>example.com -L8080:127.0.0.1:<span style="color: #000000;">5590</span></pre></div></div>

<p><span id="more-282"></span><br />
This will connect to my desktop at work and create a tunnel. The tunnel is from the machine I am sshing from to my desktop at work on port 5590.  So to connect to VNC I just do:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">vncviewer 127.0.0.1:<span style="color: #000000;">8080</span></pre></div></div>

<p>Then I am connected via the ssh tunnel to work.</p>
<p>Now lets say you wanted to connect off site to somewhere else, but your always having to ssh to work then to the site so:</p>
<p>Laptop ====&gt; work (example.com)====&gt; site (site.com)</p>
<p>and you have to ssh in 3 times to run different processes or view logs. Why not create a tunnel to do all the work?</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;">ssh john<span style="color: #0000ff;">@example</span><span style="color: #339933;">.</span>com <span style="color: #339933;">-</span>L8080<span style="color: #339933;">:</span>site<span style="color: #339933;">.</span>com<span style="color: #339933;">:</span><span style="color: #cc66cc;">22</span></pre></div></div>

<p>You can then ssh right into site.com by typing</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;">ssh john<span style="color: #0000ff;">@localhost</span> <span style="color: #339933;">-</span>P <span style="color: #cc66cc;">8080</span></pre></div></div>

<p>this is because the connection is tunneled.</p>
<p>I will get into more ssh stuff as needed like remote port sharing and sharing keys, but the above example really does show the power of ssh.</p>
]]></content:encoded>
			<wfw:commentRss>http://tonyvirelli.com/slider/using-ssh-to-get-around-those-pesky-firewalls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speeding Up MySQL with Indexes</title>
		<link>http://tonyvirelli.com/slider/speeding-up-mysql-with-indexes/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=speeding-up-mysql-with-indexes</link>
		<comments>http://tonyvirelli.com/slider/speeding-up-mysql-with-indexes/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 14:30:05 +0000</pubDate>
		<dc:creator>John Hass</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://tonyvirelli.com/?p=272</guid>
		<description><![CDATA[MySQL is an excellent database product and even though Oracle just bought out Sun, who bought out MySQL, Oracle still promised to keep up with MySQL patches and releases. (see more here)  This is great news for all us die hard MySQL and PHP guys, we no longer have to worry about giving up our [...]]]></description>
			<content:encoded><![CDATA[<p>MySQL is an excellent database product and even though Oracle just bought out Sun, who bought out MySQL, Oracle still promised to keep up with MySQL patches and releases. (<a href="http://www.marketwatch.com/story/sun-climbs-after-oracle-presents-mysql-plan-2009-12-14">see more here</a>)  This is great news for all us die hard MySQL and PHP guys, we no longer have to worry about giving up our MySQL for something else (because you can have my PHP when you pry it from my cold dead fingers).  Though the question of the day is, when we get Millions of records how can we speed it up. Say for example I have a <em><strong>callrecord</strong></em> database that has a few things in it<br />
<span id="more-272"></span><br />
id|start_time|from_number|to_number|billsec</p>
<p>When I do a query by id everything is fast, but when I do a query by <strong><em>from_number</em></strong> everything is really slow, maybe even taking hours to complete. So lets create an index on the <em><strong>from_number</strong></em> to make it faster.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">CREATE INDEX full_from_number ON table_name (from_number);</pre></div></div>

<p>Now depending on the number of records you have this could take sometime. You can check on the status by opening another MySQL session and typing &#8220;show processlist&#8221;. This will show you what is currently going on in MySQL.  It may appear that your MySQL has froze, but it hasn&#8217;t. Be patient, I had a database take 18 hours before.</p>
<p>Why not index all fields?  This is a good question, but it is important to only index the fields that you perform a where on, creating an index, does slow the insert time some, but in my example with the <em><strong>callrecord</strong></em> database, I only filled it once a day and queried 100 times the next day, so creating extra indexes was a good thing to do.</p>
]]></content:encoded>
			<wfw:commentRss>http://tonyvirelli.com/slider/speeding-up-mysql-with-indexes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting Your Clock From Google</title>
		<link>http://tonyvirelli.com/slider/setting-your-clock-from-google/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=setting-your-clock-from-google</link>
		<comments>http://tonyvirelli.com/slider/setting-your-clock-from-google/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 14:30:40 +0000</pubDate>
		<dc:creator>John Hass</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ntp]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[sockets]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[useless]]></category>

		<guid isPermaLink="false">http://tonyvirelli.com/?p=257</guid>
		<description><![CDATA[It&#8217;s time for another episode of, why the hell would you want to do that, I am your host John Hass.  On Today&#8217;s show we are going to teach you how to set the time from Google&#8217;s web server. So the first question is why, my answer is why not.  The web is full of [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s time for another episode of, why the hell would you want to do that, I am your host John Hass.  On Today&#8217;s show we are going to teach you how to set the time from Google&#8217;s web server.</p>
<p>So the first question is why, my answer is why not.  The web is full of useless things, lets add one more.  Once again using Linux and Perl, you must be root to set the time.<br />
<span id="more-257"></span></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> IO<span style="color: #339933;">::</span><span style="color: #006600;">Socket</span><span style="color: #339933;">;</span></pre></div></div>

<p>IO::Socket is the only required library for this endeavor.</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #0000ff;">$host</span><span style="color: #339933;">=</span><span style="color: #000066;">shift</span> <span style="color: #339933;">||</span> <span style="color: #ff0000;">'www.google.com'</span><span style="color: #339933;">;</span></pre></div></div>

<p>Google does not have to be where you get your time, so you can call the program with your favorite web host, but I figure you go to them for everything else why not go to them for the time.</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$sock</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> IO<span style="color: #339933;">::</span><span style="color: #006600;">Socket</span><span style="color: #339933;">::</span><span style="color: #006600;">INET</span> <span style="color: #009900;">&#40;</span>
PeerAddr <span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> <span style="color: #0000ff;">$host</span><span style="color: #339933;">,</span>
PeerPort <span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> <span style="color: #ff0000;">'80'</span><span style="color: #339933;">,</span>
Proto <span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> <span style="color: #ff0000;">'tcp'</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;Could not create connection to $host $!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #b1b100;">unless</span> <span style="color: #0000ff;">$sock</span><span style="color: #339933;">;</span></pre></div></div>

<p>Create the socket connection to Google, we only support http so I just forced the port to 80.</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #000066;">print</span> <span style="color: #0000ff;">$sock</span> <span style="color: #ff0000;">&quot;HEAD / HTTP/1.1<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$ok</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$loop</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$date</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Give Google the Head command to ask for some juicy info.</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000066;">chomp</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$_</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">#print $_ . &quot;\n&quot;;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$ok</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span> <span style="color: #0000ff;">&amp;amp</span><span style="color: #339933;">;</span><span style="color: #0000ff;">&amp;amp</span><span style="color: #339933;">;</span> <span style="color: #0000ff;">$loop</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Could not get the time<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$sock</span><span style="color: #009900;">&#41;</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;">$ok</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span> <span style="color: #0000ff;">&amp;amp</span><span style="color: #339933;">;</span><span style="color: #0000ff;">&amp;amp</span><span style="color: #339933;">;</span> <span style="color: #0000ff;">$loop</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</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: #0000ff;">$_</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">/Date:/</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #0000ff;">$date</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$_</span><span style="color: #339933;">;</span>
<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$sock</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$_</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">/200 OK/</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #0000ff;">$ok</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$loop</span><span style="color: #339933;">++;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$sock</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Parse what your momma gave you, we are looking to make sure the request worked ok and we are making sure that we have a date.</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;">$date</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">/GMT/</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Date and time is in GMT<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;$date<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$date</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/\r//g</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$date</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/Date: //g</span><span style="color: #339933;">;</span>
<span style="color: #ff0000;">`date -s &quot;$date&quot;`</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>lastly we parse out all the junk that we can&#8217;t pass to the Linux date command. then we simply set the date.</p>
<p>Thanks for wasting your time with me.</p>
<p>Now go give that network administrator the finger for not letting you specify your own ntp servers!</p>
<p><strong>Source Files: <a class="downloadlink" href="http://tonyvirelli.com/downloads/gettime.zip" title=" downloaded 14 times" >gettime.zip (14)</a><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://tonyvirelli.com/slider/setting-your-clock-from-google/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sweet Google TTS</title>
		<link>http://tonyvirelli.com/slider/sweet-google-tts/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sweet-google-tts</link>
		<comments>http://tonyvirelli.com/slider/sweet-google-tts/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 15:00:27 +0000</pubDate>
		<dc:creator>John Hass</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[Text to Speech]]></category>
		<category><![CDATA[Translate]]></category>

		<guid isPermaLink="false">http://tonyvirelli.com/?p=309</guid>
		<description><![CDATA[Google now has a text to speech service that allows you to type in a URL and some text and it will give you an mp3!  It works fairly well, so I decided to use my Swiss Army knife (Perl) and write a script that will make it easy to get mp3&#8242;s #!/usr/bin/perl use LWP; [...]]]></description>
			<content:encoded><![CDATA[<p>Google now has a text to speech service that allows you to type in a URL and some text and it will give you an mp3!  It works fairly well, so I decided to use my Swiss Army knife (Perl) and write a script that will make it easy to get mp3&#8242;s<br />
<span id="more-309"></span></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> LWP<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$speak</span> <span style="color: #339933;">=</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: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">length</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$speak</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span><span style="color: #cc66cc;">0</span> <span style="color: #339933;">||</span> <span style="color: #000066;">length</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$speak</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">100</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;what you speak needs to be &gt; 0 and &lt;100<span style="color: #000099; font-weight: bold;">\n</span>&quot;</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>This code will check to make sure that what we want to say follows with google standards. The program is called ./speak.pl &#8220;this is what I want to say&#8221;</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@headers1</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>
<span style="color: #ff0000;">'Host'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'translate.google.com'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'User-Agent'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091109 Ubuntu/9.10 (karmic) Firefox/3.5.5'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'Accept'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'Accept-Language'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'en-us,en;q=0.5'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'Accept-Encoding'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'gzip,deflate'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'Accept-Charset'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'ISO-8859-1,utf-8;q=0.7,*;q=0.7'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'Keep-Alive'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'300'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'Connection'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'keep-alive'</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$browser</span> <span style="color: #339933;">=</span> LWP<span style="color: #339933;">::</span><span style="color: #006600;">UserAgent</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">new</span><span style="color: #339933;">;</span></pre></div></div>

<p>The above is our magic headers. This allows us to use Google and the browser instantiation.</p>
<p>next we need to format it so Google can see it correctly</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #0000ff;">$speak</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/ /+/g</span><span style="color: #339933;">;</span></pre></div></div>

<p>This removes all spaces and makes them +&#8217;s</p>
<p>lastly we connect and download</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #0000ff;">$sec</span> <span style="color: #339933;">=</span> <span style="color: #000066;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$resp</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$browser</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">get</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;http://translate.google.com/translate_tts?q=$speak&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">@headers1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>FILE<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;&gt;$sec.mp3&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> FILE <span style="color: #0000ff;">$resp</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">content</span><span style="color: #339933;">;</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: #000066;">print</span> <span style="color: #ff0000;">&quot;Wrote $sec.mp3<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>What we do here get the number of seconds for the out filename and write the file.</p>
<p>Have fun and don&#8217;t abuse this service.</p>
<p><strong>Source Files: <a class="downloadlink" href="http://tonyvirelli.com/downloads/tts.zip" title=" downloaded 156 times" >tts.zip (156)</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://tonyvirelli.com/slider/sweet-google-tts/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://translate.google.com/translate_tts?q=" length="0" type="audio/mpeg" />
		</item>
	</channel>
</rss>

