<?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>J Squared Consulting &#187; Linux</title>
	<atom:link href="http://jsquaredconsulting.com/blog/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://jsquaredconsulting.com/blog</link>
	<description></description>
	<lastBuildDate>Mon, 29 Nov 2010 13:00:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Taking More Control: Even More BASH Tips</title>
		<link>http://jsquaredconsulting.com/blog/2010/11/taking-more-control-even-more-bash-tips/</link>
		<comments>http://jsquaredconsulting.com/blog/2010/11/taking-more-control-even-more-bash-tips/#comments</comments>
		<pubDate>Mon, 29 Nov 2010 13:00:27 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[BASH]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Control]]></category>
		<category><![CDATA[CTRL]]></category>
		<category><![CDATA[CTRL+k]]></category>
		<category><![CDATA[CTRL+t]]></category>
		<category><![CDATA[CTRL+u]]></category>
		<category><![CDATA[CTRL+w]]></category>
		<category><![CDATA[CTRL+y]]></category>
		<category><![CDATA[CTRL+_]]></category>
		<category><![CDATA[cut]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[paste]]></category>
		<category><![CDATA[RedHat]]></category>
		<category><![CDATA[server administration]]></category>
		<category><![CDATA[system administration]]></category>
		<category><![CDATA[System administrator]]></category>
		<category><![CDATA[time saving]]></category>
		<category><![CDATA[transposed characters]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[undo]]></category>

		<guid isPermaLink="false">http://jsquaredconsulting.com/blog/?p=116</guid>
		<description><![CDATA[This is an extension of my last BASH post, Taking Control: More BASH Tips. In that post we discussed some of the control commands that are available for clearing the screen, searching the history and moving the cursor around. This time we are going to talk about modifying the text in the current command. CTRL+_ [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" title="Tux" src="http://jsquaredconsulting.com/images/linux.png" alt="" width="64" height="64"> This is an extension of my last BASH post, <a href="http://jsquaredconsulting.com/blog/2010/11/taking-control-more-bash-tips/">Taking Control: More BASH Tips.</a>  In that post we discussed some of the control commands that are available for clearing the screen, searching the history and moving the cursor around.  This time we are going to talk about modifying the text in the current command.</p>
<p><strong>CTRL+_ or CTRL+-</strong><br />
Let&#8217;s start out with the thing that we all need sometimes, undo.  Control and underscore or dash will undo the last control command done in bash.  It WILL NOT undo the last command executed on the system.  For example if you cut all of the text from the cursor to the beginning of the line but really ment to cut the last word you can use undo.</p>
<p><code>#I want to change badger to fox.<br />
j2consulting:~ user1$ The quick brown badger jumps over the lazy dog.<br />
#I hit CTRL+u instead of CTRL+w<br />
j2consulting:~ user1$  jumps over the lazy dog.<br />
#CTRL+- saves me from my mistake<br />
j2consulting:~ user1$ The quick brown badger jumps over the lazy dog.</code></p>
<p><strong>CTRL + u, CTRL + w, CTRL + k</strong><br />
As I showed in the previous example, you can remove text from the current command.  Using these control commands you can delete text based on the current cursor position.  Control and u will delete all of the text from the point of the cursor to the beginning of the command.  Control and k will delete all of the test from the point of the cursor to the end of the command.  Finally, control and w will delete the previous word in the command.</p>
<p><code>#I want to change badger to fox.<br />
j2consulting:~ user1$ The quick brown badger jumps over the lazy dog.<br />
#I move the cursor to the space between badger and jumps and then hit CTRL+w<br />
j2consulting:~ user1$ The quick brown  jumps over the lazy dog.<br />
#Now I can add fox.<br />
j2consulting:~ user1$ The quick brown fox jumps over the lazy dog.<br />
#I don't like the end so I move the cursor to the space between fox and jumps and hit CTRL+k<br />
j2consulting:~ user1$ The quick brown fox<br />
#And now I change the ending.<br />
j2consulting:~ user1$ The quick brown fox hides while the dog chases him.<br />
#But now it's just wrong and I want to delete everything from the end to the beginning so I hit CTRL+u<br />
j2consulting:~ user1$</code></p>
<p><strong>CTRL + y </strong><br />
So you have just got done cutting all kinds of text, what is the next logical thing?  Paste.  Any of the text you cut using the previous 3 commands can be pasted into the line.  Let&#8217;s switch the sentence around to put the dog first.</p>
<p><code>j2consulting:~ user1$ The quick brown fox jumps over the lazy dog.<br />
#Putting my cursor on the . and hitting CTRL+w I cut the previous word.<br />
j2consulting:~ user1$ The quick brown fox jumps over the lazy .<br />
#Now I put my cursor between fox and jumps and hit CTRL+y<br />
j2consulting:~ user1$ The quick brown foxdog jumps over the lazy .<br />
#Now I put my cursor on the d in dog and hit CTRL+w<br />
j2consulting:~ user1$ The quick brown dog jumps over the lazy .<br />
#Finally I put my cursor on the . again and hit CTRL+y to paste the fox<br />
j2consulting:~ user1$ The quick brown dog jumps over the lazy fox.</code></p>
<p><strong>CTRL + t</strong><br />
It is a fairly common mistake to transpose two characters while typing.  Control and t can help us quickly fix this by swapping the previous two characters.</p>
<p><code>j2consulting:~ user1$ Teh<br />
#Oops, I ment to spell The, hit CTRL+t<br />
j2consulting:~ user1$ The<br />
#This can also work if you want to move the cursor to the mistake.<br />
j2consulting:~ user1$ Teh quick brown fox jumps over the lazy dog.<br />
#By placing the cursor between the h and q and hitting CTRL+t we can fix the mistake.<br />
j2consulting:~ user1$ The quick brown fox jumps over the lazy dog.</code></p>
<p>By using the tricks in this and previous BASH posts you can significantly reduce the time it takes you to get things done.  If you know of any other tricks I&#8217;d love to hear about them in the <a href="http://jsquaredconsulting.com/blog/?p=116#idc-container">comments</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://jsquaredconsulting.com/blog/2010/11/taking-more-control-even-more-bash-tips/feed/</wfw:commentRss>
		<slash:comments>155</slash:comments>
		</item>
		<item>
		<title>Taking Control: More BASH Tips</title>
		<link>http://jsquaredconsulting.com/blog/2010/11/taking-control-more-bash-tips/</link>
		<comments>http://jsquaredconsulting.com/blog/2010/11/taking-control-more-bash-tips/#comments</comments>
		<pubDate>Tue, 23 Nov 2010 19:20:18 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[BASH]]></category>
		<category><![CDATA[bash history]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Control]]></category>
		<category><![CDATA[CTRL]]></category>
		<category><![CDATA[CTRL+a]]></category>
		<category><![CDATA[CTRL+e]]></category>
		<category><![CDATA[CTRL+l]]></category>
		<category><![CDATA[CTRL+r]]></category>
		<category><![CDATA[history]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[RedHat]]></category>
		<category><![CDATA[server administration]]></category>
		<category><![CDATA[system administration]]></category>
		<category><![CDATA[System administrator]]></category>
		<category><![CDATA[time saving]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://jsquaredconsulting.com/blog/?p=84</guid>
		<description><![CDATA[Between the numerous servers I manage via ssh and my personal machines I spend a lot of time in the BASH shell and, as with anyone and who uses a tool for a long time, I have discovered numerous shortcuts to getting things done efficiently. I wrote a couple months ago about using ! and [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" title="Tux" src="http://jsquaredconsulting.com/images/linux.png" alt="" width="64" height="64"> Between the numerous servers I manage via ssh and my personal machines I spend a lot of time in the BASH shell and, as with anyone and who uses a tool for a long time, I have discovered numerous shortcuts to getting things done efficiently.  <a href="http://jsquaredconsulting.com/blog/2010/07/getting-the-bang-for-your-buck-from-bash/">I wrote a couple months ago about using ! and $ to manipulate previous commands.</a>  This time I am going to talk about moving the cursor around in the current command and manipulating the window.</p>
<p><strong>CTRL + l</strong><br />
Before we get started let&#8217;s clean up by clearing our screen.  Control and l will clear the screen without modifying any of the text on your current line.  It is very helpful for keeping your terminal clean or preparing it for a large amount of output that your next command may bring.</p>
<p><strong>CTRL + r</strong><br />
This is probably one of the most frequently used control combinations.  Control and r allows you to pull up a command from your history by typing in and having it match the last used command with those characters.  For example, if you used a command yesterday that had very complex syntax and can&#8217;t remember what it was, you could hit ctrl+r and then start typing the part of the command that you know.</p>
<p><code>j2consulting:~ user1$ echo The quick brown fox jumps over the lazy dog.<br />
The quick brown fox jumps over the lazy dog.<br />
(reverse-i-search)`fox': echo The quick brown fox jumps over the lazy dog.</code></p>
<p><strong>CTRL + a and CTRL + e</strong><br />
There are many times when you need to jump to the beginning of the line to fix a command and then jump back to the end to finish what you were typing.  Control and a as well as Control and e take care of this for you.  Say I wanted to use print instead of echo in the previous example.  I could hit the up arrow, CTRL+a, change echo to printf &#8220;, CTRL+e, add \n&#8221; and be done.</p>
<p><code>j2consulting:~ user1$ echo The quick brown fox jumps over the lazy dog.<br />
The quick brown fox jumps over the lazy dog.<br />
j2consulting:~ user1$ printf "The quick brown fox jumps over the lazy dog.\n"<br />
The quick brown fox jumps over the lazy dog.</code></p>
<p><strong>ESC, ALT, CTRL + b and ESC, ALT, CTRL + f</strong><br />
In addition to these there are commands to move back and forward one word at a time.  I don&#8217;t frequently use these because they have mixed success depending on which terminal emulator is used.  If you are on a mac on the local terminal esc and then b will move you back one word and esc then f will move you forward one word.  If you are on a mac and ssh&#8217;d into a system CTRL + the left arrow will move you back one word and CTRL + the right arrow will move you forward one word.  I have also read about ALT + b and ALT + f working on different systems.  Experiment with this one but because of the inconsistency I tend not to depend on it.</p>
<p>There are more control commands available and I will be looking at those in my next post.  Until then happy BASHing.</p>
]]></content:encoded>
			<wfw:commentRss>http://jsquaredconsulting.com/blog/2010/11/taking-control-more-bash-tips/feed/</wfw:commentRss>
		<slash:comments>89</slash:comments>
		</item>
		<item>
		<title>rscurl: A Rackspace Cloud Server command line tool</title>
		<link>http://jsquaredconsulting.com/blog/2010/11/rscurl-a-rackspace-cloud-server-command-line-tool/</link>
		<comments>http://jsquaredconsulting.com/blog/2010/11/rscurl-a-rackspace-cloud-server-command-line-tool/#comments</comments>
		<pubDate>Fri, 12 Nov 2010 21:51:08 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[amazon ec2 api tools]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[BASH]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[rackspace]]></category>
		<category><![CDATA[rackspace api]]></category>
		<category><![CDATA[rackspace api tools]]></category>
		<category><![CDATA[rackspace cloud]]></category>
		<category><![CDATA[rackspace cloud servers]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://jsquaredconsulting.com/blog/?p=107</guid>
		<description><![CDATA[rscurl.sh License: GPL Download: https://github.com/jsquared/rscurl After looking around for a tool that would allow me to manage my Rackspace Cloud Servers from the terminal and not finding anything I decided to write my own. My primary goal for this was to have a tool that could be used from the shell or used in scripts [...]]]></description>
			<content:encoded><![CDATA[<p>rscurl.sh<br />
License: GPL<br />
Download: <a href="https://github.com/jsquared/rscurl">https://github.com/jsquared/rscurl</a></p>
<p>After looking around for a tool that would allow me to manage my Rackspace Cloud Servers from the terminal and not finding anything I decided to write my own.  My primary goal for this was to have a tool that could be used from the shell or used in scripts to manage and automate the Rackspace Cloud Servers.  I have used Amazon&#8217;s EC2 API Tools in the past to manage hosts on their service and found it frustrating that they were written in Java, requiring anything that used them to have Java running on it.  Because of this I made it a secondary goal to use tools that are commonly available to systems that have bash.  Currently that has allowed me to use the script on Apple OS X, Red Hat based systems (CentOS), and Debian based systems (Ubuntu) without any modifications or special permissions on the systems.</p>
<p>rscurl allows you to list your servers, server images available to you ( including the images you make from your servers ), and server flavors ( the memory and disk combinations ).  In addition to that you can create, delete, resize and reimage servers as well as create and delete images.  All of the options except for the ones that specifically list data have a quiet option so that they can be used in automation scripts.  To use rscurl you will need your Rackspace username and api key.  The username is the same one you use to log into the web interface and the api key can be found in the <a href="https://manage.rackspacecloud.com/Login.do">Rackspace web interface</a> under Your Account, API Access.  </p>
<p>rscurl -u username -a apiKey -c command [ -s serverID ] [ -n name ] [ -i imageID ] [ -f flavorID ] [ -q -h ]<br />
	v 0.1<br />
	rscurl is a command line tool for managing Rackspace Cloud Servers.  It uses curl, awk, sed,<br />
	and tr to accomplish this in the hopes that it will work on most systems that use bash.  </p>
<p>	-u Your rackspace username.<br />
	-a Your rackspace api key, found on your rackspace cloud dashboard under Your Account, API Access.<br />
	   This cannot be your password.<br />
	-c command, possible commands are:<br />
		list-servers	- Lists all the servers you have on your account.<br />
		list-flavors	- Lists all the types of server that are available to you.<br />
		list-images		- Lists all the server images that are available to you.<br />
		create-server	- Creates a new server<br />
						  requires an imageID (-i) and flavorID (-f)<br />
						  optional name (-n)<br />
		delete-server	- Deletes a server, requires serverID (-s).<br />
						  DANGER: Server deleted without prompt, be sure.<br />
		rebuild			- Rebuilds a server with the new image, all data will be lost.<br />
						  requires an imageID (-i) and serverID (-s)<br />
		resize			- Resizes a server, requires flavorID (-f)<br />
		confirm-resize	- Confirms a recently resized server, after 24 hours it is done automatically.<br />
						  requires serverID (-s)<br />
		revert-resize	- Reverts a recently resized server to the previous size.<br />
						  requires serverID (-s)<br />
		reboot			- Reboots a server, requires serverID (-s)<br />
		force-reboot	- Forces a server to reboot, equivalent to pulling the power.<br />
		 				  Requires serverID (-s)<br />
		create-image	- Creates a new image based on an existing server.<br />
						  Requires serverID (-s), optional name (-n)<br />
		delete-image	- Deletes a server image that you own.<br />
						  Requires imageID (-i)<br />
	-s Server ID, required for some commands. To see the servers run list-servers.<br />
	-i Image ID, required for some commands. To see the images run list-images.<br />
	-f Flavor ID, required for some commands.  To see the flavors run list-flavors.<br />
	-n Name of server(required) or image(optional) when creating them.<br />
	-q Quiet mode, all commands except list-* will exit quietly<br />
	-h show this menu</p>
<p>This is my first attempt at writing something like this and there are most defiantly bugs but I think that it&#8217;s ready for other people to look at.  I have licensed it under the GPL and stored it on github in the hopes that others will find it useful and possibly contribute.  If this is a tool you can use or would like to contribute to please check it out at <a href="https://github.com/jsquared/rscurl">https://github.com/jsquared/rscurl</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://jsquaredconsulting.com/blog/2010/11/rscurl-a-rackspace-cloud-server-command-line-tool/feed/</wfw:commentRss>
		<slash:comments>607</slash:comments>
		</item>
		<item>
		<title>Installing Nagios on Ubuntu 10.10</title>
		<link>http://jsquaredconsulting.com/blog/2010/11/installing-nagios-on-ubuntu-10-10/</link>
		<comments>http://jsquaredconsulting.com/blog/2010/11/installing-nagios-on-ubuntu-10-10/#comments</comments>
		<pubDate>Tue, 09 Nov 2010 07:10:07 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[could not stat command file]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[nagios]]></category>
		<category><![CDATA[nagios command file]]></category>
		<category><![CDATA[nagios.cmd]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://jsquaredconsulting.com/blog/?p=99</guid>
		<description><![CDATA[Nagios is a powerful monitoring software package that basically consists of a web interface, a scheduling and evaluation engine, and various scripts or plug-ins. It is a widely used monitoring tool due to it&#8217;s flexibility and stability. I&#8217;ve personally seen it being used at numerous operation centers and set it up for countless clients. Until [...]]]></description>
			<content:encoded><![CDATA[<p>Nagios is a powerful monitoring software package that basically consists of a web interface, a scheduling and evaluation engine, and various scripts or plug-ins.  It is a widely used monitoring tool due to it&#8217;s flexibility and stability.  I&#8217;ve personally seen it being used at numerous operation centers and set it up for countless clients.  Until recently I had never used Ubuntu as a nagios host but that has changed and the difference in setup was worth documenting.  This </p>
<p>I&#8217;ll be starting with a basic install of Ubuntu Server 10.10, specifically the Rackspace Cloud Server image and all commands will be run as root ( sudo su &#8211; ) to simplify things.  After building it I like to make sure that I&#8217;m all patched up before starting.<br />
<code><br />
apt-get update<br />
apt-get upgrade<br />
</code></p>
<p><b>No Compiling?</b><br />
If you have ever built a nagios system in the past you have probably had to go to nagios.org, download the source, compile it and install it.  Ubuntu keeps nagios in their repository so there is no need for that.<br />
<code><br />
apt-get install nagios3<br />
</code><br />
This will prompt you to install a large number of packages including apache2, php, postfix, samba, and a slew of libraries all used to either present the nagios interface or support the underlying scripts.  The install will prompt you to set the postfix ( mail ) settings.  Internet Site and your domain name are probably what you want to use there.  It will also prompt you for the nagiosadmin password, this is for the htaccess on the website.  Once all of the packages are done installing you have a working nagios install.  You can verify this by going to the web interface at http://your.server.ip/nagios3 use the username nagiosadmin and the password you set during the install.</p>
<p><b>Where are the files?</b><br />
Traditionally nagios installs into /usr/local/nagios as a complete package.  The way the ubuntu package installs these files are put into the larger os layout.  Below is a rough cheat sheet as to where things ended up.</p>
<p>Purpose &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;. Old &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;. New<br />
binary &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; /usr/local/nagios/bin/nagios &#8230; /usr/sbin/nagios3<br />
configuration files &#8230; /usr/local/nagios/etc &#8230;&#8230;&#8230;&#8230;.. /etc/nagios3 &#038; /etc/nagios-plugins/config<br />
plugins &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;. /usr/local/nagios/libexec &#8230;&#8230;.. /usr/lib/nagios/plugins<br />
website files &#8230;&#8230;&#8230;.. /usr/local/nagios/share &#8230;&#8230;&#8230;.. /usr/share/nagios3/htdocs<br />
command file &#8230;&#8230;&#8230; /usr/local/nagios/var &#8230;&#8230;&#8230;&#8230;.. /var/lib/nagios3</p>
<p><b>One last hurdle.</b><br />
At this point you have a very basic nagios system that is functioning, almost.  If you are in the web interface and try to use any of the links under Service Commands or Host Commands you will see this error:</p>
<blockquote><p>
Sorry, but Nagios is currently not checking for external commands, so your command will not be committed!
</p></blockquote>
<p>Like the error says, external commands are not enabled.  To fix this edit /etc/nagios3/nagios.cfg, find the line <code>check_external_commands=0</code> and change it to <code>check_external_commands=1</code></p>
<p>If you restart nagios now and try the commands again you will get another error:</p>
<blockquote><p>
Error: Could not stat() command file &#8216;/var/lib/nagios3/rw/nagios.cmd&#8217;!<br />
The external command file may be missing, Nagios may not be running, and/or Nagios may not be checking external commands.<br />
An error occurred while attempting to commit your command for processing.
</p></blockquote>
<p>This error is coming up because the apache process does not have the permission to write to the file that nagios checks for the commands you are requesting.  The fix for this is to allow the www-data group read and execute permission to the directory where the command file lives and then add the www-data user to the nagios group because the command file gets created with nagios:nagios as the owner:group and 660 as the permissions.<br />
<code><br />
chmod g+rx /var/lib/nagios3/rw<br />
usermod -a -G nagios www-data<br />
/etc/init.d/apache2 restart<br />
/etc/init.d/nagios3 restart<br />
</code><br />
Now the host and service commands will work and you can start configuring the rest of your nagios setup.</p>
]]></content:encoded>
			<wfw:commentRss>http://jsquaredconsulting.com/blog/2010/11/installing-nagios-on-ubuntu-10-10/feed/</wfw:commentRss>
		<slash:comments>180</slash:comments>
		</item>
		<item>
		<title>Maverick Meerkat&#8217;s clever coming out party.</title>
		<link>http://jsquaredconsulting.com/blog/2010/10/maverick-meerkat-clever-coming-out-party/</link>
		<comments>http://jsquaredconsulting.com/blog/2010/10/maverick-meerkat-clever-coming-out-party/#comments</comments>
		<pubDate>Mon, 11 Oct 2010 03:59:11 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[10.10]]></category>
		<category><![CDATA[Cononical]]></category>
		<category><![CDATA[linux releases]]></category>
		<category><![CDATA[Maverick]]></category>
		<category><![CDATA[Maverick Meerkat]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://jsquaredconsulting.com/blog/?p=93</guid>
		<description><![CDATA[In a clever move by Canonical the next release of Ubuntu, 10.10, was released today, the tenth day of the tenth month of the tenth year. This release, named Maverick Meerkat, only has minor upgrades to most packages that effect servers with the only major upgrade being to Eucalyptus. It does include the update to [...]]]></description>
			<content:encoded><![CDATA[<p>In a clever move by Canonical the next release of Ubuntu, 10.10, was released today, the tenth day of the tenth month of the tenth year.  This release, named Maverick Meerkat, only has minor upgrades to most packages that effect servers with the only major upgrade being to Eucalyptus.  It does include the update to 3.2.1 for Nagios which includes a slightly improved site design as well as bug fixes which I was happy to see.  </p>
<p>This release also serves as a reminder that Ubuntu 9.04 ( Jaunty Jackalope ) will enter end of life in 13 days, October 23.  What does this mean? From <a href="https://lists.ubuntu.com/archives/ubuntu-announce/2010-September/000137.html">Ubuntu&#8217;s official announcement</a>: &#8220;At that time, Ubuntu Security Notices will no longer include information or updated packages for Ubuntu 9.04.&#8221;</p>
<p>To find out more about the release, check out the <a href="https://wiki.ubuntu.com/MaverickMeerkat/ReleaseNotes">release notes</a> or <a href="http://www.ubuntu.com/desktop/get-ubuntu/download">download and install</a> it for yourself.  You can also take Ubuntu up on it&#8217;s offer of a free hour of Maverick in the cloud via their <a href="https://10.cloud.ubuntu.com/">Ubuntu on Cloud 10 project</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://jsquaredconsulting.com/blog/2010/10/maverick-meerkat-clever-coming-out-party/feed/</wfw:commentRss>
		<slash:comments>107</slash:comments>
		</item>
		<item>
		<title>Using Screen to share your terminal.</title>
		<link>http://jsquaredconsulting.com/blog/2010/08/using-screen-to-share-your-terminal/</link>
		<comments>http://jsquaredconsulting.com/blog/2010/08/using-screen-to-share-your-terminal/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 06:46:12 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[User Administration]]></category>
		<category><![CDATA[BASH]]></category>
		<category><![CDATA[pair programing]]></category>
		<category><![CDATA[remote debugging]]></category>
		<category><![CDATA[remote desktop]]></category>
		<category><![CDATA[screen]]></category>
		<category><![CDATA[screen sharing]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[terminal sharing]]></category>

		<guid isPermaLink="false">http://jsquaredconsulting.com/blog/?p=88</guid>
		<description><![CDATA[As a consultant who works with remote clients and, before that, a telecommuting systems engineer for companies who used linux I have often encountered the problem of collaborating inside of a remote client that does not have X and who&#8217;s only access is ssh. Servers with GUI interfaces like Windows or Mac OS X have [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" title="Tux" src="http://jsquaredconsulting.com/images/linux.png" alt="" width="64" height="64"> As a consultant who works with remote clients and, before that, a telecommuting systems engineer for companies who used linux I have often encountered the problem of collaborating inside of a remote client that does not have X and who&#8217;s only access is ssh.  Servers with GUI interfaces like Windows or Mac OS X have a long history of tools to share the desktop with multiple users, oddly enough both are called Remote Desktop.  Servers that only have a command line interface, like most linux servers, do not have such an obvious tool for sharing the terminal with another user. While bash and ssh can be manipulated to accomplish this, <a href="http://www.gnu.org/software/screen/">screen</a> fills this roll nicely.  </p>
<p>Screen allows you to create virtual terminals that you can detach from and attach to at will.  Detaching from a screen will leave it running in the background.  Attaching to it again allows you to keep executing commands where you were or see the current state of a process you left running.  If you are the user who started the screen you can attach to a screen that is already attached to, this is is how the shared screen is accomplished. </p>
<p>To set it up, one user logs in to the server and, using su or sudo su, changes to either the second users account or an account that all parties can access.  Next, start screen with the -S option and give it a meaningful name.</p>
<blockquote><p>me@jjtest:~# sudo su &#8211; theOtherGuy<br />
theOtherGuy@jjtest:~# screen -S blogTest
</p></blockquote>
<p>If screen is not installed, it is available as a package on most popular linux distributions.  You are now in a screen session as theOtherGuy.  Now just tell theOtherGuy to log in and that your screen is called blogTest and he will simply need to run screen with the -x option and give the screen name.</p>
<blockquote><p>theOtherGuy@jjtest:~# screen -x blogTest</p></blockquote>
<p>At this point you are both in the same screen session and can both interact with it.  This is great for showing another user what kind of problems you may be having or how to do a certain process.  It can also be used to accomplish remote pair programing on the remote system.  And this doesn&#8217;t have to be limited to just two users, as long as someone can get to that system as that user they can join the screen as well.  </p>
<p>Typing exit at this point will kill the screen and kick both of you out.  If one user wants to leave but not kick the other person off the user just presses Ctrl+a and then d, this will detach you from the screen.  Ctrl+a is the default hot key for activating screen commands.  You can read more about the variety of command available on screen at <a href="http://www.pixelbeat.org/lkdb/screen.html">this site</a> or read abut it fully on the <a href="http://www.gnu.org/software/screen/manual/screen.html">man page</a>.</p>
<p>Screen can be used to do so much more than I&#8217;ve talked about here but it&#8217;s ability to facilitate the sharing of a terminal between users can be a life saver when you need it.  It is not normally installed by default to may linux systems so you may have to install it or ask that it be installed.  </p>
]]></content:encoded>
			<wfw:commentRss>http://jsquaredconsulting.com/blog/2010/08/using-screen-to-share-your-terminal/feed/</wfw:commentRss>
		<slash:comments>527</slash:comments>
		</item>
		<item>
		<title>Getting the bang (!) for your buck ($) from BASH</title>
		<link>http://jsquaredconsulting.com/blog/2010/07/getting-the-bang-for-your-buck-from-bash/</link>
		<comments>http://jsquaredconsulting.com/blog/2010/07/getting-the-bang-for-your-buck-from-bash/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 06:36:03 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[!]]></category>
		<category><![CDATA[!!]]></category>
		<category><![CDATA[!$]]></category>
		<category><![CDATA[!:]]></category>
		<category><![CDATA[BASH]]></category>
		<category><![CDATA[bash history]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[history]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[RedHat]]></category>
		<category><![CDATA[server administration]]></category>
		<category><![CDATA[system administration]]></category>
		<category><![CDATA[System administrator]]></category>
		<category><![CDATA[time saving]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://jsquaredconsulting.com/blog/?p=64</guid>
		<description><![CDATA[Most of the work I do is on systems who&#8217;s primary interface is BASH. BASH is the shell that runs on most Linux distributions and Mac OS X when you open a terminal or SSH in. There are a few short cuts I have picked up along the way that are built into BASH but [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" title="Tux" src="http://jsquaredconsulting.com/images/linux.png" alt="" width="64" height="64"> Most of the work I do is on systems who&#8217;s primary interface is BASH.  BASH is the shell that runs on most Linux distributions and Mac OS X when you open a terminal or SSH in.  There are a few short cuts I have picked up along the way that are built into BASH but aren&#8217;t all that obvious or in the man ( manual ) pages.  One very powerful shortcut, ! ( refered to as bang ), is used in BASH to reference the prior command(s) in varius ways and can really speed up your work in the terminal.</p>
<p><strong>!$</strong><br />
The command that this post is named for is used to reference the last argument in the previous command. For example, let&#8217;s say you set up a new directory for your client you would need to set the ownership and permissions on it.</p>
<blockquote><p>mkdir /dir/made/for/client1<br />
chown client1:client1 /dir/made/for/client1<br />
chmod 750 /dir/made/for/client1</p></blockquote>
<p>This can be shortened by using the !$ shortcut like this.</p>
<blockquote><p>mkdir /dir/made/for/client1<br />
chown client1:client1 !$<br />
chmod 750 !$</p></blockquote>
<p>The time savings here are minor but over time can help, by referencing the first command we also reduce the number of typos.</p>
<p><strong>!!</strong><br />
This command references the complete previous command.  &#8220;Doesn&#8217;t the up arrow do that?&#8221; you ask?  The up arrow pulls the previous command up, allowing you to run it again or modify it.  !! allows you to insert the previous command into what you are typing.  Take the previous example, if you didn&#8217;t have permission to make the directory the first time you tried you could try it again using sudo, like this.</p>
<blockquote><p>mkdir /dir/made/for/client1 (returns an error about permission denied)<br />
sudo mkdir /dir/made/for/client1 (works)</p></blockquote>
<p>This can be shortened using the !! shortcut like this.</p>
<blockquote><p>mkdir /dir/made/for/client1 (returns an error about permission denied)<br />
sudo !! (works)</p></blockquote>
<p><strong>!number</strong> or <strong>!-number</strong><br />
BASH, in most configurations, keeps a history of your commands. You can see a list of those commands using the command <em>history</em>.</p>
<blockquote><p>server01:~ j2$ history<br />
26  command1<br />
27  command2<br />
28  command3<br />
29  command4<br />
30  command5<br />
31  command6<br />
32  command7<br />
33  command8<br />
34  command9<br />
35  history</p></blockquote>
<p>You can reference any of these commands using the number next to them and the ! shortcut.  If I wanted to run command5 again I would do this.</p>
<blockquote><p>!30</p></blockquote>
<p>You can also reference commands in reverse by negating them.  If I remembered that I ran command5 six commands ago I could do this.</p>
<blockquote><p>!-6</p></blockquote>
<p><strong>!:number</strong><br />
By putting a : and a number after the ! you can reference individual arguments in a previous command.  Each &#8220;word&#8221; in a command gets assigned a number, starting with 0.  For example, in the command chmod 750 /dir/made/for/client1 chmod = 0, 750 = 1, and /dir/made/for/client1 = 2.   So if I had to change the permissions on a few directories it would look like this.</p>
<blockquote><p>chmod 750 /dir/made/for/client1<br />
chmod 750 /dir/made/for/client2<br />
chmod 750 /dir/made/for/client3</p></blockquote>
<p>Using the shortcut it would look like this.</p>
<blockquote><p>chmod 750 /dir/made/for/client1<br />
!:0 !:1 /dir/made/for/client2<br />
!:0 !:1 /dir/made/for/client3</p></blockquote>
<p>Finally, the last shortcut and this one can be combined to reference specific parts of a command in your history list.  Say I just did all those chmod commands above but forgot to chown client1&#8242;s dir.  Using the combination I could do this.</p>
<blockquote><p>chown client1:client1 !-3:2</p></blockquote>
<p>You can now see why ! is one of my favorite tools while working in BASH.  If you have any questions or know of another way to use !, please leave a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://jsquaredconsulting.com/blog/2010/07/getting-the-bang-for-your-buck-from-bash/feed/</wfw:commentRss>
		<slash:comments>181</slash:comments>
		</item>
		<item>
		<title>0 day exploits</title>
		<link>http://jsquaredconsulting.com/blog/2010/01/0-day-exploits/</link>
		<comments>http://jsquaredconsulting.com/blog/2010/01/0-day-exploits/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 03:25:40 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Apache HTTP Server]]></category>
		<category><![CDATA[Exploit]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[Hackers]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Red Hat]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Web server]]></category>
		<category><![CDATA[WWW]]></category>
		<category><![CDATA[Zero Day Attack]]></category>
		<category><![CDATA[Zero Day Exploit]]></category>

		<guid isPermaLink="false">http://jsquaredconsulting.com/blog/?p=28</guid>
		<description><![CDATA[Zero day exploits, best explained here, will be coming out daily for the month of January, it seems, due to a security research firm in Russia. No matter what you think about their methods, this does highlight a fact that is sometimes forgotten, every running service presents the potential for an exploit. But without those [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" title="Tux" src="http://jsquaredconsulting.com/images/linux.png" alt="" width="64" height="64">Zero day exploits, best explained <a href="http://en.wikipedia.org/wiki/Zero_day_attack" target="_new">here</a>, will be coming out daily for the month of January, it seems, due to a <a href="http://intevydis.blogspot.com/" target="_new">security research firm in Russia</a>.  No matter what you think about their methods, this does highlight a fact that is sometimes forgotten, every running service presents the potential for an exploit.  But without those services a computer is just an overpriced electric heater.  So how do we protect ourselves against the unknown and unpatched?  By being very careful about what our servers are running, only allowing access to the minimum number of resources required to get the job done, and having a plan for when your monitoring reports the service is down.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Since linux distributions are varied in their installs I won&#8217;t go through each but most of the &#8220;friendly&#8221; distributions start, by default, a variety of services that may not be required but could potentially have exploits.   While most of these don&#8217;t have a network component, combined with other exploits they could help open the server to attack.  For example, Red Hat starts processes to monitor the software raid and logical volume manager even if you aren&#8217;t using them.  It also starts processes for handling bluetooth devices, HP printers, and command line mouse support, even if you don&#8217;t have them.  None of these should cause you any concern but if you don&#8217;t need them they don&#8217;t need to run at all.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Most Apache HTTP server installs suffer from the same desire for usability, many modules are made available to the server by default.  For example, you probably aren&#8217;t using LDAP authentication or WebDAV as part of your server but the modules for them are preloaded on most default installs.  Identifying the modules that are required for your web site or application to run and then disabling the ones that are not will reduce your apache httpd footprint and therefore reduce your exposure.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MySQL server doesn&#8217;t have the modular nature of our prior two examples but there are some steps that you can take to reduce your exposure.  First off, after doing the install and setting the root password, remove the test user and database.  These have no known exploits but aren&#8217;t needed.  Second, ensure that your users are bound to a host instead of a wild card address, this makes sure that connections are only authorized from known hosts.  Finally, if you are running mysql on the same host as your webserver and this is the only server that needs to access it, configure it to only listen on localhost ( There is no place like 127.0.0.1 ), this ensures that remote hosts cannot connect to your database even if your firewall fails.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;While I did focus on some of the more simple things that can be done to a LAMP server, this should give you an idea of what kind of changes can be made that won&#8217;t effect your service but will reduce your exposure footprint.  Remember that before you make any changes you should do a backup and make copies of the files you are editing.  We will see what this month brings as far as unpublished exploits and should also take this time to remember that not all exploits are published or patched, or even discovered yet.</p>
<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/7fe923b5-726f-4079-a969-5b65c2f19d1f/" title="Reblog this post [with Zemanta]"><img style="border: medium none ; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_e.png?x-id=7fe923b5-726f-4079-a969-5b65c2f19d1f" alt="Reblog this post [with Zemanta]"></a><span class="zem-script more-related more-info pretty-attribution"><script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://jsquaredconsulting.com/blog/2010/01/0-day-exploits/feed/</wfw:commentRss>
		<slash:comments>1927</slash:comments>
		</item>
		<item>
		<title>Likewise, the myth debunked</title>
		<link>http://jsquaredconsulting.com/blog/2009/06/likewise-the-myth-debunked/</link>
		<comments>http://jsquaredconsulting.com/blog/2009/06/likewise-the-myth-debunked/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 06:28:08 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[User Administration]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Authentication]]></category>
		<category><![CDATA[Microsoft Windows]]></category>
		<category><![CDATA[Open source]]></category>
		<category><![CDATA[Operating system]]></category>
		<category><![CDATA[System administrator]]></category>
		<category><![CDATA[User]]></category>

		<guid isPermaLink="false">http://jsquaredconsulting.com/blog/?p=7</guid>
		<description><![CDATA[This post originally written for my personal blog on June 14th 2009. As a systems administrator in many mixed Windows and linux environments I have seen and made many of my own attempts at integrating the linux servers into the Windows Active Directory structure with mixed results. Linux registration and authentication inside of a Windows [...]]]></description>
			<content:encoded><![CDATA[<p>This post originally written for my personal blog on June 14th 2009.</p>
<p><a href="http://www.likewise.com"><img alt="" src="http://likewise.com/images/logo_likewise_pos.gif" title="Likewise" class="alignleft" width="232" height="36"></a>As a systems administrator in many mixed <a class="zem_slink" href="http://www.microsoft.com/WINDOWS" title="Windows" rel="homepage">Windows</a> and linux environments I have seen and made many of my own attempts at integrating the linux servers into the Windows Active Directory structure with mixed results.  Linux registration and authentication inside of a Windows domain is akin to the bigfoot: some have claimed to see one, many have worked long hours to find them, no one can produce consistent results.  Until now.</p>
<p>At the suggestion by a coworker I decided to give <a href="http://likewise.com" target="_new">Likewise</a> a try on my most recent attempt at bringing our linux servers into the windows domain.  Skeptically I built a new <a class="zem_slink" href="http://www.centos.org/" title="CentOS" rel="homepage">CentOS</a> 5.3 server and proceeded to follow the instructions for installing Likewise.  The seemed too simple and with each step I waited for the fatal issue that would bring the test to it&#8217;s demise.  Software installed, no issues.  As I reviewed the <a href="http://likewise.com/resources/documentation_library/manuals/open/likewise-open-guide.html" target="_new">instructions</a> for adding the system to the domain and found that it only required one command and no further configuration of files I thought, &#8220;This is so going to fall on it&#8217;s face.&#8221;  Command executed and I&#8217;m waiting, then it comes up on the screen: Success.  Success? Really? I don&#8217;t believe it, I log onto the domain controller and there it is, right where new computers are supposed to go in the domain.  I quickly flip over to the manual and look up how to authenticate for ssh, simple DOMAIN\\username@host, and give it the final test.  Success.  In the span of 15 minutes I was able to install the app, add my computer to the domain and authenticate against the domain.  15 more minutes and I was able to limit who could log in and give them sudo access.  This is a huge win for any admin who deals with linux servers in a domain.</p>
<p>I&#8217;m still testing the limits of <a href="http://likewise.com" target="_new">Likewise</a> and I will say that it hasn&#8217;t been without it&#8217;s speed bumps but I plan on paying for a little support and getting the answers I need.  Like may <a class="zem_slink" href="http://www.wikinvest.com/concept/Open_Source" title="Open Source" rel="wikinvest">open source</a> products, Likewise is making it&#8217;s money on support and by selling upgraded functionality.  I applaud this model, allowing the flexibility of open source while still finding a way to pay for all that hard work.  I will be continuing to test the limits of Likewise but as of now I am thoroughly impressed and will continue to use it.</p>
<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/bdcfe811-bf6d-41eb-89fd-6e19ef88c268/" title="Reblog this post [with Zemanta]"><img style="border: medium none ; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_e.png?x-id=bdcfe811-bf6d-41eb-89fd-6e19ef88c268" alt="Reblog this post [with Zemanta]"></a><span class="zem-script more-related more-info pretty-attribution"><script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://jsquaredconsulting.com/blog/2009/06/likewise-the-myth-debunked/feed/</wfw:commentRss>
		<slash:comments>1193</slash:comments>
		</item>
	</channel>
</rss>

