<?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>I can has weblog? &#187; scripting</title>
	<atom:link href="http://justin-hopkins.com/blog/category/scripting/feed" rel="self" type="application/rss+xml" />
	<link>http://justin-hopkins.com/blog</link>
	<description>The thoughts and works of Justin Hopkins.</description>
	<lastBuildDate>Wed, 23 Jun 2010 15:32:23 +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>You know what rocks? This fetchmail init script for Red Hat!</title>
		<link>http://justin-hopkins.com/blog/2010/06/23/you-know-what-rocks-this-fetchmail-init-script-for-red-hat</link>
		<comments>http://justin-hopkins.com/blog/2010/06/23/you-know-what-rocks-this-fetchmail-init-script-for-red-hat#comments</comments>
		<pubDate>Wed, 23 Jun 2010 15:31:08 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[scripting]]></category>
		<category><![CDATA[fetchmail]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://justin-hopkins.com/blog/2010/06/23/you-know-what-rocks-this-fetchmail-init-script-for-red-hat</guid>
		<description><![CDATA[This is from the contrib directory of the fetchmail source and is much better than what Google gives you. #!/bin/sh # # fetchmail This shell script takes care of starting and stopping # fetchmail. # # chkconfig: 2345 81 45 # description: The Fetchmail daemons allows to retrieve mail using various # mail protocols and [...]]]></description>
			<content:encoded><![CDATA[<p>This is from the contrib directory of the fetchmail source and is much better than what Google gives you.</p>



<pre>
<code>
#!/bin/sh
#
# fetchmail	This shell script takes care of starting and stopping
#		fetchmail.
#
# chkconfig: 2345 81 45
# description: The Fetchmail daemons allows to retrieve mail using various
#	       mail protocols and route them to the local MTA just as if
#	       the mail was sent directly to the local MTA. This is
#	       specially useful on intermittent dial-up connections.
# processname: fetchmail
# config: /etc/fetchmailrc
# author[s]:
#	Andrea Sterbini	&lt;a .sterbini@itelcad.it&gt;
#	ObiTuarY &lt;obituary @freshmeat.net&gt;

. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
if [ ${NETWORKING} = &quot;no&quot; ]
then
	exit 0
fi 
    
# See how we were called.
case &quot;$1&quot; in
  start)
	if [ -s /etc/fetchmailrc ]; then
		echo -n &quot;Loading fetchmail: &quot;
		daemon /usr/bin/fetchmail -f /etc/fetchmailrc
		echo
		touch /var/lock/subsys/fetchmail
	else
		exit 1
	fi
	;;
  stop)	
	echo -n &quot;Shutting down fetchmail: &quot;
	/usr/bin/fetchmail -q &gt;/dev/null 2&gt;&amp;1 &amp;&amp; echo fetchmail
#	killproc fetchmail
	rm -f /var/lock/subsys/fetchmail
	;;
  status)
        status fetchmail
        ;;
  restart|reload)
        $0 stop
        $0 start
        ;; 
	*)
	echo &quot;Usage: fetchmail {start|stop|status|restart|reload}&quot;
	exit 1
esac

exit 0

# === End of File ===
&lt;/obituary&gt;&lt;/a&gt;</code>
</pre>]]></content:encoded>
			<wfw:commentRss>http://justin-hopkins.com/blog/2010/06/23/you-know-what-rocks-this-fetchmail-init-script-for-red-hat/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to get a .csv of subscribers on all your Mailman lists</title>
		<link>http://justin-hopkins.com/blog/2009/05/16/how-to-get-a-csv-of-subscribers-on-all-your-mailman-lists</link>
		<comments>http://justin-hopkins.com/blog/2009/05/16/how-to-get-a-csv-of-subscribers-on-all-your-mailman-lists#comments</comments>
		<pubDate>Sat, 16 May 2009 17:16:33 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[Mailman]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://justin-hopkins.com/blog/?p=185</guid>
		<description><![CDATA[The boss asked me to create a list of everyone subscribed to every discussion list we have. Ended up being like 3000 lines&#8230;luckly there is a python script that polls the mailman admin web interface. The below script makes it quite a bit easier to perform on all the lists. First thing, you need a [...]]]></description>
			<content:encoded><![CDATA[<p>The boss asked me to create a list of everyone subscribed to every discussion list we have. Ended up being like 3000 lines&#8230;luckly there is a python script that polls the mailman admin web interface. The below script makes it quite a bit easier to perform on all the lists.</p>

<p>First thing, you need a file with all of your list names &#8211; this works:</p>


<pre>
ls /usr/local/mailman/lists | cat &gt; lists.txt ## This is where mailman is located on FreeBSD
</pre>



<p>Next, download <a href="http://www.msapiro.net/mailman-subscribers.py" title="Mailman Subscribers Script">mailman-subscribers.py</a> to your home directory.</p>

<p>Finally, you need to create a shell script (i.e. getallsubscribers.sh) and paste the following (substitute the [[bracketed text]] with the info for your system):</p>


<pre>
while read line
do
 echo $line | cat &gt;&gt; listsAndMembers.csv
  ~/mailman-subscribers.py -c [[your.mailman.host]] $line [[listAdminPassword]] | cat &gt;&gt; listsAndMembers.csv
  echo | cat &gt;&gt; listsAndMembers.csv
  echo | cat &gt;&gt; listsAndMembers.csv
done &lt; lists.txt
</pre>



Now make the file executable and run it:<br />
</pre>

<pre>
chmod +x getallsubscribers.sh
./getallsubscribers.sh
</pre>



<p>That's it. You should have a single file with all of your lists and their subscribers.</p>

<p><strong>edit:</strong> It came up later that it would be nice to get a list of who from each domain was subscribed. This regex will turn up the listname and name/email for each subscriber in the .csv</p>


<pre>
(?:.*(?:gmail\.com)&quot;|^[^&quot;].*$)
</pre>]]></content:encoded>
			<wfw:commentRss>http://justin-hopkins.com/blog/2009/05/16/how-to-get-a-csv-of-subscribers-on-all-your-mailman-lists/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
