<?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>SysAdmin Valley &#187; linux</title>
	<atom:link href="http://www.sysadminvalley.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sysadminvalley.com</link>
	<description>I might as well write this stuff down so I remember it tomorrow</description>
	<lastBuildDate>Tue, 18 May 2010 17:22:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Excluding files in FIND results</title>
		<link>http://www.sysadminvalley.com/2010/03/09/excluding-files-in-find-results/</link>
		<comments>http://www.sysadminvalley.com/2010/03/09/excluding-files-in-find-results/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 19:31:09 +0000</pubDate>
		<dc:creator>mshields</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[logs]]></category>
		<category><![CDATA[mini how-to]]></category>

		<guid isPermaLink="false">http://www.sysadminvalley.com/?p=195</guid>
		<description><![CDATA[Find is one of my favorite little tools under linux.  It helps me &#8220;find&#8221; almost anything, I can find files older than a certain date, newer than a certain date, modified on a certain date.  I can find files that have a certain name, or match a part of a name, file extension.  Once I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>Find is one of my favorite little tools under linux.  It helps me &#8220;find&#8221; almost anything, I can find files older than a certain date, newer than a certain date, modified on a certain date.  I can find files that have a certain name, or match a part of a name, file extension.  Once I&#8217;ve found what I&#8217;ve been looking for I can have find do something with those files like delete them or gzip them.</p>
<p>My latest &#8220;find&#8221; with the find command came about because on one of my JBoss servers I wrote a simple script that looks for log files older than 15 days and deletes them and looks for other log files older than 61 minutes and compresses them with gzip.</p>
<blockquote><p>#!/bin/bash<br />
LOGS=/usr/local/jboss/server/all/log/<br />
#delete all logs older than 37 days<br />
find $LOGS -mtime +15 | xargs rm -rf<br />
# gzip files last modify at least 1 hour ago<br />
find $LOGS -mmin +61 | xargs gzip</p></blockquote>
<p>Our JBoss setup automatically writes new logs to server.info.log and server.error.log, then every every hour it renames the INFO and ERROR log to the current date + hour, so server.info.log would be changed to server.info.log.2010-03-09-13 for today at 2pm to roll out the 1pm logs.</p>
<p>The problem I came across in my script was with my server.error.log file.  If an error hasn&#8217;t been written to the server.error.log file during that hour, it wasn&#8217;t going to rotate an empty error log.  Since the file hadn&#8217;t been touched/updated/modified in over 61 minutes, my script came along and gzipped it, at this point JBoss then had a problem because the error log was missing and didn&#8217;t create a new one.</p>
<p>So what I needed to do was to find all the files that matched the criteria, but exclude the server.info.log and server.error.log and here is my final script.</p>
<blockquote><p>#!/bin/bash<br />
LOGS=/usr/local/jboss/server/all/log/<br />
INFOLOG=&#8221;server.info.log&#8221;<br />
ERRORLOG=&#8221;server.error.log&#8221;<br />
#delete all logs older than 37 days<br />
find $LOGS -mtime +15 -not -name &#8220;$INFOLOG&#8221; -not -name &#8220;$ERRORLOG&#8221; | xargs rm -rf<br />
# gzip files last modify at least 1 hour ago<br />
find $LOGS -mmin +61 -not -name &#8220;$INFOLOG&#8221; -not -name &#8220;$ERRORLOG&#8221; | xargs gzip</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.sysadminvalley.com/2010/03/09/excluding-files-in-find-results/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some interesting MySQL projects to check out</title>
		<link>http://www.sysadminvalley.com/2010/02/11/some-interesting-mysql-projects-to-check-out/</link>
		<comments>http://www.sysadminvalley.com/2010/02/11/some-interesting-mysql-projects-to-check-out/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 17:49:04 +0000</pubDate>
		<dc:creator>mshields</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[replication]]></category>

		<guid isPermaLink="false">http://www.sysadminvalley.com/?p=187</guid>
		<description><![CDATA[While working on some MySQL stuff today I came across some interesting projects.  About 2 years ago I attended the Boston MySQL Meetup group which had a guest speaker (Patrick Galbraith) and he spoke about setting up MySQL in a Multi-Master setup.  This is where you have two MySQL database servers and each one is [...]]]></description>
			<content:encoded><![CDATA[<p>While working on some MySQL stuff today I came across some interesting projects.  About 2 years ago I attended the <a href="http://www.meetup.com/mysqlbos/calendar/6422572/?from=list&amp;offset=0" target="_blank">Boston MySQL Meetup group</a> which had a guest speaker (Patrick Galbraith) and he spoke about setting up MySQL in a Multi-Master setup.  This is where you have two MySQL database servers and each one is a slave of the other.  Today I came across two projects that look promising, the first is <a href="http://mysql-mmm.org/" target="_blank">Multi-Master Replication Manager for MySQL</a> (or MMM) and the second is <a href="http://code.google.com/p/flipper/" target="_blank">Flipper</a>.</p>
<p>MMM is a set of scripts that perform monitoring/failover and management of MySQL master-master replication.  Flipper is also a set of tools that manage which server in a Multi-Master setup is writable and which is readable by moving IP addresses based on the server&#8217;s role.  Both look very promising and hopefully soon I&#8217;ll have some free time to play around with them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sysadminvalley.com/2010/02/11/some-interesting-mysql-projects-to-check-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Working with Percona&#8217;s MySQL and RPM dependency problems</title>
		<link>http://www.sysadminvalley.com/2010/02/11/working-with-perconas-mysql-and-rpm-dependency-problems/</link>
		<comments>http://www.sysadminvalley.com/2010/02/11/working-with-perconas-mysql-and-rpm-dependency-problems/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 15:56:05 +0000</pubDate>
		<dc:creator>mshields</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[percona]]></category>
		<category><![CDATA[rpm]]></category>

		<guid isPermaLink="false">http://www.sysadminvalley.com/?p=185</guid>
		<description><![CDATA[I&#8217;ve started using Percona&#8217;s version of MySQL 5.1 and have run into a few issues trying to get other tools such as mytop or maatkit to install but have been having problems with RPM dependency&#8217;s.  I found the solution on this guy&#8217;s blog.  Basically, if you install the MySQL-client-percona, MySQL-percona, MySQL-server-percona, MySQL-shared-percona and Percona-XtraDB, instead [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve started using Percona&#8217;s version of MySQL 5.1 and have run into a few issues trying to get other tools such as mytop or maatkit to install but have been having problems with RPM dependency&#8217;s.  I found the solution on this <a href="http://neckbeard.stfudonny.com/2009/11/working-around-the-percona-mysql-rpm-dependancy-conflict-on-rhelcentos-5/" target="_blank">guy&#8217;s blog</a>.  Basically, if you install the MySQL-client-percona, MySQL-percona, MySQL-server-percona, MySQL-shared-percona and Percona-XtraDB, instead of installing MySQL-shared-percona, you should download and force upgrade (rpm -Uvh &#8211;force packagename) the MySQL-shared-compat library directly from MySQL.  Just make sure you get the same version from MySQL that you&#8217;re using of the Percona MySQL.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sysadminvalley.com/2010/02/11/working-with-perconas-mysql-and-rpm-dependency-problems/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A new way to manage files and backups</title>
		<link>http://www.sysadminvalley.com/2010/02/07/a-new-way-to-manage-files-and-backups/</link>
		<comments>http://www.sysadminvalley.com/2010/02/07/a-new-way-to-manage-files-and-backups/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 16:23:18 +0000</pubDate>
		<dc:creator>mshields</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[backups]]></category>
		<category><![CDATA[dropbox]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[recovery]]></category>

		<guid isPermaLink="false">http://www.sysadminvalley.com/?p=181</guid>
		<description><![CDATA[Do you have multiple computers? Maybe one at work and one at home, or maybe you have two at work. Have you ever said I would love to have a way to keep my documents on multiple computers at the same time and not have to worry about copying the files back and forth. Or [...]]]></description>
			<content:encoded><![CDATA[<p>Do you have multiple computers?  Maybe one at work and one at home, or maybe you have two at work.  Have you ever said I would love to have a way to keep my documents on multiple computers at the same time and not have to worry about copying the files back and forth.  Or maybe you&#8217;re just looking for a simple way to backup your files in case of emergencies.  Well, you should check out <a href="https://www.dropbox.com/referrals/NTM4MDk1MTg5">DropBox</a>.</p>
<p><a href="https://www.dropbox.com/referrals/NTM4MDk1MTg5">DropBox</a> is a new way to manage your files.  First you create an account one their website, then you install a piece of software on all your computers.  Then when you add a file into your <a href="https://www.dropbox.com/referrals/NTM4MDk1MTg5">DropBox</a> on one of your computers, immediately all your other computers download the new file.  If you make a change to that document on any of the computers, all the others immediately pickup the change.  No more copying your documents to CD/DVD/USB and then over to your other computer.  Now all your documents are synchronized immediately.</p>
<p>Here&#8217;s another benefit.  If you have multiple computers that have different operating systems, this doesn&#8217;t matter.  You can automatically synchronize files between Windows, Mac and Linux too.</p>
<p>Another great feature of <a href="https://www.dropbox.com/referrals/NTM4MDk1MTg5">DropBox</a>, have you ever accidentally deleted or changed a file and wished that you had a backup copy of it.  Well now you do.  Now you can recover deleted files or get back previous versions of your documents.</p>
<p>To get started, just go to <a href="https://www.dropbox.com/referrals/NTM4MDk1MTg5">DropBox</a> and click Download DropBox.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sysadminvalley.com/2010/02/07/a-new-way-to-manage-files-and-backups/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Helpful Tools For Amazon EC2</title>
		<link>http://www.sysadminvalley.com/2010/02/05/helpful-tools-for-amazon-ec2/</link>
		<comments>http://www.sysadminvalley.com/2010/02/05/helpful-tools-for-amazon-ec2/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 20:57:11 +0000</pubDate>
		<dc:creator>mshields</dc:creator>
				<category><![CDATA[Amazon AWS]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[ec2]]></category>

		<guid isPermaLink="false">http://www.sysadminvalley.com/?p=175</guid>
		<description><![CDATA[Here&#8217;s some tools that are great for managing Amazon&#8217;s EC2 servers. ElasticFox ElastDream]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s some tools that are great for managing Amazon&#8217;s EC2 servers.</p>
<p><a href="http://sourceforge.net/projects/elasticfox/" target="_blank">ElasticFox</a><br />
<a href="http://www.elastdream.com/" target="_blank">ElastDream</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sysadminvalley.com/2010/02/05/helpful-tools-for-amazon-ec2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Helpful Tools for Amazon S3</title>
		<link>http://www.sysadminvalley.com/2010/02/05/helpful-tools-for-amazon-s3/</link>
		<comments>http://www.sysadminvalley.com/2010/02/05/helpful-tools-for-amazon-s3/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 20:53:28 +0000</pubDate>
		<dc:creator>mshields</dc:creator>
				<category><![CDATA[Amazon AWS]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[s3]]></category>

		<guid isPermaLink="false">http://www.sysadminvalley.com/?p=171</guid>
		<description><![CDATA[I&#8217;ve been doing quite a bit of work with the Amazon Cloud and here are a few tools I&#8217;ve found useful for managing the Amazon Simple Storage Service (S3). S3Fox Simple Access for S3 &#38; AWS Amazon S3 Filesystem for Windows S3Sync for Ruby S3cmd for Perl S3fs for Linux Edit: CloudBerry Explorer for S3]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been doing quite a bit of work with the Amazon Cloud and here are a few tools I&#8217;ve found useful for managing the Amazon Simple Storage Service (S3).</p>
<p><a href="http://www.s3fox.net/" target="_blank">S3Fox</a><br />
<a href="http://timkay.com/aws/" target="_blank">Simple Access for S3 &amp; AWS</a><br />
<a href="http://wins3fs.sourceforge.net/" target="_blank">Amazon S3 Filesystem for Windows</a><br />
<a href="http://s3sync.net/" target="_blank">S3Sync for Ruby</a><br />
<a href="http://s3tools.logix.cz/" target="_blank">S3cmd for Perl</a><br />
<a href="http://code.google.com/p/s3fs/wiki/FuseOverAmazon" target="_blank">S3fs for Linux</a></p>
<p>Edit:<br />
<a href="http://www.cloudberrylab.com/default.aspx?page=cloudberry-explorer-amazon-s3" target="_blank">CloudBerry Explorer for S3</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sysadminvalley.com/2010/02/05/helpful-tools-for-amazon-s3/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>View the details of a certificate signing request with OpenSSL</title>
		<link>http://www.sysadminvalley.com/2009/10/29/view-the-details-of-a-certificate-signing-request-with-openssl/</link>
		<comments>http://www.sysadminvalley.com/2009/10/29/view-the-details-of-a-certificate-signing-request-with-openssl/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 14:13:04 +0000</pubDate>
		<dc:creator>mshields</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.sysadminvalley.com/?p=135</guid>
		<description><![CDATA[Today I had the new to generate some new certs for a customer.  I wanted to see what I used previously for the values when I generated the CSR (Certificate Signing Request).  To view the details I used the following: openssl req -noout -text -in server.csr]]></description>
			<content:encoded><![CDATA[<p>Today I had the new to generate some new certs for a customer.  I wanted to see what I used previously for the values when I generated the CSR (Certificate Signing Request).  To view the details I used the following:</p>
<blockquote>
<pre>openssl req -noout -text -in server.csr</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.sysadminvalley.com/2009/10/29/view-the-details-of-a-certificate-signing-request-with-openssl/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using Nginx Web Server with ColdFusion</title>
		<link>http://www.sysadminvalley.com/2009/10/01/using-nginx-web-server-with-coldfusion/</link>
		<comments>http://www.sysadminvalley.com/2009/10/01/using-nginx-web-server-with-coldfusion/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 12:27:39 +0000</pubDate>
		<dc:creator>mshields</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[proxy]]></category>

		<guid isPermaLink="false">http://www.sysadminvalley.com/?p=130</guid>
		<description><![CDATA[One of the many sites I run is a ColdFusion site.  Not by choice, but because the developer that created the site was a CF developer.  When I acquired the site, the original developer would just run ColdFusion Server as a standalone web and application server.  For most cases this is fine, but as the [...]]]></description>
			<content:encoded><![CDATA[<p>One of the many sites I run is a ColdFusion site.  Not by choice, but because the developer that created the site was a CF developer.  When I acquired the site, the original developer would just run ColdFusion Server as a standalone web and application server.  For most cases this is fine, but as the site has grown, so has the traffic.  When you think of all the traffic that is going to the ColdFusion application server, not just dynamic CFM file, but lots of static content like images, CSS, and plain HTML files.  There is no reason why we need to put the extra stress on the ColdFusion server, when a simple webserver could handle the static content, and pass all the requests for dynamic content to ColdFusion.</p>
<p>The original setup was just ColdFusion running on port 80 which is the standard port when going to http://www.mydomain.com.  So first I needed to change ColdFusion&#8217;s webserver to run on a different port.  To do that you need to edit the jrun.xml file which on most Linux/Unix systems is located in <em>cf_root</em>/runtime/servers/coldfusion/SERVER-INF.  cf_root is the main directory where you installed ColdFusion.  In the jrun.xml file, you are looking for the section that says:</p>
<blockquote>
<pre>&lt;!-- ================================================================== --&gt;
 &lt;!-- This is the built-in JRun Web Server                               --&gt;
 &lt;!-- ================================================================== --&gt;
 &lt;service name="WebService"&gt;
 &lt;attribute name="port"&gt;80&lt;/attribute&gt;
 &lt;attribute name="interface"&gt;*&lt;/attribute&gt;
 &lt;attribute name="deactivated"&gt;false&lt;/attribute&gt;
 &lt;attribute name="activeHandlerThreads"&gt;100&lt;/attribute&gt;
 &lt;attribute name="minHandlerThreads"&gt;1&lt;/attribute&gt;
 &lt;attribute name="maxHandlerThreads"&gt;1000&lt;/attribute&gt;
 &lt;attribute name="mapCheck"&gt;0&lt;/attribute&gt;
 &lt;attribute name="threadWaitTimeout"&gt;300&lt;/attribute&gt;
 &lt;attribute name="backlog"&gt;500&lt;/attribute&gt;
 &lt;attribute name="timeout"&gt;300&lt;/attribute&gt;
 &lt;/service&gt;</pre>
</blockquote>
<p>Where is says port 80, you want to change that to another port like 8080.  Next we need to configure Nginx.  On most RedHat/CentOS based systems the Nginx config&#8217;s are in /etc/nginx and we&#8217;re looking for the nginx.conf.  Here is the basic Nginx config to server your website on port 80, then pass all the requests for ColdFusion files to ColdFusion on port 8080.  This config has some of the basic Nginx settings stripped out and just gives you the server section, this also assumes that you have installed ColdFusion in the /usr/local/coldfusionmx7 directory, and /usr/local/coldfusionmx7/wwwroot is where all your content is.</p>
<blockquote>
<pre>server {
  listen       80;
  server_name  _;
  access_log  /var/log/nginx/host.access.log  main;

  location / {
    root   /usr/local/coldfusionmx7/wwwroot;
    index  index.cfm index.html index.htm;
    proxy_pass          http://127.0.0.1:8080/;
    proxy_redirect      off;
    proxy_set_header    Host            $host;
    proxy_set_header    X-Real-IP       $remote_addr;
    proxy_set_header    X-Forwarded_For $proxy_add_x_forwarded_for;         
  }

  location ~* ^.+.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|
exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js)$ {
    root /usr/local/coldfusionmx7/wwwroot;
  }
}</pre>
</blockquote>
<p>At this point, all you need to do is restart ColdFusion, you should be able to verify it still works by going to http://www.mydomain.com:8080. Then you can start Nginx, and go to http://www.mydomain.com.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sysadminvalley.com/2009/10/01/using-nginx-web-server-with-coldfusion/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Converting Uppercase to Lowercase (and vice-versus)</title>
		<link>http://www.sysadminvalley.com/2009/07/06/converting-uppercase-to-lowercase-and-vice-versus/</link>
		<comments>http://www.sysadminvalley.com/2009/07/06/converting-uppercase-to-lowercase-and-vice-versus/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 19:01:18 +0000</pubDate>
		<dc:creator>mshields</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[mini how-to]]></category>

		<guid isPermaLink="false">http://www.sysadminvalley.com/?p=100</guid>
		<description><![CDATA[I love bash and scripting!!!  There&#8217;s almost nothing you can&#8217;t do with a shell script that would take me forever if I had to write an app to do the same.  So here&#8217;s another quick tip.  To convert text in a file from uppercase to lowercase use the following: cat FILENAME &#124; tr &#8220;[:upper:]&#8221; &#8220;[:lower:]&#8220; [...]]]></description>
			<content:encoded><![CDATA[<p>I love bash and scripting!!!  There&#8217;s almost nothing you can&#8217;t do with a shell script that would take me forever if I had to write an app to do the same.  So here&#8217;s another quick tip.  To convert text in a file from uppercase to lowercase use the following:</p>
<blockquote><p>cat FILENAME | tr &#8220;[:upper:]&#8221; &#8220;[:lower:]&#8220;</p></blockquote>
<p>Or to go from lowercase to uppercase:</p>
<blockquote><p>cat FILENAME | tr &#8220;[:lower:]&#8221; &#8220;[:upper:]&#8220;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.sysadminvalley.com/2009/07/06/converting-uppercase-to-lowercase-and-vice-versus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using seq to generate a list of numbers</title>
		<link>http://www.sysadminvalley.com/2009/06/30/using-seq-to-generate-a-list-of-numbers/</link>
		<comments>http://www.sysadminvalley.com/2009/06/30/using-seq-to-generate-a-list-of-numbers/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 20:06:56 +0000</pubDate>
		<dc:creator>mshields</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[mini how-to]]></category>

		<guid isPermaLink="false">http://www.sysadminvalley.com/?p=96</guid>
		<description><![CDATA[Another quick hint.  While working on a server I needed to bring up a whole lot of IP addresses (200 to be exact).  If I really wanted to I could bring them all up like this: ifconfig eth0:2 1.1.1.2 netmask 255.255.255.0 up ifconfig eth0:3 1.1.1.3 netmask 255.255.255.0 up and so on to&#8230;.. ifconfig eth0:200 1.1.1.200 [...]]]></description>
			<content:encoded><![CDATA[<p>Another quick hint.  While working on a server I needed to bring up a whole lot of IP addresses (200 to be exact).  If I really wanted to I could bring them all up like this:</p>
<blockquote><p>ifconfig eth0:2 1.1.1.2 netmask 255.255.255.0 up<br />
ifconfig eth0:3 1.1.1.3 netmask 255.255.255.0 up<br />
and so on to&#8230;..<br />
ifconfig eth0:200 1.1.1.200 netmask 255.255.255.0 up</p></blockquote>
<p>Well, I&#8217;m always looking for an easier way, so I turned to my friend BASH and a tool called SEQ.  SEQ will give you a sequence of numbers.  For example if you just wanted 10 numbers you could do the following:</p>
<blockquote><p>[matt@localhost ~]$ seq 5<br />
1<br />
2<br />
3<br />
4<br />
5</p></blockquote>
<p>So for this task I needed to bring up IP addresses from 2 through 254.  Running &#8220;seq 2 254&#8243; will give me a sequence from 2 to 254, I need more than just to have a list of numbers, I actually need to use them, so here&#8217;s the syntax I used to use the numbers to bring up each of the interfaces</p>
<blockquote><p>for i in $(seq 2 254)<br />
do<br />
ifconfig eth0:$i 1.1.1.$i netmask 255.255.255.0 up<br />
done</p></blockquote>
<p>Obviously in the above example, you would substitute the sequence you want to use and the IP subnet you want to use.  Also, this syntax would put 1.1.1.2 on sub-interface eth0:2, 1.1.1.3 on sub-interface eth0:3, etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sysadminvalley.com/2009/06/30/using-seq-to-generate-a-list-of-numbers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
