<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Nelson's Tiny Blog</title>
	<atom:link href="http://nelson21.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://nelson21.wordpress.com</link>
	<description>About Tech Stuff, Gadgets, Open Source and My Personal Stuffs</description>
	<lastBuildDate>Sat, 06 Sep 2008 14:19:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='nelson21.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Nelson's Tiny Blog</title>
		<link>http://nelson21.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://nelson21.wordpress.com/osd.xml" title="Nelson&#039;s Tiny Blog" />
	<atom:link rel='hub' href='http://nelson21.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Removing duplicate entry in a text file</title>
		<link>http://nelson21.wordpress.com/2008/08/20/removing-duplicate-entry-in-a-text-file/</link>
		<comments>http://nelson21.wordpress.com/2008/08/20/removing-duplicate-entry-in-a-text-file/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 00:13:31 +0000</pubDate>
		<dc:creator>nelson21</dc:creator>
				<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://nelson21.wordpress.com/?p=70</guid>
		<description><![CDATA[If you&#8217;re generating a text file and has duplicate entry, you can use this script to remove it. I named it removedups.sh and the file that will remove the duplicate entry is addresses.txt and the output will be named tempaddress.txt Synopsis: ./removedups.sh addresses.txt &#62; tempaddress.txt #!/bin/bash cat "$@" &#124; { awk '!x[$0]++' }<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nelson21.wordpress.com&amp;blog=4504299&amp;post=70&amp;subd=nelson21&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re generating a text file and has duplicate entry, you can use this script to remove it. I named it <code>removedups.sh</code> and the file that will remove the duplicate entry is <code>addresses.txt</code> and the output will be named <code>tempaddress.txt</code></p>
<p>Synopsis: ./removedups.sh addresses.txt &gt; tempaddress.txt</p>
<p><code>#!/bin/bash</code><br />
<code><br />
cat "$@" | {<br />
awk '!x[$0]++'<br />
}<br />
</code></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nelson21.wordpress.com/70/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nelson21.wordpress.com/70/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nelson21.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nelson21.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nelson21.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nelson21.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nelson21.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nelson21.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nelson21.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nelson21.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nelson21.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nelson21.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nelson21.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nelson21.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nelson21.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nelson21.wordpress.com/70/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nelson21.wordpress.com&amp;blog=4504299&amp;post=70&amp;subd=nelson21&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nelson21.wordpress.com/2008/08/20/removing-duplicate-entry-in-a-text-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0b7b908e18334cb38762a97bb756535a?s=96&#38;d=identicon" medium="image">
			<media:title type="html">nelson21</media:title>
		</media:content>
	</item>
		<item>
		<title>Append a word in a long list of accounts</title>
		<link>http://nelson21.wordpress.com/2008/08/20/append-a-word-in-a-long-list-of-accounts/</link>
		<comments>http://nelson21.wordpress.com/2008/08/20/append-a-word-in-a-long-list-of-accounts/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 00:10:49 +0000</pubDate>
		<dc:creator>nelson21</dc:creator>
				<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://nelson21.wordpress.com/?p=68</guid>
		<description><![CDATA[Do u have a list of users and want to append @domain.com? Here is a simple command You have a file users.txt with the ff: xyzn9512 hchu4814 pjfs9418 ntxt5325 cajg6747 jexg3621 xfay1986 krkl5696 And want to append @domain.com. Just do the ff: sed 's/$/@domain.com/' users.txt This will result of the ff: xyzn9512@domain.com hchu4814@domain.com pjfs9418@domain.com ntxt5325@domain.com [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nelson21.wordpress.com&amp;blog=4504299&amp;post=68&amp;subd=nelson21&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Do u have a list of users and want to append @domain.com? Here is a simple command</p>
<p>You have a file users.txt with the ff:</p>
<p><code>xyzn9512<br />
hchu4814<br />
pjfs9418<br />
ntxt5325<br />
cajg6747<br />
jexg3621<br />
xfay1986<br />
krkl5696</code></p>
<p>And want to append @domain.com. Just do the ff:</p>
<p><code>sed 's/$/@domain.com/' users.txt</code></p>
<p>This will result of the ff:</p>
<p><code>xyzn9512@domain.com<br />
hchu4814@domain.com<br />
pjfs9418@domain.com<br />
ntxt5325@domain.com<br />
cajg6747@domain.com<br />
jexg3621@domain.com<br />
xfay1986@domain.com<br />
krkl5696@domain.com<br />
</code></p>
<p>Just dump it to a new text file if you want to have a record of the output.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nelson21.wordpress.com/68/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nelson21.wordpress.com/68/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nelson21.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nelson21.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nelson21.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nelson21.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nelson21.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nelson21.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nelson21.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nelson21.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nelson21.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nelson21.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nelson21.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nelson21.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nelson21.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nelson21.wordpress.com/68/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nelson21.wordpress.com&amp;blog=4504299&amp;post=68&amp;subd=nelson21&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nelson21.wordpress.com/2008/08/20/append-a-word-in-a-long-list-of-accounts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0b7b908e18334cb38762a97bb756535a?s=96&#38;d=identicon" medium="image">
			<media:title type="html">nelson21</media:title>
		</media:content>
	</item>
		<item>
		<title>Connection to ssh without providing a password using Openssh and Secure Shell</title>
		<link>http://nelson21.wordpress.com/2008/08/20/connection-to-ssh-without-providing-a-password-using-openssh-and-secure-shell/</link>
		<comments>http://nelson21.wordpress.com/2008/08/20/connection-to-ssh-without-providing-a-password-using-openssh-and-secure-shell/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 00:09:49 +0000</pubDate>
		<dc:creator>nelson21</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nelson21.wordpress.com/?p=66</guid>
		<description><![CDATA[First, verify your version of ssh. I have two version of ssh. Secure shell and Openssh. On an Alpha hosts: &#62; ssh -V ssh: SSH Secure Shell 3.1.0 (non-commercial version) on alpha-dec-osf5.1 On a linux host: &#62; ssh -V OpenSSH_3.1p1, SSH protocols 1.5/2.0, OpenSSL 0x0090602f Method for OpenSSH local to OpenSSH remote 1. Local host; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nelson21.wordpress.com&amp;blog=4504299&amp;post=66&amp;subd=nelson21&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>First, verify your version of ssh. I have two version of ssh. Secure shell and Openssh.</p>
<p>On an Alpha hosts:<br />
<code>&gt; ssh -V<br />
ssh: SSH Secure Shell 3.1.0 (non-commercial version) on alpha-dec-osf5.1</code></p>
<p>On a linux host:<br />
<code>&gt; ssh -V<br />
OpenSSH_3.1p1, SSH protocols 1.5/2.0, OpenSSL 0x0090602f</code></p>
<p><strong>Method for OpenSSH local to OpenSSH remote</strong></p>
<p>1. Local host; top level of your home directory; create the key pair:</p>
<p><code>[OpenSSHhost]&gt; ssh-keygen -t dsa<br />
Generating public/private dsa key pair.<br />
Enter file in which to save the key (/yourhomedir/.ssh/id_dsa):<br />
Enter passphrase (empty for no passphrase):<br />
Enter same passphrase again:<br />
Your identification has been saved in /yourhomedir/.ssh/id_dsa.<br />
Your public key has been saved in /yourhomedir/.ssh/id_dsa.pub.<br />
The key fingerprint is:<br />
03:aa:71:.......etc.........:94 username@local.met.tamu.edu</code></p>
<p>This is the creation of a dsa key pair (see ssh man pages). It has asked for a passphrase, which is a second-level password encoded in the private key and represents additional security (see ssh man pages). It will be prompted for on login unless it is left blank, which we do here.<br />
Note that the private and public keys, stored in files id_dsa and id_dsa.pub, respectively, are written to a directory at the top level of your home directory called &#8216;.ssh&#8217;. That is also where the host keys are stored for remote hosts that you have logged into, in a file called known_hosts. The private key file, id_dsa, is created without group or other&#8217;s permissions to read, write, or execute. Leave it that way &#8212; no one must have access to that key; don&#8217;t copy it anywhere else or give to anyone else. The public key file, id_dsa.pub, may be readable by others, but you may remove that if you like; they really can&#8217;t do anything harmful with it except maybe add it to their authorized_keys file, which gives you auto login to their account without having to provide their password!</p>
<p>2. Login (ssh) to the remote host and add the local public key to a file called authorized_keys in the .ssh directory on the remote host:</p>
<p><code>[OpenSSHhost]&gt; ssh remoteOpenSSHhost<br />
username@remoteOpenSSHhost's password:<br />
[remoteOpenSSHhost]&gt; cd .ssh<br />
[remoteOpenSSHhost]&gt; cat id_dsa.pub &gt;&gt; authorized_keys<br />
username@OpenSSHhost's password:</code></p>
<p>3. Change permission for securirty purposes</p>
<p><code>chmod 700 .ssh<br />
chmod 600 .ssh/authorized_keys</code></p>
<p>You can list the contents of authorized_keys to confirm that the key was added. Note that we used the concatenate redirection, &gt;&gt;, to add the key to authorized_keys, because you want to keep any other keys you may have similarly added for auto loggins from other hosts.<br />
Now back on the local machine, you should be able to ssh to the remote host and it will log you in without prompting for the password on the remote host.<br />
Repeat step 2 on each remote host that you wish to be able to achieve such automatic login from this local host</p>
<p><strong>2. Method for OpenSSH to SSH-SS</strong></p>
<p>SSH-SS has a different format for the public key. We need to convert the local OpenSSH public key to that format, then add it to the authorized_keys file on the remote SSH-SS host.</p>
<p>1. local OpenSSH host; cd to .ssh directory and generate private-public key pair as in step 1, above, if not already done.</p>
<p>2. convert OpenSSH public key to SSH-SS style public key:</p>
<p><code>[OpenSSHhost]&gt; ssh-keygen -e -f id_dsa.pub &gt; sshss_dsa.pub   [this output filename is arbitrary]</code></p>
<p>3. ssh login to SSH-SS host; cd to .ssh2 in top level of home directory</p>
<p><code>[SSH-SShost]&gt; cd .ssh2<br />
[SSH-SShost]&gt; cat sshss_dsa.pub &gt;&gt; authorized_keys</code></p>
<p>Make sure permissions mode for authorized_keys is 644 (-rw-r&#8211;r&#8211;)</p>
<p>4. create file authorization and add &#8220;Key authorized_keys&#8221; to it:</p>
<p><code>[SSH-SShost]&gt; echo "Key authorized_keys" &gt; authorization</code></p>
<p>Now, try the auto login from the OpenSSH to the remote SSH-SS host</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nelson21.wordpress.com/66/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nelson21.wordpress.com/66/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nelson21.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nelson21.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nelson21.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nelson21.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nelson21.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nelson21.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nelson21.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nelson21.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nelson21.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nelson21.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nelson21.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nelson21.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nelson21.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nelson21.wordpress.com/66/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nelson21.wordpress.com&amp;blog=4504299&amp;post=66&amp;subd=nelson21&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nelson21.wordpress.com/2008/08/20/connection-to-ssh-without-providing-a-password-using-openssh-and-secure-shell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0b7b908e18334cb38762a97bb756535a?s=96&#38;d=identicon" medium="image">
			<media:title type="html">nelson21</media:title>
		</media:content>
	</item>
		<item>
		<title>Quotation marks play a big part in bash shell scripting</title>
		<link>http://nelson21.wordpress.com/2008/08/18/quotation-marks-play-a-big-part-in-bash-shell-scripting/</link>
		<comments>http://nelson21.wordpress.com/2008/08/18/quotation-marks-play-a-big-part-in-bash-shell-scripting/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 04:29:55 +0000</pubDate>
		<dc:creator>nelson21</dc:creator>
				<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://nelson21.wordpress.com/?p=51</guid>
		<description><![CDATA[There are three types of quotation marks. They are the double quote:&#8221;, the forward quote: &#8216;, and the back quote: `. Does each of them mean something? Yes The double quote is used mainly to hold a string of words and preserve whitespace. For instance, &#8220;This string contains whitespace.&#8221;. A string enclosed in double quotes [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nelson21.wordpress.com&amp;blog=4504299&amp;post=51&amp;subd=nelson21&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There are three types of quotation marks. They are the</p>
<p>double quote:&#8221;, the<br />
forward quote: &#8216;, and the<br />
back quote: `.</p>
<p>Does each of them mean something? <em>Yes</em></p>
<p>The double quote is used mainly to hold a string of words and preserve whitespace.</p>
<p>For instance, &#8220;This string contains whitespace.&#8221;. A string enclosed in double quotes is treated as one argument.</p>
<p>For instance, take the following examples:</p>
<p><code>[nelson@cacti ~]$ mkdir "hello world"<br />
[nelson@cacti ~]$ ll<br />
total 16<br />
drwxrwxr-x  2 nelson nelson 4096 Jul 21 09:48 hello world</code></p>
<p><code>#!/bin/bash<br />
x=5 # initialize x to 5<br />
# use double quotes<br />
echo "Using double quotes, the value of x is: $x"<br />
# use forward quotes<br />
echo 'Using forward quotes, the value of x is: $x'</code></p>
<p>Back quotes are completely different from double and forward quotes. They are not used to preserve whitespace. If you recall, earlier on, we used this line:</p>
<p><code>x=$(expr $x + 1)</code></p>
<p>As you already know, the result of the command expr $x + 1 is assigned to variable x. The exact same result can be achieved with back quotes:</p>
<p><code>x=`expr $x + 1`</code></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nelson21.wordpress.com/51/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nelson21.wordpress.com/51/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nelson21.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nelson21.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nelson21.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nelson21.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nelson21.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nelson21.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nelson21.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nelson21.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nelson21.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nelson21.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nelson21.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nelson21.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nelson21.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nelson21.wordpress.com/51/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nelson21.wordpress.com&amp;blog=4504299&amp;post=51&amp;subd=nelson21&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nelson21.wordpress.com/2008/08/18/quotation-marks-play-a-big-part-in-bash-shell-scripting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0b7b908e18334cb38762a97bb756535a?s=96&#38;d=identicon" medium="image">
			<media:title type="html">nelson21</media:title>
		</media:content>
	</item>
		<item>
		<title>Backup mysql database using mysqlhotcopy</title>
		<link>http://nelson21.wordpress.com/2008/08/18/backup-mysql-database-using-mysqlhotcopy/</link>
		<comments>http://nelson21.wordpress.com/2008/08/18/backup-mysql-database-using-mysqlhotcopy/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 04:25:34 +0000</pubDate>
		<dc:creator>nelson21</dc:creator>
				<category><![CDATA[Mysql]]></category>

		<guid isPermaLink="false">http://nelson21.wordpress.com/?p=45</guid>
		<description><![CDATA[We have several server with mysql running such as radius, rbl, etc. mysql is a application that needs to be backup especially database. The best backup for me in mysql is mysqlhotcopy. If you want to make a hotcopy from your SQL database instead of a dump to a text file, you can use the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nelson21.wordpress.com&amp;blog=4504299&amp;post=45&amp;subd=nelson21&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We have several server with mysql running such as radius, rbl, etc. mysql is a application that needs to be backup especially database. The best backup for me in mysql is mysqlhotcopy.</p>
<p>If you want to make a hotcopy from your SQL database instead of a dump to a text file, you can use the mysqlhotcopy tool. This tool locks a table, copy it and than unlocks it again.</p>
<p>Use this command if you want to transfer the MySQL data to an other place on the same server.</p>
<p><code>mysqlhotcopy --user={username} --password={password} {database} {path}</code></p>
<p>Example:</p>
<p><code>mysqlhotcopy --user=root --password=xxxxxx radius /data/</code></p>
<p>This means I backing up the radius database and saving it to <code>/data</code> directory. If you want to restore the database, simple copy the backup file to your database directory. If your using rpm, it was mostly located at <code>/var/lib/mysql</code>. Just put the directory radius there and restart mysql.</p>
<p>Use this command if you want to transfer the MySQL data to an other server with SSH</p>
<p><code>mysqlhotcopy --method=scp --user={username} --password={password} {database} {ssh-username}@{ssh-server}:{path}</code></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nelson21.wordpress.com/45/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nelson21.wordpress.com/45/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nelson21.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nelson21.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nelson21.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nelson21.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nelson21.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nelson21.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nelson21.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nelson21.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nelson21.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nelson21.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nelson21.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nelson21.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nelson21.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nelson21.wordpress.com/45/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nelson21.wordpress.com&amp;blog=4504299&amp;post=45&amp;subd=nelson21&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nelson21.wordpress.com/2008/08/18/backup-mysql-database-using-mysqlhotcopy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0b7b908e18334cb38762a97bb756535a?s=96&#38;d=identicon" medium="image">
			<media:title type="html">nelson21</media:title>
		</media:content>
	</item>
		<item>
		<title>Error &#8220;tar: Removing leading `/&#8217; from&#8221; when compressing files and folders</title>
		<link>http://nelson21.wordpress.com/2008/08/18/error-tar-removing-leading-from-when-compressing-files-and-folders/</link>
		<comments>http://nelson21.wordpress.com/2008/08/18/error-tar-removing-leading-from-when-compressing-files-and-folders/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 04:23:40 +0000</pubDate>
		<dc:creator>nelson21</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nelson21.wordpress.com/?p=42</guid>
		<description><![CDATA[If you are trying to tar a bunch of folder/files, there&#8217;s a possibility that you will encounter the error: tar: Removing leading `/' from If your parameters is like these: tar -cjf backup.tar.bz2 /var/www Then, change it to this: tar -cjPf backup.tar.bz2 /var/www No more warning message will appear. Done this to my backup script [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nelson21.wordpress.com&amp;blog=4504299&amp;post=42&amp;subd=nelson21&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you are trying to tar a bunch of folder/files, there&#8217;s a possibility that you will encounter the error:</p>
<p><code>tar: Removing leading `/' from</code></p>
<p>If your parameters is like these:</p>
<p><code>tar -cjf backup.tar.bz2 /var/www</code></p>
<p>Then, change it to this:</p>
<p><code>tar -cjPf backup.tar.bz2 /var/www</code></p>
<p>No more warning message will appear.</p>
<p>Done this to my backup script and takes me an hour to discover the solution. Hopefully, it will not happen to you.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nelson21.wordpress.com/42/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nelson21.wordpress.com/42/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nelson21.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nelson21.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nelson21.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nelson21.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nelson21.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nelson21.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nelson21.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nelson21.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nelson21.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nelson21.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nelson21.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nelson21.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nelson21.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nelson21.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nelson21.wordpress.com&amp;blog=4504299&amp;post=42&amp;subd=nelson21&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nelson21.wordpress.com/2008/08/18/error-tar-removing-leading-from-when-compressing-files-and-folders/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0b7b908e18334cb38762a97bb756535a?s=96&#38;d=identicon" medium="image">
			<media:title type="html">nelson21</media:title>
		</media:content>
	</item>
		<item>
		<title>Change table name and column name in mysql</title>
		<link>http://nelson21.wordpress.com/2008/08/18/change-table-name-and-column-name-in-mysql/</link>
		<comments>http://nelson21.wordpress.com/2008/08/18/change-table-name-and-column-name-in-mysql/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 04:15:18 +0000</pubDate>
		<dc:creator>nelson21</dc:creator>
				<category><![CDATA[Mysql]]></category>

		<guid isPermaLink="false">http://nelson21.wordpress.com/?p=34</guid>
		<description><![CDATA[Do you need to change the name of the table or the table itself in your mysql? Let&#8217;s assume your table name is orgs and the old column name is o_name and you want to change this to org_name. You also want to change the table name to organizations. Below is the sample command to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nelson21.wordpress.com&amp;blog=4504299&amp;post=34&amp;subd=nelson21&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Do you need to change the name of the table or the table itself in your mysql? Let&#8217;s assume your table name is orgs and the old column name is o_name and you want to change this to org_name. You also want to change the table name to organizations. Below is the sample command to do this:</p>
<p><code>alter table orgs change o_id org_id int(11);<br />
alter table orgs change o_name org_name varchar(64);<br />
rename table orgs organizations;<br />
</code></p>
<p>Make sure you have proper permission  to alter your table.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nelson21.wordpress.com/34/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nelson21.wordpress.com/34/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nelson21.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nelson21.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nelson21.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nelson21.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nelson21.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nelson21.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nelson21.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nelson21.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nelson21.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nelson21.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nelson21.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nelson21.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nelson21.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nelson21.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nelson21.wordpress.com&amp;blog=4504299&amp;post=34&amp;subd=nelson21&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nelson21.wordpress.com/2008/08/18/change-table-name-and-column-name-in-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0b7b908e18334cb38762a97bb756535a?s=96&#38;d=identicon" medium="image">
			<media:title type="html">nelson21</media:title>
		</media:content>
	</item>
		<item>
		<title>Change mysql database directory</title>
		<link>http://nelson21.wordpress.com/2008/08/15/change-mysql-database-directory/</link>
		<comments>http://nelson21.wordpress.com/2008/08/15/change-mysql-database-directory/#comments</comments>
		<pubDate>Fri, 15 Aug 2008 14:52:42 +0000</pubDate>
		<dc:creator>nelson21</dc:creator>
				<category><![CDATA[Mysql]]></category>

		<guid isPermaLink="false">http://nelson21.wordpress.com/?p=27</guid>
		<description><![CDATA[Suddenly my /var partition got 90% and the reason was due to growing database. So I need to put a new hard drive dedicated only for my mysql data. First, backup your database and shutdown mysql. Then edit your /etc/my.cnf. my.cnf location depends on your distro. Mine is rpm so it was in /etc Before: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nelson21.wordpress.com&amp;blog=4504299&amp;post=27&amp;subd=nelson21&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Suddenly my <code>/var</code> partition got 90% and the reason was due to growing database. So I need to put a new hard drive dedicated only for my mysql data. First, backup your database and shutdown mysql. Then edit your <code>/etc/my.cnf</code>. <code>my.cnf</code> location depends on your distro. Mine is rpm so it was in <code>/etc</code></p>
<p>Before:</p>
<p><code>[mysqld]<br />
port = 3306<br />
socket = /var/lib/mysql/mysql.sock<br />
log-bin<br />
server-id = 9<br />
skip-innodb</code></p>
<p>To:</p>
<p><code>[mysqld]<br />
port = 3306<br />
socket = /var/lib/mysql/mysql.sock<br />
log-bin<br />
server-id = 9<br />
skip-innodb<br />
datadir=/data # MY NEW PARTITION</code></p>
<p>Then start mysql. Make sure your database was already in the <code>/data</code> before you start up the mysql</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nelson21.wordpress.com/27/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nelson21.wordpress.com/27/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nelson21.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nelson21.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nelson21.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nelson21.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nelson21.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nelson21.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nelson21.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nelson21.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nelson21.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nelson21.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nelson21.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nelson21.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nelson21.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nelson21.wordpress.com/27/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nelson21.wordpress.com&amp;blog=4504299&amp;post=27&amp;subd=nelson21&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nelson21.wordpress.com/2008/08/15/change-mysql-database-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0b7b908e18334cb38762a97bb756535a?s=96&#38;d=identicon" medium="image">
			<media:title type="html">nelson21</media:title>
		</media:content>
	</item>
	</channel>
</rss>
