<?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>Want Linux &#187; Walkthroughs</title>
	<atom:link href="http://www.wantlinux.net/category/walkthroughs/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wantlinux.net</link>
	<description>WantLinux.net Ubuntu the way I like it.</description>
	<lastBuildDate>Tue, 22 Dec 2009 16:08:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Ubuntu 9.04 BIND DNS Caching server</title>
		<link>http://www.wantlinux.net/2009/04/ubuntu-904-bind-dns-caching-server/</link>
		<comments>http://www.wantlinux.net/2009/04/ubuntu-904-bind-dns-caching-server/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 10:44:48 +0000</pubDate>
		<dc:creator>Darrell</dc:creator>
				<category><![CDATA[Walkthroughs]]></category>

		<guid isPermaLink="false">http://www.wantlinux.net/?p=94</guid>
		<description><![CDATA[BIND, for /Berkeley Internet Name Domain, or named, is the most commonly used DNS server on the Internet, especially on Unix-like systems, where it is a /de facto/ standard.  I have found many reasons for a BIND DNS Caching server, and a few of them are email servers to prevent the load from spilling onto [...]]]></description>
			<content:encoded><![CDATA[<p>BIND, for /Berkeley Internet Name Domain, or named, is the most<br />
commonly used DNS server on the Internet, especially on Unix-like<br />
systems, where it is a /de facto/ standard.  I have found many reasons for a BIND DNS Caching server, and a few of them are email servers to prevent the load from spilling onto your dns servers, apache web servers for the same reason, and for my internal home server just so I can clear my BIND DNS caching server when I want.  I especially like having my own BIND DNS caching server when I am working on a clients DNS so once I make the changes I can clear my cache on my DNS server, and test the change. Lets get started on how to install a BIND DNS Caching server on Ubuntu 9.04.</p>
<p>1.) Install BIND 9 and the BIND 9 utils using apt-get for our BIND DNS caching server.</p>
<p>sudo apt-get update<br />
sudo apt-get install bind9 bind9utils</p>
<p>2.) Point your /etc/resolv.conf to the new servers ip address.</p>
<p>vi /etc/resolv.conf<br />
add &#8220;nameserver xxx.xxx.xxx.xxx&#8221; to the file
<p>3.) Test your BIND DNS caching server.<br />
dig www.wantlinux.net</p><p style="float: left;margin: 4px;"><script type="text/javascript"><!--
google_ad_client = "pub-1842667318455177";
/* wantlinux 336x280 */
google_ad_slot = "9922757146";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p></p>
<p>You should notice a response the &#8220;Query time: 18 msec&#8221; from the output of the dig command.  Once you make note of the response time repeat the dig command and your response time to decrease drastically.  Congratulations your BIND DNS caching server is working.  For example my second output was &#8220;Query time: 2 msec&#8221;.  A 16 ms increase in DNS queries might not seem like alot, but when you use spamassassin with DNS options turned on you can make 10-30 DNS queries per email.  It adds up quickly when your email server receives 4 messages a second.  </p>
<p>Other options for your BIND DNS caching server would be to use your ISP&#8217;s dns servers as forwarders, but this does not give you the flexibility of clearing your DNS server cache whenever you want.  If you clear your cache you do not clear your ISP&#8217;s DNS cache and you will get the same DNS response. </p>
<p>Note that BIND caches DNS information to RAM and not disk. In most cases this will not be a problem since most machines have plenty of memory and old records are purged from memory after a period of time. However, if you expect your server to get a lot of traffic you may want to periodically flush the cache using the following command.<br />
sudo rndc -s localhost flush</p>
<p>or set the maximum amount of memory to use (in essence forcing overflow data to be deleted before it expires) by setting the max-cache-size option in the configuration file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wantlinux.net/2009/04/ubuntu-904-bind-dns-caching-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu Iptables Firewall Script for /etc/init.d</title>
		<link>http://www.wantlinux.net/2009/04/ubuntu-iptables-firewall-script-for-etcinitd/</link>
		<comments>http://www.wantlinux.net/2009/04/ubuntu-iptables-firewall-script-for-etcinitd/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 13:06:27 +0000</pubDate>
		<dc:creator>Darrell</dc:creator>
				<category><![CDATA[Walkthroughs]]></category>

		<guid isPermaLink="false">http://www.wantlinux.net/?p=90</guid>
		<description><![CDATA[I have used alot of diffierent firewall scripts over the years, and I have fell in love with the following script wriiten by Tero Karvinen It is a simple Iptables firewall script and it is easy to maintain. Not alot of variables, and totally customizable. Why would I want anything else. I have below my [...]]]></description>
			<content:encoded><![CDATA[<p>I have used alot of diffierent firewall scripts over the years, and I<br />
have fell in love with the following script wriiten by Tero Karvinen  It<br />
is a simple Iptables firewall script and it is easy to maintain.  Not<br />
alot of variables, and totally customizable.  Why would I want anything<br />
else.  I have below my mail servers Iptables firewall configuration with<br />
a state hitcount to slow down potential spammers, I have it set for a<br />
mail server that accepts 16 messages a second.  That is 1.3 million<br />
emails a day.  So the iptables firewall script works.  Here is how to<br />
install it.</p>
<p>1.) Copy the following lines.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
#!/bin/sh<br />
# Cleanup old rules # All the time firewall is in a secure, closed state<br />
iptables -P INPUT DROP<br />
iptables -P FORWARD DROP<br />
iptables &#8211;flush        # Flush all rules, but keep policies<br />
iptables &#8211;delete-chain<br />
## Workstation Minimal firewall ###<br />
iptables -P FORWARD DROP<br />
iptables -P INPUT DROP<br />
iptables -A INPUT -i lo &#8211;source 127.0.0.1 &#8211;destination 127.0.0.1 -j ACCEPT<br />
iptables -A INPUT -m state &#8211;state &#8220;ESTABLISHED,RELATED&#8221; -j ACCEPT<br />
iptables -A INPUT -p icmp &#8211;icmp-type destination-unreachable -j ACCEPT<br />
iptables -A INPUT -p icmp &#8211;icmp-type time-exceeded -j ACCEPT<br />
iptables -A INPUT -p icmp &#8211;icmp-type echo-request -j ACCEPT<br />
iptables -A INPUT -p icmp &#8211;icmp-type echo-reply -j ACCEPT<br />
####### HOLES ####### Edit holes below, then run this script again<br />
# munin<br />
iptables -A INPUT -p TCP -s 192.168.1.16/32 &#8211;destination-port 4949 -j ACCEPT<br />
# mysql<br />
iptables -A INPUT -p TCP -s 192.168.1.0.0/24 &#8211;destination-port 3306 -j ACCEPT<br />
# nagios<br />
iptables -A INPUT -p TCP -s 192.168.1.16/32 &#8211;destination-port 5666 -j ACCEPT<br />
# sshd<br />
iptables -A INPUT -p TCP -s 192.168.1.0/24 &#8211;destination-port 22 -j ACCEPT<br />
iptables -A INPUT -p TCP -s 10.0.0.0/24 &#8211;destination-port 22 -j ACCEPT<br />
# smtp<br />
iptables -A INPUT -p TCP &#8211;dport 25 -j ACCEPT<br />
iptables -I INPUT -p TCP &#8211;dport 25 -i eth0 -m state &#8211;state NEW -m recent &#8211;set<br />
iptables -I INPUT -p TCP &#8211;dport 25 -i eth0 -m state &#8211;state NEW -m recent &#8211;update &#8211;seconds 600 &#8211;hitcount 45 -j DROP<br />
# pop<br />
iptables -A INPUT -p TCP -s 0/0 &#8211;destination-port 110 -j ACCEPT<br />
# imap<br />
iptables -A INPUT -p TCP -s 0/0 &#8211;destination-port 143 -j ACCEPT<br />
# 587<br />
iptables -A INPUT -p TCP -s 0/0 &#8211;destination-port 587 -j ACCEPT<br />
##################### Edit above<br />
# iptables -A INPUT -j LOG -m limit &#8211;limit 40/minute<br />
iptables -A INPUT -j DROP<br />
# Save<br />
# iptables-save &gt; /etc/sysconfig/iptables<br />
echo &#8220;: Done.&#8221;#!/bin/sh<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
2.) Open /etc/init.d/firewall.sh with your favorite editor.</p>
<p>$ sudo vi /etc/init.d/firewall.sh</p>
<p>3.) Paste script into your editor, and edit the ports to your liking.  Make sure your are in insert mode in vi before you paste.</p>
<p>4.) Change permissions to all execute on the file.</p>
<p>$ sudo chmod 744 /etc/init.d/firewall.sh</p>
<p>5.)  Start the script</p>
<p>$ sudo /etc/init.d/firewall.sh</p>
<p>6.) Add the script to start-up</p>
<p>$ sudo  update-rc.d firewall.sh defaults</p>
<p>Please let me know if you have any questions about this really easy and nice Ubuntu iptables firewall script.  Like I said I have tried a bunch and this is the best iptables firewall script I have found.</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-1842667318455177";
/* wantlinux 234x60 */
google_ad_slot = "7210436948";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>]]></content:encoded>
			<wfw:commentRss>http://www.wantlinux.net/2009/04/ubuntu-iptables-firewall-script-for-etcinitd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu Subinterfaces</title>
		<link>http://www.wantlinux.net/2009/04/ubuntu-subinterfaces/</link>
		<comments>http://www.wantlinux.net/2009/04/ubuntu-subinterfaces/#comments</comments>
		<pubDate>Sun, 12 Apr 2009 11:22:30 +0000</pubDate>
		<dc:creator>Darrell</dc:creator>
				<category><![CDATA[Walkthroughs]]></category>

		<guid isPermaLink="false">http://www.wantlinux.net/?p=69</guid>
		<description><![CDATA[I have found myself searching the internet for the correct configuration for Linux subinterfaces.  A subinterface is a division of one physical interface into multiple logical interfaces.  So why would we do that?  I use subinterfaces for hosting multiple SSL sites, DSR returns for localhost for my load balancers, and anything else you would need [...]]]></description>
			<content:encoded><![CDATA[<p>I have found myself searching the internet for the correct configuration for Linux subinterfaces.  A subinterface is a division of one physical interface into multiple logical interfaces.  So why would we do that?  I use subinterfaces for hosting multiple SSL sites, DSR returns for localhost for my load balancers, and anything else you would need multiple ips on the same physical interface.  In Ubuntu it is easy to add subinterfaces I have never had to add a temporary subinterface in Ubuntu but I guess I figure it is easier to just add it to the system and restart networking.  Here is how to add a Ubuntu subinterface with ifconfig.</p>
<p><strong>Adding a Ubuntu subinterface without restarting networking.</strong></p>
<p>1. Add the interface and ip with one step</p>
<p>$ sudo ifconfig eth0:0 192.168.1.253 netmask 255.255.255.0</p>
<p>2. Turn the ip address up</p>
<p>$ sudo ifconfig eth0:0 up</p>
<p>3.  Check and make sure it is in ifconfig</p>
<p>$ ifconfig -a</p>
<p>eth0      Link encap:Ethernet  HWaddr 00:30:48:28:65:2b<br />
inet addr:192.168.1.5  Bcast:192.168.1.255  Mask:255.255.255.0<br />
inet6 addr: fe80::230:48ff:fe28:652b/64 Scope:Link<br />
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1<br />
RX packets:101278725 errors:10 dropped:0 overruns:0 frame:10<br />
TX packets:96594294 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:1000<br />
RX bytes:3734515707 (3.7 GB)  TX bytes:1773845088 (1.7 GB)</p>
<p>eth0:0    Link encap:Ethernet  HWaddr 00:30:48:28:65:2b<br />
inet addr:192.168.1.253  Bcast:192.168.1.255  Mask:255.255.255.0<br />
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1</p>
<p>4. Remember the subinterface is gone unless you add it to /etc/network/interfaces.</p>
<p><strong>Adding a Ubuntu subinterface permanently.</strong></p>
<p>Now that you have added the subinterface without restarting networking, and or rebooting we need to add the ip address to the configuration file on Ubuntu so the new ip address will be on the system when you do some upgrades and need to reboot</p>
<p>1.  Open the /etc/network/interfaces file with your favorite editor</p>
<p>$ sudo vi /etc/network/interfaces</p>
<p>2. Add the following lines below your physical interface to create the subinterface on reboot.</p>
<p>auto eth0:0<br />
iface eth0:0 inet static<br />
address 192.168.1.253<br />
netmask 255.255.255.0</p>
<p>3. You can always add more Ubuntu subinterfaces by changing eth0:0 to eth0:1 and eth0:2 and so on.</p>
<p>Here is  and example of my complete /etc/network/interfaces file with Ubuntu subinterfaces.</p>
<p># This file describes the network interfaces available on your system<br />
# and how to activate them. For more information, see interfaces(5).</p>
<p># The loopback network interface<br />
auto lo<br />
iface lo inet loopback</p>
<p># The primary network interface<br />
auto eth0<br />
iface eth0 inet static<br />
address 192.168.1.5<br />
netmask 255.255.255.0<br />
network 192.168.1.0<br />
broadcast 192.168.1.255<br />
gateway 192.168.1.1</p>
<p>auto eth0:0<br />
iface eth0:0 inet static<br />
address 66.37.141.237<br />
netmask 255.255.255.0</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wantlinux.net/2009/04/ubuntu-subinterfaces/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Create your own RBL</title>
		<link>http://www.wantlinux.net/2009/03/create-your-own-rbl/</link>
		<comments>http://www.wantlinux.net/2009/03/create-your-own-rbl/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 14:34:36 +0000</pubDate>
		<dc:creator>Darrell</dc:creator>
				<category><![CDATA[Walkthroughs]]></category>

		<guid isPermaLink="false">http://www.wantlinux.net/?p=45</guid>
		<description><![CDATA[I always thought that RBL were a cost effective way to get rid of SPAM. The more email I can drop at the RBL level with postfix the less Spamassassin processing I have to do. Since running spamassassin at a business level requires alot of horsepower and memory I like to clean up the know [...]]]></description>
			<content:encoded><![CDATA[<p>I always thought that RBL were a cost effective way to get rid of SPAM.  The more email I can drop at the RBL level with postfix the less Spamassassin processing I have to do.  Since running spamassassin at a business level requires alot of horsepower and memory I like to clean up the know offenders at the postfix level.  RBL blacklist.  </p>
<p>The first thing you have to do is get a blackhole email built and out on the internet hide it in websites owned by your company with policy statements or whatever you need to help you sleep at night.  Make sure the email has never been used before on your domain, and the email address is working.  For this case I am using postfix maildirs cause it separates the messages for cleaner processing, and filing.</p>
<p>Next install rbldns on ubuntu I am testing out Jaunty Jackalope right now, but it will work for 7.04 and forward.  </p>
<p>sudo apt-get install rbldnsd</p>
<p>sudo vi /etc/default/rbldnsd</p>
<p>If everything is commented add to the bottom of the file.</p>
<p>RBLDNSD=&#8221;dsbl -r/var/lib/rbldns/ -c60 -b10.0.0.1\<br />
   rbl.example.com:ip4set:rbl.example.com.db \</p>
<p>Create db file</p>
<p>echo &#8220;:127.0.0.2:http://www.example.com/removal.php?ip=$&#8221; > /var/lib/rbldnsd/rbl.example.com.db</p>
<p>You can add a url or whatever in the http section I have above.  Next add an ip address or two to the file.  I assume you have a couple if you have gotten this far.</p>
<p>echo &#8220;10.0.0.1&#8243; >> /var/lib/rbldnsd/rbl.example.com.db</p>
<p>and so on and so on.</p>
<p>Restart Rbldnsd</p>
<p>sudo /etc/init.d/rbldnsd</p>
<p>Test Rbl server.</p>
<p>dig 1.0.0.10.rbl.example.com  </p>
<p>I should respond with  something like the following.</p>
<p>$ dig 1.0.0.10.rbl.example.com</p>
<p>; < <>> DiG 9.5.1-P1 < <>> 1.0.0.10.rbl.example.com<br />
;; global options:  printcmd<br />
;; Got answer:<br />
;; ->>HEADER< <- opcode: QUERY, status: NOERROR, id: 62354<br />
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0</p>
<p>;; QUESTION SECTION:<br />
;1.0.0.10.rbl.example.com.   IN      A</p>
<p>;; ANSWER SECTION:<br />
1.0.0.10.rbl.example.com. 2100 IN    A       127.0.0.2</p>
<p>;; AUTHORITY SECTION:<br />
rbl.example.com.        600     IN      NS      rbl.example.com.</p>
<p>;; Query time: 588 msec<br />
;; SERVER: 10.0.0.55#53(10.0.0.55)<br />
;; WHEN: Wed Mar 18 09:53:14 2009<br />
;; MSG SIZE  rcvd: 80</p>
<p>Yay you have a working rbldnsd install.  Now what right.  well remember that email address you setup I bet is has an email.  Maybe?  Well now you just have to extract the senders email address and put it in the /var/lib/rbldnsd/rbl.example.com.db file.</p>
<p>I have a script to automatically extract the ip and add it to the file, but my rbl server can't access my email directory so it is over complicated.  So I will give you the make part of the script.</p>
<p>sudo grep -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' /home/test.example.com/Maildir/new/*|grep -v 127.0.0.1|awk -F[ '{print $2}'|sed s/\]\)//| grep -v 66.37 |grep -v 66.7.175| awk '{print $1}'|sed  s/\]//|grep -v ^$| sed s/\>//|sort| uniq|sort >> /var/lib/rbldns/rbl.example.com.db  </p>
<p>I have a few scripts to clean that up some, but you get the point.  I am going to test sa2dnsbl, but I have the feeling it will block to much.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.wantlinux.net/2009/03/create-your-own-rbl/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>One line command to find Sasl Authenticated users</title>
		<link>http://www.wantlinux.net/2009/03/one-line-command-to-find-sasl-authenticated-users/</link>
		<comments>http://www.wantlinux.net/2009/03/one-line-command-to-find-sasl-authenticated-users/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 19:15:19 +0000</pubDate>
		<dc:creator>Darrell</dc:creator>
				<category><![CDATA[Walkthroughs]]></category>

		<guid isPermaLink="false">http://www.wantlinux.net/?p=42</guid>
		<description><![CDATA[Today I ran into an issue with a hacked email account and of course I use postfix and sasl so I starting writing a grep command for my mail.log. I needed to find how many times each sasl user had logged into the system, and from what ip address. The command to tell how many [...]]]></description>
			<content:encoded><![CDATA[<p>Today I ran into an issue with a hacked email account and of course I use postfix and sasl so I starting writing a grep command for my mail.log. I needed to find how many times each sasl user had logged into the system, and from what ip address.  The command to tell how many times an account has logged in today and from what ip address using postfix standard logs is below.</p>
<p>sudo grep sasl /var/log/mail.log| awk -F[ '{print $3}'| sed s/],//|awk &#8216;{print $1 &#8221; &#8221; $3}&#8217;|awk -F= &#8216;{print $1 &#8221; &#8221; $2}&#8217;|awk &#8216;{print $1 &#8221; &#8221; $3}&#8217;|sort | uniq -c| sort -n</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wantlinux.net/2009/03/one-line-command-to-find-sasl-authenticated-users/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>One Liners for troubleshooting email issues</title>
		<link>http://www.wantlinux.net/2008/06/one-liners-for-troubleshooting-email-issues/</link>
		<comments>http://www.wantlinux.net/2008/06/one-liners-for-troubleshooting-email-issues/#comments</comments>
		<pubDate>Fri, 27 Jun 2008 14:34:24 +0000</pubDate>
		<dc:creator>Darrell</dc:creator>
				<category><![CDATA[Walkthroughs]]></category>

		<guid isPermaLink="false">http://www.wantlinux.net/?p=22</guid>
		<description><![CDATA[Over the years of trying to keep denial of service attacks, and a bunch of other people out there trying to take my server down I have developed some one liners that I would like to share with you. I have one liners on Ubuntu Linux that show the amount of connections incoming to your [...]]]></description>
			<content:encoded><![CDATA[<p>Over the years of trying to keep denial of service attacks, and a bunch of other people out there trying to take my server down I have developed some one liners that I would like to share with you.  I have one liners on Ubuntu Linux that show the amount of connections incoming to your server counts them, and orders them from lowest to highest.</p>
<p>$ netstat -an |grep SERVER_IP:25| awk &#8216;{print $5}&#8217;| awk -F: &#8216;{print $1}&#8217;| sort | uniq -c| sort -n</p>
<p>Example output:<br />
1 192.168.0.1<br />
2 172.31.31.2<br />
3 10.0.0.1<br />
4 10.10.1.5</p>
<p>Here is a one liner that shows the amount of client connections(client=)(email sent) to your postfix server has received in since your last log rotation. Like the previous script this one sorts the IP&#8217;s lowest amount of connections to highest.</p>
<p>$ sudo grep client= /var/log/mail.log|grep -v 127.0.0.1|grep -v sasl| awk -F[ '{print $3}'| sed s/]//g| sort | uniq -c | sort -n</p>
<p>Example output:</p>
<p>1 192.168.0.1<br />
2 172.31.31.2<br />
3 10.0.0.1<br />
4 10.10.1.5</p>
<p>Here is another one line script to sort the amount connections to your postfix server.  It is different then above.  These are connections that are could have sent an email, or not have sent an email.  I like to check this just to see if an ip address is abusing my server without sending email.  Like the last two scripts the output is in order from lowest to highest.</p>
<p>$ sudo grep &#8220;connect from&#8221; /var/log/mail.log| grep -v 127.0.0.1|grep -v disconnect| awk -F[ '{print $3}'| sed s/]//| sort | uniq -c | sort -n</p>
<p>Example output:</p>
<p>1 192.168.0.1<br />
2 172.31.31.2<br />
3 10.0.0.1<br />
4 10.10.1.5</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wantlinux.net/2008/06/one-liners-for-troubleshooting-email-issues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Basic Ubuntu Samba server for the home.</title>
		<link>http://www.wantlinux.net/2008/06/basic-ubuntu-samba-server-for-the-home/</link>
		<comments>http://www.wantlinux.net/2008/06/basic-ubuntu-samba-server-for-the-home/#comments</comments>
		<pubDate>Sat, 14 Jun 2008 15:07:47 +0000</pubDate>
		<dc:creator>Darrell</dc:creator>
				<category><![CDATA[Walkthroughs]]></category>

		<guid isPermaLink="false">http://www.wantlinux.net/?p=21</guid>
		<description><![CDATA[Over the years I have had many samba shares for the house for tv shows I am unable to watch via tv, and I have them all stored on a Linux server with 4 500GB drives in a RAID 5 configuration. I always use 3ware contollers for RAID on Linux. The reasoning for this is [...]]]></description>
			<content:encoded><![CDATA[<p>Over the years I have had many samba shares for the house for tv shows I am unable to watch via tv, and I have them all stored on a Linux server with 4 500GB drives in a RAID 5 configuration.  I always use 3ware contollers for RAID on Linux.  The reasoning for this is that they are hardware RAID which allows me to move the data from one machine to the other easily, and the kernel driver is built into most Linux kernels.  You want to install Ubuntu server with 20 GB for root or / and 100MB for boot or /boot, and the rest of the data in /home.  You can change this up, but just to make is simple I put the 1480GB in /home.  The next step after you have installed Ubuntu server on the machine is to upgrade the server, and install samba and ssh on the server.  Login locally on the Ubuntu server, and type the following to setup Samba.</p>
<p>$ sudo apt-get update<br />
$ sudo apt-get dist-upgrade<br />
$ sudo apt-get install samba openssh-server</p>
<p>If this is your first time using samba you might also want to install Samba SWAT.  Samba SWAT is a web interface on your machine that allows you to install manage Samba via a web interface on port 901.</p>
<p>$ sudo apt-get install swat xinetd</p>
<p>Now that you have everything installed you just have to get the configuration correct.  I have a basic setup that will get you going, and then I will show you how to configure Samba SWAT.  You should be able to get it all working from there.  Make sure your /etc/smb.conf file only contains the following config.</p>
<p>$ vi /etc/samba/smb.conf<br />
# Global parameters<br />
[global]<br />
workgroup = WORKGROUP<br />
server string = Samba<br />
security = SHARE<br />
encrypt passwords = true</p>
<p>[shared]<br />
path = /home/shared<br />
read only = No<br />
guest only = Yes<br />
guest ok = Yes</p>
<p>Save the file, and make the directory in /home.<br />
$ sudo mkdir /home/shared</p>
<p>This configuration will allow everyone to view, and edit files on the Ubuntu server.  Only the files in /home/shared.</p>
<p>To change your configuration using SWAT open a browser, and access the machine in a browser using the following url.</p>
<p>http://IPADDRESS:901</p>
<p>It will ask you to login, and I like to use root, just so I don&#8217;t have any permissions issues.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wantlinux.net/2008/06/basic-ubuntu-samba-server-for-the-home/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ubuntu change sysctl options</title>
		<link>http://www.wantlinux.net/2008/06/ubuntu-change-sysctl-options/</link>
		<comments>http://www.wantlinux.net/2008/06/ubuntu-change-sysctl-options/#comments</comments>
		<pubDate>Fri, 13 Jun 2008 19:07:43 +0000</pubDate>
		<dc:creator>Darrell</dc:creator>
				<category><![CDATA[Walkthroughs]]></category>

		<guid isPermaLink="false">http://www.wantlinux.net/?p=20</guid>
		<description><![CDATA[I sometimes forget what options I need to change to up max open files, and stuff like that. This is a simple page to help me, and hopefully it helps you. To change sysctl options on boot you will have to change the /etc/sysctl.conf, and add whatever options you want to the file. To see [...]]]></description>
			<content:encoded><![CDATA[<p>I sometimes forget what options I need to change to up max open files, and stuff like that.  This is a simple page to help me, and hopefully it helps you.  To change sysctl options on boot you will have to change the /etc/sysctl.conf, and add whatever options you want to the file.  To see your current sysctl options just use sysctl -a like so.</p>
<p>$ sysctl -a</p>
<p>$ vi /etc/sysctl.conf</p>
<p>Here is what you add to max open files, threads, and inodes on your system.<br />
fs.file-max=16384<br />
fs.inode-max = 65536<br />
kernel.threads-max=2048</p>
<p>Here are some sysctl options that I have used before to help the networking on a Linux server.  I have never really been able to really see the difference, but some admins swear by them.  Well we know some people are crazy.  Like windows administrators.  </p>
<p>net.ipv4.tcp_window_scaling = 1<br />
net.ipv4.tcp_syncookies = 1<br />
net.core.rmem_max = 16777216<br />
net.core.wmem_max = 16777216<br />
net.ipv4.tcp_rmem = 4096 87380 16777216<br />
net.ipv4.tcp_wmem = 4096 65536 16777216</p>
<p>After editing your sysctl.conf file you will have to run the following command to update the machine so the options take effect immediately.</p>
<p> $ /sbin/sysctl -p</p>
<p>Well feel free to add comments, and other helpful hints.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wantlinux.net/2008/06/ubuntu-change-sysctl-options/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Set speed and duplex on Ubuntu, and Debian</title>
		<link>http://www.wantlinux.net/2008/06/set-speed-and-duplex-on-ubuntu-and-debian/</link>
		<comments>http://www.wantlinux.net/2008/06/set-speed-and-duplex-on-ubuntu-and-debian/#comments</comments>
		<pubDate>Thu, 12 Jun 2008 18:12:45 +0000</pubDate>
		<dc:creator>Darrell</dc:creator>
				<category><![CDATA[Walkthroughs]]></category>

		<guid isPermaLink="false">http://www.wantlinux.net/?p=19</guid>
		<description><![CDATA[So I was building a server the other day, and had to set the duplex and speed on the machine. I was getting errors on the switch between the eth0. On linux I use mii-tool or ethtool package which allows me to change and view the negotiated speed of eth0, and very useful for forcing [...]]]></description>
			<content:encoded><![CDATA[<p>So I was building a server the other day, and had to set the duplex and speed on the machine.  I was getting errors on the switch between the eth0.  On linux I use mii-tool or ethtool package which allows me to change and view the negotiated speed of eth0, and very useful for forcing specific Ethernet speed and duplex settings.</p>
<p>Your ethernet card might not work with one of the tools, so I suggest you install the both ethtool, and mii-tool.  There are three tasks to get this setup when your machine boots. Install mii-tool and ethtool, change the speed and duples settins, and finally script in /etc/init.d to run at boot.</p>
<p><strong>Install mii-tool and ethtool tools</strong></p>
<p>If you are using Debian or Ubuntu Linux you can install both of these package with following command:# apt-get install ethtool net-tools</p>
<p>Task: Get speed and other information for eth0</p>
<p>Type following command as root user:<br />
$ ethtool eth0<br />
Settings for eth0:<br />
     Supported ports: [ TP MII ]<br />
     Supported link modes:   10baseT/Half 10baseT/Full<br />
                             100baseT/Half 100baseT/Full<br />
     Supports auto-negotiation: Yes<br />
     Advertised link modes:  10baseT/Half 10baseT/Full<br />
                             100baseT/Half 100baseT/Full<br />
     Advertised auto-negotiation: Yes<br />
     Speed: 100Mb/s<br />
     Duplex: Full<br />
     Port: MII<br />
     PHYAD: 32<br />
     Transceiver: internal<br />
     Auto-negotiation: on<br />
     Supports Wake-on: pumbg<br />
     Wake-on: d<br />
     Current message level: 0&#215;00000007 (7)<br />
     Link detected: yes</p>
<p>Or use mii-tool command as follows:<br />
$ mii-tool eth0<br />
eth0: negotiated 100baseTx-FD flow-control, link ok</p>
<p><strong>Change the speed and duplex settings</strong></p>
<p>Setup eth0 negotiated speed with mii-tool<br />
Disable autonegotiation, and force the MII to either 100baseTx-FD, 100baseTx-HD, 10baseT-FD, or 10baseT-HD:<br />
$ mii-tool 10baseT/Half<br />
$ mii-tool 10baseT/Full<br />
$ mii-tool 100baseT/Half<br />
$ mii-tool 100baseT/Full<br />
$ mii-tool 1000baseT/Half<br />
$ mii-tool 1000baseT/Full</p>
<p>Setup eth0 negotiated speed with ethtool<br />
$ ethtool -s eth0 speed 100 duplex full<br />
$ ethtool -s eth0 speed 10 duplex half</p>
<p>To make these settings permanent you need to create a script into the directory /etc/init.d/ directory and run update-rc.d command to update the script.</p>
<p><strong>Install script to make changes permanent</strong></p>
<p>$ vi /etc/init.d/100Mbs<br />
or<br />
$ sudo vi /etc/init.d/100Mbs</p>
<p>#!/bin/sh<br />
ETHTOOL=&#8221;/usr/sbin/ethtool&#8221;<br />
DEV=&#8221;eth0&#8243;<br />
SPEED=&#8221;100 duplex full&#8221;<br />
case &#8220;$1&#8243; in<br />
start)<br />
echo -n &#8220;Setting eth0 speed 100 duplex full&#8230;&#8221;;<br />
$ETHTOOL -s $DEV speed $SPEED;<br />
echo &#8221; done.&#8221;;;<br />
stop)<br />
;;<br />
esac<br />
exit 0</p>
<p>Save and close the file. Setup executable permission:<br />
$ chmod +x /etc/init.d/100Mbs<br />
or<br />
$ sudo chmod +x /etc/init.d/100Mbs</p>
<p>Now run script when Debian or Ubuntu Linux boots up. Use update-rc.d command install System-V style init script links:<br />
$ update-rc.d 100Mbs defaults<br />
or<br />
$ sudo update-rc.d 100Mbs defaultsOutput:</p>
<p> Adding system startup for /etc/init.d/100Mbs &#8230;<br />
   /etc/rc0.d/K20100Mbs -> ../init.d/100Mbs<br />
   /etc/rc1.d/K20100Mbs -> ../init.d/100Mbs<br />
   /etc/rc6.d/K20100Mbs -> ../init.d/100Mbs<br />
   /etc/rc2.d/S20100Mbs -> ../init.d/100Mbs<br />
   /etc/rc3.d/S20100Mbs -> ../init.d/100Mbs<br />
   /etc/rc4.d/S20100Mbs -> ../init.d/100Mbs<br />
   /etc/rc5.d/S20100Mbs -> ../init.d/100Mbs</p>
<p>Reboot the system to take effect or just type scrit name:<br />
$ /etc/init.d/100Mbs start<br />
or<br />
$ sudo /etc/init.d/100Mbs start</p>
<p>Read man page of mii-tool and ethtool for more information.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wantlinux.net/2008/06/set-speed-and-duplex-on-ubuntu-and-debian/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Sending an email via telnet</title>
		<link>http://www.wantlinux.net/2008/06/sending-and-email-via-telnet/</link>
		<comments>http://www.wantlinux.net/2008/06/sending-and-email-via-telnet/#comments</comments>
		<pubDate>Wed, 04 Jun 2008 20:33:38 +0000</pubDate>
		<dc:creator>Darrell</dc:creator>
				<category><![CDATA[Walkthroughs]]></category>

		<guid isPermaLink="false">http://www.wantlinux.net/?p=18</guid>
		<description><![CDATA[I like to test all my new mail servers with telnet making sure they are not open relays, and that the amavis and clamav processes are working correctly. I just check after I send a message in the logs. $ telnet 192.168.0.4 25 RESPONSE 220 192.168.0.4 is a mail server helo wantlinux.net RESPONSE 250 mail.example.com [...]]]></description>
			<content:encoded><![CDATA[<p>I like to test all my new mail servers with telnet making sure they are not open relays, and that the amavis and clamav processes are working correctly.  I just check after I send a message in the logs.</p>
<p>$ telnet 192.168.0.4 25<br />
RESPONSE 220 192.168.0.4 is a mail server<br />
helo wantlinux.net<br />
RESPONSE 250 mail.example.com<br />
mail from:<br />
RESPONSE 250 2.1.0 Ok<br />
rcpt to:<br />
RESPONSE 250 2.1.5 Ok<br />
data<br />
RESPONSE 354 End data with .<br />
Hello webmaster@example.com.  How are you?<br />
sincerely,<br />
webmaster@wantlinux.net<br />
.<br />
RESPONSE 250 2.0.0 Ok: queued as ##########<br />
quit</p>
<p>I thought it was hard to remember all that, but once you use it a few times you will not be looking up this information anymore.  I telnet to email servers all the time for testing purposes, and I have never had an issue.  If you use windows just open up a command prompt, and try the commands.  If it doesn&#8217;t work download a Ubuntu or other Linux image and install it.  Like always leave a comment if you have questions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wantlinux.net/2008/06/sending-and-email-via-telnet/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
