<?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>FettesPS &#187; bash</title>
	<atom:link href="http://www.fettesps.com/tag/bash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fettesps.com</link>
	<description>Fettes Programming Solutions</description>
	<lastBuildDate>Sun, 22 Jan 2012 18:21:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How to Stop Emacs from Opening a New Daemon</title>
		<link>http://www.fettesps.com/how-to-stop-emacs-from-opening-a-new-daemon/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-stop-emacs-from-opening-a-new-daemon</link>
		<comments>http://www.fettesps.com/how-to-stop-emacs-from-opening-a-new-daemon/#comments</comments>
		<pubDate>Mon, 13 Jun 2011 04:05:14 +0000</pubDate>
		<dc:creator>FettesPS</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[bashrc]]></category>
		<category><![CDATA[daemon]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[emacs 23]]></category>
		<category><![CDATA[putty]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.fettesps.com/?p=1375</guid>
		<description><![CDATA[I finally got around to upgrading to the the newest stable release of Emacs. There were a few things I wanted to be able to do and rather than use outdated methods I decided it was time to upgrade to Emacs 23. I ran into a few hitches along the way but after getting them [...]]]></description>
			<content:encoded><![CDATA[<p>I finally got around to upgrading to the the newest stable release of Emacs.  There were a few things I wanted to be able to do and rather than use outdated methods I decided it was time to upgrade to Emacs 23. I ran into a few hitches along the way but after getting them resolved I went about setting up the Emacs daemon to load quietly in the background and start using multiple emacs clients under different GNU Screen windows. I had a bit of a time figuring out how to make it so it wouldn&#8217;t try to start up another server each time I logged in via SSH or created a new Screen.  I never really found a one stop answer for this, rather it was a combination of several suggestions I saw.  So here&#8217;s what I came up with for my ~/.bashrc:</p>
<pre class="brush: bash; title: ; notranslate">
# Boot up the Emacs Daemon
function emacs_is_running() {
    ps -ef | grep &quot;emacs --daemon&quot; | grep -v grep &gt; /dev/null
}                                                                                                                                                                                                          

# Debug
if emacs_is_running; then
    echo Emacs daemon already running
else
    echo Launching emacs daemon
    emacs --daemon
fi                                                                                                                                                                                                         

# Fix Typos, Add Shortcuts...
alias e=&quot;emacsclient -c -a nano&quot;
alias emac=&quot;emacsclient -c -a nano&quot;
alias emacs=&quot;emacsclient -c -a nano&quot;
alias emasc=&quot;emacsclient -c -a nano&quot;
alias pico=&quot;emacsclient -c&quot;
EDITOR=&quot;emacsclient -c -a nano&quot;
VISUAL=&quot;emacsclient -c -a nano&quot;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.fettesps.com/how-to-stop-emacs-from-opening-a-new-daemon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a New User</title>
		<link>http://www.fettesps.com/unix-creating-a-new-user/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=unix-creating-a-new-user</link>
		<comments>http://www.fettesps.com/unix-creating-a-new-user/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 02:50:18 +0000</pubDate>
		<dc:creator>FettesPS</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[adduser]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[man adduser]]></category>
		<category><![CDATA[man useradd]]></category>
		<category><![CDATA[mandrake]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[sh]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[useradd]]></category>

		<guid isPermaLink="false">http://www.fettesps.com/?p=339</guid>
		<description><![CDATA[Creating a user in Linux is a simple task. Well, kinda. You can quickly create a user without specifying much of it&#8217;s characteristics, or you can get much more in depth with security, default shells and other customizations. I recommend taking the time to learn beyond the basics or you may find yourself making a [...]]]></description>
			<content:encoded><![CDATA[<p>Creating a user in Linux is a simple task. Well, kinda.  You can quickly create a user without specifying much of it&#8217;s characteristics, or you can get much more in depth with security, default shells and other customizations.  I recommend taking the time to learn beyond the basics or you may find yourself making a simple mistake. For the longest time I created my user&#8217;s with a command like this:</p>
<pre class="brush: bash; title: ; notranslate">sudo useradd -d /home/username -m username
sudo passwd username</pre>
<p>I had thought for a long time this was sufficient.  It created their home directory with the <em>-m</em> parameter and specified that location with the <em>-d</em> parameter.  After that I set the password and the user was now able to login to the system with basic privileges. But after a while I began to notice some quirks with those users.  They didn&#8217;t act like the initial admin user that was created by the installation process.  I found that the prompt was a bit less informative.  It also lacked a history, and the ability to hit tab to complete a directory as you typed it.  I even found myself copying over the root .bashrc and trying to figure out what ws different between the users.  Then I typed in the following command just to make sure it was using bash:</p>
<pre class="brush: bash; title: ; notranslate">echo $SHELL</pre>
<p>I looked at the response.</p>
<pre class="brush: bash; title: ; notranslate">/bin/sh</pre>
<p>*face-palm*</p>
<p>No wonder .bashrc didn&#8217;t do anything, I was using a completely different shell for my subsequent users.  I had never taken the time to learn the difference between the various shells, most systems use bash by default so that is what I learned and got used to.  So I never even realized they were using sh instead of bash. </p>
<p>To quickly change the shell for an established user to bash just run the command:</p>
<pre class="brush: bash; title: ; notranslate">chsh -s /bin/bash username</pre>
<p>Since then I&#8217;ve adjusted my create user command to include bash as my default shell.</p>
<pre class="brush: bash; title: ; notranslate">sudo useradd -d /home/username -m username -s /bin/bash</pre>
<p>There are many more parameters that you can add on to this command. If you&#8217;d like to read up on those then just type <em>man useradd</em> and read through the documentation.  Or if you want a very verbose and easy to use command to create your users you can always try <em>adduser</em>.  Instead of passing in which parameters you want to specify it will prompt you on every possibility.  Great for if you don&#8217;t know which options exist, but also somewhat overwhelming in the beginning.</p>
<pre class="brush: bash; title: ; notranslate">mradmin@microsoft$ sudo adduser username
Password: ******
Adding user `username’…
Adding new group `username’ (1337).
Adding new user `username’ (1337) with group `username’.
Creating home directory `/home/username’.
Copying files from `/etc/skel’
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for username
Enter the new value, or press ENTER for the default
Full Name []: Example User
Room Number []: 0
Work Phone []: 604-6122
Home Phone []: 604-6222
Other []:
Is the information correct? [y/N] </pre>
<p>The choice of which two methods to use is a mater of preference.  In the long run, what matters is that you educate yourself on what all of the available options do.  And remember, <em>man useradd</em> and <em>man adduser</em> are your friends!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fettesps.com/unix-creating-a-new-user/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linux Disk Usage</title>
		<link>http://www.fettesps.com/linux-disk-usage/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=linux-disk-usage</link>
		<comments>http://www.fettesps.com/linux-disk-usage/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 05:09:32 +0000</pubDate>
		<dc:creator>FettesPS</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[disk usage]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.fettesps.com/blog/?p=18</guid>
		<description><![CDATA[Every now and then one of my servers will stop working because the hard drive or one of its partitions has filled up.&#160; In almost every case it has simply been choking on a log file that grew to massive proportions, but not always. There are a lot of linux commands that will help you [...]]]></description>
			<content:encoded><![CDATA[<p>Every now and then one of my servers will stop working because the hard drive or one of its partitions has filled up.&nbsp; In almost every case it has simply been choking on a log file that grew to massive proportions, but not always.</p>
<p>There are a lot of linux commands that will help you track down what&#8217;s using up all your memory.&nbsp; However I found that they often left me just as puzzled afterwards.&nbsp; Here&#8217;s a handy one that will show you the space being used by every folder or file in the current directory and most importantly they will be sorted by size.</p>
<pre class="brush: bash; title: ; notranslate">du -sk * | sort -n</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.fettesps.com/linux-disk-usage/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

