<?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>HB blog &#187; Command line</title>
	<atom:link href="http://blog.hbcom.info/archives/category/command-line/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.hbcom.info</link>
	<description>Just another weblog OR maybe not</description>
	<lastBuildDate>Tue, 29 Nov 2011 15:08:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>CentOS &#8211; install IPMI</title>
		<link>http://blog.hbcom.info/archives/479?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=centos-install-ipmi</link>
		<comments>http://blog.hbcom.info/archives/479#comments</comments>
		<pubDate>Wed, 10 Aug 2011 18:19:22 +0000</pubDate>
		<dc:creator>hb</dc:creator>
				<category><![CDATA[Command line]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.hbcom.info/?p=479</guid>
		<description><![CDATA[First what is IPMI? IPMI stands for Intelligent Platform Management Interface standardized computer interface for administrators to manage computer system and monitor its operation. It is supported by most major providers &#8211; Intel (of course), Dell, HP&#8230; Installation Installation is really simple: yum install OpenIPMI OpenIPMI-tools chkconfig ipmi on service ipmi start If you see [...]]]></description>
			<content:encoded><![CDATA[<p>First what is IPMI?</p>
<p>IPMI stands for Intelligent Platform Management Interface standardized computer interface for administrators to manage computer system and monitor its operation.</p>
<p>It is supported by most major providers &#8211; Intel (of course), Dell, HP&#8230;</p>
<h3>Installation</h3>
<p>Installation is really simple:</p>
<pre>yum install OpenIPMI OpenIPMI-tools
chkconfig ipmi on
service ipmi start</pre>
<p>If you see error at last command check system log &#8211; it is possible that your hardware does not support IPMI.</p>
<h3>Usage</h3>
<p>To to see what you can do with it:</p>
<pre>ipmitool help
man ipmitool</pre>
<p>Enjoy:)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hbcom.info/archives/479/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bash: Get yesterday&#8217;s date</title>
		<link>http://blog.hbcom.info/archives/476?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=bash-get-yesterdays-date</link>
		<comments>http://blog.hbcom.info/archives/476#comments</comments>
		<pubDate>Fri, 03 Jun 2011 18:08:03 +0000</pubDate>
		<dc:creator>hb</dc:creator>
				<category><![CDATA[Command line]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://blog.hbcom.info/?p=476</guid>
		<description><![CDATA[Recently I had to create a bash script to copy some files based on date. The rule was copy yesterday&#8217;s files to &#8230; But How to determine what was the yesterdays date? The answer was in date man page. Here are the parts from the script related to yesterday date: $date -d '1 day ago' [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I had to create a bash script to copy some files based on date.</p>
<p>The rule was copy yesterday&#8217;s files to &#8230;</p>
<p>But How to determine what was the yesterdays date?</p>
<p>The answer was in date man page.</p>
<p>Here are the parts from the script related to yesterday date:</p>
<pre>$date -d '1 day ago' +'%Y/%m/%d'
2011/06/02
</pre>
<p>on Internet I&#8217;ve found also:</p>
<pre>date --date='yesterday'
Thu Jun  2 14:01:28 EDT 2011</pre>
<p>And (Bonus!!) if you want to go in future <img src='http://blog.hbcom.info/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<pre>date --date='tomorrow'
Sat Jun  4 14:04:29 EDT 2011</pre>
<p>Happy scripting&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hbcom.info/archives/476/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to crack Unix root password</title>
		<link>http://blog.hbcom.info/archives/380?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-crack-unix-root-password</link>
		<comments>http://blog.hbcom.info/archives/380#comments</comments>
		<pubDate>Wed, 01 Apr 2009 09:12:01 +0000</pubDate>
		<dc:creator>hb</dc:creator>
				<category><![CDATA[Command line]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://blog.hbcom.info/?p=380</guid>
		<description><![CDATA[The root password is the key to any Unix/Linux system and the person who knows it is with full rights. But there is a simple way to crack root password. Just type at terminal: echo '82 43/25 43+65P80P82P73P76P32P70P79P79P76P10P' &#124; dc]]></description>
			<content:encoded><![CDATA[<p>The root password is the key to any Unix/Linux system and the person who knows it is with full rights. But there is a simple way to crack root password.</p>
<p>Just type at terminal:</p>
<pre>echo '82 43/25 43+65P80P82P73P76P32P70P79P79P76P10P' | dc</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.hbcom.info/archives/380/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Make FreeBSD more &#8220;user friendly&#8221;</title>
		<link>http://blog.hbcom.info/archives/383?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=make-freebsd-more-user-friendly</link>
		<comments>http://blog.hbcom.info/archives/383#comments</comments>
		<pubDate>Wed, 18 Mar 2009 20:24:38 +0000</pubDate>
		<dc:creator>hb</dc:creator>
				<category><![CDATA[Command line]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://blog.hbcom.info/?p=383</guid>
		<description><![CDATA[In FreeBSD by default you do not have bash as shell prompt. Here is the procedure to install it: type whereis bash cd to that folder type make configure make all install clean take a cofee type chsh -s /usr/local/bin/bash root to change the shell for root or replace root with username you want to [...]]]></description>
			<content:encoded><![CDATA[<p>In FreeBSD by default you do not have bash as shell prompt.</p>
<p>Here is the procedure to install it:</p>
<ol>
<li>type whereis bash</li>
<li>cd to that folder</li>
<li>type make configure</li>
<li>make all install clean</li>
<li>take a cofee  <img src='http://blog.hbcom.info/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </li>
<li>type chsh -s /usr/local/bin/bash root to change the shell for root or replace root with username you want to change the shell.</li>
<li>Then relogin (logout and login) to enjoy bash shell</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.hbcom.info/archives/383/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>vim and PUTTY</title>
		<link>http://blog.hbcom.info/archives/251?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=vim-and-putty</link>
		<comments>http://blog.hbcom.info/archives/251#comments</comments>
		<pubDate>Tue, 16 Sep 2008 23:34:26 +0000</pubDate>
		<dc:creator>hb</dc:creator>
				<category><![CDATA[Command line]]></category>
		<category><![CDATA[Fix]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://blog.hbcom.info/?p=251</guid>
		<description><![CDATA[Most of &#8220;ux&#8221; users and administrators use remote terminal to connect to administrared machine. One of the popular choises, minly because of it&#8217;s portability is PuTTy only putty.exe is needed and no installation is required. In addition it is free. Downside is that sometimes there are problems with terminal emulation &#8211; not necessary coming from [...]]]></description>
			<content:encoded><![CDATA[<p>Most of &#8220;ux&#8221; users and administrators use remote terminal to connect to administrared machine.</p>
<p>One of the popular choises, minly because of it&#8217;s portability is <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/" target="_blank">PuTTy</a> only putty.exe is needed and no installation is required. In addition it is free.</p>
<p>Downside is that sometimes there are problems with terminal emulation &#8211; not necessary coming from putty, but still annoying.</p>
<p>One of my problems is that when vim is in insert mode arrow keys do not work. For long time I was no able to find solution to the problem, but finally i found <a href="http://www.bluehostforum.com/archive/index.php/t-6700.html" target="_blank">one</a>. Just type this in your home folder:</p>
<pre style="padding-left: 30px;">echo syntax enable &gt; ~/.vimrc</pre>
<p>This did the trick for me. Hope it helps to you too.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hbcom.info/archives/251/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to have two IPs on one interface</title>
		<link>http://blog.hbcom.info/archives/150?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-have-two-ips-on-one-interface</link>
		<comments>http://blog.hbcom.info/archives/150#comments</comments>
		<pubDate>Wed, 27 Feb 2008 14:46:59 +0000</pubDate>
		<dc:creator>hb</dc:creator>
				<category><![CDATA[Command line]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.hbcom.info/archives/150</guid>
		<description><![CDATA[Recently I got into problem to assign 2 IPs on one physical NIC. There was nothing mentioned in official documentation so I did some research and find the solution. It is really simple if you are not afraid from command line and VI editor. Unfortunately I did not find a GUI. Here it is: Go [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I got into problem to assign 2 IPs on one physical NIC.</p>
<p>There was nothing mentioned in official documentation so I did some research and find the solution.</p>
<p>It is really simple if you are not afraid  from command line and VI editor. Unfortunately I did not find a GUI.</p>
<p>Here it is:</p>
<ol>
<li>Go to command prompt</li>
<li>Be sure that you are root. Otherwise type <em>su -</em> to become.</li>
<li>Type &#8211; <em>cd /etc/sysconfig/network-scripts/</em></li>
<li>Then type <em>ls </em>to see the contents &#8211; you should have file ifcfg-eth0 if you have just one interface otherwise if you have multiple interfaces there you&#8217;ll find other files like ifcfg-eth1&#8230;n.</li>
<li>Then we will copy the file to different name &#8211; <em>cp ifcfg-eth0 ifcfg-eth0:0</em></li>
<li>Next step is to edit newly created file and put the IP we needed.</li>
<li>If needed repeat steps 5 and 6 with different numbers after&#8221;:&#8221; (1,2,&#8230;) to add additional addresses.</li>
<li>If you issue <em>ifconfig </em>you will not see newly created interface, because it is no activated &#8211; you need to restart network <em>/etc/init.d/network restart </em>will do it for you.</li>
<li>That&#8217;s it.</li>
</ol>
<p>Comments are welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hbcom.info/archives/150/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mass ping script</title>
		<link>http://blog.hbcom.info/archives/148?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mass-ping-script</link>
		<comments>http://blog.hbcom.info/archives/148#comments</comments>
		<pubDate>Fri, 22 Feb 2008 19:38:20 +0000</pubDate>
		<dc:creator>hb</dc:creator>
				<category><![CDATA[Command line]]></category>
		<category><![CDATA[Fix]]></category>

		<guid isPermaLink="false">http://blog.hbcom.info/archives/148</guid>
		<description><![CDATA[I needed to check multiple addresses for use. I did not find any ready solution so I wrote a script. I called it psweep.sh Here is it(comments are welcomed): #!/bin/bash # Sweep ping # 1-st arg ip 2-nd start 3-d end # # Written by Hristo Benev # # rev 0.3 # for i in [...]]]></description>
			<content:encoded><![CDATA[<p>I needed to check multiple addresses for use.</p>
<p>I did not find any ready solution so I wrote a script.</p>
<p>I called it psweep.sh</p>
<p>Here is it(comments are welcomed):</p>
<p><code>#!/bin/bash<br />
# Sweep ping<br />
# 1-st arg ip 2-nd start 3-d end<br />
#<br />
# Written by Hristo Benev<br />
#<br />
# rev 0.3<br />
#<br />
for i in `seq $2 $3`; do<br />
ping -c 1 -W 1 $1.$i &gt;/dev/null 2&gt;&amp;1<br />
#ping -c 1 -W 1 $1.$i<br />
if [ $? == 0 ]; then<br />
echo "host $1.$i is up"<br />
else<br />
echo "."<br />
fi<br />
done<br />
# changelog<br />
# 0.3 added progress</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hbcom.info/archives/148/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>RHEL/CentOS package xxxxx missing</title>
		<link>http://blog.hbcom.info/archives/47?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rhelcentos-package-xxxxx-missing</link>
		<comments>http://blog.hbcom.info/archives/47#comments</comments>
		<pubDate>Mon, 30 Jul 2007 13:53:57 +0000</pubDate>
		<dc:creator>hb</dc:creator>
				<category><![CDATA[Command line]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.hbcom.info/archives/47</guid>
		<description><![CDATA[Often when installing 3-d party software in RHEL/CentOS or other yum capable Linux OS there is a message of missing libraries or packages. How to fix it? Here is the trick. You can use yum package manager to search for missing pieces. yum whatprovides &#60;package name/library&#62; This command will search all configured repositories for package [...]]]></description>
			<content:encoded><![CDATA[<p>Often when installing 3-d party software in RHEL/CentOS or other yum capable Linux OS there is a message of missing libraries or packages.</p>
<p>How to fix it?</p>
<p>Here is the trick.</p>
<p>You can  use yum package manager to search for missing pieces.</p>
<p><code>yum whatprovides <em>&lt;package name/library&gt;</em></code></p>
<p>This command will search all configured repositories for package that provides it.<br />
Another option is to search Internet.</p>
<p><strong>TIP</strong>: For better stability install only packages in official repositories. OR ones that clearly  specify that they work on your OS/version.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hbcom.info/archives/47/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shutdown IPtables firewall</title>
		<link>http://blog.hbcom.info/archives/44?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=shutdown-iptables-firewall</link>
		<comments>http://blog.hbcom.info/archives/44#comments</comments>
		<pubDate>Fri, 27 Jul 2007 14:58:04 +0000</pubDate>
		<dc:creator>hb</dc:creator>
				<category><![CDATA[Command line]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.hbcom.info/archives/44</guid>
		<description><![CDATA[Sometimes in troubleshooting process is necessary to turn of firewall for a short period of time. In Linux based OS usually IPtables is used as firewall. It runs as service and could be stopped, started or restarted. In addition the status could be checked. Here is how to do it: Command line When in terminal [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes in troubleshooting process is necessary to turn of firewall for a short period of time.</p>
<p>In Linux based OS usually IPtables is used  as firewall. It runs as service and could be stopped, started or restarted. In addition the status could be checked.</p>
<p>Here is how to do it:</p>
<p><strong>Command line</strong></p>
<p>When in terminal type:</p>
<p><code>/etc/init.d/iptables<br />
Usage: /etc/init.d/iptables {start|stop|restart|condrestart|status|panic|save}</code></p>
<p>Gives you hints how to use it.</p>
<p>Note that to execute any of actions you need administrative privileges &#8211;  either login as root, &#8220;<code>su -</code>&#8221; or setup sudo.</p>
<p>another tool that is doing the same is</p>
<p><code>service iptables &lt;command&gt;</code></p>
<p>If you like GUI but use command prompt  you can use:</p>
<p><code>system-config-securitylevel-tui</code></p>
<p>And you will have simple interface of configuring security &#8211; firewall and selinux</p>
<p><a href="http://blog.hbcom.info/wp-content/uploads/2007/07/sys-config-seclvl.png" title="system-config-securitylevel-tui"><img src="http://blog.hbcom.info/wp-content/uploads/2007/07/sys-config-seclvl.thumbnail.png" alt="system-config-securitylevel-tui" /></a></p>
<p><strong>GUI based </strong></p>
<p>From GUI  you can use the same tool just by removing -tui or go to System&#8211;&gt;Administration &#8211;&gt; Security level and firewall.</p>
<p>Another GUI frienly way is System&#8211;&gt;Administration &#8211;&gt; Services where you can do the same actions as from terminal.</p>
<p><strong>TIP:</strong> Do not leave your system unprotected on Internet. Use cheap  SOHO firewall in front of the system until IPtables is set up.</p>
<p><strong>TIP: </strong>If you are newbie in firewall configuration use some third party tools as <a href="http://www.fs-security.com/" title="firestarter" target="_blank">firestarter</a> to guide you in your setup.</p>
<p><strong>NOTE:</strong> Above steps are for RHEL (CentOS) compatible systems.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hbcom.info/archives/44/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What could be better than top &#8211;&gt; htop</title>
		<link>http://blog.hbcom.info/archives/25?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=what-could-be-better-than-top-htop</link>
		<comments>http://blog.hbcom.info/archives/25#comments</comments>
		<pubDate>Mon, 16 Jul 2007 18:48:09 +0000</pubDate>
		<dc:creator>hb</dc:creator>
				<category><![CDATA[Command line]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.hbcom.info/archives/25</guid>
		<description><![CDATA[Thanks to Ubuntu tutorials I&#8217;ve realized that my lovely tool top has now better replacement htop. Quick comparison: Comparison between htop and top In &#8216;htop&#8217; you can scroll the list vertically and horizontally to see all processes and complete command lines. In &#8216;top&#8217; you are subject to a delay for each unassigned key you press [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks to <a href="http://ubuntu-tutorials.com/" title="Ubuntu tutorials" target="_blank">Ubuntu tutorials</a> I&#8217;ve realized that my lovely tool <a href="http://en.wikipedia.org/wiki/Top_(Unix)" title="top" target="_blank">top</a> has now better replacement <a href="http://htop.sourceforge.net" title="htop" target="_blank">htop</a>.</p>
<p>Quick <a href="http://htop.sourceforge.net/index.php?page=comparison" title="Compare" target="_blank">comparison</a>:</p>
<blockquote>
<h2>Comparison between htop and top</h2>
<ul>
<li>In &#8216;htop&#8217; you can scroll the list vertically and horizontally    to see all processes and complete command lines.</li>
<li>In &#8216;top&#8217; you are subject to a delay for each unassigned    key you press (especially annoying when multi-key escape    sequences are triggered by accident).</li>
<li>&#8216;htop&#8217; starts faster (&#8216;top&#8217; seems to collect data for a while    before displaying anything).</li>
<li>In &#8216;htop&#8217; you don&#8217;t need to type the process number to    kill a process, in &#8216;top&#8217; you do.</li>
<li>In &#8216;htop&#8217; you don&#8217;t need to type the process number or    the priority value to renice a process, in &#8216;top&#8217; you do.</li>
<li>&#8216;htop&#8217; supports mouse operation, &#8216;top&#8217; doesn&#8217;t</li>
<li>&#8216;top&#8217; is older, hence, more used and tested.</li>
</ul>
</blockquote>
<p>Fortunately it is available as binary package for RHEL 5 from rpmforge so the install was quick and painless:</p>
<p><code>yum install htop</code></p>
<p>Here is how it looks:</p>
<p><a href="http://blog.hbcom.info/wp-content/uploads/2007/07/htop.png" title="htop running"><img src="http://blog.hbcom.info/wp-content/uploads/2007/07/htop.thumbnail.png" alt="htop running" /></a></p>
<p>Default colors were not very appropriate for white background so I switched easily (F2-Setup-&gt;Colors) to mc colors.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hbcom.info/archives/25/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.495 seconds -->

