<?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; Unix</title>
	<atom:link href="http://blog.hbcom.info/archives/category/unix/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>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>screen -r : Cannot open your terminal &#8216;/dev/pts/0&#8242; &#8211; please check.</title>
		<link>http://blog.hbcom.info/archives/430?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=screen-r-cannot-open-your-terminal-devpts0-please-check</link>
		<comments>http://blog.hbcom.info/archives/430#comments</comments>
		<pubDate>Sat, 31 Jul 2010 23:37:08 +0000</pubDate>
		<dc:creator>hb</dc:creator>
				<category><![CDATA[Fix]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://blog.hbcom.info/?p=430</guid>
		<description><![CDATA[I love screen &#8211; it allows you to detach you console and still have the program running. For more info: man screen Recently I experienced following error: $ screen -r Cannot open your terminal '/dev/pts/0' - please check. After searching for solution I found several instructing to change permissions etc. But different solution, almost &#8220;hack&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>I love screen &#8211; it allows you to detach you console and still have the program running.</p>
<p>For more info:<br />
<code>man screen</code></p>
<p>Recently I experienced following error:<br />
<code>$ screen -r<br />
Cannot open your terminal '/dev/pts/0' - please check.</code></p>
<p>After searching for solution I found several instructing to change permissions etc.</p>
<p>But different solution, almost &#8220;hack&#8221; is the one I like.<br />
Before starting screen type:<br />
<code>script /dev/null</code><br />
And after that you can type:<br />
<code>screen -r</code><br />
Only drawback is that you need to type one additional <em>exit</em> for <em>script</em> to terminate.</p>
<p>Credits for this to Harry Jackson. Unfortunately the resource was not  available so i did to put a link to the site.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hbcom.info/archives/430/feed</wfw:commentRss>
		<slash:comments>3</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>Firefox 2.0.0.9 &#8211; Stability update released</title>
		<link>http://blog.hbcom.info/archives/118?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=firefox-2009-stability-update-released</link>
		<comments>http://blog.hbcom.info/archives/118#comments</comments>
		<pubDate>Sat, 03 Nov 2007 12:55:07 +0000</pubDate>
		<dc:creator>hb</dc:creator>
				<category><![CDATA[Fix]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://blog.hbcom.info/archives/118</guid>
		<description><![CDATA[Update of the update: The 2.0.0.8 release fixed some 200 issues, but accidentally regressed a few things. Most users wonâ€™t see any difference or experience any problems, and those 200 fixes make the 2.0.0.8 update very valuable, but you should never have to choose functionality over security. So weâ€™re working fast to understand and fix [...]]]></description>
			<content:encoded><![CDATA[<p>Update of the update:</p>
<blockquote><p>The <a href="http://developer.mozilla.org/devnews/index.php/2007/10/18/firefox-2008-security-and-stability-update-now-available/">2.0.0.8 release</a> fixed some 200 issues, but accidentally regressed a few things. Most users wonâ€™t see any difference or experience any problems, and those 200 fixes make the 2.0.0.8 update very valuable, but you should never have to choose functionality over security. So weâ€™re working fast to understand and fix these problems, and will shortly be issuing a 2.0.0.9 update to address them. The specific problems are:</p>
<ul>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=400406">Bug 400406</a> &#8211; Firefox will ignore the â€œclearâ€ CSS property when used beneath a box that is using the â€œfloatâ€ property. There is a <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=400406#c23">temporary workaround JS/CSS code</a> available for web developers with affected layouts.</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=400467">Bug 400467</a> &#8211; Windows Vista users will get â€œJava not foundâ€ or â€œJava not workingâ€ errors when trying to load Java applets after updating. To fix this, users can right-click the Firefox icon and â€œRun as administratorâ€, then browse to a page with a Java applet â€” doing this once will fix the problem and permanently restore Java functionality.</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=396695">Bug 396695</a> &#8211; Add-ons are disabled after updating. Users can fix this problem by opening their <a href="http://kb.mozillazine.org/Profile_folder_-_Firefox#Finding_the_profile_folder">profile folder</a> and removing <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=396695#c26">three files</a> (extensions.rdf, extensions.ini and extensions.cache)</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=400421">Bug 400421</a> &#8211; Removing a single area element from an image map will cause the entire map to disappear. There is no workaround available at this time.</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=400735">Bug 400735</a> &#8211; Some Windows users may experience crashes at startup. There is no workaround available at this time.</li>
</ul>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.hbcom.info/archives/118/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>QNX publishes Neutrino kernel code</title>
		<link>http://blog.hbcom.info/archives/106?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=qnx-publishes-his-kernel-code</link>
		<comments>http://blog.hbcom.info/archives/106#comments</comments>
		<pubDate>Fri, 28 Sep 2007 01:09:48 +0000</pubDate>
		<dc:creator>hb</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://blog.hbcom.info/archives/106</guid>
		<description><![CDATA[QNX announced that the company makes available the source code of his Neutrino RTOS (real time operating system) microkernel via newly created QNX Foundry27 portal. At Foundry27, customers and developers can access a wealth of resources relating to the QNX Neutrino RTOS and the QNX Momentics IDE, as well as to new community projects. Finally [...]]]></description>
			<content:encoded><![CDATA[<p>QNX <a href="http://www.qnx.com/news/pr_2519_1.html" target="_blank">announced</a> that the company makes available the source code of his Neutrino RTOS (real time operating system) microkernel via newly created QNX Foundry27 portal.</p>
<blockquote><p>At Foundry27, customers and developers can access a wealth of resources relating to the QNX Neutrino RTOS and the QNX Momentics IDE, as well as to new community projects.</p></blockquote>
<p>Finally one mature realtime kernel code is available  &#8230;. (bad news is that it is released under dual licensing).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hbcom.info/archives/106/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Versioning</title>
		<link>http://blog.hbcom.info/archives/31?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=versioning</link>
		<comments>http://blog.hbcom.info/archives/31#comments</comments>
		<pubDate>Thu, 19 Jul 2007 16:05:17 +0000</pubDate>
		<dc:creator>hb</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://blog.hbcom.info/archives/31</guid>
		<description><![CDATA[Have you already write the code and have the need to keep track of changes or keep different versions with possibility to revert easily to previous version? Do you still have those problems? If so the tool you may need is called subversion and is available for Linux/Unix/MAC OS X and Windows. How to use [...]]]></description>
			<content:encoded><![CDATA[<p>Have you already write the code and have the need to keep track of changes or keep different versions with possibility to revert easily to previous version?</p>
<p>Do you still have those problems?</p>
<p>If so the tool you may need is called <a href="http://en.wikipedia.org/wiki/Subversion_(software)" title="SVN" target="_blank">subversion</a> and is available for Linux/Unix/MAC OS X and Windows.</p>
<p>How to use it?</p>
<p>It is relatively easy especially if you create local repository:</p>
<p>1. You need to install the binary version or compile from source code (<em>the procedure is described for CentOS 5, but sould not be drastically different for other OS&#8217;s except fro installation part</em>)</p>
<p><code>yum install subversion</code></p>
<p>2. Next step is to create repository &#8211; it must be done on the machine where repository will reside</p>
<p><code>svnadmin create &lt;path to local directory&gt;</code></p>
<p>3. After you create repository next step is to import data</p>
<p><code>svn import &lt;folder&gt; &lt;repository&gt; -m "&lt;log message&gt;"</code></p>
<p>Where:</p>
<ul>
<li>folder &#8211; direcrtory where your data reside</li>
<li>repository &#8211; file:///&lt;path to repository&gt; <em>Note there are 3 slashes</em></li>
<li>log message &#8211; something meaninfull probably something like &#8220;first import&#8221;</li>
</ul>
<p>4. Rename the folder</p>
<p><code>mv folder folder.beforesvn</code></p>
<p>5. Create working copy of the data</p>
<p><code>svn checkout &lt;repository&gt; &lt;working copy&gt;</code></p>
<p>6. Start working and send changes to repository with</p>
<p><code>svn commit</code></p>
<p><em>Note that you need to be in &#8220;working copy&#8221; folder.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hbcom.info/archives/31/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Removing user in Linux</title>
		<link>http://blog.hbcom.info/archives/5?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=removing-user-in-linux</link>
		<comments>http://blog.hbcom.info/archives/5#comments</comments>
		<pubDate>Thu, 05 Jul 2007 19:01:26 +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/archives/5</guid>
		<description><![CDATA[Today I removed the user in my Linux workstation. Probably you will say that this is simple task just remove user home directory and his password, but appears that this is not. First thing is that there is no single command that will do this task for you. Let&#8217;s start: 1. Lock user &#8211; this [...]]]></description>
			<content:encoded><![CDATA[<p>Today I removed the user in my Linux workstation.</p>
<p>Probably you will say that this is simple task just remove user home directory and his password, but appears that this is not.</p>
<p>First thing is that there is no single command  that will do this task for you.</p>
<p>Let&#8217;s start:</p>
<p>1. Lock user &#8211; this is done with following command:</p>
<p><code>passwd -l &lt;user_name&gt;</code></p>
<p>This command will achieve it by changing the password to a value that cannot be matched by any possible encrypted value.</p>
<p>This command is usefull also for temporary disabling user account.</p>
<p>2. Search for and kill any user processes that still run</p>
<p><code>ps aux | grep -i ^&lt;user_name&gt;</code></p>
<p>kill -9 &lt;PID number&gt;</p>
<p>where  &lt;PID number&gt; is the number in the column just after the user name.</p>
<p>3. Find all files that belong to this user</p>
<p><code>find / -user &lt;user_name&gt;|less</code></p>
<p>4. Decision time &#8211; decide do you want to keep those files or erase them. My suggestion is to backup them just in case.</p>
<p>5. List and remove any crontab jobs</p>
<p>List user cron jobs:</p>
<p><code>crontab -u &lt;user_name -l</code></p>
<p>And if you see any entries remove them:</p>
<p><code>crontab -u &lt;user_name&gt; -r</code></p>
<p>6. Remove user from sudoers (if you use sudo)</p>
<p><code>visudo</code></p>
<p>7. Check any other applications as remote access, MySQL, Web App.<br />
<a href="http://www.howtoforge.com/linux_remove_users">More extended howto<br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hbcom.info/archives/5/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>bash: /bin/rm: Argument list too long &#8211; How to fix it</title>
		<link>http://blog.hbcom.info/archives/4?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=bash-binrm-argument-list-too-long-how-to-fix-it</link>
		<comments>http://blog.hbcom.info/archives/4#comments</comments>
		<pubDate>Thu, 05 Jul 2007 14:39:50 +0000</pubDate>
		<dc:creator>hb</dc:creator>
				<category><![CDATA[Command line]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[Fix]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://blog.hbcom.info/?p=4</guid>
		<description><![CDATA[Today I&#8217;ve decided to cleanup the hard drive on my Linux workstation and &#8220;surprisingly&#8221; found 8G of temporary files in one folder. After quick review I&#8217;ve decided to erase them with rm command. For my surprise when running the command: /bin/rm *.tmp I got following error message: bash: /bin/rm: Argument list too long Conclusion:Even rm [...]]]></description>
			<content:encoded><![CDATA[<p><!--  		@page { size: 8.5in 11in; margin: 0.79in } 		P { margin-bottom: 0.08in } 		PRE { font-family: "Nimbus Mono L", monospace } -->Today I&#8217;ve decided to cleanup the hard drive on my Linux workstation and &#8220;surprisingly&#8221; found 8G of temporary files in one folder.</p>
<p>After quick review I&#8217;ve decided to erase them with rm command.</p>
<p>For my surprise when running the command:</p>
<pre style="margin-bottom: 0.2in;">/bin/rm *.tmp</pre>
<p>I got following error message:</p>
<p>bash: /bin/rm: Argument list too long</p>
<p>Conclusion:Even rm command has his limits!</p>
<p>Solution: Get Plumber(Joking)<br />
Actually only <a href="http://en.wikipedia.org/wiki/Pipeline_%28Unix%29">Pipe</a> is needed.<br />
By typing following command:</p>
<pre style="margin-bottom: 0.2in;">find . -name "*.tmp"|less</pre>
<p>You will see list of the files and by replacing less with <em>xargs /bin/rm</em> those files will be erased. Can you skip previous step? Yes you can and it is not required, but you risk to erase a lot of data if you have syntax error.</p>
<pre style="margin-bottom: 0.2in;">find . -name "*.tmp"| xargs /bin/rm.</pre>
<p>Depending on the number of files and your system speed after a while all files will be erased.</p>
<p>Done .</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hbcom.info/archives/4/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

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

