<?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>windohs.co.za</title>
	<atom:link href="http://www.windohs.co.za/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.windohs.co.za</link>
	<description>Servers - Windows and Linux</description>
	<lastBuildDate>Thu, 08 Nov 2012 06:42:33 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Creating a Symbolic Link</title>
		<link>http://www.windohs.co.za/2012/08/27/creating-a-symbolic-link/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=creating-a-symbolic-link</link>
		<comments>http://www.windohs.co.za/2012/08/27/creating-a-symbolic-link/#comments</comments>
		<pubDate>Mon, 27 Aug 2012 16:08:43 +0000</pubDate>
		<dc:creator>Lyle</dc:creator>
				<category><![CDATA[CLI]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.windohs.co.za/?p=733</guid>
		<description><![CDATA[Symbolic links or soft links is a special type of file that contains a reference to a file or directory in the form of an absolute or relative path. In other words it&#8217;s like a shortcut for those Windows users out there.
I&#8217;ll be using CentOS for this tutorial but it&#8217;s the same on all distributions  [...]]]></description>
				<content:encoded><![CDATA[<p>Symbolic links or soft links is a special type of file that contains a reference to a file or directory in the form of an absolute or relative path. In other words it&#8217;s like a shortcut for those Windows users out there.</p>
<p>I&#8217;ll be using CentOS for this tutorial but it&#8217;s the same on all distributions of Linux and Unix.<span id="more-733"></span></p>
<pre>[root@localhost:~]# ln -s [target file/directory] [symbolic file]</pre>
<p>Example</p>
<pre>[root@localhost:~]# ln -s /var/www/cacti/index.php /home/index.php</pre>
<p>If you want to see the link then you can just list the directory contents:</p>
<pre>[root@localhost:~]# ll 
lrwxrwxrwx 1 root          root        46 Aug 27 15:41 index.php -&gt; /var/www/cacti/index.php</pre>
<p><script type="text/javascript">// <![CDATA[
var _adynamo_client = "fc1fad20-3cec-41cd-92fd-5e58a2cbc571"; 	var _adynamo_width = 468; 	var _adynamo_height = 60;
// ]]&gt;</script><br />
<script type="text/javascript" src="http://static.addynamo.net/ad/js/deliverAds.js"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.windohs.co.za/2012/08/27/creating-a-symbolic-link/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Channel Bonding on CentOS 6.2</title>
		<link>http://www.windohs.co.za/2012/08/13/channel-bonding-on-centos-6-2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=channel-bonding-on-centos-6-2</link>
		<comments>http://www.windohs.co.za/2012/08/13/channel-bonding-on-centos-6-2/#comments</comments>
		<pubDate>Mon, 13 Aug 2012 19:07:27 +0000</pubDate>
		<dc:creator>Lyle</dc:creator>
				<category><![CDATA[CLI]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.windohs.co.za/?p=724</guid>
		<description><![CDATA[Channel bonding is also known as Network Bonding. It involves pairing network devices to increase throughput or load balance. Cases that you&#8217;d need something like this would be on a server with a high network traffic. Mostly I&#8217;ve had this problem with monitoring servers that are running Cacti and  [...]]]></description>
				<content:encoded><![CDATA[<p>Channel bonding is also known as Network Bonding. It involves pairing network devices to increase throughput or load balance. Cases that you&#8217;d need something like this would be on a server with a high network traffic. Mostly I&#8217;ve had this problem with monitoring servers that are running Cacti and Nagios.<br />
Also the devices don&#8217;t have to be the same brand.<br />
<script type="text/javascript">
	<!--
	var _adynamo_client = "65862195-e2d6-44ac-8015-0c1f267704fc";
	var _adynamo_width = 650;
	var _adynamo_height = 90;
	//-->
</script><br />
<script type="text/javascript" src="http://static.addynamo.net/ad/js/deliverAds.js"></script><br />
<span id="more-724"></span>There are 6 different bonding modes: (The following is from the CentOS website)</p>
<p><strong>mode=1 (active-backup)</strong> &#8211; Active-backup policy: Only one slave in the bond is active. A different slave becomes active if, and only if, the active slave fails. The bond&#8217;s MAC address is externally visible on only one port (network adapter) to avoid confusing the switch. This mode provides fault tolerance. The primary option affects the behavior of this mode.</p>
<p><strong>mode=2 (balance-xor)</strong> &#8211; XOR policy: Transmit based on [(source MAC address XOR'd with destination MAC address) modulo slave count]. This selects the same slave for each destination MAC address. This mode provides load balancing and fault tolerance.</p>
<p><strong>mode=3 (broadcast)</strong> &#8211; Broadcast policy: transmits everything on all slave interfaces. This mode provides fault tolerance.</p>
<p><strong>mode=4 (802.3ad)</strong> &#8211; IEEE 802.3ad Dynamic link aggregation. Creates aggregation groups that share the same speed and duplex settings. Utilizes all slaves in the active aggregator according to the 802.3ad specification.</p>
<p><em>Pre-requisites:<br />
Ethtool support in the base drivers for retrieving the speed and duplex of each slave.<br />
A switch that supports IEEE 802.3ad Dynamic link aggregation. Most switches will require some type of configuration to enable 802.3ad mode.</em></p>
<p><strong>mode=5 (balance-tlb)</strong> &#8211; Adaptive transmit load balancing: channel bonding that does not require any special switch support. The outgoing traffic is distributed according to the current load (computed relative to the speed) on each slave. Incoming traffic is received by the current slave. If the receiving slave fails, another slave takes over the MAC address of the failed receiving slave.</p>
<p><em>Prerequisite: Ethtool support in the base drivers for retrieving the speed of each slave.</em></p>
<p><strong>mode=6 (balance-alb)</strong> - Adaptive load balancing: includes balance-tlb plus receive load balancing (rlb) for IPV4 traffic, and does not require any special switch support. The receive load balancing is achieved by ARP negotiation. The bonding driver intercepts the ARP Replies sent by the local system on their way out and overwrites the source hardware address with the unique hardware address of one of the slaves in the bond such that different peers use different hardware addresses for the server.</p>
<p>First we need to create the master bond file. (Replace the information provided with the relevant information pertaining to your network setup)<br />
<strong>*Note: Make a backup of all files you edit incase you need to rollback.</strong></p>
<pre>[root@localhost:~]# vi /etc/sysconfig/network-scripts/ifcfg-bond0</pre>
<p>Paste the following into the newly created file:</p>
<pre>DEVICE=bond0
USERCTL=no
BOOTPROTO=none
ONBOOT=yes
IPADDR=10.0.0.10
NETMASK=255.255.255.0
NETWORK=10.0.0.0
GATEWAY=10.0.0.2
DNS1=10.0.0.11
BONDING_OPTS="miimon=100 mode=balance-alb"
TYPE=unknown
IPV6INIT=no</pre>
<p>Next we edit the existing interface config files:</p>
<pre>[root@localhost:~]# vi /etc/sysconfig/network-scripts/ifcfg-eth1</pre>
<p>Paste the following into the ifcfg-eth1 file:</p>
<pre>DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no</pre>
<pre>[root@localhost:~]# vi /etc/sysconfig/network-scripts/ifcfg-eth2</pre>
<p>Paste the following into the ifcfg-eth2 file:</p>
<pre>DEVICE=eth2
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no</pre>
<p>I&#8217;ll only be bonding two network interfaces for the purpose of this example.<br />
Next you need to define the bond:</p>
<pre>[root@localhost:~]# vi /etc/modprobe.d/bonding.conf</pre>
<p>Insert the following text:</p>
<pre>alias bond0 bonding</pre>
<p>Restart the network service</p>
<pre>[root@localhost:~]# service network restart</pre>
<p>Source: <a title="CentOS Wiki" href="http://wiki.centos.org/TipsAndTricks/BondingInterfaces" target="_blank">CentOS Wiki</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.windohs.co.za/2012/08/13/channel-bonding-on-centos-6-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find the Linux Distribution Name and Version</title>
		<link>http://www.windohs.co.za/2012/08/12/linux-distribution/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=linux-distribution</link>
		<comments>http://www.windohs.co.za/2012/08/12/linux-distribution/#comments</comments>
		<pubDate>Sun, 12 Aug 2012 18:54:35 +0000</pubDate>
		<dc:creator>Lyle</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.windohs.co.za/?p=714</guid>
		<description><![CDATA[How do I find my Linux distribution name and version? I often find myself asking that question because we have multiple environments with a lot of VM&#8217;s running. It&#8217;s becomes a lot to keep track of if you haven&#8217;t completed the documentation for the environment yet.
// 
The following command will  [...]]]></description>
				<content:encoded><![CDATA[<p>How do I find my Linux distribution name and version? I often find myself asking that question because we have multiple environments with a lot of VM&#8217;s running. It&#8217;s becomes a lot to keep track of if you haven&#8217;t completed the documentation for the environment yet.<br />
<script type="text/javascript">// <![CDATA[
var _adynamo_client = "65862195-e2d6-44ac-8015-0c1f267704fc"; 	var _adynamo_width = 650; 	var _adynamo_height = 90;
// ]]&gt;</script><span id="more-714"></span></p>
<p>The following command will tell you the release name and version:</p>
<pre>[root@localhost:~]# cat /etc/*-release
CentOS Linux release 6.0 (Final)</pre>
<p>If you want to see the kernel version and if it&#8217;s 32-bit or 64-bit:</p>
<pre>[root@localhost:~]# uname -mrs
Linux 2.6.32-71.el6.x86_64 x86_64</pre>
<p>x86_64 = 64-bit<br />
Kernel = 2.6.32-71.el6.x86_64<br />
2 = Kernel Version<br />
6 = Major revision of the kernel<br />
32 = Minor revision of the kernel<br />
71 = Immediate fixing / bug fixing for critical error<br />
el6 = This is specific to the distribution, Redhat appends el and the major kernel version</p>
]]></content:encoded>
			<wfw:commentRss>http://www.windohs.co.za/2012/08/12/linux-distribution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setup BIND DNS Server with Webmin on CentOS 6.2</title>
		<link>http://www.windohs.co.za/2012/07/19/setup-bind-dns-server-webmin-centos-6-2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=setup-bind-dns-server-webmin-centos-6-2</link>
		<comments>http://www.windohs.co.za/2012/07/19/setup-bind-dns-server-webmin-centos-6-2/#comments</comments>
		<pubDate>Thu, 19 Jul 2012 08:08:01 +0000</pubDate>
		<dc:creator>Lyle</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[BIND]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[webmin]]></category>

		<guid isPermaLink="false">http://www.windohs.co.za/?p=700</guid>
		<description><![CDATA[For this setup I will be using the following:
CentOS 6.2
Yum (Yellowdog Updater, Modified)
IP Address: 192.168.0.10
You&#8217;d generally use the following config for an office or home network. I&#8217;ve setup a few of these BIND servers for office networks and also in the Amazon cloud platform. You don&#8217;t  [...]]]></description>
				<content:encoded><![CDATA[<p>For this setup I will be using the following:</p>
<p>CentOS 6.2</p>
<p>Yum (Yellowdog Updater, Modified)</p>
<p>IP Address: 192.168.0.10</p>
<p>You&#8217;d generally use the following config for an office or home network. I&#8217;ve setup a few of these BIND servers for office networks and also in the Amazon cloud platform. You don&#8217;t need the Webmin interface to work with BIND but I&#8217;ve found that making quick changes using Webmin is easier.<br />
<span id="more-700"></span></p>
<p>I&#8217;ll be working as root, use root if you feel comfortable enough that you wont break anything.</p>
<p>I&#8217;ve also disabled SELinux for this tutorial, I don&#8217;t recommend it but it&#8217;s just easier to work with CentOS if it&#8217;s disabled.<br />
<script type="text/javascript">
	<!--
	var _adynamo_client = "65862195-e2d6-44ac-8015-0c1f267704fc";
	var _adynamo_width = 650;
	var _adynamo_height = 90;
	//-->
</script><br />
<script type="text/javascript" src="http://static.addynamo.net/ad/js/deliverAds.js"></script><br />
To start we&#8217;ll install BIND</p>
<pre>[root@localhost ~]$ yum -y install bind bind-utils bind-libs</pre>
<p>Make sure it starts at boot</p>
<pre>[root@localhost ~]$ chkconfig named on</pre>
<p>Then start it up</p>
<pre>[root@localhost ~]$ service named start</pre>
<p>Now configure named.conf</p>
<pre>[root@localhost ~]$ vi /etc/named.conf</pre>
<p>You can copy paste the following into there, it&#8217;s minimal config needed to get things going, just be sure to change the zone name to a domain name that you want. In this case I&#8217;m using windohs.co.za.</p>
<pre>options {
        directory "/etc";
        pid-file "/var/run/named/named.pid";
        };

zone "." {
        type hint;
        file "/etc/db.cache";
        };

zone "windohs.co.za" {
        type master;
        file "/var/named/windohs.co.za.hosts";
        };</pre>
<p>Above you can see where the process identification file is found, the hints file for BIND and the file that contains all the DNS entries.</p>
<p>Now we can create the zone file for the domain.</p>
<pre>[root@localhost ~]$ vi /var/named/windohs.co.za.hosts</pre>
<p>You can copy the following as is and just change the domain</p>
<pre>$ttl 38400
windohs.co.za. IN SOA dns.windohs.co.za. lyle@windohs.co.za. (
1300270007
300
3600
604800
38400 )
windohs.co.za. IN NS dns.windohs.co.za.</pre>
<p>Make sure that you have the server IP in /etc/resolv.conf</p>
<pre>[root@localhost ~]$ vi /etc/resolv.conf</pre>
<pre>search windohs.co.za
nameserver 192.168.0.10</pre>
<p>Restart the BIND service</p>
<pre>[root@localhost ~]$ service named restart</pre>
<p>Test your new BIND server</p>
<pre>[root@localhost ~]$ nslookup www.windohs.co.za

Server:         192.168.0.10
Address:        192.168.0.10#53

Name:   www.windohs.co.za
Address: 192.168.0.20</pre>
<p>Installing Webmin<br />
First we need the Webmin repo.</p>
<pre>[root@localhost ~]$ vi /etc/yum.repos.d/webmin.repo</pre>
<p>Copy and paste the following into the webmin.repo file</p>
<pre>[Webmin]
name=Webmin Distribution Neutral
#baseurl=http://download.webmin.com/download/yum
mirrorlist=http://download.webmin.com/download/yum/mirrorlist
enabled=1</pre>
<p>Import the GPG Key, without it you wont be able to install Webmin using Yum</p>
<pre>rpm --import http://www.webmin.com/jcameron-key.asc</pre>
<p>Now install Webmin using Yum, the dependencies will resolve automatically.</p>
<pre>[root@localhost ~]$ yum install webmin</pre>
<p>Open your browser and browse to your new DNS server on port 10000.</p>
<p>http://192.168.0.10:10000</p>
<p>On the left under Servers you will find BIND DNS Server.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.windohs.co.za/2012/07/19/setup-bind-dns-server-webmin-centos-6-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Send Commands via SSH</title>
		<link>http://www.windohs.co.za/2012/06/06/send-commands-via-ssh/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=send-commands-via-ssh</link>
		<comments>http://www.windohs.co.za/2012/06/06/send-commands-via-ssh/#comments</comments>
		<pubDate>Wed, 06 Jun 2012 07:36:51 +0000</pubDate>
		<dc:creator>Lyle</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.windohs.co.za/?p=689</guid>
		<description><![CDATA[Just a little bit of knowledge that every Linux Administrator should know. You can indeed send SSH commands to a remote system without logging in, granted you have an account on that machine and know the password.
Below you can see a command that I sent to a backup server to stop the Bacula File  [...]]]></description>
				<content:encoded><![CDATA[<p>Just a little bit of knowledge that every Linux Administrator should know. You can indeed send SSH commands to a remote system without logging in, granted you have an account on that machine and know the password.</p>
<p>Below you can see a command that I sent to a backup server to stop the Bacula File Daemon service.</p>
<pre>[lyle@localhost ~]$ ssh root@backup01 'service bacula-fd stop'
bacula-fd is stopped</pre>
<p>As you can you just need to add the command in a single quote. After pressing enter to send the command you will be prompted for the password. You will then receive the output of the command.<br />
<script type="text/javascript">
	<!--
	var _adynamo_client = "65862195-e2d6-44ac-8015-0c1f267704fc";
	var _adynamo_width = 650;
	var _adynamo_height = 90;
	//-->
</script><br />
<script type="text/javascript" src="http://static.addynamo.net/ad/js/deliverAds.js"></script><br />
Another handy option to add is -t, this will keep the connection open so that you can interact with a screen-based program like top. It would be very useful if editing a file using vi.<span id="more-689"></span></p>
<pre>[lyle@localhost ~]$ ssh -t root@backup01 'top'</pre>
<p>You can also send multiple commands in one line and receive the output. Using a semicolon to separate each command.</p>
<pre>[lyle@localhost ~]$ ssh root@backup01 'ls -l; pwd; whoami'</pre>
<p>The commands above will list the directories and files in the current directory, print the current working directory and tell you which account you&#8217;re logged in with.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.windohs.co.za/2012/06/06/send-commands-via-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dell PowerEdge R720 and CentOS 6 Installation</title>
		<link>http://www.windohs.co.za/2012/06/05/dell-poweredge-r720-and-centos-6-installation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dell-poweredge-r720-and-centos-6-installation</link>
		<comments>http://www.windohs.co.za/2012/06/05/dell-poweredge-r720-and-centos-6-installation/#comments</comments>
		<pubDate>Tue, 05 Jun 2012 06:49:39 +0000</pubDate>
		<dc:creator>Lyle</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.windohs.co.za/?p=682</guid>
		<description><![CDATA[I ran into a problem installing CentOS 6 on a Dell PowerEdge R720. The problem being, the RAID controller was too new so there were no drivers on the installation media.
The error that came up:
No Drives Found
An error occurred &#8211; no valid devices were found on which to create new file systems.  [...]]]></description>
				<content:encoded><![CDATA[<p>I ran into a problem installing CentOS 6 on a Dell PowerEdge R720. The problem being, the RAID controller was too new so there were no drivers on the installation media.</p>
<p>The error that came up:</p>
<p>No Drives Found<br />
An error occurred &#8211; no valid devices were found on which to create new file systems. Please check your hardware for the cause of this problem.</p>
<p>This particular batch of servers have the PERC H710 Mini RAID Controller. 300GB 15000RPM SAS drives installed in it.</p>
<p>It could be a different RAID controller in your server, so this will only work on the PERC H710 series.<span id="more-682"></span></p>
<p>Quite a silly fix for this problem&#8230; Download and install CentOS 6.2. Problem solved. There have also been reports of it working on CentOS 5.8.</p>
<p><a title="CentOS Download Mirrors" href="http://www.centos.org/modules/tinycontent/index.php?id=30" target="_blank">Download Mirrors</a><br />
<script type="text/javascript">// <![CDATA[
 	var _adynamo_client = "fc1fad20-3cec-41cd-92fd-5e58a2cbc571"; 	var _adynamo_width = 468; 	var _adynamo_height = 60;
// ]]&gt;</script><br />
<script type="text/javascript" src="http://static.addynamo.net/ad/js/deliverAds.js"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.windohs.co.za/2012/06/05/dell-poweredge-r720-and-centos-6-installation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redirection operators</title>
		<link>http://www.windohs.co.za/2012/03/27/redirection-operators/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=redirection-operators</link>
		<comments>http://www.windohs.co.za/2012/03/27/redirection-operators/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 07:57:57 +0000</pubDate>
		<dc:creator>Lyle</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://windohs.co.za/?p=669</guid>
		<description><![CDATA[Have you ever run a script and it goes too fast to see the output or there&#8217;s too much output and you can&#8217;t scroll back far enough. Then you need redirection.
The one I use the most would be to direct standard output to a text file for reference later.



 


&#62;
A new file will be created that will  [...]]]></description>
				<content:encoded><![CDATA[<p>Have you ever run a script and it goes too fast to see the output or there&#8217;s too much output and you can&#8217;t scroll back far enough. Then you need redirection.</p>
<p>The one I use the most would be to direct standard output to a text file for reference later.<span id="more-669"></span></p>
<table width="482" border="0" cellspacing="0" cellpadding="0">
<colgroup>
<col width="64" />
<col width="418" /> </colgroup>
<tbody>
<tr>
<td width="64" height="42">&gt;</td>
<td width="418">A new file will be created that will contain standard output. If you specify the same file name, the existing one will be overwritten.</td>
</tr>
<tr>
<td height="42">&gt;&gt;</td>
<td width="418">Appends to an existing file. If the file does not exist it will be created.</td>
</tr>
<tr>
<td height="42">2&gt;</td>
<td width="418">Creates a new file that contains standard error. If the file already exists it will be overwritten.</td>
</tr>
<tr>
<td height="42">2&gt;&gt;</td>
<td width="418">Appends standard error to an existing file and creates the file if it does not exist.</td>
</tr>
<tr>
<td height="42">&amp;&gt;</td>
<td width="418">This will create a file that will contain standard output and standard error. If the file already exists it will be overwritten</td>
</tr>
<tr>
<td height="42">&lt;</td>
<td width="418">The contents of a file will be used as standard input.</td>
</tr>
<tr>
<td height="42">&lt;&lt;</td>
<td width="418">Accepts text on the following lines as input</td>
</tr>
<tr>
<td height="42">&lt;&gt;</td>
<td width="418">Causes the specified file to be used as standard input and standard output</td>
</tr>
</tbody>
</table>
<p>One of the most common uses for redirection is to send output to /dev/null, /dev/null is a device that is connected to nothing so it&#8217;s like a black hole for unwanted data. Most of the time it would be used to discard error messages.</p>
<p>The &lt;&lt; redirection is not typically used on the command line but more in scripts. You wouldn&#8217;t use it to specify a file like most of the others mentioned previously, as an example &lt;&lt; EOF. Everything before the EOF would be passed as input to a command.</p>
<p>There&#8217;s one more I&#8217;d like to mention before i get to the most useful, which is pretty useful. tee, is used to send standard output to the terminal and to a specified file so that you can refer to it later.</p>
<pre>[root@localhost ~]# ifconfig | tee ifconfig.txt</pre>
<p>I know that I haven&#8217;t mentioned the most obvious one yet | (pipe), which you can see in use above. Normally ifconfig would show us the network interfaces and their properties. By adding the pipe it sends the output to tee which will then write the output to the file I&#8217;ve specified which is ifconfig.txt and it will output the information to the terminal. If I had used the following then it would create a new file or overwrite the file if it exists and not show any output on the terminal.</p>
<pre>[root@localhost ~]# ifconfig &gt; ifconfig.txt</pre>
<p>For the LPIC 101 exam, you&#8217;d need to know the table I&#8217;ve added above. Not all will be in the exam but they select a few.<br />
<script type="text/javascript">
	<!--
	var _adynamo_client = "fc1fad20-3cec-41cd-92fd-5e58a2cbc571";
	var _adynamo_width = 468;
	var _adynamo_height = 60;
	//-->
</script><br />
<script type="text/javascript" src="http://static.addynamo.net/ad/js/deliverAds.js"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.windohs.co.za/2012/03/27/redirection-operators/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The du command</title>
		<link>http://www.windohs.co.za/2012/03/26/the-du-command/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-du-command</link>
		<comments>http://www.windohs.co.za/2012/03/26/the-du-command/#comments</comments>
		<pubDate>Mon, 26 Mar 2012 08:47:19 +0000</pubDate>
		<dc:creator>Lyle</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://windohs.co.za/?p=656</guid>
		<description><![CDATA[I recently passed the LPIC 101 exam so I thought I&#8217;d share a little bit of what comes in the first exam. The two things in this post that were part of the exam would be du with the &#8211;max-depth option.
The du or disk usage command will estimate the amount of space being used by the files and  [...]]]></description>
				<content:encoded><![CDATA[<p>I recently passed the LPIC 101 exam so I thought I&#8217;d share a little bit of what comes in the first exam. The two things in this post that were part of the exam would be du with the &#8211;max-depth option.</p>
<p>The du or disk usage command will estimate the amount of space being used by the files and directories within the current directory. The individual file sizes will just be a cumulative size shown with the directory as a whole.</p>
<p>If you&#8217;d like the full write-up about the du command then you could check the manual pages.</p>
<pre>[root@localhost:/home]# man du</pre>
<p>I&#8217;ll list the most useful options to use with the du command in this post.</p>
<p><script type="text/javascript">// <![CDATA[
 	var _adynamo_client = "fc1fad20-3cec-41cd-92fd-5e58a2cbc571"; 	var _adynamo_width = 468; 	var _adynamo_height = 60;
// ]]&gt;</script><br />
<script type="text/javascript" src="http://static.addynamo.net/ad/js/deliverAds.js"></script><br />
<span id="more-656"></span><br />
Firstly we would most likely be able to see the size of our current directory. We would use the -s (summarize) option here. I&#8217;m using the /etc/nagios directory for these examples because there&#8217;s quite a bit of files in there.</p>
<pre>[root@localhost nagios]# du -s
413488  .</pre>
<p>You&#8217;ll notice this tells you the amount of space used but it&#8217;s not really human readable, so we add -h (human readable) to the mix.</p>
<pre>[root@localhost nagios]# du -sh
404M    .</pre>
<p>This gives us the size in megabytes and tells us that its showing the size of the current directory and all it&#8217;s contents.</p>
<p>You&#8217;ll notice that if you ever use the du command without any options in a large directory that you&#8217;ll end up with a lot more output than you wanted to see. In this case we would use the &#8211;max-depth=N option. N is the number of directories deep you&#8217;d like to view. I&#8217;ve added -h so that we don&#8217;t have to workout the size of the folders.</p>
<pre>[root@localhost nagios]# du --max-depth=1 -h
12K     ./var
88K     ./globalconfig
4.0K    ./.ssh
210M    ./archives
404M    .</pre>
<p>There&#8217;s one more that I&#8217;ve found useful but it uses an additional command which is pretty useful. The less command. Particularly useful for directories with a large amount of sub-directories. For the next example, the /etc directory. Depending on the size of your SSH window you&#8217;ll get a result like I have below:</p>
<pre>[root@localhost etc]# du -h | less
8.0K    ./snmp
24K     ./audit
16K     ./reader.conf.d
24K     ./lsb-release.d
24K     ./yum/pluginconf.d
40K     ./yum
8.0K    ./cups/ppd
:</pre>
<p>Now you can move between the different pages using the F key to jump forward, B to go backwards and Q to quit.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.windohs.co.za/2012/03/26/the-du-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Retrieve your Dell Service Tag using command prompt and Linux CLI</title>
		<link>http://www.windohs.co.za/2011/12/28/retrieve-your-dell-service-tag-using-command-prompt-and-linux-cli/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=retrieve-your-dell-service-tag-using-command-prompt-and-linux-cli</link>
		<comments>http://www.windohs.co.za/2011/12/28/retrieve-your-dell-service-tag-using-command-prompt-and-linux-cli/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 09:54:52 +0000</pubDate>
		<dc:creator>Lyle</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Windows Server 2008]]></category>
		<category><![CDATA[dell]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://windohs.co.za/?p=640</guid>
		<description><![CDATA[It&#8217;s been a long time since I&#8217;ve posted anything on the system admin front, so here we go.
I work with Dell a lot and dealing with their technical support is the least favourite part of my day when something goes wrong. You always need to supply them with a service tag number, but what if you need  [...]]]></description>
				<content:encoded><![CDATA[<p>It&#8217;s been a long time since I&#8217;ve posted anything on the system admin front, so here we go.</p>
<p>I work with Dell a lot and dealing with their technical support is the least favourite part of my day when something goes wrong. You always need to supply them with a service tag number, but what if you need a part for a server that&#8217;s located in an internet data centre? Most times I run into this exact problem. Other times, I don&#8217;t feel like getting up and going to have a look.<br />
<span id="more-640"></span><br />
<script type="text/javascript">// <![CDATA[
     	var _adynamo_client = "fc1fad20-3cec-41cd-92fd-5e58a2cbc571"; 	var _adynamo_width = 468; 	var _adynamo_height = 60;
// ]]&gt;</script><br />
<script type="text/javascript" src="http://static.addynamo.net/ad/js/deliverAds.js"></script></p>
<p>Using Command Prompt:</p>
<pre>C:\wmic bios get serialnumber
SerialNumber
123ABCD</pre>
<p>The following command will give you the service tag, model number and vendor name:</p>
<pre>C:\wmic csproduct get vendor,name,identifyingnumber
IdentifyingNumber  Name            Vendor
123ABCD            PowerEdge T710  Dell Inc.</pre>
<p>The next one can be executed to get a service tag remotely if you find yourself without remote desktop access to the machine.</p>
<pre>C:\wmic /user:administrator /node:remote.machine bios get serialnumber
Enter the password :************

SerialNumber
123ABCD</pre>
<p><strong>Using Linux CLI:</strong></p>
<pre>[root@remotehost ~]# dmidecode -s system-serial-number
123ABCD</pre>
<p>After obtaining the Service tags I&#8217;d recommend keeping a spreadsheet with all of them, and also you can put the warranty expiry dates in there so that you don&#8217;t place a pointless call with Dell.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.windohs.co.za/2011/12/28/retrieve-your-dell-service-tag-using-command-prompt-and-linux-cli/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google halts Android 4.0.3 update</title>
		<link>http://www.windohs.co.za/2011/12/22/google-halts-android-4-0-3-update/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=google-halts-android-4-0-3-update</link>
		<comments>http://www.windohs.co.za/2011/12/22/google-halts-android-4-0-3-update/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 15:20:32 +0000</pubDate>
		<dc:creator>Lyle</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[android 4.0]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://windohs.co.za/?p=637</guid>
		<description><![CDATA[Google has put a halt on the release of the latest update for the Nexus S. There have been reports of a decrease in battery life. I have also experienced this since updating my Nexus S over the weekend. Usually after a day of moderate to high usage I&#8217;d get home with about 60% battery life, now for  [...]]]></description>
				<content:encoded><![CDATA[<p>Google has put a halt on the release of the latest update for the Nexus S. There have been reports of a decrease in battery life. I have also experienced this since updating my Nexus S over the weekend. Usually after a day of moderate to high usage I&#8217;d get home with about 60% battery life, now for the past 3 working days I&#8217;ve noticed the battery life to be around 30%-40% when getting home after work.<span id="more-637"></span><br />
<script type="text/javascript">
	<!--
	try{
		var _adynamo_client = "9eaab5b2-432d-4872-8851-cefc5d8d247f";
		var _adynamo_v = 2;
	} catch (e){
	}
	//-->
</script><br />
<script type="text/javascript" src="http://static.addynamo.net/ad/js/deliverSmartAds.js"></script><br />
Most users that still get the update notification will notice that if they try to update, nothing happens and they will be forced to cancel the download because it never starts.</p>
<p>You could always download the ROM and install that manually but I wouldn&#8217;t recommend that. Best to just wait for the OTA update to come out, once the battery life issue is resolved.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.windohs.co.za/2011/12/22/google-halts-android-4-0-3-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
