<?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>Trylinux.org &#187; tips</title>
	<atom:link href="http://trylinux.org/category/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://trylinux.org</link>
	<description>Linux tips and advocacy</description>
	<lastBuildDate>Thu, 27 May 2010 14:51:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Sending email from the command line and specifying the from</title>
		<link>http://trylinux.org/2010/05/27/sending-email-from-the-command-line-and-specifying-the-from/</link>
		<comments>http://trylinux.org/2010/05/27/sending-email-from-the-command-line-and-specifying-the-from/#comments</comments>
		<pubDate>Thu, 27 May 2010 14:51:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://trylinux.org/?p=90</guid>
		<description><![CDATA[The easiest way to send an email from a Linux command line is this:
mail -s subject me@here.com < /dev/null
Sometimes you need to specify the from address, but I'm always forgetting the syntax.
echo "The message" &#124; mail -s "The subject" me@here.com -- -f sender@someplace.com  
]]></description>
			<content:encoded><![CDATA[<p>The easiest way to send an email from a Linux command line is this:<br />
<code>mail -s subject me@here.com < /dev/null</code></p>
<p>Sometimes you need to specify the from address, but I'm always forgetting the syntax.<br />
<code>echo "The message" | mail -s "The subject" me@here.com -- -f sender@someplace.com</code>  </p>
]]></content:encoded>
			<wfw:commentRss>http://trylinux.org/2010/05/27/sending-email-from-the-command-line-and-specifying-the-from/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenDNS.org and issues with Mac OSX</title>
		<link>http://trylinux.org/2008/08/26/opendnsorg-and-issues-with-mac-osx/</link>
		<comments>http://trylinux.org/2008/08/26/opendnsorg-and-issues-with-mac-osx/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 03:19:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://trylinux.org/2008/08/26/opendnsorg-and-issues-with-mac-osx/</guid>
		<description><![CDATA[I ran across a great site today for people with kids or just want to filter traffic on their network.  I have 3 kids and I just bought my 5 and 3 year old a macbook to share.  When I ran across http://OpenDNS.org I thought wow this would be a great time to do some [...]]]></description>
			<content:encoded><![CDATA[<p>I ran across a great site today for people with kids or just want to filter traffic on their network.  I have 3 kids and I just bought my 5 and 3 year old a macbook to share.  When I ran across <a title="OpenDNS.org" href="http://OpenDNS.org" target="_blank">http://OpenDNS.org</a> I thought wow this would be a great time to do some filtering to keep them from coming across something they shouldn&#8217;t.<br />
<!-- OpenDNS button --><br />
<a title="Use OpenDNS to make your Internet faster, safer, and smarter." href="http://www.opendns.com/share/"><img style="border: 0pt none " src="http://images.opendns.com/buttons/use_opendns_155x52.gif" alt="Use OpenDNS" width="155" height="52" /></a><br />
<!-- / end OpenDNS button --><br />
It&#8217;s very simple to create an account and set it up since it is based on DNS.  Since it is based on DNS it is easy to work around, but I figure it will be a few years before my kids get to that point.</p>
<p>One issue I ran into though is their documentation for the Mac is based on a wired ethernet connection.  Who uses patch cables at home anymore?  Luckily I found a link to a site that shows how to get around this on the Mac.  You can read about hit here: <a title="DNS DHCP fix for Mac OSX" href="http://qmail.jms1.net/djbdns/osx.shtml#dhcp-nameserver" target="_blank">http://qmail.jms1.net/djbdns/osx.shtml#dhcp-nameserver</a></p>
]]></content:encoded>
			<wfw:commentRss>http://trylinux.org/2008/08/26/opendnsorg-and-issues-with-mac-osx/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sorting a loop in bash and other possibilites</title>
		<link>http://trylinux.org/2008/04/04/sorting-a-loop-in-bash-and-other-possibilites/</link>
		<comments>http://trylinux.org/2008/04/04/sorting-a-loop-in-bash-and-other-possibilites/#comments</comments>
		<pubDate>Fri, 04 Apr 2008 21:15:32 +0000</pubDate>
		<dc:creator>tip</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://trylinux.org/2008/04/04/sorting-a-loop-in-bash-and-other-possibilites/</guid>
		<description><![CDATA[As I said in my previous post, I learned a couple things about bash today.  I had a nice for loop that outputted the info I wanted, but not in the right order.  I thought to myself, man if this were php I would just put it in an array and sort it [...]]]></description>
			<content:encoded><![CDATA[<p>As I said in my previous post, I learned a couple things about bash today.  I had a nice for loop that outputted the info I wanted, but not in the right order.  I thought to myself, man if this were php I would just put it in an array and sort it before looping across it.  I bet this will be a pain in bash.</p>
<p>BUT, I was pleasantly surprised to find out how simple this really was.  If you want to perform an action the output of a loop in bash then you just pipe done into the fuction you want performed.  See the example below.</p>
<pre>for VAR in $VARS; do
{someaction}
done | sort -n</pre>
<p>Cool, right?</p>
]]></content:encoded>
			<wfw:commentRss>http://trylinux.org/2008/04/04/sorting-a-loop-in-bash-and-other-possibilites/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lineing up fields with BASH (or other programming languages)</title>
		<link>http://trylinux.org/2008/04/04/lineing-up-fields-with-bash-or-other-programming-languages/</link>
		<comments>http://trylinux.org/2008/04/04/lineing-up-fields-with-bash-or-other-programming-languages/#comments</comments>
		<pubDate>Fri, 04 Apr 2008 21:08:59 +0000</pubDate>
		<dc:creator>tip</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://trylinux.org/2008/04/04/lineing-up-fields-with-bash-or-other-programming-languages/</guid>
		<description><![CDATA[Learned a couple things about bash today.  I was wanting to print something out nicely, so I was using tabs to separate fields.  As you know, nothing ever lines up if you do not have values very similar in size.  So I was about to search Google for the problem when I [...]]]></description>
			<content:encoded><![CDATA[<p>Learned a couple things about bash today.  I was wanting to print something out nicely, so I was using tabs to separate fields.  As you know, nothing ever lines up if you do not have values very similar in size.  So I was about to search Google for the problem when I had a moment of sheer brilliance. <img src='http://trylinux.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   I thought I&#8217;ll just concatenate a bunch of spaces on the end of the variable and then use cut to grab how many characters I want.  I was very proud of myself, but then bash quickly humbled me by condensing all my spaces I had added to the variable.</p>
<p>So, back to the all knowing Google.  Turns out you have to quote your variable when you use it if you don&#8217;t want bash to truncate the spaces.  So I quoted my variable when using it and all is good.</p>
<pre>BUFFER="$VAR                                                                "
NICE_VAR=`echo "$VAR" | cut -c -15`
echo "$VAR $VAR2"</pre>
]]></content:encoded>
			<wfw:commentRss>http://trylinux.org/2008/04/04/lineing-up-fields-with-bash-or-other-programming-languages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Move Oracle data files</title>
		<link>http://trylinux.org/2008/03/29/move-oracle-data-files/</link>
		<comments>http://trylinux.org/2008/03/29/move-oracle-data-files/#comments</comments>
		<pubDate>Sat, 29 Mar 2008 23:06:15 +0000</pubDate>
		<dc:creator>tip</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://trylinux.org/2008/03/29/move-oracle-data-files/</guid>
		<description><![CDATA[The procedure below will allow you to move Oracle data and redo files.
1. It is a good idea to make a backup of the directory you are moving just in case something goes horribly wrong.  
# cp -rp {data_dir} {backup_dir}
2. log in as the oracle user
# su -l oracle
3. move the database files
# mv [...]]]></description>
			<content:encoded><![CDATA[<p>The procedure below will allow you to move Oracle data and redo files.</p>
<p>1. It is a good idea to make a backup of the directory you are moving just in case something goes horribly wrong.  <img src='http://trylinux.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
# cp -rp {data_dir} {backup_dir}</p>
<p>2. log in as the oracle user<br />
# su -l oracle</p>
<p>3. move the database files<br />
# mv {data_dir} {new_data_dir}</p>
<p>4. Set SID, log into database.<br />
# export ORACLE_SID={ORACLE_SID}<br />
# sqlplus /nolog<br />
SQL&gt; connect /as sysdba;</p>
<p>5. Create pfile from spfile<br />
SQL&gt; create pfile from spfile;</p>
<p>6. In another terminal, modify the newly created pfile.  It is usually called init{SID}.ora and can be in different directories.  Look in udump, dbs, and other directories until you find the newly created pfile.  Check the date to make sure it is the one you are looking for.  Now, fix the directories for the control_files variable.</p>
<p>7. Go back to the original terminal and create spfile from pfile;<br />
SQL&gt; create spfile from pfile;</p>
<p>8. Mount database.<br />
SQL&gt; startup mount;</p>
<p>9. Alter the database to look in the new location for the data files and redo logs.  Below is an example. (Do this for all data and redo logs.)<br />
SQL&gt; alter database rename file &#8216;/home/oracle/oradata/{SID}/sysaux01.dbf&#8217; to &#8216;/usr/local/app/oracle/oradata/{SID}/sysaux01.dbf&#8217;<br />
SQL&gt; alter database rename file &#8216;/home/oracle/oradata/{SID}/redo01.log&#8217; to &#8216;/usr/local/app/oracle/oradata/{SID}/redo01.log&#8217;</p>
<p>10. Open database.<br />
SQL&gt; alter database open;</p>
<p>Now it should hopefully come up properly.  You man want to shut it down and bring it up once more to make sure everything is working properly.</p>
]]></content:encoded>
			<wfw:commentRss>http://trylinux.org/2008/03/29/move-oracle-data-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dumping a mysql table to SQL</title>
		<link>http://trylinux.org/2008/02/06/dumping-a-mysql-table-to-sql/</link>
		<comments>http://trylinux.org/2008/02/06/dumping-a-mysql-table-to-sql/#comments</comments>
		<pubDate>Wed, 06 Feb 2008 18:52:57 +0000</pubDate>
		<dc:creator>tip</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[reminder]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://trylinux.org/2008/02/06/dumping-a-mysql-table-to-sql/</guid>
		<description><![CDATA[I usually use phpMyAdmin to dump my table to SQL, but sometimes it is easier to do it from the command line.  Use the following syntax to dump a table to SQL.
mysqldump -p -e -c --add-drop-table -r table.sql dbname table
Warning: The &#8211;add-drop-table will cause it to drop the existing table when you import.
You can [...]]]></description>
			<content:encoded><![CDATA[<p>I usually use phpMyAdmin to dump my table to SQL, but sometimes it is easier to do it from the command line.  Use the following syntax to dump a table to SQL.</p>
<p><code>mysqldump -p -e -c --add-drop-table -r table.sql dbname table</code></p>
<p><font color="#ff0000"><strong>Warning</strong></font>: The &#8211;add-drop-table will cause it to drop the existing table when you import.</p>
<p>You can import this with the command</p>
<p><code>mysql -p dbname &lt; table.sql</code></p>
]]></content:encoded>
			<wfw:commentRss>http://trylinux.org/2008/02/06/dumping-a-mysql-table-to-sql/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>yum repository from Dell</title>
		<link>http://trylinux.org/2007/12/14/yum-repository-for-open-manage/</link>
		<comments>http://trylinux.org/2007/12/14/yum-repository-for-open-manage/#comments</comments>
		<pubDate>Fri, 14 Dec 2007 18:53:47 +0000</pubDate>
		<dc:creator>tip</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://trylinux.org/2007/12/14/yum-repository-for-open-manage/</guid>
		<description><![CDATA[I was thinking to myself it would be really great if Dell made available a yum repository for open manage.  So I did a search and sure enough the do!  This makes my job a lot easier  
http://linux.dell.com/repo/hardware/
Also check out http://linux.dell.com/wiki/index.php/Repository/software 
and http://linux.dell.com/wiki/index.php/Repository/firmware
]]></description>
			<content:encoded><![CDATA[<p>I was thinking to myself it would be really great if Dell made available a yum repository for open manage.  So I did a search and sure enough the do!  This makes my job a lot easier <img src='http://trylinux.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://linux.dell.com/repo/hardware/" target="_blank">http://linux.dell.com/repo/hardware/</a></p>
<p>Also check out <a href="http://linux.dell.com/wiki/index.php/Repository/software" target="_blank">http://linux.dell.com/wiki/index.php/Repository/software</a> <br />
and <a href="http://linux.dell.com/wiki/index.php/Repository/firmware" target="_blank">http://linux.dell.com/wiki/index.php/Repository/firmware</a></p>
]]></content:encoded>
			<wfw:commentRss>http://trylinux.org/2007/12/14/yum-repository-for-open-manage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>yum upgrades tip</title>
		<link>http://trylinux.org/2007/12/12/yum-upgrades-tip/</link>
		<comments>http://trylinux.org/2007/12/12/yum-upgrades-tip/#comments</comments>
		<pubDate>Thu, 13 Dec 2007 03:37:09 +0000</pubDate>
		<dc:creator>tip</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://trylinux.org/2007/12/12/yum-upgrades-tip/</guid>
		<description><![CDATA[When upgrading with yum I have started taking an rpm inventory before and after the upgrade.
Before Upgrade:
rpm -qa &#62; BeforeUpgrade.txt
After Upgrade:
rpm -qa &#62; AfterUpgrade.txt
Then I can compare them so that I know which packages were not upgraded and I can figure out why the did not upgrade.
cat BeforeUpgrade.txt AfterUpgrade.txt &#124; sort &#124; uniq -c &#124; [...]]]></description>
			<content:encoded><![CDATA[<p>When upgrading with yum I have started taking an rpm inventory before and after the upgrade.<br />
<strong>Before Upgrade:</strong></p>
<pre>rpm -qa &gt; BeforeUpgrade.txt</pre>
<p><strong>After Upgrade:</strong></p>
<pre>rpm -qa &gt; AfterUpgrade.txt</pre>
<p>Then I can compare them so that I know which packages were not upgraded and I can figure out why the did not upgrade.</p>
<pre>cat BeforeUpgrade.txt AfterUpgrade.txt | sort | uniq -c | sort -n | grep "^\ *2"</pre>
]]></content:encoded>
			<wfw:commentRss>http://trylinux.org/2007/12/12/yum-upgrades-tip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reboot a windows box from Linux</title>
		<link>http://trylinux.org/2007/10/22/reboot-a-windows-box-from-linux/</link>
		<comments>http://trylinux.org/2007/10/22/reboot-a-windows-box-from-linux/#comments</comments>
		<pubDate>Mon, 22 Oct 2007 16:59:48 +0000</pubDate>
		<dc:creator>tip</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://trylinux.org/2007/10/22/reboot-a-windows-box-from-linux/</guid>
		<description><![CDATA[Occasionally I have the need to reboot a windows box from Linux.  Here is the command I use to do this.
net -I {IP Address} -U Administrator rpc shutdown -r -f
The net command is part of the samba package and can be used for much more than rebooting, like adding or deleteing users, etc.  Read [...]]]></description>
			<content:encoded><![CDATA[<p>Occasionally I have the need to reboot a windows box from Linux.  Here is the command I use to do this.<br />
<code>net -I {IP Address} -U Administrator rpc shutdown -r -f</code></p>
<p>The net command is part of the samba package and can be used for much more than rebooting, like adding or deleteing users, etc.  Read the man file for more info.</p>
]]></content:encoded>
			<wfw:commentRss>http://trylinux.org/2007/10/22/reboot-a-windows-box-from-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>convert is awesome</title>
		<link>http://trylinux.org/2007/10/18/convert-is-awesome/</link>
		<comments>http://trylinux.org/2007/10/18/convert-is-awesome/#comments</comments>
		<pubDate>Fri, 19 Oct 2007 02:17:24 +0000</pubDate>
		<dc:creator>tip</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://trylinux.org/2007/10/18/convert-is-awesome/</guid>
		<description><![CDATA[Someone was asking how to convert PDFs to JPGs and I thought to myself, surely there is a Linux utility to do this.  Well ImageMagick comes with a utility called convert and the syntax is really easy.
convert test.pdf test.jpg
This will create a jpeg for each page of the pdf.  Simple right?  Plus it supports [...]]]></description>
			<content:encoded><![CDATA[<p>Someone was asking how to convert PDFs to JPGs and I thought to myself, surely there is a Linux utility to do this.  Well ImageMagick comes with a utility called convert and the syntax is really easy.</p>
<p><code>convert test.pdf test.jpg</code></p>
<p>This will create a jpeg for each page of the pdf.  Simple right?  Plus it supports many input and output formats.</p>
]]></content:encoded>
			<wfw:commentRss>http://trylinux.org/2007/10/18/convert-is-awesome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
