<?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>diginc</title>
	<atom:link href="http://diginc.us/feed/" rel="self" type="application/rss+xml" />
	<link>http://diginc.us</link>
	<description>\'dij-iŋk\</description>
	<lastBuildDate>Fri, 18 Jun 2010 20:17:25 +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>Using IPTables with Dynamic IP hostnames like dyndns.org</title>
		<link>http://diginc.us/2010/05/using-iptables-with-dynamic-ip-hostnames-like-dyndns-org/</link>
		<comments>http://diginc.us/2010/05/using-iptables-with-dynamic-ip-hostnames-like-dyndns-org/#comments</comments>
		<pubDate>Wed, 26 May 2010 15:51:42 +0000</pubDate>
		<dc:creator>diginc</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://diginc.us/?p=172</guid>
		<description><![CDATA[Whenever IPTables has a hostname in a rule it looks up the hostname&#8217;s IP address and uses that instead of the actual hostname &#8211; so it&#8217;s stuck with the IP until the next time IPTables is flushed/restarted. Here&#8217;s a quick &#8230; <a href="http://diginc.us/2010/05/using-iptables-with-dynamic-ip-hostnames-like-dyndns-org/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Whenever IPTables has a hostname in a rule it looks up the hostname&#8217;s IP address and uses that instead of the actual hostname &#8211; so it&#8217;s stuck with the IP until the next time IPTables is flushed/restarted.  Here&#8217;s a quick little python script to stick in a crontab which checks the IP of your dynamic IP hostname (free ones provided by dyndns.org) and will restart iptables if it catches a change in your hostname.  Viewable Source After Jump</p>
<p>I just set this up as root and in root&#8217;s crontab.</p>
<p><a href="/examples/iptables_dyndns_update.py">Download Source</a></p>
<p><span id="more-172"></span></p>
<p><strong>Source:</strong></p>
<pre>#!/usr/bin/python

import os

def gettextoutput(cmd):
    """Return (status, output) of executing cmd in a shell."""
    pipe = os.popen('{ ' + cmd + '; } 2>&#038;1', 'r')
    pipe = os.popen(cmd + ' 2>&#038;1', 'r')
    text = pipe.read()
    if text[-1:] == '\n': text = text[:-1]
    return text

home_dyndns = "example.dyndns.org"
log_dyndns = "./new_home_ip_check.log"
last_dyndns = gettextoutput("cat " + log_dyndns)
cur_dyndns = gettextoutput("host " + home_dyndns)

print "Log: "+ last_dyndns
print "Cur: "+ cur_dyndns

if last_dyndns == cur_dyndns:
    print "IPs match, no restart necessary"
else:
    print "Updating last IP with current"
    os.system("echo '" + cur_dyndns + "' > " + log_dyndns)
    print "Restarting iptables to update"
    os.system("/etc/init.d/iptables restart")
</pre>
<p><strong>Output looks like:</strong></p>
<pre>
Log: example.dyndns.org has address 114.76.37.112
Cur: example.dyndns.org has address 114.76.37.112
IPs match, no restart necessary

Log: example.dyndns.org has address 114.76.37.113
Cur: example.dyndns.org has address 114.76.37.112
Updating last IP with current
Restarting iptables to update
Flushing firewall rules:                                   [  OK  ]
Setting chains to policy ACCEPT: filter                    [  OK  ]
Unloading iptables modules:                                [  OK  ]
Applying iptables firewall rules:                          [  OK  ]
Loading additional iptables modules: ip_conntrack_netbios_n[  OK  ]
</pre>
]]></content:encoded>
			<wfw:commentRss>http://diginc.us/2010/05/using-iptables-with-dynamic-ip-hostnames-like-dyndns-org/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bash Script: Confirm domains in your DNS Bind server are still pointed at your address (haven&#8217;t moved to other DNS)</title>
		<link>http://diginc.us/2010/05/bash-script-confirm-domains-in-your-dns-bind-server-are-still-pointed-at-your-address-havent-moved-to-other-dns/</link>
		<comments>http://diginc.us/2010/05/bash-script-confirm-domains-in-your-dns-bind-server-are-still-pointed-at-your-address-havent-moved-to-other-dns/#comments</comments>
		<pubDate>Fri, 07 May 2010 16:02:13 +0000</pubDate>
		<dc:creator>diginc</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Bind]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://diginc.us/?p=161</guid>
		<description><![CDATA[Here&#8217;s a quick script I wrote last year which I forgot about until today. I thought I should share it since it works fairly well with some modifications &#8211; it could be refined/improved quite a bit; I&#8217;m not the best &#8230; <a href="http://diginc.us/2010/05/bash-script-confirm-domains-in-your-dns-bind-server-are-still-pointed-at-your-address-havent-moved-to-other-dns/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick script I wrote last year which I forgot about until today.  I thought I should share it since it works fairly well with some modifications &#8211; it could be refined/improved quite a bit; I&#8217;m not the best bash/shell scripter.  Be prepared to get your hands dirty with mods if you want to use this.  Here&#8217;s a quick run down &#038; description of what&#8217;s going on.</p>
<p>The script&#8217;s input is the bind9 file containing all zone entries you want to confirm are pointed to your server, I suggest making a copy &#8211; not working with any live configs.  The script will run an lookup using `<code>host -t ns</code>` on google&#8217;s DNS server to find out what the outside world thinks the domains&#8217; name servers are; I tried `<code>whois</code>` in the past but it was too unreliable due to timeouts &#038; limits on the number of calls per minute.  Then it checks the results of that host lookup against the hostnames, all capitalized hostnames, and IP addresses of your DNS servers (3 in my case).  If any one of the DNS servers matches than we know the domain is still using our DNS.  The other options are 1) it doesn&#8217;t find any DNS servers that are ours 2) it finds the phrase &#8216;not found&#8217; which host returns if the domain is expired or there are no &#8216;NS&#8217; type records in DNS.  The script echos to shell what DNS servers match as it runs, but it only logs the DNS servers that don&#8217;t have any matches (so they can be removed by automation or manually later).</p>
<p>With the zone-audit.log output I then can remove the domains that aren&#8217;t using our DNS since they&#8217;re no longer in use.  Please leave feedback in the comments if you think of a good improvement.</p>
<p>Code after the jump or <a href="/examples/confirm-dns-zones.php">Here</a><br />
<span id="more-161"></span></p>
<pre>
#!/bin/bash
#

domains=`sed -n 's/^zone\s*\&quot;\([^\&quot;]*\)\&quot;\s* {[^\r]*/\1/p' /root/confirm-dns-zones/named.master`
date &gt; /root/confirm-dns-zones/zone-audit.log

for i in $domains
do
  echo &quot;Checking $i&quot;
  domain_ns=`host -t ns $i 8.8.8.8 | grep &quot;$i&quot;`
  echo $domain_ns

  if [[ $domain_ns =~ 'NS1.EXAMPLE' || $domain_ns =~ 'ns1.example' || $domain_ns =~ '4.3.2.1' ]]; then
    echo &quot;$i contains DNS1 (4.3.2.1)&quot;
    match_dns1=TRUE
  else
    #echo &quot;DNS1 NOT FOUND&quot;
    match_dns1=FALSE
  fi;

  if [[ $domain_ns =~ 'NS2.EXAMPLE' || $domain_ns =~ 'ns2.example' || $domain_ns =~ '4.3.2.2' ]]; then
    echo &quot;$i contains DNS2 (4.3.2.2)&quot;
    match_dns2=TRUE
  else
    #echo &quot;DNS2 NOT FOUND&quot;
    match_dns2=FALSE
  fi;

  if [[ $domain_ns =~ 'NS3.EXAMPLE' || $domain_ns =~ 'ns3.example' || $domain_ns =~ '4.3.2.3' ]]; then
    echo &quot;$i contains DNS3 (4.3.2.3)&quot;
    match_dns3=TRUE
  else
    #echo &quot;DNS3 NOT FOUND&quot;
    match_dns3=FALSE
  fi;

  if [[ $match_dns1 == FALSE &amp;&amp; $match_dns2 == FALSE &amp;&amp; $match_dns3 == FALSE ]]; then
   echo &quot;* ERROR: $i - None of our DNS found for this domain using 8.8.8.8&quot;
   echo $i &gt;&gt; /root/confirm-dns-zones/zone-audit.log
  fi;

  if [[ $domain_ns =~ 'not found' ]]; then
    echo &quot;* Possible script error or missing DNS / Expired domain&quot;
    echo &quot;* ERROR: $i - Possible script error or missing DNS / Expired domain&quot; &gt;&gt; /root/confirm-dns-zones/zone-audit.log
  fi 

  echo
  echo &quot;----------------&quot;
  echo
  sleep 1
done</pre>
]]></content:encoded>
			<wfw:commentRss>http://diginc.us/2010/05/bash-script-confirm-domains-in-your-dns-bind-server-are-still-pointed-at-your-address-havent-moved-to-other-dns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Encrypt forms&#8217; passwords before submitting with jquery</title>
		<link>http://diginc.us/2010/05/encrypt-forms-passwords-before-submitting-with-jquery/</link>
		<comments>http://diginc.us/2010/05/encrypt-forms-passwords-before-submitting-with-jquery/#comments</comments>
		<pubDate>Wed, 05 May 2010 19:49:07 +0000</pubDate>
		<dc:creator>diginc</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://diginc.us/?p=153</guid>
		<description><![CDATA[If a site&#8217;s login/registration isn&#8217;t encrypted using SSL why would you risk sending a user&#8217;s password in plain text to the form&#8217;s processing script? Because you didn&#8217;t know any better and didn&#8217;t read this how-to, that&#8217;s why. With today&#8217;s average &#8230; <a href="http://diginc.us/2010/05/encrypt-forms-passwords-before-submitting-with-jquery/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If a site&#8217;s login/registration isn&#8217;t encrypted using SSL why would you risk sending a user&#8217;s password in plain text to the form&#8217;s processing script?  Because you didn&#8217;t know any better and didn&#8217;t read this how-to, that&#8217;s why.  With today&#8217;s average computer and connection speed adding a little encryption and downloading small library (in addition to jquery&#8217;s 76k or so) isn&#8217;t a big deal.  Here&#8217;s how I&#8217;m encrypting a password before form submission:</p>
<p><a href="/examples/pre-encrypt-password.php">Browser/Client side password encryption example</a><br />
<a href="/examples/pre-encrypt-password.zip">Download Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://diginc.us/2010/05/encrypt-forms-passwords-before-submitting-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spamato vs SpamBayes [Win7]</title>
		<link>http://diginc.us/2009/10/spamato-vs-spambayes-win7/</link>
		<comments>http://diginc.us/2009/10/spamato-vs-spambayes-win7/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 20:51:54 +0000</pubDate>
		<dc:creator>diginc</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Outlook]]></category>
		<category><![CDATA[Spamato]]></category>
		<category><![CDATA[SpamBayes]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://diginc.us/?p=132</guid>
		<description><![CDATA[Which spam prevention product wins: SpamBayes vs Spamato? SpamBayes is the clear winner in my mind. I used Spamato with my outlook 2007 first and recently switched to Spambayes because Spamato simply wouldn&#8217;t work with Windows 7 even after going &#8230; <a href="http://diginc.us/2009/10/spamato-vs-spambayes-win7/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Which spam prevention product wins: <a href="http://spambayes.sourceforge.net/">SpamBayes</a> vs <a href="www.spamato.net">Spamato</a>?  SpamBayes is the clear winner in my mind.</p>
<p>I used Spamato with my outlook 2007 first and recently switched to Spambayes because Spamato simply wouldn&#8217;t work with Windows 7 even after going through an enormous hassle of <a href="http://saranspot.blogspot.com/2009/02/installing-dotnet-framework-11-on.html">hacking Microsoft&#8217;s .NET Framework 1.1 installer</a> to get it to install in Windows 7.</p>
<p>I&#8217;m really glad I switched, SpamBayes has amazing accuracy when trained with your Spam/Ham folders.  It even has a &#8216;Junk Suspects&#8217; folder which has caught all (1 or 2) my ham messages which is mistook for spam.  I don&#8217;t think any Ham has ended up in the Junk folder unless it was an automated mail/newsletter and those quickly stopped going to junk after useing the &#8216;recovering from spam&#8217; toolbar button to improve training.</p>
<p>I used Spamato for more than a year and it works fairly well, I liked it and recommended it to others.  Every time I recommended it to a non technical person I cringed a little bit after remembering the fact that it requires a couple, not so simple to explain over the phone, prerequisites.</p>
<p>The finite accuracy seems better in SpamBayes and the installation is definitely a hell of a lot easier than Spamato.  </p>
]]></content:encoded>
			<wfw:commentRss>http://diginc.us/2009/10/spamato-vs-spambayes-win7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using fail2ban to open back door ports in your iptables</title>
		<link>http://diginc.us/2009/09/using-fail2ban-to-open-back-doors-ports-in-your-iptables/</link>
		<comments>http://diginc.us/2009/09/using-fail2ban-to-open-back-doors-ports-in-your-iptables/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 21:38:26 +0000</pubDate>
		<dc:creator>diginc</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[auth2accept]]></category>
		<category><![CDATA[auth2allow]]></category>
		<category><![CDATA[fail2accept]]></category>
		<category><![CDATA[fail2allow]]></category>
		<category><![CDATA[fail2ban]]></category>

		<guid isPermaLink="false">http://diginc.us/?p=108</guid>
		<description><![CDATA[The opposite of fail2ban would probably be called auth2allow (authenticate to allow) or fail2allow &#8211; but that&#8217;s not necessary because fail2ban&#8217;s configs can be customized to do exactly what I&#8217;m talking about. What am I talking about you ask? Basically &#8230; <a href="http://diginc.us/2009/09/using-fail2ban-to-open-back-doors-ports-in-your-iptables/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The opposite of <a href="http://www.fail2ban.org">fail2ban</a> would probably be called auth2allow (authenticate to allow) or fail2allow &#8211; but that&#8217;s not necessary because fail2ban&#8217;s configs can be customized to do exactly what I&#8217;m talking about.  What am I talking about you ask?  Basically what I&#8217;ve done and am about to explain how to do is setup fail2ban to look for a successful login on a FTP to allow the authenticated IP to get access to another port that isn&#8217;t as secure as FTP so is usually 100% black listed in IPTables.  It&#8217;s just a hack of a security mechanism to allow your self or others into places securely through obscure means.  Like most security it&#8217;s not perfect but it seems pretty solid in my mind.  </p>
<p>If someone can authenticate on the FTP (could even be anonymous ftp, but I&#8217;d recommend using a special username you want to specifically grant access) then fail2ban triggers an ALLOW command for their IP on some port (or all ports), for example SSH (22) or apache https (443) with a private site on it that you want to keep private and totally hidden from the internet at large.  This concept could really apply to anything.  Any command IPTables can run can be triggered through something fail2ban sees in a log file basically, the possibilities are endless.  In my example I&#8217;ll use https, port 443, but in real life I&#8217;m using an obscure port number and the program running on it that is not very secure by default.</p>
<p>So here are my slightly modified configuration files for setting up a custom fail2ban service that does the opposite of what fail2ban typically does.</p>
<p><span id="more-108"></span></p>
<p>In /etc/fail2bain/jail.conf I added:</p>
<pre>
 [vsftpd2allow443]

 enabled  = true
 port     = 443
 filter   = vsftpd-2-https
 banaction = iptables-accept-https
 logpath  = /var/log/vsftpd.log
 maxretry = 1
 bantime  = -1
</pre>
<p>filter has to match the name of the corresponding file in the <code>/etc/fail2ban/filter.d</code> folder.  banaction has to match the corresponding file in the <code>/etc/fail2ban/action.d</code> folder.  Max retry is 1 so the person doesn&#8217;t need to successfully login to the FTP more than once to get access to our secret port back door.  Bantime -1 should add the person for ever.  For added security try <code>bantime = 86400</code> for 1 days access (bantime uses seconds).</p>
<p>Next make a copy of a default action for a template:</p>
<pre>
 cp -vip /etc/fail2ban/action.d/iptables.conf /etc/fail2ban/action.d/iptables-accept-https.conf
</pre>
<p>Then modify all the DENYs to ACCEPT and change the port:</p>
<pre>
 actionban = iptables -I fail2ban-<name> 1 -s <ip> -j DROP
 # Becomes
 actionban = iptables -I fail2ban-<name> 1 -s <ip> -j ACCEPT

 actionunban = iptables -D fail2ban-<name> -s <ip> -j DROP
 # Becomes
 actionunban = iptables -D fail2ban-<name> -s <ip> -j ACCEPT

 port = ssh
 # Becomes
 port = 443
</pre>
<p>And lastly you need your fail2ban filter that watches vsftpd for successful authenticions of our special user who gets special ports opened up for them.  Since I&#8217;m using vsftpd as my FTP I just copied it&#8217;s current filter and modified it to look for good auths instead of bad auths. </p>
<pre>
 cp -vip /etc/fail2ban/filter.d/vsftpd.conf /etc/fail2ban/filter.d/vsftpd-2-accept-https.conf
</pre>
<p>Change &#8216;<code>specialuser</code>&#8216; to whatever FTP user you want to gain special access to your server.</p>
<pre>
 failregex = vsftpd(?:\(pam_unix\))?(?:\[\d+\])?:.* authentication failure; .* rhost=<HOST>(?:\s+user=\S*)?\s*$
     \[.+\] FAIL LOGIN: Client "<HOST>"\s*$
 # Becomes
 failregex = vsftpd(?:\(pam_unix\))?(?:\[\d+\])?:.* authentication failure; .* rhost=<HOST>(?:\s+user=\S*)?\s*$
     \[specialuser\] OK LOGIN: Client "<HOST>"\s*$
</pre>
<p>If you&#8217;re not using VFTPd then fail2ban has many other popular linux FTP client&#8217;s setup in the filter.d folder.  You should also look in your log file (<code>ls /var/log/*ftp*</code> should find it) to find out what syntax it uses to denote a successful FTP login because it will most likely be different than what VSFTPd uses.</p>
<p>Now you just need to remember the password for your <code>specialuser</code> and you just FTP to your server with that login from any computer in the world to open your hidden port to access your secret content.  This idea is mostly for personal use and I recommend against trying to have any beginner users use this as a mechanism for accessing content or even using it in a serious This slight modification isn&#8217;t revolutionary or anything and I may not be the first to come up with it but it definitely isn&#8217;t a well search indexed idea so I thought I&#8217;d throw this out there for others.</p>
]]></content:encoded>
			<wfw:commentRss>http://diginc.us/2009/09/using-fail2ban-to-open-back-doors-ports-in-your-iptables/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My linux Quake 3 dedicated server setup notes (Ubuntu 9.04 server)</title>
		<link>http://diginc.us/2009/09/my-linux-quake-3-dedicated-server-setup-notes-ubuntu-9-04-server/</link>
		<comments>http://diginc.us/2009/09/my-linux-quake-3-dedicated-server-setup-notes-ubuntu-9-04-server/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 16:18:02 +0000</pubDate>
		<dc:creator>diginc</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://diginc.us/?p=93</guid>
		<description><![CDATA[Not really a tutorial, mostly notes to my self so I remember how it&#8217;s done down the road. adduser q3ds cd /home/q3ds Find linuxq3apoint-1.32b-3.x86.run, wget or upload to the q3ds user folder chmod +x linuxq3apoint-1.32b-3.x86.run ./linuxq3apoint-1.32b-3.x86.run # Returns... # Verifying &#8230; <a href="http://diginc.us/2009/09/my-linux-quake-3-dedicated-server-setup-notes-ubuntu-9-04-server/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Not really a tutorial, mostly notes to my self so I remember how it&#8217;s done down the road.</p>
<p><span id="more-93"></span></p>
<pre>adduser q3ds
cd /home/q3ds
</pre>
<p>Find <a href="http://www.google.com/search?q=linuxq3apoint-1.32b-3.x86.run">linuxq3apoint-1.32b-3.x86.run</a>, wget or upload to the q3ds user folder</p>
<pre>
chmod +x linuxq3apoint-1.32b-3.x86.run
./linuxq3apoint-1.32b-3.x86.run

# Returns...
# Verifying archive integrity...tail: cannot open `+6' for reading: No such file or directory
# Error in check sums 579851737 212141158
# This should fix that error: 

export _POSIX2_VERSION=199209
./linuxq3apoint-1.31.x86.run 

# Returns...
# Verifying archive integrity...OK
# Uncompressing Quake III Arena Point Release 1.31 ..................................................................
# This installation doesn't support glibc-2.0 on Linux / x86_64
# Please contact Id software technical support at bugs@idsoftware.com
# The program returned an error code (1)
# OK, time for another fix:

sudo apt-get install ia32-libs linux32
# ... press Y <enter> to confirm install

# Try again with 32bit emulation

linux32 ./linuxq3apoint-1.31.x86.run 

# Go through the install and change the install path to /home/q3ds/quake3/
</pre>
<p>Copy/FTP baseq3/pak0.pk3 off our CD or backup into your /home/q3ds/quake3/baseq3 folder.</p>
<p>These are my console screens for running q3ded behind the scenes, they&#8217;re setup for my mod of choice &#8211; <a href="http://weaponsfactory.planetquake.gamespy.com/Quake3/">WFA</a> (whose install files are located @ <a href="http://bitblender.net">bitblender.net</a>:</p>
<p>q3start:</p>
<pre>
#!/bin/bash
echo "Starting WFA Server"
sleep 1
cd /home/q3ds/quake3
screen -L -A -m -d -S wfa-server ./q3ded +set fs_game wfa +set dedicated  2 +set sv_pure 0 +set gametype 4 +exec wfa-server.cfg
</pre>
<p>q3stop:</p>
<pre>
#!/bin/sh
screen -dr wfa-server -X quit
echo "Killing off wfa-server...";
</pre>
<p>q3restart:</p>
<pre>
#!/bin/bash
echo "Restarting WFA Server"
sleep 1
/home/q3ds/scripts/q3stop
sleep 1
/home/q3ds/scripts/q3start
</pre>
<p>q3console (ctrl+A+D to detach from console):</p>
<pre>
#!/bin/sh
sudo screen -x wfa-server
</pre>
]]></content:encoded>
			<wfw:commentRss>http://diginc.us/2009/09/my-linux-quake-3-dedicated-server-setup-notes-ubuntu-9-04-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>GNUmp3d init.d with PIDs for running multiple instances of GNUmp3d</title>
		<link>http://diginc.us/2009/09/gnump3d-init-d-with-pids-for-running-multiple-instances-of-gnump3d/</link>
		<comments>http://diginc.us/2009/09/gnump3d-init-d-with-pids-for-running-multiple-instances-of-gnump3d/#comments</comments>
		<pubDate>Sat, 12 Sep 2009 05:07:15 +0000</pubDate>
		<dc:creator>diginc</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[gnump3d]]></category>
		<category><![CDATA[init.d]]></category>
		<category><![CDATA[invoke-rc.d]]></category>
		<category><![CDATA[service]]></category>

		<guid isPermaLink="false">http://diginc.us/?p=73</guid>
		<description><![CDATA[I made some modifications to my original gnump3d init.d script when I needed more than one instance of GNUmp3d running (for multiple folders completely separated). I still haven&#8217;t quite figured out how to get the tag database to work for &#8230; <a href="http://diginc.us/2009/09/gnump3d-init-d-with-pids-for-running-multiple-instances-of-gnump3d/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I made some modifications to my original gnump3d init.d script when I needed more than one instance of GNUmp3d running (for multiple folders completely separated).  I still haven&#8217;t quite figured out how to get the tag database to work for my second GNUmp3d instance, if anyone can help please leave a comment.  Here&#8217;s the script and some brief instructions:</p>
<p><span id="more-73"></span></p>
<p>/etc/init.d/gnump3d :</p>
<pre>
#!/bin/bash

gmconfig="/etc/gnump3d/gnump3d.conf"
gmport="54321"
gmpidfile="/var/run/gnump3d_$gmport.pid"

case "$1" in
start)
  if [ -f $gmpidfile ] ; then
    echo "GNUmp3d already running on port $gmport"
  else
    echo "Starting GNUmp3d."
    /usr/bin/gnump3d --background -config $gmconfig --port $gmport
    sleep 1
    ps -ef | grep -v "grep" | grep "config $gmconfig" | cut -c10-15 > $gmpidfile
  fi
;;
stop)
  if [ -f $gmpidfile ] ; then
    echo "Shutting down GNUmp3d."
    /bin/kill -9 $(cat $gmpidfile)
    rm $gmpidfile
  else
    echo "GNUmp3d isn't running on port $gmport yet"
  fi

;;
restart)
  $0 stop
  $0 start
;;
status)
  if [ -f $gmpidfile ] ; then
    echo "GNUmp3d running on port $gmport with config $gmconfig and pid $(cat $gmpidfile)"
    echo $(ps -ef | grep -v "grep" | grep "config $gmconfig")
    #echo
    # code to display the other instance of gnump3d here...
  else
    echo "GNUmp3d isn't running yet"
  fi
;;
*)
  echo "Usage: $0 {start|stop|restart|status}"
  exit 1
esac

exit 0
</pre>
<p>To run more than one copy of gnump3d with this simply make a copy of this script and call it something like gnump3d_2.</p>
<pre>sudo cp -vip /etc/init.d/gnump3d /etc/init.d/gnump3d_2</pre>
<p>Then change the new init.d script to point to your new config and port (pid file auto updates by port #).</p>
<pre>
gmconfig="/etc/gnump3d/gnump3d_2.conf"
gmport="54322"
</pre>
<p>Make a copy of the stock gnump3d config and modify the necessary lines.</p>
<pre>sudo cp -vip /etc/gnump3d/gnump3d.conf /etc/gnump3d/gnump3d_2.conf</pre>
<p>In my config I modified these lines:</p>
<pre>
port = 54322
root = /home/gnump3d_2
user = gnump3d_2
logfile = /var/log/gnump3d/access_2.log
errorlog = /var/log/gnump3d/error_2.log
now_playing_path = /var/cache/gnump3d_2/serving
tag_cache = /var/cache/gnump3d_2/song.tags
</pre>
<p>And lastly we&#8217;ll need to make the cache drectories:</p>
<pre>mkdir /var/cache/gnump3d_2/
mkdir /var/cache/gnump3d_2/serving
chmod -R 777 /var/cache/gnump3d_2
touch /var/cache/gnump3d_2/song.tags
</pre>
<p>And then you&#8217;re set to startup the second gnump3d instance.</p>
<pre>/etc/init.d/gnump3d_2 start</pre>
]]></content:encoded>
			<wfw:commentRss>http://diginc.us/2009/09/gnump3d-init-d-with-pids-for-running-multiple-instances-of-gnump3d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu SABnzbd+ protected by an apache2 proxy and htpasswd</title>
		<link>http://diginc.us/2009/02/ubuntu-sabnzbd-protected-by-an-apache2-proxy-and-htpasswd/</link>
		<comments>http://diginc.us/2009/02/ubuntu-sabnzbd-protected-by-an-apache2-proxy-and-htpasswd/#comments</comments>
		<pubDate>Sun, 08 Feb 2009 00:00:48 +0000</pubDate>
		<dc:creator>diginc</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[sabnzbd]]></category>
		<category><![CDATA[usenet]]></category>

		<guid isPermaLink="false">http://diginc.us/?p=35</guid>
		<description><![CDATA[Basic SABnzbd+ Setup &#8211; SAB for short. There are plenty of tutorials out there which cover configuring a normal SAB installation so I won&#8217;t cover that here. What I am going to do is make my SAB available through a &#8230; <a href="http://diginc.us/2009/02/ubuntu-sabnzbd-protected-by-an-apache2-proxy-and-htpasswd/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Basic SABnzbd+ Setup</strong> &#8211; SAB for short.</p>
<p>There are plenty of tutorials out there which cover configuring a normal SAB installation so I won&#8217;t cover that here.  What I am going to do is make my SAB available through a web accessible passworded page, this can be accomplished with default SAB features by putting a web username/password in the general configuration section.  However I find it annoying to have to enter the password when I&#8217;m on my internal 192.168 home network just to make it protected from the outside, and I don&#8217;t like the way it presents the username/password prompt in a website form rather than an generic apache pop-up.  I&#8217;m sure open accessibility could be fixed in the SABnzbd+ code but I&#8217;m not a pro python hacker yet so I&#8217;ll just stick to what I know.</p>
<p>Basically I want a generic pop-up password that is only for people outside my network so I&#8217;m not bothered with SAB passwords while at home (And I can&#8217;t get <a href="https://nzbdstatus.bountysource.com/">nzbdStatus</a> to work with a pass enabled).  The htpasswd also acts as a bit of camouflage and additional security.  There are some concepts which aren&#8217;t covered here which are required, you need to know how to configure your own SAB servers, Portforwarding or Firewall/iptables.</p>
<p>If you&#8217;re using a router, you&#8217;re going to want to make sure you&#8217;re not port forwarding the default SAB port of 8080 (which would make it wide open) and only are forwarding the apache2 port you setup for the SAB proxy.  If you&#8217;re not on an internal IP subnet and have a static IP assigned directly to the linux machine you&#8217;re doing this on then I expect you have enough knowledge of IPTables to block the SAB port and allow the proxy port.</p>
<p><span id="more-35"></span></p>
<p><strong>SABnzbd Daemon (optional)</strong></p>
<p>Download the latest SABnzbd version from http://www.sabnzbd.org/download/ to your favorite place to install python apps and optionally install a deamon to auto start SAB: <a href="http://artur.hefczyc.net/node/10">http://artur.hefczyc.net/node/10</a>.  Mine is modified to include a restart command:</p>
<p><code><br />
#!/bin/sh<br />
# Source: http://sabnzbd.wikidot.com/install-as-a-unix-daemon<br />
case "$1" in<br />
start)<br />
echo "Starting SABnzbd."<br />
/usr/bin/sudo -u sabuser -H /usr/local/src/SABnzbd/SABnzbd.py -d -f /home/sabuser/.sabnzbd/sabnzbd.ini<br />
;;<br />
stop)<br />
echo "Shutting down SABnzbd."<br />
/usr/bin/wget -q --delete-after "http://localhost:8080/sabnzbd/api?mode=shutdown"<br />
;;<br />
restart)<br />
$0 stop<br />
$0 start<br />
;;<br />
*)<br />
echo "Usage: $0 {start|stop|restart}"<br />
exit 1<br />
esac<br />
exit 0<br />
</code><br />
At this point I&#8217;ll assume you have a working sabnzbd installation and have tested to confirm it&#8217;s working.</p>
<p><code>vi /home/sabuser/.sabnzbd/sabnzbd.ini</code><br />
Change <code>host = localhost</code> to <code>host = 192.168.0.53</code> to make it accessible from elsewhere besides the box running SAB.<br />
That&#8217;s all you need to do with SAB other than configure servers and preferences.</p>
<p><strong>Apache Proxy Setup</strong><br />
<code><br />
apt-get install apache2<br />
htpasswd -c /usr/local/src/SABnzbd/.htpasswd username # Enter your password when prompted<br />
a2enmod proxy<br />
a2enmod proxy_http<br />
a2enmod proxy_html</code></p>
<p>Ubuntu mod_proxy Denies all but default so you&#8217;ll need to make a similar modification to what follows &#8211; see your Apache error files for something like  if your proxy isn&#8217;t working.  You can either change <code>Deny from all</code> to <code>Allow from all</code> if you expect to be using it from any external IP address or individual IPs you&#8217;ll expect needing access (work IP).  In my case 192.168.0.1 port forwards so that&#8217;s the only one I need but I put in my entire internal subnet for testing purposes.<br />
<code>vi /etc/apache2/mods-enabled/proxy.conf</code><br />
<code>&lt;Proxy *&gt;<br />
  AddDefaultCharset off<br />
  Order deny,allow<br />
  Deny from all<br />
  Allow from 192.168.0.0/24<br />
&lt;Proxy&gt;</code></p>
<p>Add something like this to your apache2 vhost config (logs are optional)<br />
<code>vi /etc/apache2/conf.d/vhosts.conf</code><br />
<code><br />
Listen 8001 # Use whatever port you want, I usually use obscure ports that aren't regularly scanned.<br />
NameVirtualHost 192.168.0.53:8001  # Change 192.168.0.53 to whatever your SAB server's IP is (make sure it's static too).<br />
</code><code><br />
&lt;VirtualHost 192.168.0.53:8001&gt;<br />
ServerName sabuser.dyndns.org # Enter your hostname or <strong>static</strong> IP address here.  I use dyndns.org since I have a dynamic IP<br />
ProxyPass /sabnzbd http://192.168.0.53:8080/sabnzbd/<br />
ProxyPassReverse /sabnzbd http://192.168.0.53:8080/sabnzbd/<br />
ProxyPreserveHost On<br />
# Password Protect the external proxy only.<br />
&lt;Location /sabnzbd&gt;<br />
AuthUserFile /usr/local/src/SABnzbd/.htpasswd<br />
AuthName "Authenticate Yourself."<br />
AuthType Basic<br />
Require valid-user<br />
&lt;/Location&gt;<br />
# Alternate method, requires rewrite mod:<br />
#RewriteEngine   on<br />
#RewriteRule     (.*) http://192.168.0.53:8080/sabnzbd/$1 [P]<br />
&lt;/VirtualHost&gt;<br />
</code></p>
<p>References</p>
<p># Apache Proxy<br />
<a href="http://snippets.dzone.com/posts/show/1318">http://snippets.dzone.com/posts/show/1318</a><br />
<a href="http://mail-archives.apache.org/mod_mbox/httpd-users/200307.mbox/%3C20030723191854.43885.qmail@web40903.mail.yahoo.com%3E">http://mail-archives.apache.org/mod_mbox/httpd-users/200307.mbox/%3C20030723191854.43885.qmail@web40903.mail.yahoo.com%3E</a><br />
<a href="http://httpd.apache.org/docs/2.2/mod/mod_proxy.html">http://httpd.apache.org/docs/2.2/mod/mod_proxy.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://diginc.us/2009/02/ubuntu-sabnzbd-protected-by-an-apache2-proxy-and-htpasswd/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>MRTG Indexmaker Interface + Description</title>
		<link>http://diginc.us/2009/02/mrtg-indexmaker-interface-description/</link>
		<comments>http://diginc.us/2009/02/mrtg-indexmaker-interface-description/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 23:26:59 +0000</pubDate>
		<dc:creator>diginc</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://diginc.us/uncategorized/mrtg-indexmaker-interface-description/</guid>
		<description><![CDATA[I like to have interfaces and description, not one or the other. So I do this. Use your favorite editor to open indexmaker: vi /usr/bin/indexmaker Find this part: for ($$opt{section}) { # ...Skip ahead to descr... /^descr(iption)?$/ &#038;&#038; do{ $section &#8230; <a href="http://diginc.us/2009/02/mrtg-indexmaker-interface-description/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I like to have interfaces and description, not one or the other.  So I do this.  Use your favorite editor to open indexmaker: <code>vi /usr/bin/indexmaker</code></p>
<p>Find this part:<br />
<code><br />
for ($$opt{section}) {<br />
#    ...Skip ahead to descr...<br />
            /^descr(iption)?$/ &#038;&#038;<br />
              do{<br />
                  $section = "No Description for $item";<br />
                  $$rcfg{setenv}{$item} =~ /MRTG_INT_DESCR="(.+?)"/  #"<br />
                        and $section = $1;<br />
                  $$rcfg{pagetop}{$item} =~<br />
                          m,&lt;td>Description:&lt;/td&gt;\s*&lt;td&gt;\Q$section\E\s*([^&lt; ][^&gt;]+?)</td>
<p>,i<br />
                        and $section = $1;<br />
                  last;<br />
              };<br />
</code></p>
<p>The first &#8220;<code>and $section = $1;</code>&#8221; is a catch all to assign the interface name if there&#8217;s no description.  The second one overwrites it, replacing the int name if it does find a description.  So all you need to do is modify the second instance of &#8220;and $section = $1;&#8221;  to:</p>
<p><code>and $section = $section . " - " . $1;</code></p>
<p>And your MRTG index is infinitely improved!</p>
]]></content:encoded>
			<wfw:commentRss>http://diginc.us/2009/02/mrtg-indexmaker-interface-description/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Outlook 2007: None of the Authentication Methods Supported By This Client Are Supported By Your Server</title>
		<link>http://diginc.us/2009/02/outlook-2007-none-of-the-authentication-methods-supported-by-this-client-are-supported-by-your-server/</link>
		<comments>http://diginc.us/2009/02/outlook-2007-none-of-the-authentication-methods-supported-by-this-client-are-supported-by-your-server/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 22:17:04 +0000</pubDate>
		<dc:creator>diginc</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Bug by Design]]></category>
		<category><![CDATA[Outlook 2007]]></category>
		<category><![CDATA[Outlook 2k7]]></category>
		<category><![CDATA[SMTP Authentication]]></category>

		<guid isPermaLink="false">http://diginc.us/?p=42</guid>
		<description><![CDATA[Can&#8217;t send from certain locations and keep having to turn on/off outgoing server SMTP Authentication in outlook 2007? You might see this error too: &#8220;None of the Authentication Methods Supported By This Client Are Supported By Your Server&#8221; My Answer: &#8230; <a href="http://diginc.us/2009/02/outlook-2007-none-of-the-authentication-methods-supported-by-this-client-are-supported-by-your-server/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Can&#8217;t send from certain locations and keep having to turn on/off outgoing server SMTP Authentication in outlook 2007?  You might see this error too: &#8220;<strong>None of the Authentication Methods Supported By This Client Are Supported By Your Server</strong>&#8221;</p>
<p>My Answer:  Goto Email Accounts, Change the problem account, More Settings, Outgoing Server tab, and check outgoing server require authentication and choose &#8220;Log on to incoming mail server before sending mail&#8221; instead of &#8220;Use same settings as incoming&#8221; &#8211; Outlook 2007 is the first and only mail program to require any of our mail servers to use this setting.  So far I&#8217;ve only confirmed the problem to be on older sendmail servers.  There can be other solutions to this error message but this is one I find most often resolves it.</p>
<p>The Question:  As a systems administrator I take calls for our tech support queue and one user called with a really odd problem.  Basically it&#8217;s detailed here:</p>
<p>http://thepursuitofalife.com/outlook-2007-error-none-of-the-authentication-methods-supported-by-this-client-are-supported-by-your-server/</p>
<p>Like the above link describes the user would have to disable SMTP auth in certain locations (That&#8217;s a workaround, not the solution), even though all our servers require SMTP authentication.  The above link eventually shares the true solution but it&#8217;s buried under many comments thanking the poster for the work around.  So I decided to help fellow googlers by making this post.</p>
<p>Update: Comments about other people&#8217;s experience with this error made me want to add my further experience with it.  I&#8217;ve seen this error a lot more often since I first made this post and am convinced it&#8217;s really some sort of bug with Outlook 2007.  Some people cannot get rid of the error and have to continually switch between &#8220;Log on to incoming mail server before sending mail&#8221; and &#8220;Use same settings as incoming&#8221; to keep outlook sending correctly.   Whereas if they switch to Windows Mail (The Vista and Windows 7 equivalent of outlook express) they never need to do anything but set &#8216;use same settings as incoming&#8217; and never have any problem sending.  If it&#8217;s not a &#8217;2007 Bug&#8217; then it&#8217;s definitely a Outlook 2007 incompatibility with certain MTAs &#8211; specifically (maybe just older) sendmail &#8211; our postfix servers don&#8217;t seem to have this bug, but like I just said only 2007 has this incompatibility so you can&#8217;t entirely blame sendmail.</p>
]]></content:encoded>
			<wfw:commentRss>http://diginc.us/2009/02/outlook-2007-none-of-the-authentication-methods-supported-by-this-client-are-supported-by-your-server/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>
