<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Data Blog</title>
	<atom:link href="http://numberformatdata.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://numberformatdata.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Mon, 20 Feb 2012 05:29:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='numberformatdata.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Data Blog</title>
		<link>http://numberformatdata.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://numberformatdata.wordpress.com/osd.xml" title="Data Blog" />
	<atom:link rel='hub' href='http://numberformatdata.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Firewall Testing and Monitoring</title>
		<link>http://numberformatdata.wordpress.com/2012/02/08/firewall-testing-and-monitoring/</link>
		<comments>http://numberformatdata.wordpress.com/2012/02/08/firewall-testing-and-monitoring/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 03:08:58 +0000</pubDate>
		<dc:creator>numberformat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[ipfw]]></category>
		<category><![CDATA[nmap]]></category>

		<guid isPermaLink="false">http://numberformatdata.wordpress.com/?p=799</guid>
		<description><![CDATA[This page describes how to setup a firewall monitoring script. It sends out an email if it detects a malfunction in the firewall configuration. This type of monitoring is important to ensure your firewall is properly configured and also helps prevent inadvertent firewall misconfiguration and alerts the administration in the case of break in attempts. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=numberformatdata.wordpress.com&amp;blog=11783965&amp;post=799&amp;subd=numberformatdata&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This page describes how to setup a firewall monitoring script. It sends out an email if it detects a malfunction in the firewall configuration. This type of monitoring is important to ensure your firewall is properly configured and also helps prevent inadvertent firewall misconfiguration and alerts the administration in the case of break in attempts.</p>
<p>The solution is to use &#8220;nmap&#8221; to monitor ports from a remote machine on the internet. </p>
<ol>
<li>FreeBSD</li>
<li>Root access</li>
<li><a href="http://numberformatdata.wordpress.com/2010/07/25/configuring-a-firewall-in-freebsd-8-1/">A working firewall</a></li>
<li>Another machine outside the firewall.</li>
</ol>
<h3>Install and Configure</h3>
<p><pre class="brush: bash; gutter: false;">
cd /usr/ports/security/nmap
rehash
nmap --version
</pre></p>
<p>The following script monitors ports 22,110, and 80 and sends out an email if it detects that that the port is open.<br />
<pre class="brush: bash; gutter: false;">
#!/bin/sh
 
# Sends an email only when there is a hole in the firewall.
 
/usr/local/bin/nmap -Pn -p 22,110,80  yourhostname.com | grep open &gt; ~/out.txt
 
if [ $? -eq 0 ] ; then
    cat ~/out.txt | mailx -s &quot;firewall misconfiguration&quot; youremail@youremailhost.com 
fi
rm -f ~/out.txt
</pre></p>
<p>Enter the following into your crontab<br />
vi /etc/crontab<br />
<pre class="brush: plain; gutter: false;">
# check firewall every 30 minutes.
*/30 * * * * yourusername /home/yourusername/bin/checkFirewall.sh
</pre></p>
<h3>Test</h3>
<p>Test the script by opening up a port in your firewall. Wait for the script to run, and verify that you get the alert email.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/numberformatdata.wordpress.com/799/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/numberformatdata.wordpress.com/799/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/numberformatdata.wordpress.com/799/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/numberformatdata.wordpress.com/799/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/numberformatdata.wordpress.com/799/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/numberformatdata.wordpress.com/799/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/numberformatdata.wordpress.com/799/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/numberformatdata.wordpress.com/799/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/numberformatdata.wordpress.com/799/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/numberformatdata.wordpress.com/799/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/numberformatdata.wordpress.com/799/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/numberformatdata.wordpress.com/799/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/numberformatdata.wordpress.com/799/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/numberformatdata.wordpress.com/799/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=numberformatdata.wordpress.com&amp;blog=11783965&amp;post=799&amp;subd=numberformatdata&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://numberformatdata.wordpress.com/2012/02/08/firewall-testing-and-monitoring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6c22d6d1f6cd226c2501f8658e726e81?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">numberformat</media:title>
		</media:content>
	</item>
		<item>
		<title>Convert Java Properties to Shell Environment Variables</title>
		<link>http://numberformatdata.wordpress.com/2012/02/05/convert-java-properties-to-shell-environment-variables/</link>
		<comments>http://numberformatdata.wordpress.com/2012/02/05/convert-java-properties-to-shell-environment-variables/#comments</comments>
		<pubDate>Sun, 05 Feb 2012 16:41:08 +0000</pubDate>
		<dc:creator>numberformat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[properties]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://numberformatdata.wordpress.com/?p=791</guid>
		<description><![CDATA[This page describes how to convert java properties to shell environment variables. It is helpful to allow shell scripts to share project configuration files with java programs. Requirements Unix or Cygwin Borne shell or Bash The following script converts key=value pairs into environment variables and escapes the . with _ and &#8220;quotes&#8221; so they can [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=numberformatdata.wordpress.com&amp;blog=11783965&amp;post=791&amp;subd=numberformatdata&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This page describes how to convert java properties to shell environment<br />
variables.</p>
<p>It is helpful to allow shell scripts to share project configuration files with<br />
java programs. </p>
<h3>Requirements</h3>
<ul>
<li>Unix or Cygwin</li>
<li>Borne shell or Bash</li>
</ul>
<p>The following script converts key=value pairs into environment variables and<br />
escapes the . with _ and &#8220;quotes&#8221; so they can be used as environment variables.</p>
<p>vi makeconfig.sh<br />
<pre class="brush: bash; gutter: false;">
#!/bin/sh
#
# This script is responsible for generating the setEnv.sh script
# based on the information inside env.properties

# run this file after updating env.properties

if [ ! -f $1 ] ; then
    echo &quot;usage: &quot;
    echo &quot;    $0 [property file] &gt; setEnv.sh&quot;
    echo &quot;\nExiting.&quot;
    exit 1
fi

TMPFILE=~/tmpfile
TMPFILE2=~/tmpfile2

echo &quot;#!/bin/sh&quot;

grep -v &quot;^#&quot; $1 | sed -e '/^$/d' &gt; $TMPFILE

# escape the keys and values so they are shell friendly.

while read curline; do
echo $curline | awk -F = '{print $1;}' | tr '.' '_' | tr '\n' '=' &gt;&gt; $TMPFILE2
echo $curline | awk -F = '{print $2;}' | sed &quot;s/'/'\&quot;'\&quot;'/g&quot; | sed &quot;s/^/\'/&quot; | sed &quot;s/$/\'/&quot; &gt;&gt; $TMPFILE2
done &lt; $TMPFILE

while read curline; do
echo export $curline
done &lt; $TMPFILE2

rm -f $TMPFILE $TMPFILE2
</pre></p>
<p>env.properties<br />
<pre class="brush: plain; gutter: false;">
# Main Environment Config file
# remember to run bin/makeconfig.sh after editing this file.

testspace=test space
testsinglequote=test'one'two'three
testdoublequote=test&quot;one&quot;two&quot;three
testdollar=testing$one$two$three
testsingledouble=single'quote'double&quot;quote&quot;
</pre></p>
<h3>Run the script</h3>
<p>The following generates the setEnv.sh shell script.</p>
<p><pre class="brush: bash; gutter: false;">
chmod +x makeconfig.sh test.sh
./makeconfig.sh env.properties &gt; setEnv.sh
./test.sh
</pre></p>
<p>The following imports the script and outputs a few tests to the console.</p>
<p>vi test.sh<br />
<pre class="brush: bash; gutter: false;">
#!/bin/sh

. ~/setEnv.sh

echo $testspace
echo $testsinglequote
echo $testdoublequote
echo $testdollar
echo $testsingledouble
</pre></p>
<p>The output should look something like this&#8230;</p>
<p><pre class="brush: plain; gutter: false;">
test space
test'one'two'three
test&quot;one&quot;two&quot;three
testing$one$two$three
single'quote'double&quot;quote&quot;
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/numberformatdata.wordpress.com/791/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/numberformatdata.wordpress.com/791/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/numberformatdata.wordpress.com/791/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/numberformatdata.wordpress.com/791/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/numberformatdata.wordpress.com/791/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/numberformatdata.wordpress.com/791/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/numberformatdata.wordpress.com/791/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/numberformatdata.wordpress.com/791/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/numberformatdata.wordpress.com/791/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/numberformatdata.wordpress.com/791/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/numberformatdata.wordpress.com/791/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/numberformatdata.wordpress.com/791/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/numberformatdata.wordpress.com/791/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/numberformatdata.wordpress.com/791/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=numberformatdata.wordpress.com&amp;blog=11783965&amp;post=791&amp;subd=numberformatdata&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://numberformatdata.wordpress.com/2012/02/05/convert-java-properties-to-shell-environment-variables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6c22d6d1f6cd226c2501f8658e726e81?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">numberformat</media:title>
		</media:content>
	</item>
		<item>
		<title>UPS configuration on FreeBSD 8.2</title>
		<link>http://numberformatdata.wordpress.com/2012/01/16/ups-configuration-on-freebsd-8-2/</link>
		<comments>http://numberformatdata.wordpress.com/2012/01/16/ups-configuration-on-freebsd-8-2/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 17:14:37 +0000</pubDate>
		<dc:creator>numberformat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[ups]]></category>

		<guid isPermaLink="false">http://numberformatdata.wordpress.com/?p=766</guid>
		<description><![CDATA[This page describes the process of configuring an APC BackUPS Uninterrupted Power Supply (UPS) on FreeBSD. Hardware/Software APC Back-UPS BX1000G FreeBSD port: apcupsd 3.14.8_2 FreeBSD 8.2 USB connection cable to the UPS Installation Configuration The following are the changes to my configuration file in diff format. diff -u /usr/local/etc/apcupsd/apcupsd.conf.sample /usr/local/etc/apcupsd/apcupsd.conf Start-up Configuration vi /etc/rc.conf Start [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=numberformatdata.wordpress.com&amp;blog=11783965&amp;post=766&amp;subd=numberformatdata&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This page describes the process of configuring an APC BackUPS Uninterrupted Power Supply (UPS) on FreeBSD. </p>
<h3>Hardware/Software</h3>
<ul>
<li>APC Back-UPS BX1000G</li>
<li>FreeBSD port: apcupsd 3.14.8_2</li>
<li>FreeBSD 8.2</li>
<li>USB connection cable to the UPS</li>
</ul>
<h3>Installation</h3>
<p><pre class="brush: bash; gutter: false;"> 
cd /usr/ports/sysutils/apcupsd
make config

  ┌────────────────────────────────────────────────────────────────────┐
  │                   Options for apcupsd 3.14.8_2                     │  
  │ ┌────────────────────────────────────────────────────────────────┐ │  
  │ │[ ] APCSMART_DRV  Compile APC SmartUPS serial driver            │ │  
  │ │[X] APCDUMB_DRV   Compile dumb UPS driver                       │ │  
  │ │[ ] CLIENT_ONLY   Only NIS client (no network server or drivers)│ │  
  │ │[ ] CGI           Compile with CGI programms to show status     │ │  
  │ │[X] PCNET_DRV     Compile PowerChute Network Shutdown driver    │ │  
  │ │[X] USB           Compile with USB Support driver               │ │  
  │ │[ ] SNMP_DRV      Compile with SNMP driver                      │ │  
  │ │[ ] SNMP_DRV_OLD  Compile with old SNMP driver                  │ │  
  │ │[ ] TCP_WRAPPERS  Compile with TCP_WRAPPERS support             │ │  
  │ │[ ] TEST_DRV      Compile TEST driver                           │ │  
  │ │[ ] GAPCMON       Build GTK GUI front-end                       │ │  
  │ │                                                                │ │  
  │ │                                                                │ │  
  │ │                                                                │ │  
  │ │                                                                │ │  
  ├─└────────────────────────────────────────────────────────────────┘─┤  
  │                       [  OK  ]       Cancel                        │  
  └────────────────────────────────────────────────────────────────────┘  


make install clean
</pre> </p>
<h3>Configuration</h3>
<p>The following are the changes to my configuration file in diff format.</p>
<p>diff -u /usr/local/etc/apcupsd/apcupsd.conf.sample /usr/local/etc/apcupsd/apcupsd.conf<br />
<pre class="brush: plain; gutter: false;"> 
--- /usr/local/etc/apcupsd/apcupsd.conf.sample	2012-01-16 00:47:17.000000000 -0500
+++ /usr/local/etc/apcupsd/apcupsd.conf	2012-01-16 00:52:10.000000000 -0500
@@ -26,7 +26,7 @@
 #     940-1524C, 940-0024G, 940-0095A, 940-0095B,
 #     940-0095C, M-04-02-2000
 #
-UPSCABLE smart
+UPSCABLE usb
 
 # To get apcupsd to work, in addition to defining the cable
 # above, you must also define a UPSTYPE, which corresponds to
@@ -73,8 +73,8 @@
 #                            passphrase are the credentials for which the card 
 #                            has been configured.
 #
-UPSTYPE apcsmart
-DEVICE /dev/usv
+UPSTYPE usb
+#DEVICE /dev/usv
 
 # POLLTIME &lt;int&gt;
 #   Interval (in seconds) at which apcupsd polls the UPS for status. This
</pre></p>
<h3>Start-up Configuration</h3>
<p>vi /etc/rc.conf<br />
<pre class="brush: plain; gutter: false;">
apcupsd_enable=&quot;YES&quot;
</pre></p>
<h3>Start services</h3>
<p>Manually start all services (or reboot):<br />
<pre class="brush: plain; gutter: false;">
/usr/local/etc/rc.d/apcupsd start
</pre></p>
<h3>Check UPS Status</h3>
<p><pre class="brush: bash; gutter: false;">
apcaccess status
</pre></p>
<p>The output should look something like this&#8230;<br />
<pre class="brush: plain; gutter: false;">
APC      : 001,037,0944
DATE     : 2012-01-16 00:56:22 -0500  
HOSTNAME : prod.xxxx.com
VERSION  : 3.14.8 (16 January 2010) freebsd
UPSNAME  : prod.xxxx.com
CABLE    : USB Cable
MODEL    : Back-UPS BX1000G 
UPSMODE  : Stand Alone
STARTTIME: 2012-01-16 00:54:18 -0500  
STATUS   : ONLINE 
LINEV    : 123.0 Volts
LOADPCT  :  31.0 Percent Load Capacity
BCHARGE  : 100.0 Percent
TIMELEFT :  26.9 Minutes
MBATTCHG : 5 Percent
MINTIMEL : 3 Minutes
MAXTIME  : 0 Seconds
SENSE    : Medium
LOTRANS  : 088.0 Volts
HITRANS  : 139.0 Volts
ALARMDEL : Always
BATTV    : 27.2 Volts
LASTXFER : No transfers since turnon
NUMXFERS : 0
TONBATT  : 0 seconds
CUMONBATT: 0 seconds
XOFFBATT : N/A
SELFTEST : NO
STATFLAG : 0x07000008 Status Flag
MANDATE  : 2011-10-02
SERIALNO : 3B1140X37672  
BATTDATE : 2011-10-02
NOMINV   : 120 Volts
NOMBATTV :  24.0 Volts
NOMPOWER : 600 Watts
FIRMWARE : 869.L2 .D USB FW:L2
APCMODEL : Back-UPS BX1000G 
END APC  : 2012-01-16 00:56:24 -0500  
</pre></p>
<h3>Testing the UPS</h3>
<p>Testing the UPS involves actually pulling the cord and observing the system gracefully shut down.</p>
<h4>Procedure</h4>
<ol>
<li>Edit the /usr/local/etc/apcupsd/apcupsd.conf and set TIMEOUT 60. This will allow the system to shut down 60 seconds after the power is cut. Testing it this way prevents wear on the battery life.</li>
<li>restart the daemon (/usr/local/etc/rc.d/apcupsd restart)</li>
<li>pull the plug and 60 seconds later the system should initiate the shut-down.</li>
<li>restore the power to the system. After the system comes back, Look for clues of a successful shut-down. On my server after the system comes back I observe the /var/messages and the MySQL logs since they indicate when they have been shut-down successfully. Compare the outputs with outputs of previous shut-downs.</li>
</ol>
<p>Here is the output of my test:</p>
<p>After pulling the cord I got the following message on the console.<br />
<pre class="brush: plain; gutter: false;">
Broadcast Message from xxx@prod.xxxx.com                               
        (no tty) at 11:29 EST...                                               
                                                                               
Power failure. Running on UPS batteries.    
</pre></p>
<p>A minute later:<br />
<pre class="brush: plain; gutter: false;">
Broadcast Message from xxxx@prod.xxxx.com                               
        (no tty) at 11:30 EST...                                               
                                                                               
UPS battery runtime limit exceeded. Doing shutdown.                            
                                                                               
                                                                               
Broadcast Message from xxxx@prod.xxxx.com                               
        (no tty) at 11:30 EST...                                               
                                                                               
Beginning Shutdown Sequence                                                                               
                                                                               
*** FINAL System shutdown message from xxxx@prod.xxxx.com ***         
System going down IMMEDIATELY                                                  
                                                                               
apcupsd initiated shutdown
</pre></p>
<p>After the system came back I got the following in the<br />
/var/messages</p>
<p><pre class="brush: plain; gutter: false;">
Jan 16 11:29:09 prod apcupsd[3062]: Power failure.
Jan 16 11:29:15 prod apcupsd[3062]: Running on UPS batteries.
Jan 16 11:30:16 prod apcupsd[3062]: Reached run time limit on batteries.
Jan 16 11:30:16 prod apcupsd[3062]: Initiating system shutdown!
Jan 16 11:30:16 prod apcupsd[3062]: User logins prohibited
Jan 16 11:30:16 prod apcupsd[3062]: Attempting to kill the UPS power!
Jan 16 11:30:16 prod shutdown: halt by xxxx: apcupsd initiated shutdown
Jan 16 11:30:25 prod squid[1375]: Squid Parent: child process 1377 exited with status 0
Jan 16 11:30:32 prod apcupsd[3062]: apcupsd exiting, signal 15
Jan 16 11:30:32 prod apcupsd[3062]: apcupsd shutdown succeeded
Jan 16 11:30:33 prod syslogd: exiting on signal 15
</pre></p>
<p>Looks like everything is in order&#8230; After your test is complete, don&#8217;t forget to restore the TIMEOUT value to the original.</p>
<p>Leave a small note below with the make and model of your UPS and version of FreeBSD to let me know it worked for you!</p>
<p>Thanks.</p>
<h3>References:</h3>
<p>This page is a variation of a page originally written by Julien Gabel back in 2006: <a href="http://blog.thilelli.net/post/2006/07/09/Configuring-an-APC-Back-UPS-RS-800VA">http://blog.thilelli.net/post/2006/07/09/Configuring-an-APC-Back-UPS-RS-800VA</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/numberformatdata.wordpress.com/766/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/numberformatdata.wordpress.com/766/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/numberformatdata.wordpress.com/766/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/numberformatdata.wordpress.com/766/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/numberformatdata.wordpress.com/766/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/numberformatdata.wordpress.com/766/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/numberformatdata.wordpress.com/766/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/numberformatdata.wordpress.com/766/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/numberformatdata.wordpress.com/766/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/numberformatdata.wordpress.com/766/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/numberformatdata.wordpress.com/766/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/numberformatdata.wordpress.com/766/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/numberformatdata.wordpress.com/766/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/numberformatdata.wordpress.com/766/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=numberformatdata.wordpress.com&amp;blog=11783965&amp;post=766&amp;subd=numberformatdata&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://numberformatdata.wordpress.com/2012/01/16/ups-configuration-on-freebsd-8-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6c22d6d1f6cd226c2501f8658e726e81?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">numberformat</media:title>
		</media:content>
	</item>
		<item>
		<title>sudo on ubuntu without password</title>
		<link>http://numberformatdata.wordpress.com/2011/12/02/sudo-on-ubuntu-without-password/</link>
		<comments>http://numberformatdata.wordpress.com/2011/12/02/sudo-on-ubuntu-without-password/#comments</comments>
		<pubDate>Fri, 02 Dec 2011 03:45:57 +0000</pubDate>
		<dc:creator>numberformat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[sudo]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://numberformatdata.wordpress.com/?p=733</guid>
		<description><![CDATA[The following tip can be used to use the sudo command on Ubuntu without requiring a password. This actually came out handy because I needed to run a command in a non-interactive shell script. It wasn&#8217;t working because the script was expecting the user to enter the root password. I know there probably is a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=numberformatdata.wordpress.com&amp;blog=11783965&amp;post=733&amp;subd=numberformatdata&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The following tip can be used to use the sudo command on Ubuntu without requiring a password. This actually came out handy because I needed to run a command in a non-interactive shell script. It wasn&#8217;t working because the script was expecting the user to enter the root password. </p>
<p>I know there probably is a better solution to running commands that require root from shell scripts but for now this will do.</p>
<p>sudo vi /etc/sudoers</p>
<p>Add the following line to the bottom of the file. (replace username with your own)<br />
<pre class="brush: plain; light: true;">
username ALL=(ALL) NOPASSWD: ALL
</pre></p>
<p>Please comment below if you know of a better way.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/numberformatdata.wordpress.com/733/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/numberformatdata.wordpress.com/733/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/numberformatdata.wordpress.com/733/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/numberformatdata.wordpress.com/733/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/numberformatdata.wordpress.com/733/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/numberformatdata.wordpress.com/733/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/numberformatdata.wordpress.com/733/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/numberformatdata.wordpress.com/733/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/numberformatdata.wordpress.com/733/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/numberformatdata.wordpress.com/733/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/numberformatdata.wordpress.com/733/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/numberformatdata.wordpress.com/733/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/numberformatdata.wordpress.com/733/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/numberformatdata.wordpress.com/733/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=numberformatdata.wordpress.com&amp;blog=11783965&amp;post=733&amp;subd=numberformatdata&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://numberformatdata.wordpress.com/2011/12/02/sudo-on-ubuntu-without-password/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6c22d6d1f6cd226c2501f8658e726e81?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">numberformat</media:title>
		</media:content>
	</item>
		<item>
		<title>Fake SMTP Server</title>
		<link>http://numberformatdata.wordpress.com/2011/12/01/fake-smtp-server/</link>
		<comments>http://numberformatdata.wordpress.com/2011/12/01/fake-smtp-server/#comments</comments>
		<pubDate>Thu, 01 Dec 2011 02:28:01 +0000</pubDate>
		<dc:creator>numberformat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[smtp]]></category>
		<category><![CDATA[threading]]></category>

		<guid isPermaLink="false">http://numberformatdata.wordpress.com/?p=724</guid>
		<description><![CDATA[The following page just contains a link to a nice Fake SMTP server that can be used to test email client software. The server does not send out any email. It just presents an interface for client software to connect and post email messages. The original JavaWorld Article describing this project is posted here. The [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=numberformatdata.wordpress.com&amp;blog=11783965&amp;post=724&amp;subd=numberformatdata&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The following page just contains a link to a nice Fake SMTP server that can be used to test email client software. The server does not send out any email. It just presents an interface for client software to connect and post email messages.</p>
<p>The original JavaWorld Article describing this project is <a href="http://www.javaworld.com/javaworld/jw-08-2003/jw-0829-smtp.html">posted here</a>.</p>
<p>The project has since been forked and a newer version of the software is available here: <a href="https://github.com/rjo1970/dumbster">SMTP server Git Hub Repository URL</a></p>
<p>The SMTP server is also a good baseline to start</p>
<ol>
<li>a new project that implements your own custom protocol.</li>
<li>to learn about server side multi-threading</li>
<li>to implement a server using Java</li>
</ol>
<p>The original project older version of the project is hosted at the following URL: </p>
<p><a href="http://quintanasoft.com/dumbster/">http://quintanasoft.com/dumbster/</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/numberformatdata.wordpress.com/724/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/numberformatdata.wordpress.com/724/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/numberformatdata.wordpress.com/724/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/numberformatdata.wordpress.com/724/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/numberformatdata.wordpress.com/724/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/numberformatdata.wordpress.com/724/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/numberformatdata.wordpress.com/724/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/numberformatdata.wordpress.com/724/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/numberformatdata.wordpress.com/724/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/numberformatdata.wordpress.com/724/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/numberformatdata.wordpress.com/724/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/numberformatdata.wordpress.com/724/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/numberformatdata.wordpress.com/724/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/numberformatdata.wordpress.com/724/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=numberformatdata.wordpress.com&amp;blog=11783965&amp;post=724&amp;subd=numberformatdata&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://numberformatdata.wordpress.com/2011/12/01/fake-smtp-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6c22d6d1f6cd226c2501f8658e726e81?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">numberformat</media:title>
		</media:content>
	</item>
		<item>
		<title>Configuring TCSH with command line search on Ubuntu</title>
		<link>http://numberformatdata.wordpress.com/2011/11/30/draft-configuring-tcsh-on-ubuntu/</link>
		<comments>http://numberformatdata.wordpress.com/2011/11/30/draft-configuring-tcsh-on-ubuntu/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 15:37:29 +0000</pubDate>
		<dc:creator>numberformat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[tcsh]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://numberformatdata.wordpress.com/?p=209</guid>
		<description><![CDATA[Ubuntu lacks the rich command line search functionality present in FreeBSD tcsh shell. This page describes how to get that back by installing and configuring tcsh on Ubuntu. Background tcsh is a pretty good shell. If you login to the root account in FreeBSD you will notice the command history search is pretty powerful. The [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=numberformatdata.wordpress.com&amp;blog=11783965&amp;post=209&amp;subd=numberformatdata&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ubuntu lacks the rich command line search functionality present in FreeBSD tcsh shell. This page describes how to get that back by installing and configuring tcsh on Ubuntu.</p>
<h3>Background</h3>
<p>tcsh is a pretty good shell. If you login to the root account in FreeBSD you will notice the command history search is pretty powerful. The following are the instructions on how to get the shell configured on Ubuntu.</p>
<h3>Procedure</h3>
<ol>
<li>The first step is to install tcsh. (Google for the instructions on how to get this installed) Based on my experience the command is: sudo apt-get install tcsh </li>
<li>At this moment I would keep one terminal screen open to make sure you don&#8217;t lock yourself out.</li>
<li>Next we will modify/create a /etc/csh.cshrc file.</li>
<p><pre class="brush: bash; gutter: false;">
# /etc/csh.cshrc: system-wide .cshrc file for csh(1) and tcsh(1)

if ($?tcsh &amp;&amp; $?prompt) then

        bindkey &quot;\e[1~&quot; beginning-of-line # Home
        bindkey &quot;\e[7~&quot; beginning-of-line # Home rxvt
        bindkey &quot;\e[2~&quot; overwrite-mode    # Ins
        bindkey &quot;\e[3~&quot; delete-char       # Delete
        bindkey &quot;\e[4~&quot; end-of-line       # End
        bindkey &quot;\e[8~&quot; end-of-line       # End rxvt

        bindkey &quot;^W&quot; backward-delete-word
        bindkey -k up history-search-backward
        bindkey -k down history-search-forward

        set autoexpand
        set autolist
        set prompt = '[%B%m%b] %B%~%b%# '
endif
</pre></p>
<li>Next we change the login shell for a test user on your system.</li>
<li>Login to the box using that test user and you should be able to see the difference.</li>
</ol>
<p>Let me know if it worked for you by entering a comment below.</p>
<p>Thanks!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/numberformatdata.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/numberformatdata.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/numberformatdata.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/numberformatdata.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/numberformatdata.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/numberformatdata.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/numberformatdata.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/numberformatdata.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/numberformatdata.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/numberformatdata.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/numberformatdata.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/numberformatdata.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/numberformatdata.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/numberformatdata.wordpress.com/209/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=numberformatdata.wordpress.com&amp;blog=11783965&amp;post=209&amp;subd=numberformatdata&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://numberformatdata.wordpress.com/2011/11/30/draft-configuring-tcsh-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6c22d6d1f6cd226c2501f8658e726e81?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">numberformat</media:title>
		</media:content>
	</item>
		<item>
		<title>Uninstalling Leaf Ports</title>
		<link>http://numberformatdata.wordpress.com/2011/11/27/uninstalling-leaf-ports/</link>
		<comments>http://numberformatdata.wordpress.com/2011/11/27/uninstalling-leaf-ports/#comments</comments>
		<pubDate>Sun, 27 Nov 2011 16:34:55 +0000</pubDate>
		<dc:creator>numberformat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[FreeBSD]]></category>

		<guid isPermaLink="false">http://numberformatdata.wordpress.com/?p=715</guid>
		<description><![CDATA[This page describes the process of un-installing ports that don&#8217;t have any other ports depending on them. These types of ports are called leafs. This is the first place to start when starting to analyse the system to remove software that is no longer used as a dependency for any thing else. Requirements FreeBSD box [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=numberformatdata.wordpress.com&amp;blog=11783965&amp;post=715&amp;subd=numberformatdata&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This page describes the process of un-installing ports that don&#8217;t have any other ports depending on them. These types of ports are called leafs. This is the first place to start when starting to analyse the system to remove software that is no longer used as a dependency for any thing else.</p>
<h3>Requirements</h3>
<ul>
<li>FreeBSD box with access to root account</li>
</ul>
<h3>Procedure</h3>
<p>A nice tool to help automate this task is available from the <a href="http://www.freshports.org/sysutils/pkg_cutleaves/">ports-mgmt/pkg_cutleaves</a> port.</p>
<p>Install the software and read the man page.</p>
<p>The typical options I use when using this port are:</p>
<p>-g &#8211; generate or merge exclude list when complete<br />
-R &#8211; auto prune newly created leaves<br />
-x &#8211; tells the program to use the exclude file. </p>
<p>Exclude file is kept here: /usr/local/etc/pkg_leaves.exclude</p>
<p>If I just want to have the program list me the leaves then I use</p>
<p>-l &#8211; list leaves only.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/numberformatdata.wordpress.com/715/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/numberformatdata.wordpress.com/715/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/numberformatdata.wordpress.com/715/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/numberformatdata.wordpress.com/715/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/numberformatdata.wordpress.com/715/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/numberformatdata.wordpress.com/715/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/numberformatdata.wordpress.com/715/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/numberformatdata.wordpress.com/715/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/numberformatdata.wordpress.com/715/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/numberformatdata.wordpress.com/715/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/numberformatdata.wordpress.com/715/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/numberformatdata.wordpress.com/715/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/numberformatdata.wordpress.com/715/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/numberformatdata.wordpress.com/715/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=numberformatdata.wordpress.com&amp;blog=11783965&amp;post=715&amp;subd=numberformatdata&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://numberformatdata.wordpress.com/2011/11/27/uninstalling-leaf-ports/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6c22d6d1f6cd226c2501f8658e726e81?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">numberformat</media:title>
		</media:content>
	</item>
		<item>
		<title>Displaying Perl Program Usage Information</title>
		<link>http://numberformatdata.wordpress.com/2011/11/26/displaying-perl-program-usage-information/</link>
		<comments>http://numberformatdata.wordpress.com/2011/11/26/displaying-perl-program-usage-information/#comments</comments>
		<pubDate>Sat, 26 Nov 2011 18:02:51 +0000</pubDate>
		<dc:creator>numberformat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://numberformatdata.wordpress.com/?p=700</guid>
		<description><![CDATA[Validate PERL program arguments, command line usage and generate man page. This page is also a good place to start with a blank perl template. The Program The following program is annotated with specific tokens that allow the Pod::Usage module provide the features listed above. Parameter Validation Print Help Information PERL Doc If you have [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=numberformatdata.wordpress.com&amp;blog=11783965&amp;post=700&amp;subd=numberformatdata&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Validate PERL program arguments, command line usage and generate man page. This page is also a good place to start with a blank perl template.</p>
<h3>The Program</h3>
<p>The following program is annotated with specific tokens that allow the Pod::Usage module provide the features listed above.</p>
<p><pre class="brush: perl; gutter: false;">
#!/usr/bin/perl -w

use Getopt::Long;
use Pod::Usage;

my $man = 0;
my $help = 0;
## Parse options and print usage if there is a syntax error,
## or if usage was explicitly requested.
GetOptions('help|?' =&gt; \$help, man =&gt; \$man) or pod2usage(2);
pod2usage(1) if $help;
pod2usage(-verbose =&gt; 2) if $man;

## If no arguments were given, then allow STDIN to be used only
## if it's not connected to a terminal (otherwise print usage)
pod2usage(&quot;$0: No files given.&quot;) if ((@ARGV == 0) &amp;&amp; (-t STDIN));
__END__

=head1 NAME

sample - Using GetOpt::Long and Pod::Usage

=head1 SYNOPSIS

sample [options] [file ...]

=head1 OPTIONS

=over 8

=item B&lt;-help&gt;

Print a brief help message and exits.

=item B&lt;-man&gt;

Prints the manual page and exits.

=back

=head1 DESCRIPTION

B&lt;This program&gt; will read the given input file(s) and do something
useful with the contents thereof.

=cut
</pre></p>
<h3>Parameter Validation</h3>
<p><pre class="brush: bash; gutter: false;">
./test.pl
</pre></p>
<h3>Print Help Information</h3>
<p><pre class="brush: bash; gutter: false;">
./test.pl -help
</pre></p>
<h3>PERL Doc</h3>
<p>If you have perldoc installed on your system when you type:</p>
<p><pre class="brush: bash; gutter: false;">
./test.pl -man
</pre></p>
<p>or</p>
<p><pre class="brush: bash; gutter: false;">
perldoc -T test.pl
</pre></p>
<p>The following is how to output looks like.<br />
<pre class="brush: plain; gutter: false;">
TEST(1)               User Contributed Perl Documentation              TEST(1)



NAME
       sample - Using GetOpt::Long and Pod::Usage

SYNOPSIS
       sample [options] [file ...]

OPTIONS
       -help   Print a brief help message and exits.

       -man    Prints the manual page and exits.

DESCRIPTION
       This program will read the given input file(s) and do something useful
       with the contents thereof.



perl v5.10.1                      2011-11-26                           TEST(1)
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/numberformatdata.wordpress.com/700/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/numberformatdata.wordpress.com/700/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/numberformatdata.wordpress.com/700/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/numberformatdata.wordpress.com/700/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/numberformatdata.wordpress.com/700/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/numberformatdata.wordpress.com/700/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/numberformatdata.wordpress.com/700/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/numberformatdata.wordpress.com/700/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/numberformatdata.wordpress.com/700/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/numberformatdata.wordpress.com/700/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/numberformatdata.wordpress.com/700/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/numberformatdata.wordpress.com/700/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/numberformatdata.wordpress.com/700/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/numberformatdata.wordpress.com/700/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=numberformatdata.wordpress.com&amp;blog=11783965&amp;post=700&amp;subd=numberformatdata&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://numberformatdata.wordpress.com/2011/11/26/displaying-perl-program-usage-information/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6c22d6d1f6cd226c2501f8658e726e81?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">numberformat</media:title>
		</media:content>
	</item>
		<item>
		<title>Installing a Fake DNS Server</title>
		<link>http://numberformatdata.wordpress.com/2011/11/24/installing-a-fake-dns-server/</link>
		<comments>http://numberformatdata.wordpress.com/2011/11/24/installing-a-fake-dns-server/#comments</comments>
		<pubDate>Thu, 24 Nov 2011 03:04:17 +0000</pubDate>
		<dc:creator>numberformat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[FreeBSD]]></category>

		<guid isPermaLink="false">http://numberformatdata.wordpress.com/?p=689</guid>
		<description><![CDATA[This page describes the process of installing DNSHijacker on your FreeBSD machine so that it can respond to requests with a specified answer. Background Faking DNS response can be handy when trying to create a walled garden, pop-up blocking, or IT Information Security analysis. Process The DNS Hijacker application is available as a port. The [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=numberformatdata.wordpress.com&amp;blog=11783965&amp;post=689&amp;subd=numberformatdata&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This page describes the process of installing DNSHijacker on your FreeBSD machine so that it can respond to requests with a specified answer. </p>
<h3>Background</h3>
<p>Faking DNS response can be handy when trying to create a walled garden, pop-up blocking, or IT Information Security analysis.</p>
<h3>Process</h3>
<p>The DNS Hijacker application is available as a port.</p>
<p><pre class="brush: bash; gutter: false;">
cd /usr/ports/dns/dnshijacker
make install clean
rehash
</pre></p>
<p>The following command line will run the DNS server and respond with 127.0.0.1 to all DNS queries. Specify -z to run it it as a daemon.<br />
<pre class="brush: bash; gutter: false;">
dnshijacker -d 127.0.0.1 -i lo0
</pre><br />
The answers are static. They can be specified in the command line argument, or in a tab delimited file.</p>
<h3>run a test query using dig</h3>
<p><pre class="brush: bash; gutter: false;">
virtual# dig @localhost ftp.freebsd.org
; &lt;&lt;&gt;&gt; DiG 9.6.-ESV-R3 &lt;&lt;&gt;&gt; @localhost ftp.freebsd.org
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 37226
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;ftp.freebsd.org.		IN	A

;; ANSWER SECTION:
ftp.freebsd.org.	0	IN	A	127.0.0.1

;; Query time: 204 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Wed Nov 23 21:37:49 2011
;; MSG SIZE  rcvd: 64
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/numberformatdata.wordpress.com/689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/numberformatdata.wordpress.com/689/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/numberformatdata.wordpress.com/689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/numberformatdata.wordpress.com/689/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/numberformatdata.wordpress.com/689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/numberformatdata.wordpress.com/689/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/numberformatdata.wordpress.com/689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/numberformatdata.wordpress.com/689/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/numberformatdata.wordpress.com/689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/numberformatdata.wordpress.com/689/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/numberformatdata.wordpress.com/689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/numberformatdata.wordpress.com/689/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/numberformatdata.wordpress.com/689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/numberformatdata.wordpress.com/689/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=numberformatdata.wordpress.com&amp;blog=11783965&amp;post=689&amp;subd=numberformatdata&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://numberformatdata.wordpress.com/2011/11/24/installing-a-fake-dns-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6c22d6d1f6cd226c2501f8658e726e81?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">numberformat</media:title>
		</media:content>
	</item>
		<item>
		<title>Mysql Backup and Restore procedures</title>
		<link>http://numberformatdata.wordpress.com/2011/11/12/mysql-backup-and-restore-procedures/</link>
		<comments>http://numberformatdata.wordpress.com/2011/11/12/mysql-backup-and-restore-procedures/#comments</comments>
		<pubDate>Sat, 12 Nov 2011 06:28:01 +0000</pubDate>
		<dc:creator>numberformat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://numberformatdata.wordpress.com/?p=627</guid>
		<description><![CDATA[This page describes techniques for backing up and restoring data in a mysql database. The page will start with a simple scenario for backing up data on an inactive or read only database and move on to more advanced examples of backing up data on an active database. For the purposes of this example we [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=numberformatdata.wordpress.com&amp;blog=11783965&amp;post=627&amp;subd=numberformatdata&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This page describes techniques for backing up and restoring data in a mysql database. The page will start with a simple scenario for backing up data on an inactive or read only database and move on to more advanced examples of backing up data on an active database.</p>
<p>For the purposes of this example we will use a mySQL database located on a FreeBSD system. However this procedures should work fine for databases located in windows (using cygwin) as well.</p>
<h3>Backup Types</h3>
<ol>
<li><strong>Text format backups</strong>: are done by using the mysqldump command. They create a text file with all the commands necessary for re-creating the database. This type of backup can be done while the server is running but in read only mode.</li>
<li><strong>Binary format backups</strong>: These types of backups are done using standard archival tools such as (cp, tar and gzip). These tools are more compact and quicker. This type of operation requires that the server be shut down.</li>
</ol>
<h3>Text Backup</h3>
<p>Step 1 is to make the server read only</p>
<p><pre class="brush: bash; light: true;">
FLUSH TABLES WITH READ LOCK;
SET GLOBAL read_only = ON;
</pre></p>
<p>Create the backup using the following command:<br />
<pre class="brush: bash; light: true;">
mysqldump --all-databases | gzip &gt; output.txt.gz
</pre></p>
<p>To make the server read-write issue the following commands.<br />
<pre class="brush: bash; light: true;">
SET GLOBAL read_only = OFF;
UNLOCK TABLES;
</pre></p>
<h3>Binary Backups</h3>
<p>Binary backups require that you shut down the mySQL server. In order to shut down the mySQL server in FreeBSD issue the following </p>
<p>command:<br />
<pre class="brush: bash; light: true;">
/usr/local/etc/rc.d/mysql-server stop
</pre></p>
<p>Once the server is stopped you can copy the complete database over to another disk or tape. Once the copy is complete  you can start the database server by issuing the following command:</p>
<p><pre class="brush: bash; light: true;">
/usr/local/etc/rc.d/mysql-server start
</pre></p>
<h3>Backing up data on an active or live database</h3>
<p>This type of backup is more challenging since we will be performing a backup on a database that is actively being used. In order to get this done, review the following tutorial on <a href="http://numberformatdata.wordpress.com/2011/11/12/setting-up-data-replication-in-mysql/">setting up mySQL data replication.</a></p>
<p>Once replication is set up all that needs to be done is to shut down the slave server, perform the backup on the data and bring the server back up. The slave server will sync with the master and get all the updates it missed while the backup was taking place.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/numberformatdata.wordpress.com/627/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/numberformatdata.wordpress.com/627/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/numberformatdata.wordpress.com/627/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/numberformatdata.wordpress.com/627/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/numberformatdata.wordpress.com/627/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/numberformatdata.wordpress.com/627/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/numberformatdata.wordpress.com/627/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/numberformatdata.wordpress.com/627/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/numberformatdata.wordpress.com/627/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/numberformatdata.wordpress.com/627/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/numberformatdata.wordpress.com/627/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/numberformatdata.wordpress.com/627/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/numberformatdata.wordpress.com/627/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/numberformatdata.wordpress.com/627/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=numberformatdata.wordpress.com&amp;blog=11783965&amp;post=627&amp;subd=numberformatdata&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://numberformatdata.wordpress.com/2011/11/12/mysql-backup-and-restore-procedures/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6c22d6d1f6cd226c2501f8658e726e81?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">numberformat</media:title>
		</media:content>
	</item>
	</channel>
</rss>
