<?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>Techblog</title>
	<atom:link href="http://techblog.ryansworld.net/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://techblog.ryansworld.net</link>
	<description></description>
	<lastBuildDate>Thu, 26 Aug 2010 17:39:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Firewall blocking RIR IP Blocks</title>
		<link>http://techblog.ryansworld.net/?p=138</link>
		<comments>http://techblog.ryansworld.net/?p=138#comments</comments>
		<pubDate>Thu, 26 Aug 2010 17:35:44 +0000</pubDate>
		<dc:creator>RyanWagner</dc:creator>
				<category><![CDATA[SMB]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Understanding Technology]]></category>

		<guid isPermaLink="false">http://techblog.ryansworld.net/?p=138</guid>
		<description><![CDATA[When I am working with an organization to improve overall network security I start off by looking through logs and in nearly every situation the majority of attacks come from outside of North America.  My next question is &#8220;What legitimate reason would someone outside of North America have to reach your network?&#8221;, and in many [...]]]></description>
			<content:encoded><![CDATA[<p>When I am working with an organization to improve overall network security I start off by looking through logs and in nearly every situation the majority of attacks come from outside of North America.  My next question is &#8220;What legitimate reason would someone outside of North America have to reach your network?&#8221;, and in many situations the answer is &#8220;none&#8221;.</p>
<p>For those of you who find yourself in this situation here is some helpful information.</p>
<p>Q1: What does RIR stand for?</p>
<p>A1: Regional Internet Registry</p>
<p>Q2: What does a RIR do?</p>
<p>A2: IANA distrubutes /8 IPv4 address blocks to the 5 RIRs and the RIRs distribute those address&#8217; to organizations, like ISPs, within their region.</p>
<p>Q3: How does this information help me improve my security?</p>
<p>A3:  Using the <a href="http://www.iana.net/assignments/ipv4-address-space/ipv4-address-space.xml">IANA Ipv4 Address Space Registry</a> we know which RIRs have which IP Blocks.  Since ARIN managed the US, Canada, and some of the Caribbean we can block entire regions that have no legitimate reason to access your network.</p>
<p>Q4: What do you mean &#8220;no legitimate reason to access your network&#8221;</p>
<p>A4: Well if your organization only deals with customers, clients, etc within North America and Europe then anyone outside of of North America and Europe who tries to access your web servers, email servers, etc is likely doing so for a nefarious reason.</p>
<p>Q5:  Wouldn&#8217;t blocking entire regions be dangerous or harmful?</p>
<p>A5:  This depends on your organizational needs, but in most cases the network connections made from regions outside of your organizational influence are done so to harm you.  Blocking these regions is the next logical step and you are already probably blocking large quantities of IPs from these regions anyway, after you responded to a threat.  Simply put the only risk is that you would prohibit legitimate traffic, and this is why you need to ask yourself &#8220;Why would someone in X region need to legitimately connect with my network?&#8221;</p>
<p>Q6: What&#8217;s the benefit from doing this?</p>
<p>A6: If your able to block all traffic outside of ARIN coverage then you should expect to see upwards of 99% reduction in attacks and information gathering.  Very few attacks come from North America and those that do are usually coming in the form of spam, and I credit much of this to the responsiveness from the FBI.  Most countries do not chase after cyber criminals with the same tenacity the US and Canada does and as a result more criminals choose to operate from outside of the ARIN coverage area.  Even in environments that have been actively improving security there is still a sizable reduction in threats detected.</p>
<p>Q7:  What about people who travel outside the country?</p>
<p>A7:  There are several solutions available to work around this problem, but the easiest, and usually most cost effective solution, is to buy a single server who&#8217;s sole purpose is for remote access.  This will not open up access for everyday users, but if your Senior Engineer is exploring Africa when a major network outage occurs and they have access to the internet then they can simply remote into the remote system and go from there.   I also should point out that a single cloud server capable of simple remote access via a CLI can be as cheep as 10USD/month.  If you only use the server for emergency international access you could reduce this cost even more.  Just imagine any solution in the same way you currently imagine how you work VPN access or any other security zone access.  You want to block as much as you can as a general rule and then restricted access from a single access point that is heavily managed and monitored.<br />
NOTE:  For email access anyone currently using a mobile device that connects to email via a proxy will still work.  For example if your using a blackberry service or Iphone service then users will still have access to email on their mobile device regardless of where they connect from.  If your using an internal service then you will need to place a mobile mail server that has access.  This is basically a proxy server that allows email to be served from outside the normal RIR restrictions.</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.ryansworld.net/?feed=rss2&amp;p=138</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows 2008 R2 DNS Issues</title>
		<link>http://techblog.ryansworld.net/?p=132</link>
		<comments>http://techblog.ryansworld.net/?p=132#comments</comments>
		<pubDate>Thu, 10 Jun 2010 16:46:58 +0000</pubDate>
		<dc:creator>RyanWagner</dc:creator>
				<category><![CDATA[SMB]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Understanding Technology]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://techblog.ryansworld.net/?p=132</guid>
		<description><![CDATA[By default 2008 R2 has enabled EDNS, but EDNS is not compliant with all domains as of right now.  This causes DNS failures. Fix To disable EDns, you can do it from the command prompt, or by editing the registry. From the command prompt, no restart of DNS is required.  If from the registry, make [...]]]></description>
			<content:encoded><![CDATA[<p>By default 2008 R2 has enabled EDNS, but EDNS is not compliant with all domains as of right now.  This causes DNS failures.</p>
<p><strong>Fix</strong></p>
<p>To disable EDns, you can do it from the command prompt, or by editing the registry.</p>
<p>From the command prompt, no restart of DNS is required.  If from the registry, make sure to restart the DNS Server service.</p>
<p><em>Command prompt:  </em></p>
<p>dnscmd /config /EnableEDNSProbes 0</p>
<p>No restart is needed.  It takes effect immediately.</p>
<p><em>or Registry: </em>&lt;/&gt;</p>
<p>Create a DWORD called EnableEDNSProbes and set to 0 in HKLM\SYSTEM\CurrentControlSet\services\DNS\Parameters</p>
<p>Restart the DNS Server service for it to take effect.</p>
<p>Here is a link to the source of the fix:</p>
<p><a href="http://weblogs.asp.net/owscott/archive/2009/09/15/windows-server-2008-r2-dns-issues.aspx">http://weblogs.asp.net/owscott/archive/2009/09/15/windows-server-2008-r2-dns-issues.aspx</a></p>
<p>Here is the windows kb article on the issue: <a href="http://support.microsoft.com/kb/832223">http://support.microsoft.com/kb/832223</a></p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.ryansworld.net/?feed=rss2&amp;p=132</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Milter-Greylist &amp; Sendmail (fix)</title>
		<link>http://techblog.ryansworld.net/?p=128</link>
		<comments>http://techblog.ryansworld.net/?p=128#comments</comments>
		<pubDate>Tue, 18 May 2010 13:30:50 +0000</pubDate>
		<dc:creator>RyanWagner</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[SMB]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Understanding Technology]]></category>

		<guid isPermaLink="false">http://techblog.ryansworld.net/?p=128</guid>
		<description><![CDATA[If you are currently using milter-greylist for sendmail then you may have errors in your maillog indicating errors.  The first error you may see is a {daemon_port} error.  The next error you may see is a socket unsafe error The final error you may see is a error indicating that milter-greylist has stopped working. All 3 [...]]]></description>
			<content:encoded><![CDATA[<p>If you are currently using milter-greylist for sendmail then you may have errors in your maillog indicating errors. </p>
<p>The first error you may see is a {daemon_port} error. </p>
<p>The next error you may see is a socket unsafe error</p>
<p>The final error you may see is a error indicating that milter-greylist has stopped working.</p>
<p>All 3 of these can be occuring without any noticable issues for users.  In my mind if you can remove an error by updating the config then you should and all 3 of these errors are because the milter-greylist documentation has a weak/broken example for the M4 file.</p>
<p>THE FIX:</p>
<p>Update your M4 milter-greylist entry to:</p>
<p>INPUT_MAIL_FILTER(`milter-graylist&#8217;,`S=local:/var/run/milter-greylist/milter-greylist.sock, F=T,T=S:1m;R:2m;E:3m&#8217;)dnl<br />
define(`confMILTER_MACROS_CONNECT&#8217;,confMILTER_MACROS_CONNECT`,{daemon_port}&#8217;)dnl<br />
define(`confMILTER_MACROS_HELO&#8217;,confMILTER_MACROS_HELO`,{verify},{client_resolve}&#8217;)dnl                                 <br />
define(`confMILTER_MACROS_ENVRCPT&#8217;,confMILTER_MACROS_ENVRCPT`,{client_resolve}&#8217;)dnl</p>
<p>Please note that this entry is for the default install location for Yum/Fedora.  If you are using another unix flavor, or installed milter-greylist to run from a different location, just update the file path.</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.ryansworld.net/?feed=rss2&amp;p=128</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install ClamAV on Fedora via Yum for sendmail</title>
		<link>http://techblog.ryansworld.net/?p=123</link>
		<comments>http://techblog.ryansworld.net/?p=123#comments</comments>
		<pubDate>Wed, 12 May 2010 16:01:25 +0000</pubDate>
		<dc:creator>RyanWagner</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[SMB]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Understanding Technology]]></category>

		<guid isPermaLink="false">http://techblog.ryansworld.net/?p=123</guid>
		<description><![CDATA[ClamAV installation on fedora is not at all simple or straight forward.  ClamAV support and wiki do not properly document the process so here are the steps you need to complete. packages to install: clamav-server clamav-update clamav-milter clamav-milter-sysvinit Then you need to run the bash script found here: http://github.com/csmart/naa/blob/master/configure-clamd.sh In the event that link dies: [...]]]></description>
			<content:encoded><![CDATA[<p>ClamAV installation on fedora is not at all simple or straight forward.  ClamAV support and wiki do not properly document the process so here are the steps you need to complete.</p>
<p>packages to install:</p>
<blockquote><p>clamav-server</p>
<p>clamav-update</p>
<p>clamav-milter</p>
<p>clamav-milter-sysvinit</p></blockquote>
<p>Then you need to run the bash script found here:</p>
<p><a href="http://github.com/csmart/naa/blob/master/configure-clamd.sh">http://github.com/csmart/naa/blob/master/configure-clamd.sh</a></p>
<p>In the event that link dies:</p>
<blockquote>
<pre>#!/bin/bash

# Copyright 2009 "Christopher Smart" &lt;<span class="mh-plaintext">m<a href='http://mailhide.recaptcha.net/d?k=016utmuMS5LGaus29dd1vFfQ==&amp;c=rABI_foHcZW7EyfZ3Vc6xe9XVSF6K366KS0bc3GR0mE=' onclick="window.open('http://mailhide.recaptcha.net/d?k=016utmuMS5LGaus29dd1vFfQ==&amp;c=rABI_foHcZW7EyfZ3Vc6xe9XVSF6K366KS0bc3GR0mE=', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;" title="Reveal this e-mail address">...</a>@christophersmart.com</span>&gt;
#
# 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 3 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.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.

#This script is for installing and configuring clam-server (clamd) on Fedora

#Variables
VERSION=0.1
COUNTDOWN_TIMEOUT=5
FEDORA_RELEASE="`cat /etc/fedora-release 2&gt;/dev/null`"
FRESHCLAM_CONF="/etc/freshclam.conf"

#These variables are set later, once we know the user
CLAMD_USER=""
CLAMD_CONFIG=""
CLAMD_SYSCONFIG=""
CLAMD_INIT=""
CLAMD_LOGROTATE=""
CLAMD_PID=""
CLAMD_LOG=""

#These variables are set later, once we know clamav-server version
CLAMD_VERSION=""
CLAMD_CONFIG_TEMPLATE=""
CLAMD_SYSCONFIG_TEMPLATE=""
CLAMD_INIT_TEMPLATE=""
CLAMD_LOGROTATE_TEMPLATE=""

#Functions
countdown() {
	i=$1
	echo "If you do NOT want to proceed, hit CTRL+C within $i seconds..."
	while [ $i -gt 0 ]
	do
		sleep 1
		echo -ne "$i.. "
		let i=i-1
	done
}

#Make this more pretty by adding an extra blank line at the beginning
echo ""

#Print help, if requested
if [ "$1" == "help" -o "$1" == "-help" -o "$1" == "--help" -o "$1" == "-h" -o "$1" == "--h" ]
then
	echo "This script configures clamav-server (clamd) on Fedora."
	echo "Version $VERSION"
	echo ""
	echo "Usage:"
	echo " $0 [option] [username] [port]"
	echo ""
	echo "Options:"
	echo " -c creates an instance, overwriting if already exists."
	echo " -r removes an instance."
	echo ""
	echo "Parameters (optional):"
	echo " [username] pass in the username you want clamd to run as, defaults to 'clamav'."
	echo " [port] pass in the port you want clamd to run on, defaults to '3310'."
	echo ""
	echo "Create example:"
	echo " $0 -c me 3311"
	echo ""
	echo "Remove example:"
	echo " $0 -r me 3311"
	echo ""
	echo "Report bugs to <span class="mh-plaintext">m<a href='http://mailhide.recaptcha.net/d?k=016utmuMS5LGaus29dd1vFfQ==&amp;c=rABI_foHcZW7EyfZ3Vc6xe9XVSF6K366KS0bc3GR0mE=' onclick="window.open('http://mailhide.recaptcha.net/d?k=016utmuMS5LGaus29dd1vFfQ==&amp;c=rABI_foHcZW7EyfZ3Vc6xe9XVSF6K366KS0bc3GR0mE=', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;" title="Reveal this e-mail address">...</a>@christophersmart.com</span>"
	echo ""
	exit 0
fi

#Check that we're running Fedora
if [ -z "$FEDORA_RELEASE" ]
then
	echo "You don't appear to be running Fedora, sorry!"
	echo "Exiting."
	echo ""
	exit 1
fi

#We're running Fedora, so make sure we're root
if [ $EUID -ne 0 ]
then
	echo "You must run this as root. Prepend sudo, or run:"
	echo "su -c '$0 [option] [username] [port]'"
	echo ""
	echo "Exiting."
	echo ""
	exit 1
else
	echo "You appear to be running `echo $FEDORA_RELEASE`, excellent."
	echo ""
fi

#Set clamd user and port
if [ "$1" != "-c" -a "$1" != "-r" ]
then
	CLAMD_USER="clamav"
	CLAMD_PORT="3310"
else
	if [ -z "$2" ]
	then
		CLAMD_USER="clamav"
	else
		CLAMD_USER="$2"
	fi

	if [ -z "$3" ]
	then
		CLAMD_PORT="3310"
	else
		CLAMD_PORT="$3"
	fi
fi

#Variables for config files, now that we know the user
CLAMD_CONFIG="/etc/clamd.d/$CLAMD_USER.conf"
CLAMD_INIT="/etc/init.d/clamd.$CLAMD_USER"
CLAMD_LOGROTATE="/etc/logrotate.d/clamd-$CLAMD_USER"
CLAMD_PID="/var/run/clamd.$CLAMD_USER"
CLAMD_LOG="/var/log/clamd.$CLAMD_USER"
CLAMD_SYSCONFIG="/etc/sysconfig/clamd.$CLAMD_USER"
CLAMD_CHKCONFIG="/sbin/chkconfig clamd.$CLAMD_USER"

#Removing existing instance of clamd for specified user, if told to do so
if [ "$1" == "-r" ]
then
	echo "**WARNING** Removing clamd instance for user '$CLAMD_USER'."
	countdown $COUNTDOWN_TIMEOUT
	echo ""
	echo "OK then, proceeding.."
	echo ""

	#Check to see if there's a configuration for that user already
	if [ ! -e $CLAMD_CONFIG ]
	then
		echo "No clamd instance found for user '$CLAMD_USER'."
		echo "Exiting."
		echo ""
		exit 1
	fi	

	#Stop and disable daemon
	$CLAMD_INIT stop &amp;&gt;/dev/null
	if [ $? -ne 0 ]
	then
		echo "Could not stop service, sorry."
		echo ""
		echo "Instance of clamd for user '$CLAMD_USER' NOT removed."
		echo "Exiting."
		echo ""
		exit 1
	fi

	#Turn off daemon
	$CLAMD_CHKCONFIG off &amp;&gt;/dev/null

	#Remove configs and logs, etc
	rm -f $CLAMD_CONFIG 2&gt;/dev/null
	rm -f $CLAMD_INIT 2&gt;/dev/null
	rm -f $CLAMD_LOGROTATE 2&gt;/dev/null
	rm -rf $CLAMD_PID 2&gt;/dev/null
	rm -f $CLAMD_LOG 2&gt;/dev/null
	rm -f $CLAMD_SYSCONFIG 2&gt;/dev/null
	unlink /usr/sbin/clamd.$CLAMD_USER 2&gt;/dev/null

	#Remove user?
	if [ -n "`id $CLAMD_USER 2&gt;/dev/null`" ]
	then
		#User exists, so ask if it should be removed
		echo -e "**WARNING** DO YOU WANT TO REMOVE THE USER FROM THE SYSTEM? (y/N): \c "
		read answer
		echo ""
		if [ "$answer" == "y" -o "$answer" == "Y" ]
		then
			#Remove user and confirm success
			echo "OK, removing user '$CLAMD_USER' from the system."
			userdel -r $CLAMD_USER 2&gt;/dev/null
			if [ $? -eq 0 -o $? -eq 12 ]
			then
				echo "User removed successfully."
				echo ""
			else
				echo "**WARNING** Could not remove clamd user from the system. Perform manually."
				echo ""
			fi
		else
			echo "OK, user will NOT be removed."
			echo ""
		fi
	else
		echo "User does not exist in the system, not removing."
		echo ""
	fi
	echo "Instance of clamd for user '$CLAMD_USER' has been successfully removed."
	echo ""
	exit 0
fi

#Creating
echo "Configuring clamd to run as user '$CLAMD_USER' on port '$CLAMD_PORT'."
echo ""
countdown $COUNTDOWN_TIMEOUT
echo ""
echo "OK then, proceeding.."
echo ""

#Checking to see if required packages are installed or not
echo "Checking for required packages.."
if [ -n "`rpm -qa |grep clamav`" -a "`rpm -qa |grep clamav-update`" -a "`rpm -qa |grep clamav-server`" ]
then
	echo "Required packages already installed."
	echo ""
else

	#Install required packages
	echo "Installing required clamav packages.."
	echo ""
	yum -yq install clamav clamav-server clamav-update
	echo ""

	#Check that the install was successful (or already installed)
	if [ -n "`rpm -qa |grep clamav`" -a "`rpm -qa |grep clamav-update`" -a "`rpm -qa |grep clamav-server`" ]
	then
		echo "Packages successfully installed."
		echo ""
	else
		echo "Problem installing required packages, sorry."
		echo ""
		echo "Instance of clamd for user '$CLAMD_USER' NOT created successfully."
		echo "Exiting."
		echo ""
		exit 1
	fi
fi

#Get version of clamd, now that it's installed
CLAMD_VERSION="`rpm -qa |grep clamav-server |awk -F "-" {'print $3'} 2&gt;/dev/null`"

#Variables for template files now that we know the version of clamav-server installed
CLAMD_CONFIG_TEMPLATE="/usr/share/doc/clamav-server-$CLAMD_VERSION/clamd.conf"
CLAMD_SYSCONFIG_TEMPLATE="/usr/share/doc/clamav-server-$CLAMD_VERSION/clamd.sysconfig"
CLAMD_INIT_TEMPLATE="/usr/share/doc/clamav-server-$CLAMD_VERSION/clamd.init"
CLAMD_LOGROTATE_TEMPLATE="/usr/share/doc/clamav-server-$CLAMD_VERSION/clamd.logrotate"

#Create clamav user if doesn't exist
#This should be the user who wants to talk to clamd, else user clamav must have read (and possibly write) access on the files.
echo "Checking for clamav user, '$CLAMD_USER'.."

if [ -z "`id $CLAMD_USER 2&gt;/dev/null`" ]
then
	useradd $CLAMD_USER -r -c "User for clamd" -d /dev/null -M -s /sbin/nologin 2&gt;/dev/null
	if [ $? -ne 0 ]
	then
		echo "Unable to create new clamd user, '$CLAMD_USER', sorry."
		echo ""
		echo "Instance of clamd for user '$CLAMD_USER' NOT created successfully."
		echo "Exiting."
		echo ""
		exit 1
	else
		echo "Created new user."
		echo ""
	fi
else
	echo "User already exists, not creating."
	echo ""
fi

#Copy and configure clamd configuration file
echo "Configuring clamd to do all the right things.."

#Check that ALL required template files exist before continuing
if [ ! -e "$CLAMD_CONFIG_TEMPLATE" -o  ! -e "$CLAMD_SYSCONFIG_TEMPLATE" -o ! -e "$CLAMD_INIT_TEMPLATE" -o ! -e "$CLAMD_LOGROTATE_TEMPLATE" ]
then
	echo "Could not find required template files under /usr/share/doc/clamav-server-$CLAMD_VERSION/, sorry."
	echo ""
	echo "Instance of clamd for user '$CLAMD_USER' NOT created successfully."
	echo "Exiting."
	echo ""
	exit 1
fi

#Check to see if an instance of clamd for user already exists
if [ -e $CLAMD_CONFIG ]
then
	echo "Instance of clamd already exists, clobbering.."
	#Stop existing daemon to enable new one
	/etc/init.d/clamd.$CLAMD_USER stop &amp;&gt;/dev/null
	#Remove existing config because 'cp' is aliased with -i and we don't want a prompt
	rm -f $CLAMD_CONFIG 2&gt;/dev/null
fi

#Check to see if the port is already in use, if so, increment by one until we find something that's free
PORT_INUSE=0
while [ -n "`netstat -ltn |grep ":$CLAMD_PORT"`" ]
do
	CLAMD_PORT=$(($CLAMD_PORT+1))

	PORT_INUSE=1
done
if [ $PORT_INUSE == 1 ]
then
	echo "Port was already in use, using '$CLAMD_PORT' instead."
fi

#Make sure directory exists, which it should if clamav-server is installed (but you never know)
mkdir -p /etc/clamd.d 2&gt;/dev/null

#Copy over the template file
cp -f $CLAMD_CONFIG_TEMPLATE $CLAMD_CONFIG 2&gt;/dev/null
sed -i 's/clamd.&lt;SERVICE&gt;/clamd.'$CLAMD_USER'/' $CLAMD_CONFIG
sed -i 's/^Example/#Example/' $CLAMD_CONFIG
sed -i 's/^#LogFile/LogFile/' $CLAMD_CONFIG
sed -i 's/^#PidFile/PidFile/' $CLAMD_CONFIG
sed -i 's/^LocalSocket/#LocalSocket/' $CLAMD_CONFIG
sed -i 's/^#TCPSocket\ 3310/TCPSocket\ '$CLAMD_PORT'/' $CLAMD_CONFIG
sed -i 's/^#TCPAddr/TCPAddr/' $CLAMD_CONFIG
sed -i 's/&lt;USER&gt;/'$CLAMD_USER'/' $CLAMD_CONFIG
echo "Done."
echo ""

#Copy and configure clamd for log rotation
if [ -d /etc/logrotate.d ]
then
	echo "Configuring log rotation for clamd.."

	#Try to remove existing log rotate config, whether it exists or not because 'cp' is aliased with -i
	rm -f $CLAMD_LOGROTATE 2&gt;/dev/null
	cp -f $CLAMD_LOGROTATE_TEMPLATE $CLAMD_LOGROTATE
	sed -i 's/clamd.&lt;SERVICE&gt;/clamd.'$CLAMD_USER'/' $CLAMD_LOGROTATE
fi
echo "Done."
echo ""

#Configuring clamd under sysconfig
echo "Configuring clamd under syconfig.."

#Try to remove existing config, whether it exists or not because 'cp' is aliased with -i
rm -f $CLAMD_SYSCONFIG 2&gt;/dev/null

#Copy over the template file
cp -f $CLAMD_SYSCONFIG_TEMPLATE $CLAMD_SYSCONFIG 2&gt;/dev/null
sed -i 's/&lt;SERVICE&gt;/'$CLAMD_USER'/' $CLAMD_SYSCONFIG
sed -i 's/^#CLAMD/'CLAMD'/' $CLAMD_SYSCONFIG
echo "Done."
echo ""

#Configuring clamd init script
echo "Configuring clamd init script.."

#Try to remove existing config, whether it exists or not because 'cp' is aliased with -i
rm -f $CLAMD_INIT 2&gt;/dev/null

#Copy over the init script
cp -f $CLAMD_INIT_TEMPLATE $CLAMD_INIT 2&gt;/dev/null
sed -i 's/&lt;SERVICE&gt;/'$CLAMD_USER'/' $CLAMD_INIT
ln -s /usr/sbin/clamd /usr/sbin/clamd.$CLAMD_USER 2&gt;/dev/null
$CLAMD_CHKCONFIG on
#Check that was successful
if [ $? -ne 0 ]
then
	echo "Could not turn service on, sorry."
	echo "Exiting."
	echo ""
	exit 1
fi
echo "Done."
echo ""

#Configure freshclam
echo "Enabling freshclam, the clamav updater.."
sed -i 's/^Example/#Example/' $FRESHCLAM_CONF

#Should we set the proxy too, if in env?
echo "Done."
echo ""

echo "Creating required directories and starting service.."
#Setup logs
touch $CLAMD_LOG
chown $CLAMD_USER:$CLAMD_USER $CLAMD_LOG
chmod 0620 $CLAMD_LOG

#Setup run socket
mkdir $CLAMD_PID 2&gt;/dev/null
chown $CLAMD_USER:$CLAMD_USER $CLAMD_PID/

#Start services
/etc/init.d/clamd.$CLAMD_USER start &amp;&gt;/dev/null
if [ $? -ne 0 ]
then
	echo "Could not start service, sorry."
	echo "Continuing."
	echo ""
fi
echo "Done."
echo ""

#Print summary
echo "The clamd service has been successfully installed and configured with:"
echo "User '$CLAMD_USER' on port '$CLAMD_PORT'."
echo ""
echo 'Have fun!'
echo ""</pre>
</blockquote>
<pre>Now open clamav-milter.conf (/etc/mail/clamav-milter.conf)</pre>
<pre>comment out:</pre>
<blockquote>
<pre>#Example</pre>
</blockquote>
<pre>Add/Change:</pre>
<blockquote>
<pre>MilterSocket /var/run/clamav-milter/clamav-milter.socket</pre>
<pre>ClamdSocket unix:/var/run/clamd.clamav/clamd.sock
ClamdSocket tcp:localhost</pre>
</blockquote>
<pre>Now open clamd.conf (/etc/clamd.conf)</pre>
<pre>comment out:</pre>
<blockquote>
<pre>#User &lt;USER&gt;</pre>
</blockquote>
<pre>Add/Change:</pre>
<blockquote>
<pre>LocalSocket /var/run/clamd.clamav/clamd.sock</pre>
</blockquote>
<pre>Your services are named</pre>
<blockquote>
<pre>THIS INSTALL = OTHER DISTROS</pre>
<pre>clamd.clamav = clamd</pre>
<pre>clamav-milter = clamav-milter</pre>
</blockquote>
<pre>In Sendmail you need to edit the m4 file:</pre>
<pre>add/change:</pre>
<blockquote>
<pre>INPUT_MAIL_FILTER(`clamav-milter',`S=local:/var/run/clamav-milter/clamav-milter.socket,F=T, T=S:4m;R:4m')dnl
define(`ConfINPUT_MAIL_FILTERS', `clamav-milter')dnl
</pre>
</blockquote>
<pre>At this point you will need to restart all 3 services (clamd.clamav, clamav-milter, sendmail)</pre>
<pre>Keep in mind that this process will enable clamav, but by default clamav doesn't do anything.  You will still need to configure clamav, but this process is just like any other distro.</pre>
]]></content:encoded>
			<wfw:commentRss>http://techblog.ryansworld.net/?feed=rss2&amp;p=123</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows 7 Trial &#8211; Extended</title>
		<link>http://techblog.ryansworld.net/?p=116</link>
		<comments>http://techblog.ryansworld.net/?p=116#comments</comments>
		<pubDate>Wed, 21 Apr 2010 12:52:10 +0000</pubDate>
		<dc:creator>RyanWagner</dc:creator>
				<category><![CDATA[SMB]]></category>

		<guid isPermaLink="false">http://techblog.ryansworld.net/?p=116</guid>
		<description><![CDATA[Windows 7 Trial has been extended thru Dec 31, 2010: http://technet.microsoft.com/en-us/evalcenter/cc442495.aspx]]></description>
			<content:encoded><![CDATA[<p>Windows 7 Trial has been extended thru Dec 31, 2010:</p>
<p><a href="http://technet.microsoft.com/en-us/evalcenter/cc442495.aspx">http://technet.microsoft.com/en-us/evalcenter/cc442495.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.ryansworld.net/?feed=rss2&amp;p=116</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[FIX]Cisco ASA &#8211; No DHCP Address</title>
		<link>http://techblog.ryansworld.net/?p=120</link>
		<comments>http://techblog.ryansworld.net/?p=120#comments</comments>
		<pubDate>Tue, 06 Apr 2010 15:14:13 +0000</pubDate>
		<dc:creator>RyanWagner</dc:creator>
				<category><![CDATA[SMB]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Understanding Technology]]></category>

		<guid isPermaLink="false">http://techblog.ryansworld.net/?p=120</guid>
		<description><![CDATA[If you have a Cisco ASA and are having problems recieving a DHCP address there are a couple things you should know. 1) Prior to ASA version 7.2.2 (22) there is no way to assign a &#8220;client-id&#8221;. 2) client-id is a requirement for many ISPs to recieve a DHCP address. Solution: 1) Need ASA IOS [...]]]></description>
			<content:encoded><![CDATA[<p>If you have a Cisco ASA and are having problems recieving a DHCP address there are a couple things you should know.</p>
<p>1) Prior to ASA version 7.2.2 (22) there is no way to assign a &#8220;client-id&#8221;.</p>
<p>2) client-id is a requirement for many ISPs to recieve a DHCP address.</p>
<p>Solution:</p>
<p>1) Need ASA IOS 7.2.(2).22 or higher</p>
<p>2) DO NOT USE &#8216;Cisco&lt;MAC&gt;-interfaxce_name-&lt;host&gt;&#8217; as the client-id</p>
<p>3) perform the command:</p>
<blockquote><p>Interface vlanX</p>
<p>dhcp client route distance 1</p>
<p>ip address  dhcp setroute</p>
<p>dhcp-client client-id interface outside</p></blockquote>
<p>with vlanX being the correct vlan for your outside interface.</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.ryansworld.net/?feed=rss2&amp;p=120</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Comcast IPv6 Information</title>
		<link>http://techblog.ryansworld.net/?p=112</link>
		<comments>http://techblog.ryansworld.net/?p=112#comments</comments>
		<pubDate>Fri, 12 Mar 2010 16:42:39 +0000</pubDate>
		<dc:creator>RyanWagner</dc:creator>
				<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://techblog.ryansworld.net/?p=112</guid>
		<description><![CDATA[For those of you who have Comcast you can find out more about IPv6 in your area here: http://www.comcast6.net/ There is also a link to signup if you are eager to test out ipv6 from home. Just remember that google ipv6 site doesn&#8217;t like tunnels and the comcast 1st test phase is tunneled.]]></description>
			<content:encoded><![CDATA[<p>For those of you who have Comcast you can find out more about IPv6 in your area here:<br />
<a href="http://www.comcast6.net/">http://www.comcast6.net/</a></p>
<p>There is also a link to signup if you are eager to test out ipv6 from home.  Just remember that google ipv6 site doesn&#8217;t like tunnels and the comcast 1st test phase is tunneled.</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.ryansworld.net/?feed=rss2&amp;p=112</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IPv6 Exhaustion Counter &amp; and other tools for IPv6 tracking</title>
		<link>http://techblog.ryansworld.net/?p=110</link>
		<comments>http://techblog.ryansworld.net/?p=110#comments</comments>
		<pubDate>Fri, 05 Mar 2010 12:30:49 +0000</pubDate>
		<dc:creator>RyanWagner</dc:creator>
				<category><![CDATA[SMB]]></category>
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://techblog.ryansworld.net/?p=110</guid>
		<description><![CDATA[Anyone who knows me personally knows how serious I take the IPv6 change over. Here is a counter I found that shows the exhaustion to occur in Sept 2011. http://inetcore.com/project/ipv4ec/index_en.html Here are some other tools they have offered: 1) IPv4/IPv6 Address checker: http://inetcore.com/project/46checker/index.html.en 2) Internet Metrics: http://inetcore.com/project/metrics/index.html.en 3) IPv4/IPv6 Meter: (I will be adding this [...]]]></description>
			<content:encoded><![CDATA[<p>Anyone who knows me personally knows how serious I take the IPv6 change over.  Here is a counter I found that shows the exhaustion to occur in Sept 2011.<br />
<a href="http://inetcore.com/project/ipv4ec/index_en.html">http://inetcore.com/project/ipv4ec/index_en.html</a></p>
<p>Here are some other tools they have offered:</p>
<p>1) IPv4/IPv6 Address checker:<br />
<a href="http://inetcore.com/project/46checker/index.html.en">http://inetcore.com/project/46checker/index.html.en</a></p>
<p>2) Internet Metrics:<br />
<a href="http://inetcore.com/project/metrics/index.html.en">http://inetcore.com/project/metrics/index.html.en</a></p>
<p>3) IPv4/IPv6 Meter:  (I will be adding this here as soon as I setup IPv6 here)<br />
<a href="http://inetcore.com/project/46meter/index.html.en">http://inetcore.com/project/46meter/index.html.en</a></p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.ryansworld.net/?feed=rss2&amp;p=110</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>vSphere cluster: max 4 ESX hosts per “location” because of HA limitations?</title>
		<link>http://techblog.ryansworld.net/?p=103</link>
		<comments>http://techblog.ryansworld.net/?p=103#comments</comments>
		<pubDate>Fri, 26 Feb 2010 09:12:43 +0000</pubDate>
		<dc:creator>RyanWagner</dc:creator>
				<category><![CDATA[SMB]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Understanding Technology]]></category>

		<guid isPermaLink="false">http://techblog.ryansworld.net/?p=103</guid>
		<description><![CDATA[Normally I do not link to other articles, but today I came accross this article and thought it was a critical piece of information for so many organizations planning for VMWare Clustering. http://virtualfuture.info/2010/02/vsphere-cluster-max-4-esx-hosts-per-location-because-of-ha-limitations/ Here is a copy of the information incase the link dies. vSphere cluster: max 4 ESX hosts per “location” because of HA [...]]]></description>
			<content:encoded><![CDATA[<p>Normally I do not link to other articles, but today I came accross this article and thought it was a critical piece of information for so many organizations planning for VMWare Clustering.</p>
<p><a href="http://virtualfuture.info/2010/02/vsphere-cluster-max-4-esx-hosts-per-location-because-of-ha-limitations/">http://virtualfuture.info/2010/02/vsphere-cluster-max-4-esx-hosts-per-location-because-of-ha-limitations/</a></p>
<p>Here is a copy of the information incase the link dies.</p>
<blockquote><p>
vSphere cluster: max 4 ESX hosts per “location” because of HA limitations?<br />
posted by Matthijs Haverink February 3, 2010Not a lot of info is found when you Google for manually selecting/fixing the primary HA nodes in a VMware VI or vSphere environment. Of course Duncan Epping has a couple of extremely interesting posts on Yellow-Bricks.com concerning HA even when it comes down to selecting or promoting the HA status of ESX nodes (a must read!), but I want more …</p>
<p>Let’s start with what I assume to know about HA:</p>
<p>- HA works with primary and secondary HA nodes<br />
- The primary nodes are aware of the states and configs of all nodes in an HA cluster<br />
- The secondary nodes depend on the primary nodes<br />
- There is an supported limit of 5 primary HA nodes per cluster<br />
- The first 5 ESX hosts that are added in a HA cluster are initially defined as primary HA nodes<br />
- All the other hosts that are added to the HA cluster are configured as secondary HA nodes<br />
- There’s a way to configure a HA node as primary or secondary, however it’s not possible to configure an ESX host as a “fixed” primary HA node:</p>
<p>/opt/vmware/aam/bin/Cli<br />
AAM> promotenode <EsxNodeName> (Configure host as a primary HA node)</p>
<p>/opt/vmware/aam/bin/Cli<br />
AAM> demotenode <EsxNodeName>   (Configure host as a secondary HA node)</p>
<p>- One primary HA node is the Active Primary HA node; this node coordinates the restarts of the VM’s that went down with “crashed” host.<br />
- When the Active Primary HA node goes down, another primary is (s)elected as Active Primary HA node” and takes over the coordinating role.<br />
- A new primary is chosen when another primary is disconnected from the cluster in one of these situations:</p>
<p> (Re)configuring HA on a host<br />
Disconnecting a host from the cluster (manually or by failure)<br />
Removing a host from the cluster<br />
In case of a HA failure<br />
Putting a host into maintenance mode<br />
Especially when you read the last bullet we can establish that HA roles are really dynamic in a VI/vSphere environment. This means that you have no control over the physical location of the primary and secondary roles.</p>
<p>And this is what my post is about:</p>
<p>This situation freaks me out because when you have a larger environment with a couple of possible failure domains as I’d like to call them (represented by any physically separated group of hosts within an HA cluster like different blade chassis or different server rooms) you want to have control over the placement of these HA roles.</p>
<p>And as I stated earlier Duncan Epping has some interesting articles like the HA deep dive and the Primary and Secondary nodes, pick one! which describe how to select a role for a host but this selection is not static; whenever a primary host is disconnected (Maintenance mode, Reconfigure HA and so on) there is a reelection and you lose control over the role placement.</p>
<p>So what if all 5 primaries HA nodes are on the same “possible failure domain” (say blade chassis) and that goes down? Well you just lost all your HA nodes that know what to do in case of a host-failure, so HA won’t work!</p>
<p>We’ll have to nuance the drama a bit: if 5 hosts of a “10 ESX host cluster” go down, you have a major issue anyway, if HA works or not, because you lost half of your capacity.</p>
<p>But you do have to realize that if HA is configured correctly, the 5 remaining hosts have some resources available, you have your primaries separated over the 2 locations and you have defined the start-up rules for the most important VM’s, these important VM’s will be booted up.</p>
<p>If you have the same situation as above but with all 5 primary HA nodes down because they were physically grouped, HA won’t work and none of the crashed VM’s will be booted up automatically!</p>
<p>During VMworld 2009 Marc Sevigny from VMware explained that they were looking into an option which would enable you to pick your primary hosts.This would solve the problem but until then the only solution is to keep your clusters limited to a total of 8 ESX hosts , 4 ESX hosts per “possible failure domain”.</p>
<p>I’m curious if I’m the only one running into this challenge; please let me know!</p>
<p>P.S. Special kudo’s go to Remon Lam from vminfo.nl who discovered this “feature” and reviewed the article .</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://techblog.ryansworld.net/?feed=rss2&amp;p=103</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>OpenSolaris is being discontinued.</title>
		<link>http://techblog.ryansworld.net/?p=100</link>
		<comments>http://techblog.ryansworld.net/?p=100#comments</comments>
		<pubDate>Wed, 24 Feb 2010 10:07:15 +0000</pubDate>
		<dc:creator>RyanWagner</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[Non-Technical]]></category>

		<guid isPermaLink="false">http://techblog.ryansworld.net/?p=100</guid>
		<description><![CDATA[Oracle, since acquiring Sun Systems, has been closing many of the open source projects that Sun once operated. This now includes OpenSolaris. You can see the end of life cycle announcement here: http://www.sun.com/service/eosl/eosl_opensolaris.html]]></description>
			<content:encoded><![CDATA[<p>Oracle, since acquiring Sun Systems, has been closing many of the open source projects that Sun once operated.  This now includes OpenSolaris.  You can see the end of life cycle announcement here:</p>
<p><a href="http://www.sun.com/service/eosl/eosl_opensolaris.html">http://www.sun.com/service/eosl/eosl_opensolaris.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.ryansworld.net/?feed=rss2&amp;p=100</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
