<?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>Anthony Persaud &#187; General</title>
	<atom:link href="http://anthonypersaud.com/category/general/feed/" rel="self" type="application/rss+xml" />
	<link>http://anthonypersaud.com</link>
	<description></description>
	<lastBuildDate>Mon, 19 Oct 2009 05:50:17 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>I Love San Diego!</title>
		<link>http://anthonypersaud.com/2009/10/i-love-san-diego/</link>
		<comments>http://anthonypersaud.com/2009/10/i-love-san-diego/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 05:50:17 +0000</pubDate>
		<dc:creator>Anthony Persaud</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[san diego]]></category>

		<guid isPermaLink="false">http://anthonypersaud.com/?p=23</guid>
		<description><![CDATA[Julie and I ended up going to Coronado to celebrate a special event by taking a Gondola ride and going out to the Primavera restaurant. Outside the restaurant I took a snapshot of the street and I think it just turned out great!

]]></description>
			<content:encoded><![CDATA[<p>Julie and I ended up going to Coronado to celebrate a special event by taking a Gondola ride and going out to the Primavera restaurant. Outside the restaurant I took a snapshot of the street and I think it just turned out great!<br />
<a href="http://anthonypersaud.com/wp-content/uploads/2009/10/IMG_2812.jpg"><img class="size-medium wp-image-24 alignnone" title="Coronado - San Diego, CA" src="http://anthonypersaud.com/wp-content/uploads/2009/10/IMG_2812-225x300.jpg" alt="Coronado - San Diego, CA" width="225" height="300" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://anthonypersaud.com/2009/10/i-love-san-diego/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Real-Time Scanning &#8211; (no better time() like &#039;now&#039;)</title>
		<link>http://anthonypersaud.com/2005/07/real-time-scanning-no-better-time-like-now/</link>
		<comments>http://anthonypersaud.com/2005/07/real-time-scanning-no-better-time-like-now/#comments</comments>
		<pubDate>Sat, 02 Jul 2005 01:10:57 +0000</pubDate>
		<dc:creator>Anthony Persaud</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://nmapparser.wordpress.com/2005/07/02/real-time-scanning-no-better-time-like-now/</guid>
		<description><![CDATA[ You can run a nmap scan and have the parser parse the information automagically. The only constraint is that you cannot use &#8216;-oX&#8217;, &#8216;-oN&#8217;, or &#8216;-oG&#8217; as one of your arguments for nmap command line parameters passed to parsescan().
 use Nmap::Parser;

 my $np = new Nmap::Parser;
 my @hosts = @ARGV; #get hosts from cmd [...]]]></description>
			<content:encoded><![CDATA[<p class="articlestext"> You can run a nmap scan and have the parser parse the information automagically. The only constraint is that you cannot use &#8216;-oX&#8217;, &#8216;-oN&#8217;, or &#8216;-oG&#8217; as one of your arguments for nmap command line parameters passed to parsescan().</p>
<pre> use Nmap::Parser;

 my $np = new Nmap::Parser;
 my @hosts = @ARGV; #get hosts from cmd line

 #runs the nmap command with hosts and parses it automagically
 $np-&gt;parsescan('/usr/bin/nmap','-sS O -p 1-1023',@hosts);

 for my $host ($np-&gt;all_hosts()){
        print $host-&gt;hostname."\n";
        #do mor stuff...
 }</pre>
]]></content:encoded>
			<wfw:commentRss>http://anthonypersaud.com/2005/07/real-time-scanning-no-better-time-like-now/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Callbacks &#8211; (not our $normal *69)</title>
		<link>http://anthonypersaud.com/2005/07/callbacks-not-our-normal-69/</link>
		<comments>http://anthonypersaud.com/2005/07/callbacks-not-our-normal-69/#comments</comments>
		<pubDate>Sat, 02 Jul 2005 01:10:12 +0000</pubDate>
		<dc:creator>Anthony Persaud</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://nmapparser.wordpress.com/2005/07/02/callbacks-not-our-normal-69/</guid>
		<description><![CDATA[This is probably the easiest way to write a script with using Nmap::Parser, if you don&#8217;t need the general scan session information. During the parsing process, the parser will obtain information of every host. The callback function (in this case &#8216;booyah()&#8217;) is called after the parsing of every host (sequentially). When the callback returns, the [...]]]></description>
			<content:encoded><![CDATA[<p class="articlestext">This is probably the easiest way to write a script with using Nmap::Parser, if you don&#8217;t need the general scan session information. During the parsing process, the parser will obtain information of every host. The callback function (in this case &#8216;booyah()&#8217;) is called after the parsing of every host (sequentially). When the callback returns, the parser will delete all information of the host it had sent to the callback. This callback function is called for every host that the parser encounters. The callback function must be setup before parsing</p>
<pre> use Nmap::Parser;
 my $np = new Nmap::Parser;

 $np-&gt;callback( \&amp;booyah );

 $np-&gt;parsefile('nmap_results.xml');
    # or use parsescan()

 sub booyah {
    my $host = shift; #Nmap::Parser::Host object, just parsed
    print 'IP: ',$host-&gt;addr,"\n";
         # ... do more stuff with $host ...

    #when it returns, host object will be deleted from memory
    #(good for processing VERY LARGE files or scans)
 }</pre>
]]></content:encoded>
			<wfw:commentRss>http://anthonypersaud.com/2005/07/callbacks-not-our-normal-69/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DHCP Hosts Search Script</title>
		<link>http://anthonypersaud.com/2005/05/dhcp-hosts-search-script/</link>
		<comments>http://anthonypersaud.com/2005/05/dhcp-hosts-search-script/#comments</comments>
		<pubDate>Fri, 13 May 2005 01:07:59 +0000</pubDate>
		<dc:creator>Anthony Persaud</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://nmapparser.wordpress.com/2007/06/13/dhcp-hosts-search-script/</guid>
		<description><![CDATA[Called in rc.local or custom wireless networking scripts, dhcphosts.pl generates an /etc/hosts file  for a host on a DHCP network, allowing the use of hostnames regardless of given IP addresses. The code can also be found at http://dual.home.comcast.net/perl/dhcphosts.txt
#!/usr/bin/perl

# dhcphosts.pl - by dual
#
# Generates an /etc/hosts file for a
# box on a DHCP network
#
# - [...]]]></description>
			<content:encoded><![CDATA[<p class="articlestext">Called in rc.local or custom wireless networking scripts, dhcphosts.pl generates an /etc/hosts file  for a host on a DHCP network, allowing the use of hostnames regardless of given IP addresses. The code can also be found at <a href="http://dual.home.comcast.net/perl/dhcphosts.txt">http://dual.home.comcast.net/perl/dhcphosts.txt</a></p>
<pre>#!/usr/bin/perl

# dhcphosts.pl - by dual
#
# Generates an /etc/hosts file for a
# box on a DHCP network
#
# - Simply call it in /etc/rc.local.
# - Depends on Nmap::Parser.
####################################

# Include Nmap::Parser
######################
use strict;
use Nmap::Parser;

# Declare and set variables
###########################
my $ip;
my $fqn;
my $dmain;
my $tld;
my $host;
my $path = '/usr/bin/nmap';
my $args = '-sP';
my @ips  = qw/192.168.1.101-109/;
my $ip_addr;
my $mac_addr;

# Obtain local info
###################
my @ifconfig = `/sbin/ifconfig eth1`;
foreach my $line (@ifconfig) {
  $ip = $1 if ($line =~ /inet addr:(d{1,3}.d{1,3}.d{1,3}.d{1,3})/);
}

open NETWK, ") {
  $fqn = $1 if ($_ =~ /^HOSTNAME=(.+)$/);
}

close NETWK;

my @names = split (/./, "$fqn");
$host  = $names[0];
$dmain = $names[1];
$tld   = $names[2];

# Clobber /etc/hosts
####################
open HOSTS, "&gt;/etc/hosts" or die "Can't open hosts: $!";

# Print local info
##################
print HOSTS "# Generated by dhcphosts.plnn";
print HOSTS "# Gotta have loopbackn";
print HOSTS "127.0.0.1tlocalhost.localdomaintlocalhostnn";
print HOSTS "# This box...n";
print HOSTS "$ipt$fqnt$hostnn";
print HOSTS "# Remaining network hostsn";

# Scan, parse and print the remaining network
#############################################
my $nmap = new Nmap::Parser;
$nmap-&gt;parsescan ($path, $args, @ips);

for my $host ($nmap-&gt;all_hosts()) {
  $ip_addr  = $host-&gt;addr;
  $mac_addr = $host-&gt;mac_addr;
  if ($mac_addr =~ /.{2}:.{2}:.{2}:.{2}:.{2}:.{2}/) {
    # Fill in your MACs and hostnames here
    if ($mac_addr =~ /XX:XX:XX:XX:XX:XX/) {
      print HOSTS "$ip_addrthostname1.$dmain.$tldthostname1n";
    }
    elsif ($mac_addr =~ /XX:XX:XX:XX:XX:XX/) {
      print HOSTS "$ip_addrthostname2.$dmain.$tldthostname2n";
    }
    elsif ($mac_addr =~ /XX:XX:XX:XX:XX:XX/) {
      print HOSTS "$ip_addrthostname3.$dmain.$tldthostname3n";
    }
    elsif ($mac_addr =~ /XX:XX:XX:XX:XX:XX/) {
      print HOSTS "$ip_addrthostname4.$dmain.$tldthostname4n";
    }
  }
}

# Clean up
##########
close HOSTS;

__END__
=pod

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.  See the GNU General Public License for more details.

=cut</pre>
]]></content:encoded>
			<wfw:commentRss>http://anthonypersaud.com/2005/05/dhcp-hosts-search-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
