<?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>Tech Notes &#187; Linux</title>
	<atom:link href="http://www.ryannitz.org/tech-notes/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ryannitz.org/tech-notes</link>
	<description>Miscellaneous technology examples and notes</description>
	<lastBuildDate>Mon, 10 Aug 2009 18:29:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
<image>
  <link>http://www.ryannitz.org/tech-notes</link>
  <url>http://ryan-nitz/favicon.ico</url>
  <title>Tech Notes</title>
</image>
		<item>
		<title>Chkconfig Notes</title>
		<link>http://www.ryannitz.org/tech-notes/2009/07/10/chkconfig-notes/</link>
		<comments>http://www.ryannitz.org/tech-notes/2009/07/10/chkconfig-notes/#comments</comments>
		<pubDate>Sat, 11 Jul 2009 02:26:32 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Config]]></category>
		<category><![CDATA[chkconfig]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://ryan-nitz.com/tech-notes/?p=175</guid>
		<description><![CDATA[Chkconfig is a simple utility available on Linux that allows you to register services to start/stop on bootup and shutdown. The following are the basic commands you need to know to get things going: chkconfig --list (lists all the commands that are registered) chkconfig --add httpd (add httpd to the chkconfig list) chkconfig  --level 35 [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-42" title="linux" src="http://ryan-nitz.com/tech-notes/wp-content/uploads/2008/08/linux.jpeg" alt="linux" width="113" height="124" /></p>
<p><a href="http://linuxcommand.org/man_pages/chkconfig8.html" target="_blank">Chkconfig</a> is a simple utility available on Linux that allows you to register services to start/stop on bootup and shutdown. The following are the basic commands you need to know to get things going:</p>
<pre>chkconfig --list (lists all the commands that are registered)
chkconfig --add httpd (add httpd to the chkconfig list)
chkconfig  --level 35 httpd on (enables the httpd daemon to start on <a href="http://en.wikipedia.org/wiki/Runlevel" target="_blank">runlevels</a> 3 and 5)
chkconfig --level 35 mysqld on (enables the mysqld daemon to start on runlevels 3 and 5)
chkconfig --level 35 memcached on (enables the memcached daemon to start on runlevels 3 and 5)
chkconfig --level 2345 sendmail on (enabled the sendmail daemon to start on runlevels 2, 3, 4 and 5)</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannitz.org/tech-notes/2009/07/10/chkconfig-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bash Find On A Large Dataset &#8211; Write The Results To A File</title>
		<link>http://www.ryannitz.org/tech-notes/2009/03/14/bash-find-dataset-write-file/</link>
		<comments>http://www.ryannitz.org/tech-notes/2009/03/14/bash-find-dataset-write-file/#comments</comments>
		<pubDate>Sat, 14 Mar 2009 18:20:26 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Examples]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Find]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://leisuremech.com/?p=148</guid>
		<description><![CDATA[A fast bash based solution for executing a find on a directory with a lot of files that you want to log to a file: find /my/data/  -name '*.xml' -type f -fprint my_xml_files.txt This example looks in the /my/data/ directory for all files with the xml extension and then writes the results to the my_xml_files.txt [...]]]></description>
			<content:encoded><![CDATA[<p>A fast <a href="http://en.wikipedia.org/wiki/Bash" target="_blank">bash</a> based solution for executing a <a href="http://www.gnu.org/software/findutils/" target="_blank">find</a> on a directory with a lot of files that you want to log to a file:</p>
<pre>find /my/data/  -name '*.xml' -type f -fprint my_xml_files.txt</pre>
<p>This example looks in the <em>/my/data/</em> directory for all files with the <em>xml</em> extension and then writes the results to the <em>my_xml_files.txt</em> file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannitz.org/tech-notes/2009/03/14/bash-find-dataset-write-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux Process Thread Count</title>
		<link>http://www.ryannitz.org/tech-notes/2008/11/19/linux-process-thread-count/</link>
		<comments>http://www.ryannitz.org/tech-notes/2008/11/19/linux-process-thread-count/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 04:58:03 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Examples]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://leisuremech.com/?p=68</guid>
		<description><![CDATA[On Linux, to get a thread count for particular process, issue: ps UH p PID_OF_PROCESS &#124; wc -l Removing the pipe to the &#8220;&#124; wc -l&#8221; yields more information about the running threads.]]></description>
			<content:encoded><![CDATA[<p><a href="http://ryan-nitz.com/tech-notes/wp-content/uploads/2008/08/linux.jpeg"><img class="alignnone size-medium wp-image-42" title="linux" src="http://ryan-nitz.com/tech-notes/wp-content/uploads/2008/08/linux.jpeg" alt="" width="113" height="124" /></a></p>
<p>On Linux, to get a thread count for particular process, issue:</p>
<pre>ps UH p PID_OF_PROCESS | wc -l</pre>
<p>Removing the pipe to the &#8220;| wc -l&#8221; yields more information about the running threads.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannitz.org/tech-notes/2008/11/19/linux-process-thread-count/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configure Linux Hostname</title>
		<link>http://www.ryannitz.org/tech-notes/2008/08/07/configure-linux-hostname/</link>
		<comments>http://www.ryannitz.org/tech-notes/2008/08/07/configure-linux-hostname/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 00:13:45 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Config]]></category>
		<category><![CDATA[Configure]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Hostname]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://leisuremech.com/?p=44</guid>
		<description><![CDATA[If you want to change your Linux hostname and you&#8217;re running Fedora or Red Hat, the steps are listed below. Immediate Change echo 'some.host.com' &#62; /proc/sys/kernel/hostname Persisted Change This is for non-DHCP nodes. Add your name to /etc/sysconfig/network NETWORKING=yes HOSTNAME="some.host.com" If you&#8217;re node gets an IP address from a DHCP server then you can set: [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://ryan-nitz.com/tech-notes/wp-content/uploads/2008/08/fedora.jpg"><img class="alignnone size-thumbnail wp-image-49" title="fedora" src="http://leisuremech.com/wp-content/uploads/2008/08/fedora-150x150.jpg" alt="" width="150" height="150" /></a></p>
<p>If you want to change your Linux <a href="http://en.wikipedia.org/wiki/Hostname" target="_blank">hostname</a> and you&#8217;re running <a href="http://fedoraproject.org/" target="_blank">Fedora</a> or Red Hat, the steps are listed below.</p>
<h3>Immediate Change</h3>
<pre>echo 'some.host.com' &gt; /proc/sys/kernel/hostname</pre>
<h3>Persisted Change</h3>
<p>This is for non-DHCP nodes.</p>
<p>Add your name to /etc/sysconfig/network</p>
<pre>NETWORKING=yes
HOSTNAME="some.host.com"</pre>
<p>If you&#8217;re node gets an IP address from a <a href="http://en.wikipedia.org/wiki/Dhcp" target="_blank">DHCP</a> server then you can set:</p>
<pre>DHCP_HOSTNAME="some.host.com"</pre>
<p>in the /etc/sysconfig/network-scripts/ifcfg-eth0 file (or whatever your primary device is).</p>
<h3>Notes</h3>
<p>You can also add your hostname to your /etc/hosts file</p>
<pre>10.1.1.10 some.host.com some</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannitz.org/tech-notes/2008/08/07/configure-linux-hostname/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux &#8211; Programmatically Change Password</title>
		<link>http://www.ryannitz.org/tech-notes/2008/08/06/linux-programatically-change-password/</link>
		<comments>http://www.ryannitz.org/tech-notes/2008/08/06/linux-programatically-change-password/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 00:22:00 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Examples]]></category>
		<category><![CDATA[crypt]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[usermod]]></category>

		<guid isPermaLink="false">http://leisuremech.com/?p=36</guid>
		<description><![CDATA[If you need to script a password change you have two main options: Write a script that interacts with the command line and executes passwd Use the usermod command Option one is a bit of a mess and option two requires an encrypted version of the password. At first, we couldn&#8217;t figure out how to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://ryan-nitz.com/tech-notes/wp-content/uploads/2008/08/linux.jpeg"><img class="alignnone size-medium wp-image-42" title="linux" src="http://ryan-nitz.com/tech-notes/wp-content/uploads/2008/08/linux.jpeg" alt="" width="113" height="124" /></a></p>
<p>If you need to script a password change you have two main options:</p>
<ol>
<li>Write a script that interacts with the command line and executes <a href="http://en.wikipedia.org/wiki/Passwd_%28command%29" target="_blank">passwd<br />
</a></li>
<li>Use the <a href="http://linux.die.net/man/8/usermod" target="_blank">usermod</a> command</li>
</ol>
<p>Option one is a bit of a mess and option two requires an encrypted version of the password. At first, we couldn&#8217;t figure out how to encrypt the password but then we realized that you could use the <a href="http://perldoc.perl.org/functions/crypt.html" target="_blank">Perl crypt</a> function.</p>
<p>An example of number two:</p>
<pre>#!/bin/bash

usermod -p `perl -e 'print crypt("test", "salt")'` root;</pre>
<p>That&#8217;s all there is to it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannitz.org/tech-notes/2008/08/06/linux-programatically-change-password/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
