<?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; linux</title>
	<atom:link href="http://www.linuxscrew.com/category/linux/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=5713</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Phone call as Nagios notification</title>
		<link>http://www.linuxscrew.com/2011/09/13/nagios-notification-by-phone-call/</link>
		<comments>http://www.linuxscrew.com/2011/09/13/nagios-notification-by-phone-call/#comments</comments>
		<pubDate>Tue, 13 Sep 2011 06:51:27 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[applications]]></category>
		<category><![CDATA[howtos]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1407</guid>
		<description><![CDATA[Some time ago I found it pretty useful to configure Nagios monitoring system to send me a phone call in case of some critical problem. If some mission critical application goes down at night most probably you&#8217;ll miss an e-mail or sms notifying about that but won&#8217;t miss a telephone call to your cell phone. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.linuxscrew.com/wp-content/uploads/2008/04/smalllogo7nagios.jpg"><img src="http://www.linuxscrew.com/wp-content/uploads/2008/04/smalllogo7nagios.jpg" alt="" title="nagios logo" width="150" height="40" class="alignright size-full wp-image-497" /></a>Some time ago I found it pretty useful to configure Nagios monitoring system to send me a phone call in case of some critical problem. If some mission critical application goes down at night most probably you&#8217;ll miss an e-mail or sms notifying about that but won&#8217;t miss a telephone call to your cell phone. Honestly a telephone call is much more notorious rather than IM message notification or, again, e-mail/sms. You&#8217;re welcome to see below how to configure your Nagios for that.</p>
<p>First of all you need to have account at some SIP voip service provider like www.voiptalk.org or similar (Skype is not an option so far). Once registered you will get SIP username/password and SIP gateway&#8217;s IP address which will be used to make outgoing calls by Nagios.</p>
<p>1. Download and install pjsua console caller from pjsip.</p>
<pre>cd /usr/src/
wget http://www.pjsip.org/release/1.10/pjproject-1.10.tar.bz2
tar -xvjf pjproject-1.10.tar.bz2
cd /usr/src/pjproject-1.10
./configure --disable-sound
make
sudo cp pjsip-apps/bin/pjsua-i686-pc-linux-gnu /usr/bin/pjsua
</pre>
<p>2. Configure pjsua.</p>
<p>Create /etc/pjsuarc configuration file with the following contents (depends on details provided by SIP provider):</p>
<pre>
--null-audio
--registrar sip:<SIP gateway IP>:5060
--realm=*
--id sip:&#060;username&#062;@&#060;SIP gateway IP&#062;:5060
--username &#060;username&#062;
--password &#060;password&#062;
</pre>
<p>From that point you can try calling yourself by command:</p>
<pre>/usr/bin/pjsua --config-file=/etc/pjsuarc sip:&#060;your phone number&#062;@&#060;SIP gateway IP&#062;</pre>
<p>3. Configure Nagios to notify you by sending you a telephone call:</p>
<p>Add the following block to Nagios&#8217; commands.cfg:</p>
<pre>define command{
        command_name  notify-host-by-sip
        command_line  (sleep 30 &#038;&#038; echo q) | /usr/bin/pjsua --config-file=/etc/pjsuarc sip:$CONTACTEMAIL$
}</pre>
<p>Add below contact to Nagios&#8217; contact.cfg:</p>
<pre>
define contact{
        contact_name  user_sip
        alias  useralias
        service_notification_period  24x7
        host_notification_period  24x7
        service_notification_options  c
        host_notification_options  d
        service_notification_commands  notify-service-by-sip
        host_notification_commands  notify-host-by-sip
        email  &#060;your phone number&#062;@&#060;SIP gateway IP&#062;
}
</pre>
<p>That&#8217;s it, from this point Nagios will call you in case of critical problem and won&#8217;t bother you with warnings.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2011/09/13/nagios-notification-by-phone-call/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linus Torvalds &#8212; The Facts You Didn&#8217;t Know</title>
		<link>http://www.linuxscrew.com/2011/07/15/linus-torvalds-the-facts-you-didnt-know/</link>
		<comments>http://www.linuxscrew.com/2011/07/15/linus-torvalds-the-facts-you-didnt-know/#comments</comments>
		<pubDate>Fri, 15 Jul 2011 14:08:52 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[reviews]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1388</guid>
		<description><![CDATA[Some of you may well be younger than Linux, some of you may have grown up with the OS, and some of you, more ancient ones, may well remember thinking that this stuff is going to &#8216;blow the bloody doors off&#8217; as Michael Caine put it when you first encountered it. But how about Linus [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.linuxscrew.com/wp-content/uploads/2011/07/linus-torvalds-hollywood.jpeg" alt="Linus Torvalds" title="Linus Torvalds" width="207" height="243" class="alignright size-full wp-image-1397" />Some of you may well be younger than Linux, some of you may have grown up with the OS, and some of you, more ancient ones, may well remember thinking that this stuff is going to &#8216;blow the bloody doors off&#8217; as Michael Caine put it when you first encountered it. But how about Linus Torvald, the man who wrote the first kernel? Here we&#8217;re going to give you an insight into his life and personality. </p>
<p>He is Finnish but actually grew up speaking Swedish. This is because Linus is one of the &#8220;finlandssvensk&#8221; or &#8220;finlandssvenskar&#8221; community in Finland. These were Swedes who moved to Finland many hundreds of years ago when the country was part of the Swedish Empire and continue to speak Swedish. </p>
<p>It was on August 25th 1991 that Linus announced to the Usenet newsgroup &#8220;comp.os.minix.&#8221; that he was making a free OS, although he thought it wouldn&#8217;t be big or professional like Gnu. Well, who would have thought that Linux would turn the computing world on its head? </p>
<p>He hates phones, which he believes distracts him from more important things in life. This doesn&#8217;t mean he doesn&#8217;t own a phone, he just uses it for the GPS function when he&#8217;s driving. </p>
<p>Linus Torvald rarely gets to code any more. This is not because he&#8217;s spending all his time looking at his bill on <a href="http://www.o2.co.uk/broadband/">www.o2.co.uk</a> or crafting amazing images on photoshop, no, he&#8217;s replying to a huge email in-box and the few bits of code he does write are usually pasted in emails to questions explaining what to avoid. </p>
<p>I don&#8217;t know how much tea or coffee you drink, but Linus reckons he is a coffee addict and calculates that he and his wife have drunk an average of 4.7 double shots per day between 2002 and 2010 and that&#8217;s not including take-out coffees. </p>
<p>Despite this caffeine intake, he still manages to get a fairly serious nine hours sleep a night (he goes to bed at 10 and gets up at 7). </p>
<p>Perhaps this is because he likes drinking Guinness, that Irish stout from Dublin that contains a serious amount of iron and used to be taken as a health tonic in the British Isles before modern fads changed peoples&#8217; opinions. </p>
<p>Prior to having laser surgery, Linus used to wear spectacles. </p>
<p>He is married and lives in Portland, Oregon with his wife Tove and their three daughters. </p>
<p><font size="2pt" style="font-style: italic;" color="#999999">[ This is sponsored blog post. Feel free to contact me via artiomix at gmail dot com for more details about availability and prices for sponsored posts. ]</font></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2011/07/15/linus-torvalds-the-facts-you-didnt-know/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install nfdump and nfsen netflow tools in Linux</title>
		<link>http://www.linuxscrew.com/2011/02/23/install-nfdump-and-nfsen-netflow-tools-in-linux/</link>
		<comments>http://www.linuxscrew.com/2011/02/23/install-nfdump-and-nfsen-netflow-tools-in-linux/#comments</comments>
		<pubDate>Wed, 23 Feb 2011 20:00:01 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[applications]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[howtos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1182</guid>
		<description><![CDATA[Using nfsen it is possible to view IP traffic statistics on Linux interfaces including the graphs showing data sent and received (see the screenshot to the right) as well as historical information about all data transfers. So after you&#8217;ve configured nfsen and nfdump to monitor traffic on certain Linux server or router you&#8217;ll be able [...]]]></description>
			<content:encoded><![CDATA[<p><a target="_blank" href="http://www.linuxscrew.com/wp-content/uploads/2011/02/Selection_033.png"><img src="http://www.linuxscrew.com/wp-content/uploads/2011/02/Selection_033-small.png" alt="" title="nfsen screenshot" width="300" height="162" class="alignright size-full wp-image-1190" /></a>Using <strong><a href="http://nfsen.sourceforge.net/">nfsen</a></strong> it is possible to view IP traffic statistics on <strong><a href="http://www.linuxscrew.com/category/linux/">Linux</a></strong> interfaces including the graphs showing data sent and received (see the screenshot to the right) as well as historical information about all data transfers. So after you&#8217;ve configured <strong>nfsen</strong> and <strong>nfdump</strong> to monitor traffic on certain <strong>Linux</strong> server or router you&#8217;ll be able to answer the following example questions: What IP was downloading data through 48161 last Wednesday? or How many bytes were sent to IP 8.8.8.8 via 53 port from Linux server? These are the only examples so <strong>nfdump</strong> and <strong>nfdump</strong> <a href="http://en.wikipedia.org/wiki/Netflow">netflow</a> tools gives you wide range of capabilities to monitor and analyze traffic on your <strong>Linux</strong> host.</p>
<p><strong>Netflow</strong> is the protocol developed by <a href="http://www.cisco.com">Cisco</a> to manage data about IP traffic. In a few words using Netflow you can collect data about all IP data send/received on multiple Cisco/Linux/BSD/Juniper hosts and send it to central Netflow collector that will show you the nice graphs and also will allow to have a complete picture of what data was sent/received on those hosts (including destination and source IP, port, bytes transfered, int/out interfaces etc). <strong>Nfdump</strong> is netflow collector. <strong>Nfsen</strong> is graphical tools for generating graphs and querying <strong>Nfdump</strong> for historical traffic reports. In this article you will see how to deploy all this staff in <strong>Linux</strong>.</p>
<p>Netflow probe is required to collect IP traffic data on <strong>Linux</strong> host. In general this piece of sofware will sit in background, store every network activity on certain network interface and then send collected data to Netflow collector nfdump. As Netflow probe I prefer <strong><a href="http://fprobe.sourceforge.net/">fprobe</a></strong> that is totally simple application that just does its job. If you feel that fprobe is not what you need or there are some problems with installing it you can try <a href="http://www.mindrot.org/projects/softflowd/">softflowd</a> that can do the same job.</p>
<p><em>Install fprobe from sources:</em></p>
<pre>cd /usr/src/
sudo -s
wget http://sourceforge.net/projects/fprobe/files/fprobe/1.1/fprobe-1.1.tar.bz2/download
tar -xvjf fprobe-1.1.tar.bz2
cd fprobe-1.1
./configure --prefix=/
make
make install
</pre>
<p><em>Point fprobe to one of network interfaces of <strong>Linux</strong> host and make it to send data to Netflow collector:</em></p>
<pre>fprobe -i eth0 11.22.33.44:23456</pre>
<p>In above example fprobe stores all data trasnfers on eth0 network interface and sends collected data to 11.22.33.44 host via 23456 UDP port (you may want to change firewall rules to make Netflow working over 23456 UDP port).</p>
<p><em>Install nfdump Netflow collector from sources:</em></p>
<pre>cd /usr/src/
sudo -s
wget http://sourceforge.net/projects/nfdump/files/stable/nfdump-1.6.2/nfdump-1.6.2.tar.gz/download
tar -xvzf nfdump-1.6.2.tar.gz
cd nfdump-1.6.2
./configure --prefix=/ --enable-nfprofile
make make
install</pre>
<p>When finished Netflow collector becomes ready so you can start capturing traffic from Netflow probe. If you don&#8217;t need any graphical tools like <strong>nfsen</strong> described below you can just start collector and save Netflow data in /var/neflow/ directory (THIS STEP IS OPTIONAL):</p>
<pre>/bin/nfcapd -w -D -p 23456 -B 200000 -S 1 -z -I Linux-Host-1-eth0 -l /var/netflow/</pre>
<p>In order to install <strong>nfsen</strong> from sources you have to get all its prerequisites, run one of below lines depending on what <strong>Linux</strong> distro you&#8217;re using (1st line is for <a href="http://www.linuxscrew.com/category/fedora/">Fedora</a>, <a href="http://www.linuxscrew.com/category/centos/">Centos</a>, Redhat while 2nd line is for <a href="http://www.linuxscrew.com/category/ubuntu/">Ubuntu</a>, <a href="http://www.linuxscrew.com/category/debian/">Debian</a>, Mint and similar):</p>
<pre>yum install rrdtool rrdtool-devel rrdutils perl-rrdtool -y</pre>
<p>or</p>
<pre>aptitude install rrdtool librrd2-dev librrd-dev librrd4 librrds-perl librrdp-perl</pre>
<p><em>Compile nfsen from sources:</em></p>
<pre>cd /usr/src/
sudo -s
wget http://sourceforge.net/projects/nfsen/files/stable/nfsen-1.3.5/nfsen-1.3.5.tar.gz/download
tar -xvzf nfsen-1.3.5.tar.gz
cd nfsen-1.3.5
cp etc/nfsen-dist.conf etc/nfsen.conf</pre>
<p>In order to continue the installation you should edit file <i>etc/nfsen.conf</i> to specify where to install <strong>nfsen</strong>, web server’s username (yes, you have to install apache, lighttpd, nginx or any other web server first), its document root directory etc. The major section of that config file is ‘Netflow sources’ that must list all hosts you&#8217;ve started Netflow probes at. Here is an example section for monitoring above <strong>Linux</strong> host:</p>
<pre>%sources = (
    'Linux-Host-eth0'    => { 'port' => '23456', 'col' => '#ff0000', 'type' => 'netflow' },
);</pre>
<p>When finished it&#8217;s time to actually install <strong>nfsen</strong> using installation script:</p>
<pre>./install.pl etc/nfsen.conf</pre>
<p>In case of successful installation you will be notified with corresponding congratulations message so it would be proper time to start <strong>nfsen</strong> daemon:</p>
<pre>/path/to/nfsen/bin/nfsen start</pre>
<p>Now you can open http://localhost/nfsen/nfsen.php at Linux host where <strong>nfsen</strong> was installed to start using this Netflow tool and see some graphs. Notice that it takes about 5-10 minutes to see first bars at the graphs, if the graphs are still empty you will have to check at least the following:</p>
<p>1. If fprobe is able to communicate to Netwflow collector and can send Netflow data to it (use <em>&#8216;ps ax | grep fprobe&#8217;</em> and Linux host being monitored and tcpdump tool at Netflow collector).<br />
2. If Netflow collector is started and can receive data from Netflow probe. Use <em>&#8216;ps ax | grep nfcapd&#8217;</em> and tcpdump at Netflow collector Linux host.</p>
<p>If you can add anything &#8212; feel free to drop a comment below.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2011/02/23/install-nfdump-and-nfsen-netflow-tools-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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">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">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>Namebench: cross-platform DNS benchmarking tool</title>
		<link>http://www.linuxscrew.com/2011/01/15/namebench-cross-platform-dns-benchmarking-tool/</link>
		<comments>http://www.linuxscrew.com/2011/01/15/namebench-cross-platform-dns-benchmarking-tool/#comments</comments>
		<pubDate>Sat, 15 Jan 2011 20:47:56 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[applications]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1157</guid>
		<description><![CDATA[It was long time ago when I wrote here last time but today I&#8217;d like to share the link to an application that would be appreciated by everyone starting from Linux starter wishing to speed up his/her Internet connection and ending with system administrators who may want to run benchmarks and run stress tests against [...]]]></description>
			<content:encoded><![CDATA[<p>It was long time ago when I wrote here last time but today I&#8217;d like to share the link to an application that would be appreciated by everyone starting from Linux starter wishing to speed up his/her Internet connection and ending with system administrators who may want to run benchmarks and run stress tests against certain DNS service(s). I am talking about <a href="http://code.google.com/p/namebench/"><strong>Namebench</strong></a>. This is cross platform tool written in Python that makes it possible to easily select the fastest DNS available in your area as well as to run benchmark tests directed to DNS entries.</p>
<p>All what you need to have to start using namebench is Python and Tk library, e.g. if you use Ubuntu or Debian just run the following command to meet namebench library requirements:</p>
<p><code>sudo apt-get install python python-tk -y</code></p>
<p>When done go to <a href="http://code.google.com/p/namebench/">namebench&#8217;s official website</a> and download the latest tarball from there. For example 1.3.1 is the latest version for today so you can download it directly from <a href="http://code.google.com/p/namebench/downloads/detail?name=namebench-1.3.1-source.tgz">here</a>. Or you can just take below steps:</p>
<p><code>cd /usr/src<br />
sudo -s<br />
wget http://code.google.com/p/namebench/downloads/detail?name=namebench-1.3.1-source.tgz<br />
tar -xvzf namebench-1.3.1-source.tgz<br />
cd namebench-1.3.1<br />
./namebench.py<br />
</code></p>
<p>Here you go:</p>
<p><img src="http://www.linuxscrew.com/wp-content/uploads/2011/01/namebench_001.png" alt="namebench screenshot" title="namebench screenshot" width="716" height="396" class="aligncenter size-full wp-image-1158" /></p>
<p>The application has the only button so I believe it won&#8217;t bring any problems even to Linux newbies <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/2011/01/15/namebench-cross-platform-dns-benchmarking-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to assign range of IP addresses in Linux?</title>
		<link>http://www.linuxscrew.com/2010/11/26/how-to-assign-range-of-ip-addresses-to-one-network-interface/</link>
		<comments>http://www.linuxscrew.com/2010/11/26/how-to-assign-range-of-ip-addresses-to-one-network-interface/#comments</comments>
		<pubDate>Fri, 26 Nov 2010 17:04:32 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[centos]]></category>
		<category><![CDATA[distros]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1136</guid>
		<description><![CDATA[As we know Linux allows to assign almost unlimited number of IP addresses to its interfaces. Such additional IPs applied to the same NIC are known as secondary IP addresses or just secondaries. Some time ago i faced a problem on how to apply about 500 IP addresses to one Linux box and then ensure [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.linuxscrew.com/wp-content/uploads/2010/11/fig1_ip_address.png"><img src="http://www.linuxscrew.com/wp-content/uploads/2010/11/fig1_ip_address.png" alt="ip address example" title="ip address example" width="300" height="90" class="alignright size-full wp-image-1150" /></a>As we know Linux allows to assign almost unlimited number of IP addresses to its interfaces. Such additional IPs applied to the same NIC are known as secondary IP addresses or just secondaries. Some time ago i faced a problem on how to apply about 500 IP addresses to one Linux box and then ensure that all of them get online after Linux reboots. There are several ways to accomplish this taks so i would like to share them all.</p>
<h4>Shell script with ifconfig commands</h4>
<p>This is one of the most inefficient ways to get many IP addresses applied to one network interface. Anyways it allows to create as many aliases for the interface as you like so you should create shell script and execute it every time Linux boots.</p>
<pre>touch /path/to/script.sh
chmod +x /path/to/script.sh
vi /path/to/script.sh
</pre>
<p>Now you should add there shell lines which will apply IP addresses, e.g. the following one applies 60 IP addresses to <em>eth0</em> interface:</p>
<pre>for n in {3..63};  do ifconfig eth0:${n} 10.10.10.${n} netmask 255.255.255.0 up; done</pre>
<p>If you type &#8216;ifconfig&#8217; now you will very long output like this one:</p>
<pre>
eth0:3  Link encap:Ethernet  HWaddr 00:50:8D:D1:24:DB
          inet addr:10.10.10.3  Bcast:10.10.10.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:10 Base address:0x2000 

eth0:4  Link encap:Ethernet  HWaddr 00:50:8D:D1:24:DB
          inet addr:10.10.10.4  Bcast:10.10.10.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:10 Base address:0x2000

...

eth0:63  Link encap:Ethernet  HWaddr 00:50:8D:D1:24:DB
          inet addr:10.10.10.63  Bcast:10.10.10.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:10 Base address:0x2000
</pre>
<p>If you decide to delete those IPs you can run the following line as a remedy:</p>
<pre>for n in {3..63};  do ifconfig eth0:${n} 0.0.0.0 &#038;> /dev/null; done</pre>
<p>Once you finished editing <em>/path/to/script.sh</em> script you should add it to startup, so put the line <em>/path/to/script.sh</em> into <em>/etc/rc.local</em> file that Linux executes every time it boots. Please notice that in various distributions this file may be missing so consult with distro&#8217;s docs to get where it is stored.</p>
<h4>Redhat/Centos/Fedora network scripts</h4>
<p>Users of these Linux distributions can apply ranges of IP addresses using <em>ifcfg-eth0-range0</em> files which are read during initialization of network interfaces during boot up process. The following example will make Linux to apply 200 IP addresses to <em>eth1</em> during booting:</p>
<pre>[root ~]#cat /etc/sysconfig/network-scripts/ifcfg-eth1-range0

IPADDR_START=192.168.1.1
IPADDR_END=192.168.1.200
CLONENUM_START=10</pre>
<p><em>CLONENUM_START</em> value specifies starting identifier of alias that will be applied to eth1 interface, in above example the first <em>192.168.1.1</em> will be assigned to <em>eth1:10</em> alias. The last IP of the range <em>192.168.1.200</em> will be applied to <em>eth:210</em> sub-interface. This is totally easy approach.</p>
<pre>Loopback interface</pre>
<p>Did you know that by one line presented below you assign 1022 virtual IP addresses to your Linux system? Here it is:</p>
<pre>ifconfig lo:0 10.0.0.1/22</pre>
<p>Now you can make sure of this by pinging IPs from that range (10.0.0.1 &#8211; 10.0.3.254).</p>
<pre>[root ~]#ping 10.0.0.1 -c 1
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=0.063 ms

--- 10.0.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.063/0.063/0.063/0.000 ms

...

[root ~]#[root@whitehorse /]# ping 10.0.3.254 -c 1
PING 10.0.0.1 (10.0.3.254) 56(84) bytes of data.
64 bytes from 10.0.3.254: icmp_seq=1 ttl=64 time=0.063 ms

--- 10.0.3.254 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.063/0.063/0.063/0.000 ms</pre>
<p>If you still feel that the first suggested way meets your requirements better than the third one please read more about <a href="http://en.wikipedia.org/wiki/Loopback">loopback interface at wikipedia</a> &#8212; loopbacks are much more useful than aliases in most cases.</p>
<p>Hope it helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2010/11/26/how-to-assign-range-of-ip-addresses-to-one-network-interface/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to monitor traffic at Cisco router using Linux (Netflow)</title>
		<link>http://www.linuxscrew.com/2010/11/25/how-to-monitor-traffic-at-cisco-router-using-linux-netflow/</link>
		<comments>http://www.linuxscrew.com/2010/11/25/how-to-monitor-traffic-at-cisco-router-using-linux-netflow/#comments</comments>
		<pubDate>Thu, 25 Nov 2010 21:16:38 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[applications]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[distros]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[howtos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1109</guid>
		<description><![CDATA[By default Cisco IOS doesn&#8217;t provide any traffic monitoring tools like iftop or iptraff available in Linux. While there are lots of proprietary solutions for this purpose including Cisco Netflow Collection, you are free to choose nfdump and nfsen open source software to monitor traffic of one or many Cisco routers and get detailed monitoring [...]]]></description>
			<content:encoded><![CDATA[<p>By default <strong>Cisco IOS</strong> doesn&#8217;t provide any <strong>traffic monitoring</strong> tools like <a href="http://www.ex-parrot.com/pdw/iftop/">iftop</a> or <a href="http://iptraf.seul.org/shots/iptraf-iptm1.gif">iptraff</a> available in <strong>Linux</strong>. While there are lots of proprietary solutions for this purpose including <a href="http://www.cisco.com/en/US/products/sw/netmgtsw/ps1964/index.html">Cisco Netflow Collection</a>, you are free to choose <a href="http://nfdump.sourceforge.net/"><strong>nfdump</strong></a> and <strong><a href="http://nfdump.sourceforge.net/">nfsen</a></strong> open source software to monitor traffic of one or many Cisco routers and get detailed monitoring data through your Linux command line or as graphs at absolutely no cost.</p>
<p>Below is beginner&#8217;s guide that helps to quickly deploy netflow collector and visualizer under Linux and impress everybody by cute and descriptive graphs like these:</p>
<p><center><img src="http://www.linuxscrew.com/wp-content/uploads/2010/11/nfsen1.png" alt="nfsen screen" title="nfsen screen" width="500" height="307" class="aligncenter size-full wp-image-1115" /></center></p>
<p>It is highly recommended to look through Netflow basics to get brief understanding of how it works before configuring anything. For example, <a href="http://www.cisco.com/en/US/prod/collateral/iosswrel/ps6537/ps6555/ps6601/prod_white_paper0900aecd80406232.html">here is Cisco&#8217;s document</a> that gives complete information about <a href="http://en.wikipedia.org/wiki/Netflow">Netflow</a>. In a few words to get started you should enable netflow exporting on Cisco router and point it to netflow collector running under Linux. Exported data will contain complete information about all packets the router has received/sent so nfdump and nfsen working under Linux will collect it and visualize to present you the graph like above example.</p>
<p><strong>Cisco Router Setup</strong></p>
<p>1. Enable flow export on ALL Cisco router&#8217;s interfaces that send and receive some traffic, here is an example:</p>
<pre>Router1# configure terminal
Router1(config)#interface FastEthernet 0/0
Router1(config-if)#ip route-cache flow input
Router1(config-if)#interface FastEthernet 0/1
Router1(config-if)#ip route-cache flow input
...</pre>
<p>2. Setup netflow export:</p>
<pre>Router1# configure terminal
Router1(config)#ip flow-export source FastEthernet0/0
Router1(config)#ip flow-export source FastEthernet0/1
Router1(config)#ip flow-export version 5
Router1(config)#ip flow-export destination 1.1.1.1 23456</pre>
<p>Where <em>1.1.1.1</em> is IP address of Linux host where you plan to collect and analyze netflow data. <em>23456</em> is port number of netflow collector running on Linux.</p>
<p><b>Linux Setup</b></p>
<p>1. Download and install nfdump.</p>
<pre>cd /usr/src/
wget http://sourceforge.net/projects/nfdump/files/stable/nfdump-1.6.2/nfdump-1.6.2.tar.gz/download
tar -xvzf nfdump-1.6.2.tar.gz
cd nfdump-1.6.2
./configure --prefix=/ --enable-nfprofile
make
make install
</pre>
<p>2. Download and install nfsen.</p>
<p>It requires web server with php module and <a href="http://www.mrtg.org/rrdtool/">RRD</a> so make sure you have the corresponding packages installed. I hope you&#8217;re running httpd with php already so below are rrd/perl related packages installation hints only.</p>
<p>Fedora/Centos/Redhat users should type this:</p>
<pre>yum install rrdtool rrdtool-devel rrdutils perl-rrdtool</pre>
<p>Ubuntu/Debian:</p>
<pre>aptitude install rrdtool librrd2-dev librrd-dev librrd4 librrds-perl librrdp-perl</pre>
<p>If you run some exotic Linux distribution just install everything that is related to rrd + perl.</p>
<p>At last, nfsen installation:</p>
<pre>cd /usr/src/
wget http://sourceforge.net/projects/nfsen/files/stable/nfsen-1.3.5/nfsen-1.3.5.tar.gz/download
tar -xvzf nfsen-1.3.5.tar.gz
cd nfsen-1.3.5
cp etc/nfsen-dist.conf etc/nfsen.conf
</pre>
<p>In order to continue you should edit file <em>etc/nfsen.conf</em> to specify where to install nfsen, web server&#8217;s username, its document root directory etc. That file is commented so there shouldn&#8217;t be serious problems with it.</p>
<p>One of the major sections of <em>nfsen.conf</em> is &#8216;Netflow sources&#8217;, it should contain exactly the same port number(s) you&#8217;ve configured Cisco with &#8212; recall &#8216;ip flow-export &#8230;&#8217; line where we&#8217;ve specified port 23456. E.g.</p>
<pre>%sources = (
    'Router1'    => { 'port' => '23456', 'col' => '#0000ff', 'type' => 'netflow' },
);</pre>
<p>Now it&#8217;s time to finish the installation:</p>
<pre>./install.pl etc/nfsen.conf</pre>
<p>In case of success you&#8217;ll see corresponding notification after which you will have to start nfsen daemon to get the ball rolling:</p>
<pre>/path/to/nfsen/bin/nfsen start</pre>
<p>From this point nfdump started collecting netflow data exported by Cisco router and nfsen is hardly working to visualize it &#8212; just open web browser and go to <em>http://linux_web_server/nfsen/nfsen.php</em> to make sure. If you see empty graphs just wait for a while to let nfsen to collect enough data to visualize it.</p>
<p>That&#8217;s it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2010/11/25/how-to-monitor-traffic-at-cisco-router-using-linux-netflow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The easiest way to split and merge pdf files in Ubuntu</title>
		<link>http://www.linuxscrew.com/2010/06/18/the-easiest-way-to-split-and-merge-pdf-files-in-ubuntu/</link>
		<comments>http://www.linuxscrew.com/2010/06/18/the-easiest-way-to-split-and-merge-pdf-files-in-ubuntu/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 06:09:17 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[centos]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1087</guid>
		<description><![CDATA[The easiest way to split, merge or edit pdf files in Ubuntu is to use pdftk utility. This rather old (latest version was released in 2006) but still simple and powerful program can be installed in Ubuntu (Debian or any deb-family Linux distribution) by the following command in terminal:
sudo aptitude install pdftk
(if you run Fedora, [...]]]></description>
			<content:encoded><![CDATA[<p>The easiest way to split, merge or edit pdf files in Ubuntu is to use <a href="http://www.accesspdf.com/pdftk/">pdftk utility</a>. This rather old (latest version was released in 2006) but still simple and powerful program can be installed in Ubuntu (Debian or any deb-family Linux distribution) by the following command in terminal:</p>
<p><code>sudo aptitude install pdftk</code><br />
(if you run Fedora, RedHat or CentOS use this one: <code>sudo yum install pdftk</code>)</p>
<p><strong>Split large pdf into many one-page files:</strong></p>
<p><code>pdftk largepdfile.pdf burst</code></p>
<p>(as the result you will get many small files like pg_0001.pdf, pg_0002.pdf and so on).</p>
<p><strong>Merge files into one PDF file:</strong></p>
<p><code>pdftk *.pdf cat output onelargepdfile.pdf</code></p>
<p>pdftk is extremely powerful and makes it possible to do almost anything with input pdf files. Thus above two commands are just examples showing how to split and merge pdf files in Ubuntu easily.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2010/06/18/the-easiest-way-to-split-and-merge-pdf-files-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Split huge files in Ubuntu or any other Linux distro</title>
		<link>http://www.linuxscrew.com/2010/06/16/split-huge-files-using-ubuntu-linux/</link>
		<comments>http://www.linuxscrew.com/2010/06/16/split-huge-files-using-ubuntu-linux/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 15:10:18 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[applications]]></category>
		<category><![CDATA[ipod]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1072</guid>
		<description><![CDATA[Recently I&#8217;ve bought WD TV media player for streaming full HD movies (primarily in 1080p resolution) to my home TV from external storage like usb HDD or ipod classic. You might already know that size of average HD movie rip is more than 4GB (e.g. full HD Avatar movie image is literally 21 GB mkv [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve bought WD TV media player for streaming full HD movies (primarily in <a href="http://en.wikipedia.org/wiki/1080p">1080p</a> resolution) to my home TV from external storage like usb HDD or ipod classic. You might already know that size of average HD movie rip is more than 4GB (e.g. full HD <a href="http://www.imdb.com/title/tt0499549/">Avatar</a> movie image is literally 21 GB mkv file) so it&#8217;s just impossible to store such huge files on any <a href="http://en.wikipedia.org/wiki/File_Allocation_Table">FAT32</a> formatted HDD or ipod. My ipod classic 160 GB is windows formatted so it uses FAT32 filesystem where maximum file size is 4 GB. As far as ipod cannot be formatted into ext3 but still be able to play music (just sweet dreams) I have to <strong>split huge files</strong> to 3.99GB parts and store them to my ipod for later reassemble. When it&#8217;s time to watch the some HD movie stored at ipod it&#8217;s required to assemble those 3.99 GB parts into one solid file, transfer it to media player and then actually watch the movie.</p>
<p>Rather long preface but solution is quite simple. If u run <strong>Ubuntu</strong> you can try <strong><a href="http://lxsplit.sourceforge.net/">lxsplit</a></strong> utility for breaking files into parts (binary packages for other <strong>Linux</strong> distributions as well as source code are available at  lxsplit project&#8217;s <a href="http://lxsplit.sourceforge.net/">homepage</a>.):</p>
<p><code>sudo apt-get install lxsplit</code></p>
<p>In order to split some file in 3.99GB parts use the following command:</p>
<p><code>lxsplit -s /path/to/hugemoviefile.mkv 3999M</code></p>
<p>Depending on size of <em>hugemoviefile.mkv</em> you will get several parts <em>hugemoviefile.mkv.001</em>, <em>hugemoviefile.mkv.002</em> and so on stored in current directory. It means that if you&#8217;re going to store those parts on some external storage like ipod you can do the following:</p>
<p><code>cd /media/ipod/<br />
lxsplit -s /path/to/hugemoviefile.mkv 3999M</code></p>
<p>and hugemoviefile.mkv.001.. will saved in /media/ipod/ directory regardless where hugemoviefile.mkv is located.</p>
<p>Now coming to assembling procedure. It&#8217;s just as easy as splitting:</p>
<p><code>lxsplit -j hugemoviefile.mkv.001</code></p>
<p>Once done you will get <em>hugemoviefile.mkv</em> saved in current directory.</p>
<p><span style="color: #800000;"><em>Have  an interesting article? You&#8217;re welcome to <a href="mailto:artiomix@gmail.comREMOVETHIS">contact me</a> and get  it   published at <a href="http://www.linuxscrew.com">LinuxScrew.com</a>!</em></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2010/06/16/split-huge-files-using-ubuntu-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

