<?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>Linux System Admins Blog &#187; CLI</title>
	<atom:link href="http://linuxsysadminblog.com/category/cli/feed/" rel="self" type="application/rss+xml" />
	<link>http://linuxsysadminblog.com</link>
	<description>System admins of Promet - an e-commerce, high availability Open Source web shop - share their findings</description>
	<lastBuildDate>Wed, 25 Aug 2010 19:46:52 +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>HowTo remove a list of files</title>
		<link>http://linuxsysadminblog.com/2010/07/howto-remove-a-list-of-files/</link>
		<comments>http://linuxsysadminblog.com/2010/07/howto-remove-a-list-of-files/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 21:33:28 +0000</pubDate>
		<dc:creator>marius</dc:creator>
				<category><![CDATA[CLI]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://linuxsysadminblog.com/?p=1116</guid>
		<description><![CDATA[Here is a quick tip on how to remove a list of files. Let&#8217;s say you have the list of files inside a file called files_to_remove. Usually I would do something like this: LIST=`cat files_to_remove` and then ls -al $LIST just to check what is in the list and if it looks good. And finally: [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a quick tip on how to remove a list of files. Let&#8217;s say you have the list of files inside a file called <strong>files_to_remove</strong>. Usually I would do something like this:<br />
<code>LIST=`cat files_to_remove`</code><br />
and then<br />
<code>ls -al $LIST</code><br />
just to check what is in the list and if it looks good.</p>
<p>And finally:<br />
<code>rm -vf $LIST</code></p>
]]></content:encoded>
			<wfw:commentRss>http://linuxsysadminblog.com/2010/07/howto-remove-a-list-of-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HowTo display PHP errors when you don&#8217;t have access to php.ini</title>
		<link>http://linuxsysadminblog.com/2009/09/howto-display-php-errors-when-you-dont-have-access-to-php-ini/</link>
		<comments>http://linuxsysadminblog.com/2009/09/howto-display-php-errors-when-you-dont-have-access-to-php-ini/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 12:10:34 +0000</pubDate>
		<dc:creator>marius</dc:creator>
				<category><![CDATA[CLI]]></category>
		<category><![CDATA[Centos]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://linuxsysadminblog.com/?p=867</guid>
		<description><![CDATA[If you are using a shared server, or just have a limited account on your company servers, you might not have access to your php configuration file php.ini (this is usually found under /etc/php.ini in rhel/centos and /etc/php5/apache2/php.ini in debian/ubuntu). Still, in many situations it might be needed to enable php errors in the browser [...]]]></description>
			<content:encoded><![CDATA[<p>If you are using a shared server, or just have a limited account on your company servers, you might <strong>not have access</strong> to your php configuration file <strong>php.ini</strong> (this is usually found under <em>/etc/php.ini</em> in rhel/centos and <em>/etc/php5/apache2/php.ini</em> in debian/ubuntu). Still, in many situations it might be needed to <strong>enable php errors</strong> in the browser so you can see what is the actual problem instead of an empty page (if the server has error reporting disabled as most production systems should have).</p>
<p>In order to enable error reporting for your php script or application include inside your code the following lines:<br />
<code>error_reporting(E_ALL);<br />
ini_set("display_errors", 1);</code><br />
and this will result in displaying in the browser any errors your application might have.</p>
<p>ps: once you are done with this and fixed the issue, don&#8217;t forget to remove the error reporting lines, as we don&#8217;t want our users/clients to see errors in the browser in case something went wrong.</p>
]]></content:encoded>
			<wfw:commentRss>http://linuxsysadminblog.com/2009/09/howto-display-php-errors-when-you-dont-have-access-to-php-ini/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using svn+ssh with a non-standard ssh port</title>
		<link>http://linuxsysadminblog.com/2009/08/using-svnssh-with-a-non-standard-ssh-port/</link>
		<comments>http://linuxsysadminblog.com/2009/08/using-svnssh-with-a-non-standard-ssh-port/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 09:25:05 +0000</pubDate>
		<dc:creator>marius</dc:creator>
				<category><![CDATA[CLI]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://linuxsysadminblog.com/?p=829</guid>
		<description><![CDATA[Many people use subversion over ssh for a simple and secure way to work on remotely hosted svn repositories. This is normally as simple as running: svn co svn+ssh://user@server/repo . If the remote ssh server is not running on the default ssh port (tcp 22) then this needs a little tweaking to get it working. [...]]]></description>
			<content:encoded><![CDATA[<p>Many people use <a href="http://subversion.tigris.org/" target="_blank"><strong>subversion</strong></a> over ssh for a simple and secure way to work on remotely hosted svn repositories. This is normally as simple as running:<br />
<code>svn co svn+ssh://user@server/repo .</code></p>
<p>If the remote ssh server is <strong>not running on the default ssh port</strong> (tcp 22) then this needs a little tweaking to get it working. Normally I was expecting that adding a custom entry for the svn server in the <em>/etc/ssh/ssh_config</em> file with the appropriate port would make this work on the fly without changing the command line; or if not, adding the ssh port in &#8216;telnet like&#8217; way: <em>server:port</em> would make a difference. Still none of those worked and in order to get this working I had to dig into the subversion documentation on how we can define a special tunnel.</p>
<p>We can define a new tunnel in the svn configuration file (<strong>.subversion/config</strong>):<br />
<code>[tunnels]<br />
sshtunnel = ssh -p &lt;port&gt;</code></p>
<p>And after this we can use svn as usual but with a url like <strong>svn+sshtunnel://</strong> :<br />
<code>svn co svn+sshtunnel://user@server/repo .</code></p>
]]></content:encoded>
			<wfw:commentRss>http://linuxsysadminblog.com/2009/08/using-svnssh-with-a-non-standard-ssh-port/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HowTo: Get started with Amazon EC2 api tools</title>
		<link>http://linuxsysadminblog.com/2009/06/howto-get-started-with-amazon-ec2-api-tools/</link>
		<comments>http://linuxsysadminblog.com/2009/06/howto-get-started-with-amazon-ec2-api-tools/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 14:57:46 +0000</pubDate>
		<dc:creator>marius</dc:creator>
				<category><![CDATA[CLI]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[cloud computing]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[ec2]]></category>

		<guid isPermaLink="false">http://linuxsysadminblog.com/?p=722</guid>
		<description><![CDATA[This article is meant to be a quick quide that will introduce the things needed to get you started with Amazon EC2. All this information can be found in the EC2 api docs, and this is not meant to be a replacement of the documentation, just trying to show the things needed in a clear [...]]]></description>
			<content:encoded><![CDATA[<p>This article is meant to be a quick quide that will introduce the things needed to <strong>get you started with Amazon EC2</strong>. All this information can be found in the EC2 api docs, and this is not meant to be a replacement of the documentation, just trying to show the things needed in a clear and short form.</p>
<h3>Getting Started</h3>
<p>First of all you will need one <a href="http://aws.amazon.com/" target="_blank"><strong>Amazon AWS</strong></a> <strong>account </strong>and enable the <strong>EC2 service</strong>; in case you don&#8217;t have this already now is the time to <a href="http://www.amazon.com/gp/aws/registration/registration-form.html" target="_blank">create</a> your account. Once you do that you can safely return to this doc <img src='http://linuxsysadminblog.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Once you have your account working, while still on the aws site, go and create a new <strong>X.509 certificate</strong> (under the AWS Access Identifiers page, in the X.509 certificate section near the bottom, click Create New). Once this is done, you will want to <em>download locally the private key file and X.509 certificate</em>.</p>
<h3>EC2 API tools</h3>
<p>Next you will have to <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=351&amp;categoryID=88" target="_blank">download</a> and install the Amazon EC2 api tools on one system (controlling machine) that will be used to start your EC2 army of servers, and control their usage. You will want to use the latest version (2009-05-15 at this time) as it will support all the features Amazon is offering for the EC2 service.</p>
<p><span id="more-722"></span>The only real dependency of the EC2 API tools is <strong>java </strong>(at least version 1.5) so we will want to install that first. If you are running debian you can easily do this just by running (for lenny):<br />
<code>aptitude install sun-java6-jre</code><br />
while for etch you will have to use: <em>aptitude install sun-java5-jre</em><br />
For other distributions you can either use their internal packaging mechanism (in case they provide sun-java packages) or just download the binary from sun and install it manually.</p>
<p><strong>Extract </strong>the EC2 APi tools (it is a zip archive called <strong>ec2-api-tools.zip</strong>) and move it under a folder of your preferece. I like to use <strong>~/.ec2</strong> for this, but you can use any folder you prefer. Also copy the <strong>private key</strong> and <strong>X.509 certificate</strong> in the same directory. Those files will look like <em>cert-xxx.pem</em> and <em>pk-xxx.pem</em>.</p>
<p>Next we will have to <strong>export some shell variables</strong>. A good place to put this is in ~/.bashrc:<br />
<code>export EC2_HOME=~/.ec2<br />
export PATH=$PATH:$EC2_HOME/bin<br />
export EC2_PRIVATE_KEY=$EC2_HOME/pk-xxx.pem<br />
export EC2_CERT=$EC2_HOME/cert-xxx.pem<br />
#Java home for debian default install path:<br />
export JAVA_HOME=/usr<br />
#add ec2 tools to default path<br />
export PATH=~/.ec2/bin:$PATH</code></p>
<p>Finally source the file to have the changes active in your current shell session:<br />
<code>source ~/.bashrc</code><br />
or just open a new shell before starting to use the API tools.</p>
<h3>EC2 Keypair</h3>
<p>We will need to create one <strong>keypair </strong>that will be used to connect using <strong>ssh</strong> to the EC2 instances we will be using. We will use the <strong>ec2-add-keypair</strong> utility to create the key and register it with amazon:<br />
<code>ec2-add-keypair my-keypair</code><br />
This will print out the private key that we will have to save in a file:<br />
<code>cat &gt; ~/.ec2/id_rsa-my-keypair<br />
#paste the private key content<br />
sudo chmod 600 </code><code>~/.ec2/id_rsa-my-keypair</code></p>
<h3>Running your first EC2 instance</h3>
<p>Amazon EC2 uses the concept of <strong>AMIs </strong>= Amazon Machine Images. Any EC2 instance is started from one AMI. You can either use standard, public AMIs or create and customize your own private images. Creating or modifying existing AMIs is beyond the scope of this article, but just as a general information this is done using special AMI tools. Also before building your AMI you will want to ensure if you want to use a &#8216;small&#8217; type of image (i386 os) or a &#8216;large&#8217; type of instance (64bit os). These are described under<a href="http://aws.amazon.com/ec2/instance-types/" target="_blank"> http://aws.amazon.com/ec2/instance-types/</a></p>
<p>For the scope of our article we will find a standard public image and start one instance of it to see that all is working properly with the EC2 api tools. You can see all the public images using:<br />
<code>ec2-describe-images -a</code><br />
(over 2,300 images <img src='http://linuxsysadminblog.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ). You should probably grep the result to get any useful information. There are many good public images to use, like for example the <a href="http://alestic.com/" target="_blank">alestic</a> ones (for debian and ubuntu)<br />
Having the AMI id of the image we want to use we are ready to start our fist EC2 instance:<br />
<code>ec2-run-instances ami-e348af8a -k my-keypair</code><br />
that will start a small instance with a 32bit debian lenny server instance from alestic.com.</p>
<p><code>ec2-describe-instances</code><br />
- this will describe the status of all the running instances, with their hostname, instance id, etc.</p>
<p><code>ec2-authorize default -p 22</code><br />
- in order to connect to your instance you will need to customize the &#8216;default&#8217; firewall rules for your account. The above rule will allow ssh on port 22 from anywhere. If you want to open http traffic you will have to add a rule like this:<br />
<code>ec2-authorize default -p 80</code></p>
<p>Finally we can ssh to the ec2 instance using:<br />
<code>ssh -i ~/.ec2/id_rsa-my-keypair root@ec2-XXX-XXX-XXX-XXX.z-2.compute-1.amazonaws.com</code><br />
where ec2-XXX-XXX-XXX-XXX.z-2.compute-1.amazonaws.com is the actual hostname of the instance as obtained from ec2-describe-instances.</p>
<p><span style="text-decoration: underline;"><em>Note</em></span>: don&#8217;t forget to <strong>stop your instance</strong> when you no longer need it. EC2 is a service paid as you use, hence if you forget your instance running you will be billed for it <img src='http://linuxsysadminblog.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> . You can do this by running <strong>shutdown </strong>inside the instance or by using:<br />
<code>ec2-terminate-instances i-yourinstance</code><br />
and verify with <strong>ec2-describe-instances</strong> that the instance is indeed stopped.</p>
<p>Next step is to create/customize your own EC2 AMI images based on your needs. This will be covered in a future article. Hopefully you found this article useful, and it will get you on track quickly with Amazon EC2 api tools.</p>
]]></content:encoded>
			<wfw:commentRss>http://linuxsysadminblog.com/2009/06/howto-get-started-with-amazon-ec2-api-tools/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>rhel/centos x86_64 and i386 packages mess&#8230;</title>
		<link>http://linuxsysadminblog.com/2009/05/rhelcentos-x86_64-and-i386-packages-mess/</link>
		<comments>http://linuxsysadminblog.com/2009/05/rhelcentos-x86_64-and-i386-packages-mess/#comments</comments>
		<pubDate>Tue, 19 May 2009 09:30:51 +0000</pubDate>
		<dc:creator>marius</dc:creator>
				<category><![CDATA[CLI]]></category>
		<category><![CDATA[Centos]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[rhel]]></category>
		<category><![CDATA[rpm]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://linuxsysadminblog.com/?p=665</guid>
		<description><![CDATA[Anyone running centos/rhel x86_64 systems has probably noticed that redhat has a strange way to install a mix of i386 and x86_64 rpms on such a systems. This is how redhat is using the 64bit architecture in a mixed way to be able to support also i386 applications. This is completely different from how for [...]]]></description>
			<content:encoded><![CDATA[<p>Anyone running <strong>centos/rhel</strong> <strong>x86_64</strong> systems has probably noticed that redhat has a strange way to install a mix of i386 and x86_64 rpms on such a systems. This is how <strong>redhat </strong>is using the <span style="text-decoration: underline;">64bit architecture</span> in a mixed way to be able to support also i386 applications. This is completely different from how for example <strong>debian </strong>does this where you will not see by default any i386 libraries or duplicate applications installed (you can install and use ia32 libraries for compatibility reasons but the user is in full control on this process). The way how this works in rhel is <strong>confusing</strong>; let&#8217;s take a simple example (the commands are taken from a clean centos5.3 install with the base packages selected): let&#8217;s see what version of ncurses we have on the system:<br />
<code lang="bash">rpm -qa | grep ncurses<br />
ncurses-5.5-24.20060715<br />
ncurses-5.5-24.20060715</code><br />
what? why is this listed twice? hmm&#8230; Running: <em>rpm -qi ncurses-5.5-24.20060715</em> will also list the package twice (but doesn&#8217;t show the difference). We can assume one is <strong>i386 </strong>and one is <strong>x86_64</strong> right? but we can&#8217;t see this.</p>
<p><span id="more-665"></span>To overcome this issue, and at least have <strong>rpm report the proper versions</strong> we have to add in our <strong>rpmmacros </strong>file a new line like: <em>&#8220;%_query_all_fmt %%{name}-%%{version}-%%{release}.%%{arch}&#8221;</em> that will add to the rpm output the architecture and allow us to see the this:</p>
<pre><code lang="bash">cat >> ~/.rpmmacros
%_query_all_fmt %%{name}-%%{version}-%%{release}.%%{arch}</code></pre>
<p>and now running the same command will return a more intuitive and meaningful:<br />
<code lang="bash">rpm -qa | grep ncurses<br />
ncurses-5.5-24.20060715.x86_64<br />
ncurses-5.5-24.20060715.i386</code></p>
<p>This doesn&#8217;t fix anything in how yum will install duplicate programs or libraries, but at least it will allow us to see the full name of the packages in rpm commands. Theoretically people should be able to add into <strong>yum.conf </strong>(this is the default anyway, so you might have it already):<br />
<code lang="bash">exactarch=1</code><br />
and <strong>yum </strong>will install by default the packages of the arch it is running on (x86_64 in our case). Still, this will not prevent i386 dependencies to show up and be installed. In case you want to completely ignore other arch packages add in the <strong>[main] </strong>section of <strong>/etc/yum.conf </strong>to exclude all 32bit packages,:<br />
<code lang="bash">exclude=*.i386 *.i586 *.i686</code><br />
and this will completely exclude them completely from yum operations. Please use this with care, and only if you have a full understanding of the implications to exclude those packages.</p>
<p>Even if you don&#8217;t exclude the 32bit packages as shown above, it is a good idea to add the <strong>arch </strong>to all yum operations (like install, remove, etc.), like:<br />
<code lang="bash">yum install ncurses.x86_64</code></p>
<p>Hopefully you found this post useful, and have now a better understanding on how rhel/centos use the i368 and x86_64 packages and libraries with rpm and yum on a 64bit installation.</p>
]]></content:encoded>
			<wfw:commentRss>http://linuxsysadminblog.com/2009/05/rhelcentos-x86_64-and-i386-packages-mess/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Cisco ASA 5505: Active/Standby Failover Configuration</title>
		<link>http://linuxsysadminblog.com/2009/02/cisco-asa-5505-activestandby-failover-configuration/</link>
		<comments>http://linuxsysadminblog.com/2009/02/cisco-asa-5505-activestandby-failover-configuration/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 11:35:57 +0000</pubDate>
		<dc:creator>marius</dc:creator>
				<category><![CDATA[CLI]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[asa]]></category>
		<category><![CDATA[asa5505]]></category>
		<category><![CDATA[firewall]]></category>

		<guid isPermaLink="false">http://linuxsysadminblog.com/?p=327</guid>
		<description><![CDATA[The ASA 5505 is the smallest (and cheapest) solution from the current Cisco hardware security appliances. Still, if we have the proper software license (like Security Plus for example) we can use the ASA5505 to setup rather complex solutions. This post will show how we can setup a pair of ASA5505 in failover configuration, solution [...]]]></description>
			<content:encoded><![CDATA[<p>The <strong>ASA 5505</strong> is the smallest (and cheapest) solution from the current Cisco hardware security appliances. Still, if we have the proper software license (like <em>Security Plus</em> for example) we can use the ASA5505 to setup rather complex solutions. This post will show how we can setup a pair of <strong>ASA5505 in failover configuration</strong>, solution that can be very useful in a small office where we want to achieve a high availability and we can&#8217;t tolerate a failure of our frontend firewall.</p>
<h3>Prerequisites</h3>
<p>Before even starting, let&#8217;s check that our ASA5505&#8242;s are running the appropriate software license. For example the sh run command will output something like this:<br />
<code>sh ver<br />
...<br />
Licensed features for this platform:<br />
Maximum Physical Interfaces  : 8<br />
VLANs                        : 20, DMZ Unrestricted<br />
Inside Hosts                 : Unlimited<br />
<strong>Failover                   : Active/Standby</strong><br />
VPN-DES                      : Enabled<br />
VPN-3DES-AES                 : Enabled<br />
VPN Peers                    : 25<br />
WebVPN Peers                 : 2<br />
Dual ISPs                    : Enabled<br />
VLAN Trunk Ports             : 8<br />
AnyConnect for Mobile        : Disabled<br />
AnyConnect for Linksys phone : Disabled<br />
Advanced Endpoint Assessment : Disabled<br />
UC Proxy Sessions            : 2<br />
This platform has an ASA 5505 Security Plus license.<br />
.</code><br />
You should look at the Failover feature and you should have &#8220;<strong>Active/Standby</strong>&#8220;. If this outputs <em>disabled</em>, you will have to order and install a software license upgrade from Cisco in order to be able to use the ASA&#8217;s in failover.</p>
<p><span id="more-327"></span>Cisco (as always) has a very complex <a href="http://www.cisco.com/en/US/docs/security/asa/asa72/configuration/guide/failover.html#wp1064158" target="_blank">documentation</a> on how you can achieve this. Still, it is hard to digest, as they try to cover all possible devices on the same page (even the obsolete pix500); even more the ASA5505 has some particularities compared with the rest of the ASA 5500 range of products and <strong>this is not very clearly explained</strong>. <em>Hopefully this post will be more useful and simpler to follow.</em></p>
<p>First we need to understand some limitations of our devices. The ASA5505 can <strong>only perform Active/Standby</strong> failover and <strong>not Active/Active</strong>. If you need that, you will have to look at a higher range device. Also they can only perform <strong>LAN-Based Failover</strong> (as opposed to old pixes that can use cable based failover) and they <strong>don&#8217;t support Stateful Failover</strong> (meaning all active connections will be lost after a failover event). Also both units must have the same hardware, software configuration, and proper license and run in same mode (single or multiple, transparent or routed).</p>
<h3>Configuring the Primary Unit</h3>
<p>For each of the IPs assigned to the interfaces of the ASA we will need to <strong>allocate a secondary IP</strong> from the same network range; this will be used as the IP of the standby unit, while the main IPs will always be used by the primary (active) unit and will be normally used by the clients (as default gateways for ex). The first step is to <strong>configure the active and standby IP addresses for each data interface</strong>; the cisco documentation is confusing here and it is not clear that on the <strong>ASA5505 </strong>this is done for <strong>each of the used vlans, and not real interfaces</strong>:<br />
<code>conf t<br />
(config)#interface Vlan1<br />
(config-if)#ip address active_addr netmask standby standby_addr</code><br />
for ex:<br />
<code>(config-if)#ip address 192.168.0.1 255.255.255.0 standby 192.168.0.2</code></p>
<p>Once we have defined all standby IPs we can move forward&#8230;<br />
You will also need to define <strong>one interface that will be used for failover</strong>. You can either cross-connect this between the 2 ASAs or you can use a switch with a dedicated vlan for this. The later one is preferred as it will more accurately detect if one ASA is down. Again in the documentation this is not clear how to do it on the ASA5505 and it discusses about <em>real interfaces</em>, while on the <strong>ASA5505 we have to use vlans</strong>.</p>
<p><strong>The trick is to create a new vlan and don&#8217;t assign any ip on the vlan inteface:</strong><br />
<code>interface Vlan32<br />
description LAN Failover Interface<br />
no shutdown</code><br />
the ip will be assigned by the failover commands;<br />
Finally <strong>enable failover</strong>:<br />
<code>failover<br />
failover lan unit primary<br />
failover lan interface failover Vlan32<br />
failover interface ip failover 192.168.255.1 255.255.255.0 standby 192.168.255.2</code><br />
(where you will use one unused ip range for the failover ips).</p>
<p>Save the running config: <strong>copy running-config startup-config</strong></p>
<h3>Configuring the Secondary Unit</h3>
<p>The configuration of the secondary, standby unit is very simple as it needs <strong>only the failover interface configuration</strong>.  The secondary unit requires these commands to initially communicate with the primary unit, and get its configuration from the active unit.</p>
<p>As with the main ASA we have to define the <strong>vlan that will be used for failover</strong> first:<br />
<code>interface Vlan32<br />
description LAN Failover Interface<br />
no shutdown</code></p>
<p>And next we just have to enable failover and set this unit as secondary:<br />
<code>failover<br />
failover lan unit secondary<br />
failover lan interface failover Vlan32<br />
failover interface ip failover 192.168.255.1 255.255.255.0 standby 192.168.255.2</code></p>
<p>After this, the active unit sends the configuration in running memory to the standby unit. As the configuration synchronizes, the messages &#8220;Beginning configuration replication: Sending to mate&#8221; and &#8220;End Configuration Replication to mate&#8221; appear on the active unit console.</p>
<h3>Verifying the Failover Configuration</h3>
<p>The command <strong>show failover</strong> can be used to show the status of the failover operation; the output on the active device will look similar to:<br />
<code>sh failover<br />
Failover On<br />
Failover unit Primary<br />
Failover LAN Interface: failover Vlan32 (up)<br />
Unit Poll frequency 1 seconds, holdtime 15 seconds<br />
Interface Poll frequency 5 seconds, holdtime 25 seconds<br />
Interface Policy 1<br />
Monitored Interfaces 5 of 250 maximum<br />
Version: Ours 8.0(4), Mate 8.0(4)<br />
Last Failover at: 02:28:31 CST Jan 23 2009<br />
This host: Primary - Active<br />
Active time: 2166923 (sec)<br />
slot 0: ASA5505 hw/sw rev (1.0/8.0(4)) status (Up Sys)<br />
Interface inside (10.10.10.1): Normal<br />
Interface outside (192.168.0.1): Normal<br />
slot 1: empty<br />
Other host: Secondary - Standby Ready<br />
Active time: 378 (sec)<br />
slot 0: ASA5505 hw/sw rev (1.0/8.0(4)) status (Up Sys)<br />
Interface inside (10.10.10.2): Normal<br />
Interface outside (192.168.0.2): Normal<br />
slot 1: empty</code></p>
<p>Finally, you will probably want to test the failover functionality and maybe tune the triggers of the failover, but maybe we will talk about this in a future post.<br />
<em>I hope you found this post useful and helped to explain better the steps needed to configure the Active/Standby Failover on the ASA5505.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://linuxsysadminblog.com/2009/02/cisco-asa-5505-activestandby-failover-configuration/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>AdBard &#8211; dont die!</title>
		<link>http://linuxsysadminblog.com/2009/02/adbard-dont-die/</link>
		<comments>http://linuxsysadminblog.com/2009/02/adbard-dont-die/#comments</comments>
		<pubDate>Mon, 02 Feb 2009 19:37:49 +0000</pubDate>
		<dc:creator>andrew</dc:creator>
				<category><![CDATA[CLI]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[monitoring]]></category>

		<guid isPermaLink="false">http://linuxsysadminblog.com/?p=291</guid>
		<description><![CDATA[So a couple of weeks ago I touted the AdBard folks and their FLOSS oriented ad network system.  Today we received the following email from them.  What is worse, is that the ads have already stopped appearing on the site.  . It looks like they will be teaming up with  Free Software Foundation. Hello, This [...]]]></description>
			<content:encoded><![CDATA[<p>So a couple of weeks ago I touted the <a href="http://adbard.net/" target="_blank">AdBard</a> folks and their FLOSS oriented ad network system.  Today we received the following email from them.  What is worse, is that the ads have already stopped appearing on the site.  .</p>
<p>It looks like they will be teaming up with  <a href="http://www.fsf.org/" target="_blank">Free Software Foundation</a>.</p>
<blockquote><p>Hello,</p>
<p>This email details your current earnings from your participation in the Ad Bard Network.  We are also excited to announce major changes to our network, including general improvements and the direct participation of the Free Software Foundation.  However, our planned changes require that we temporarily suspend the entire network for the month of February.  As a member you will be receiving payment for your outstanding earnings balances, and then if you elect to participate in our newly structured network you will be required to sign up again.  We apologize for the inconvenience of this, but hope that it helps achieve the end goal of increasing the earnings of member websites and improving the desirability of the network for advertisers.</p>
<p>Statistics:<br />
&#8212;&#8212;&#8212;&#8211;<br />
LInux System Admin Blog average ad impressions:<br />
Hourly:           nn<br />
Daily:           nnn<br />
Monthly:      nnnnn</p>
<p>Outstanding earnings:<br />
$nnn</p>
<p>Due to the upgrade in process, please remove the JavaScript snippet from your website at this time.  No further advertisements will be displayed through this snippet, and before the end of February 2009 the handling for this javascript will be disabled and could result in an error on your website.  If you will require more than 2 weeks to remove the snippet, please send us an email and we will work with you as necessary.  A new snippet will be provided for the new website.</p>
<p>We will be issuing payments for all outstanding earnings through PayPal or via a check.  If your payment information has changed, please respond<br />
to this email with updated details.  Please be sure to include your Ad Bard username in your email. </p>
<p>If you have converted earnings into unused coupons, please reply to this email with details so that we are sure to properly credit you<br />
back.</p>
<p>Details about our enhanced network will be posted to <a href="http://adbard.net/" target="_blank">http://adbard.net/</a> over the upcoming month.  You will also be receiving an update via email when it is possible to sign up for the new network.  A few of the planned changes include a limited number of advertising slots, the ability to participate in approving which FLOSS-appropriate advertisements are accepted, and improvements to our payment algorithms.<br />
The Free Software Foundation is actively advising us in this effort, and will help campaign for the new network once it goes live.</p>
<p>Thank you for your patience and participation in our evolving network. We hope that you like the changes that will be happening this month, and<br />
that you will continue to participate.</p>
<p>Cheers, -Jeremy<br />
<span style="color: #888888;"><br />
&#8211;<br />
Jeremy Andrews<br />
877-875-8824 x100<br />
Tag1 Consulting, Inc.<br />
<a href="http://tag1consulting.com/" target="_blank"><br />
</a></span></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://linuxsysadminblog.com/2009/02/adbard-dont-die/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>HowTo upgrade ASDM using CLI on Cisco ASA5500</title>
		<link>http://linuxsysadminblog.com/2009/01/howto-upgrade-asdm-using-cli-on-cisco-asa5500/</link>
		<comments>http://linuxsysadminblog.com/2009/01/howto-upgrade-asdm-using-cli-on-cisco-asa5500/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 11:18:17 +0000</pubDate>
		<dc:creator>marius</dc:creator>
				<category><![CDATA[CLI]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[asa]]></category>
		<category><![CDATA[asdm]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[firewall]]></category>

		<guid isPermaLink="false">http://linuxsysadminblog.com/?p=261</guid>
		<description><![CDATA[This post will show how you can easily upgrade ASDM (Cisco Adaptive Security Device Manager for ASA) to the latest version on a Cisco ASA5500 firewall using the command line interface. In order to do this you will need the latest asdm image (you will need a proper cisco cco user and contract to download [...]]]></description>
			<content:encoded><![CDATA[<p>This post will show how you can easily upgrade <strong>ASDM </strong>(Cisco Adaptive Security Device Manager for ASA) to the latest version on a <strong>Cisco ASA5500</strong> firewall using the command line interface. In order to do this you will need the latest asdm image (you will need a proper cisco cco user and contract to download this) from <a href="http://www.cisco.com/cgi-bin/tablebuild.pl/asa" target="_blank">http://www.cisco.com/cgi-bin/tablebuild.pl/asa</a> ; at this time the latest version available is <strong>6.1.5.51</strong> (asdm-61551.bin). You will also need a method to serve this file to the firewall, and normally this is done using a local <strong>tftp server</strong> (but you can also use an ftp, or even http server).</p>
<p>After you have the above things prepared, from the ASA cli (in exec mode) you have to run:<br />
<code>copy tftp flash<br />
Address or name of remote host []? &lt;- 192.168.1.1<br />
Source filename []? &lt;- asdm-61551.bin<br />
Destination filename [asdm-61551.bin]? &lt;- enter</code><br />
This will download the asdm firmware on the firewall flash.</p>
<p><span id="more-261"></span>Now you just have to enable the new version, from configure mode:<br />
<code>configure terminal<br />
asdm image disk0:/asdm-61551.bin<br />
exit<br />
write mem</code></p>
<p>And finally you will have to reboot the ASA in order for the change to become active:<br />
<code>reload</code></p>
<p><em>Note: replace the asdm filename with the one you are actually upgrading (might be a newer one for ex.) and also use the proper ip for your tftp server.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://linuxsysadminblog.com/2009/01/howto-upgrade-asdm-using-cli-on-cisco-asa5500/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>HowTO change the timezone on RHEL/CentOS</title>
		<link>http://linuxsysadminblog.com/2008/12/howto-change-the-timezone-on-rhelcentos/</link>
		<comments>http://linuxsysadminblog.com/2008/12/howto-change-the-timezone-on-rhelcentos/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 10:05:17 +0000</pubDate>
		<dc:creator>marius</dc:creator>
				<category><![CDATA[CLI]]></category>
		<category><![CDATA[Centos]]></category>
		<category><![CDATA[rhel]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://linuxsysadminblog.com/?p=166</guid>
		<description><![CDATA[Linux systems traditionally keep the definition of their timezone in /etc/localtime. This is a binary file with the timezone info, and if we want to change it we need to find the appropriate timezone file from /usr/share/zoneinfo and copy it over the one from /etc or just link to it. Once you change it, you [...]]]></description>
			<content:encoded><![CDATA[<p>Linux systems traditionally keep the definition of their <strong>timezone </strong>in <strong>/etc/localtime</strong>. This is a binary file with the timezone info, and if we want to change it we need to find the appropriate timezone file from <strong>/usr/share/zoneinfo</strong> and copy it over the one from /etc or just link to it. Once you change it, you will need to <strong>restart </strong>any daemons or applications that use the timezone as they might still use the old one.</p>
<p>Still on <strong>RHEL/Centos</strong> based systems this is not enough, and even if apparently all seems to work as expected, there might be some applications still using the old timezone. This is happening if they read the timezone definition from the rhel specific file: <strong>/etc/sysconfig/clock</strong><br />
<code>cat /etc/sysconfig/clock<br />
ZONE="America/Chicago"<br />
UTC=true<br />
ARC=false</code></p>
<p>We also need to update the <strong>ZONE </strong>field in <strong>/etc/sysconfig/clock</strong> to be sure that all occurrences of the old timezone are changed and everything on the system will use the new setting.</p>
<p><em>Note</em>: you <em>don&#8217;t need to restart the system</em> to activate this change, but you will have to <strong>restart </strong>the applications using the timezone so they can read the updated information.</p>
]]></content:encoded>
			<wfw:commentRss>http://linuxsysadminblog.com/2008/12/howto-change-the-timezone-on-rhelcentos/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>vsftpd logging timestamp</title>
		<link>http://linuxsysadminblog.com/2008/12/vsftpd-logging-timestamp/</link>
		<comments>http://linuxsysadminblog.com/2008/12/vsftpd-logging-timestamp/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 08:23:41 +0000</pubDate>
		<dc:creator>marius</dc:creator>
				<category><![CDATA[CLI]]></category>
		<category><![CDATA[Centos]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[vsftpd]]></category>

		<guid isPermaLink="false">http://linuxsysadminblog.com/?p=151</guid>
		<description><![CDATA[While investigating some ftp transfers issues we realized that there was something wrong with the logs generated by vsftpd. The timestamps reported in the vsftpd log were wrong, and the fact that they were always 5 hours behind the actual time made us think this was caused by a timezone issue. The system running this [...]]]></description>
			<content:encoded><![CDATA[<p>While investigating some ftp transfers issues we realized that there was something wrong with the logs generated by vsftpd. <strong>The timestamps reported in the vsftpd log were wrong</strong>, and the fact that they were always 5 hours behind the actual time made us think this was caused by a timezone issue. The system running this was the <strong>latest Centos 5.2</strong> with stock <strong>vsftpd </strong>package.</p>
<p>After further investigation we realized that vsftpd was <strong>not using the system timezone</strong> settings but was always logging its messages using <strong>GMT</strong>. Why would anyone want this? I have no idea, but imo they should change the default value to use the system timezone as that is what the majority of people would expect. In order to fix this, you just have to add to the <strong>vsftpd.conf</strong> the following line:<br />
<code>use_localtime=YES</code><br />
as we can see from vsftpd manual page (<em>man vsftpd.conf</em>) if undefined, this defaults to &#8220;<strong>NO</strong>&#8220;:<br />
&#8220;<em><strong>use_localtime</strong> &#8211; If  enabled, vsftpd will display directory listings with the time in your local time zone. The default is to display GMT. The times returned by the MDTM FTP command are also affected by this option.<br />
Default: NO</em>&#8221;</p>
<p>After changing this variable as with any other vsftpd options, you have to restart the vsftpd service to activate the change.</p>
]]></content:encoded>
			<wfw:commentRss>http://linuxsysadminblog.com/2008/12/vsftpd-logging-timestamp/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
