<?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>Andrea Veri&#039;s Blog &#187; Debian</title>
	<atom:link href="http://blogs.gnome.org/woody/category/debian/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.gnome.org/woody</link>
	<description>woody&#039;s home</description>
	<lastBuildDate>Sat, 12 May 2012 18:31:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Nagios XMPP Notifications for GTalk</title>
		<link>http://blogs.gnome.org/woody/2012/02/18/nagios-xmpp-notifications-for-gtalk/</link>
		<comments>http://blogs.gnome.org/woody/2012/02/18/nagios-xmpp-notifications-for-gtalk/#comments</comments>
		<pubDate>Sat, 18 Feb 2012 12:03:00 +0000</pubDate>
		<dc:creator>Andrea Veri</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[Planet Fedora]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/woody/?p=286</guid>
		<description><![CDATA[While improving GNOME&#8217;s servers Nagios Notifications,  I ended up working on a nice way to notify the relevant folks through GTalk in case something could go wrong on any of the hosted services. Looking around on the web, I found Seth Vidal&#8217;s script, modified it to suit my needs and made it working with GTalk, [...]]]></description>
			<content:encoded><![CDATA[<p>While improving GNOME&#8217;s servers Nagios Notifications,  I ended up working on a nice way to notify the relevant folks through GTalk in case something could go wrong on any of the hosted services. Looking around on the web, I found Seth Vidal&#8217;s <a href="http://skvidal.fedorapeople.org/misc/xmppsend.py">script</a>, modified it to suit my needs and made it working with GTalk, here&#8217;s the result:</p>
<pre>#!/usr/bin/python -tt

import warnings
warnings.simplefilter("ignore")

import xmpp
from xmpp.protocol import Message

from optparse import OptionParser
import ConfigParser
import sys
import os

parser = OptionParser()
opts, args = parser.parse_args()

if len(args) &lt; 1:
    print "xmppsend message [to whom, multiple args]"
    sys.exit(1)

msg = args[0]

msg = msg.replace('\\n', '\n')

# Connect to the server
c  =  xmpp.Client('gmail.com')
c.connect( ( 'talk.google.com', 5223 ) )

# Authenticate to the server
jid  =  xmpp.protocol.JID( 'example@gmail.com' )
c.auth( jid.getNode( ), 'yourgmailpassword' )

if len(args) &lt; 2:
    r = c.getRoster()
    for user in r.keys():
        if user == username:
            continue
        c.send(Message(user, '%s' % msg))
else:
    for user in args[1:]:
        c.send(Message(user, '%s' % msg))</pre>
<p>I, then, added the command definitions on the relevant Nagios configuration file:</p>
<pre>define command{
        command_name    host-notify-by-xmpp
        command_line    /home/user/bin/xmppsend "Host '$HOSTALIAS$' is $HOSTSTATE$ - Info : $HOSTOUTPUT$" $CONTACTPAGER$
        }

define command{
        command_name    notify-by-xmpp
        command_line    /home/user/bin/xmppsend "$NOTIFICATIONTYPE$ $HOSTNAME$ $SERVICEDESC$ $SERVICESTATE$ $SERVICEOUTPUT$ $LONGDATETIME$" $CONTACTPAGER$
        }</pre>
<p>And in the end on <strong>contacts.cfg</strong>:</p>
<pre>define contact {
        contact_name    admin
        use             generic-contact
        alias           Full Name
        email           example@gmail.com
        pager           example@gmail.com
        service_notification_commands   notify-by-xmpp
        host_notification_commands      host-notify-by-xmpp
}</pre>
<p>When done just reload the configuration files with:</p>
<pre>sudo /etc/init.d/nagios3 reload</pre>
<p>Enjoy your new XMPP Nagios notifications!</p>
<p><strong>Update:</strong> if you don&#8217;t want the script to store your username or password, you can use the following modified <a href="http://people.gnome.org/~av/xmppsend">script</a> together with a nice config file like this one:</p>
<pre>
[xmpp_nagios]
username=example@gmail.com
password=yourgmailpassword
</pre>
<p>Then you can invoke <strong>xmppsend</strong> this way:</p>
<pre>
xmppsend -a config.ini
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/woody/2012/02/18/nagios-xmpp-notifications-for-gtalk/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>A few useful Puppet snippets</title>
		<link>http://blogs.gnome.org/woody/2012/01/31/a-few-useful-puppet-snippets/</link>
		<comments>http://blogs.gnome.org/woody/2012/01/31/a-few-useful-puppet-snippets/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 19:43:26 +0000</pubDate>
		<dc:creator>Andrea Veri</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[Planet Fedora]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/woody/?p=274</guid>
		<description><![CDATA[I&#8217;ve been playing with Puppet lately both on my home network and within the Fedora&#8217;s Infrastructure team and I thought some of the work I did might be useful for anyone out there being stuck with a Puppet&#8217;s manifest or an ERB template. Snippet #1: Make sure the user &#8216;foo&#8217; is alwais created with its [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been playing with <strong><a href="http://puppetlabs.com">Puppet</a></strong> lately both on my home network and within the Fedora&#8217;s Infrastructure team and I thought some of the work I did might be useful for anyone out there being stuck with a Puppet&#8217;s manifest or an ERB template.</p>
<p><strong>Snippet #1</strong>: Make sure the user <strong>&#8216;foo&#8217;</strong> is alwais created with its own home directory, password, shell, and full name.</p>
<pre>class users {
    users::add { "foo":
        username        =&gt; 'foo',
        comment         =&gt; 'Foo's Full Name',
        shell           =&gt; '/bin/bash',
        password_hash   =&gt; 'pwd_hash_as_you_can_see_in_/etc/shadow'
    }

define users::add($username, $comment, $shell, $password_hash) {
    user { $username:
        ensure =&gt; 'present',
        home   =&gt; "/home/${username}",
        comment =&gt; $comment,
        shell  =&gt; $shell,
        managehome =&gt; 'true',
        password =&gt; $password_hash,
    }
  }<strong></strong>
}</pre>
<p><strong>Snippet #2:</strong> Make sure the user <strong>&#8216;foo&#8217;</strong> gets added into <strong>/etc/sudoers</strong>.</p>
<pre>class sudoers {

file { "/etc/sudoers":
      owner   =&gt; "root",
      group   =&gt; "root",
      mode    =&gt; "440",
     }
}

augeas { "addfootosudoers":
  context =&gt; "/files/etc/sudoers",
  changes =&gt; [
    "set spec[user = 'foo']/user foo",
    "set spec[user = 'foo']/host_group/host ALL",
    "set spec[user = 'foo']/host_group/command ALL",
    "set spec[user = 'foo']/host_group/command/runas_user ALL",
  ],
}</pre>
<p><strong>Snippet #3:</strong> Make sure that <strong>openssh-server</strong> is: installed, running on Port 222 and accepting <strong>RSA </strong>authentications only.</p>
<pre>class openssh-server {

  package { "openssh-server":
      ensure =&gt; "installed",
  }

    service { "ssh":
        ensure    =&gt; running,
        hasstatus =&gt; true,
        require   =&gt; Package["openssh-server"],
    }

augeas { "sshd_config":
  context =&gt; "/files/etc/ssh/sshd_config",
    changes =&gt; [
    "set PermitRootLogin no",
    "set RSAAuthentication yes",
    "set PubkeyAuthentication yes",
    "set AuthorizedKeysFile	%h/.ssh/authorized_keys",
    "set PasswordAuthentication no",
    "set Port 222",
  ],
 }
}</pre>
<p><strong>Snippet #4:</strong> Don&#8217;t apply a specific <strong>IPTABLES </strong>rule if an host is tagged as &#8216;staging&#8217; in the relevant node file.</p>
<p>On <strong>templates/iptables.erb</strong>:</p>
<pre># Allow unlimited traffic on eth0
-A INPUT -i eth0 -j ACCEPT
-A OUTPUT -o eth0 -j ACCEPT

# Allow unlimited traffic from trusted IP addresses
-A INPUT -s 192.168.1.1/24 -j ACCEPT

&lt;% if environment == "production" %&gt;

-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

&lt;% unless defined?(staging).nil? %&gt;
-A INPUT -s X.X.X.X -j REJECT --reject-with icmp-host-prohibited
&lt;% end -%&gt;

&lt;% end -%&gt;</pre>
<p>On the <strong>manifest</strong> file:</p>
<pre>
class iptables {
    package { iptables:
        ensure =&gt; installed;
    }

    service { "iptables":
        ensure    =&gt; running,
        hasstatus =&gt; true,
        require   =&gt; Package["iptables"],
    }

    file { "/etc/sysconfig/iptables":
        owner   =&gt; "root",
        group   =&gt; "root",
        mode    =&gt; 644,
        content =&gt; template("iptables/iptables.erb"),
        notify  =&gt; Service["iptables"],
    }
}</pre>
<p>That&#8217;s all for now!</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/woody/2012/01/31/a-few-useful-puppet-snippets/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>A few other additions to my Mutt and Desktop setup!</title>
		<link>http://blogs.gnome.org/woody/2011/09/11/a-few-other-additions-to-my-mutt-and-desktop-setup/</link>
		<comments>http://blogs.gnome.org/woody/2011/09/11/a-few-other-additions-to-my-mutt-and-desktop-setup/#comments</comments>
		<pubDate>Sun, 11 Sep 2011 19:25:32 +0000</pubDate>
		<dc:creator>Andrea Veri</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/woody/?p=207</guid>
		<description><![CDATA[A few days ago I blogged about my main computer&#8217;s configuration files and desktop&#8217;s appearance and today I managed to add a few little tweaks to those, they are: Google&#8217;s contacts list integrated into Mutt a cleaner and nicer Login screen Curious to know how you can easily integrate your Google&#8217;s contacts into Mutt? Well, [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago I <a href="http://blogs.gnome.org/woody/2011/09/04/new-desktop-mutt-and-irssi-setup/" target="_blank">blogged</a> about my main computer&#8217;s configuration files and desktop&#8217;s appearance and today I managed to add a few little tweaks to those, they are:</p>
<ul>
<li>Google&#8217;s <a href="https://www.google.com/contacts" target="_blank">contacts list</a> integrated into Mutt</li>
<li>a cleaner and nicer Login screen</li>
</ul>
<p>Curious to know how you can easily integrate your Google&#8217;s contacts into Mutt? Well, you should be able to achieve that within a few minutes after reading this small <strong>HowTo</strong>:</p>
<p><strong>1.</strong> Download and install <strong>goobook</strong> as explained <a href="http://pypi.python.org/pypi/goobook/1.3a1#source-installation" target="_blank">here</a>.</p>
<p><strong>2.</strong> Setup a<strong> <em>.goobookrc</em></strong> file into your Home directory. It should look like this:</p>
<div>
<blockquote>
<pre>machine google.com
 login example@gmail.com
 password yourpassword</pre>
</blockquote>
</div>
<p><span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size: 13px;line-height: 19px"><strong>3.</strong> Add the relevant configuration bits into your <strong><em>/etc/Muttrc</em></strong> file:</span></p>
<blockquote>
<pre>set query_command="goobook query '%s'"
bind editor &lt;Tab&gt; complete-query
macro index,pager a "&lt;pipe-message&gt;goobook add&lt;return&gt;" "Add sender's address to your Google contacts"</pre>
</blockquote>
<p><strong>4.</strong> Your configuration should be good to go now, so here&#8217;s a few examples on goobook&#8217;s <strong>usage</strong> within Mutt:</p>
<ul>
<li>Use <strong>TAB</strong> if you want to auto-complete a mail address when specifying the <strong>To:</strong> field.</li>
<li>Use the <strong>A</strong> key if you want to add sender&#8217;s address to your Google contacts.</li>
<li>Use the <strong>Q</strong> key for querying your contacts list.</li>
</ul>
<p>We can now move on on customizing your Login Screen running GDM3. Let&#8217;s begin with a <strong>screenshoot</strong>:</p>
<p><a href="http://blogs.gnome.org/woody/files/2011/09/login_screen.png"><img class="alignnone size-full wp-image-208" src="http://blogs.gnome.org/woody/files/2011/09/login_screen.png" alt="" width="475" height="359" /></a></p>
<p>I definitely love it, it&#8217;s <strong>clear</strong> and <strong>clean</strong> and most of all it has everything I need, no extra toolbars or menus. If you agree with me, open up the <strong><em>/etc/gdm3/greeter.gconf-defaults</em></strong> file and do the needed changes. This is how your greeter.gconf-defaults file should look like:</p>
<blockquote>
<pre>/desktop/gnome/background/picture_filename      /path/to/your/dusty-bg/file # dusty's background can be downloaded <a href="http://gnome-look.org/content/show.php/Dusty?content=94332" target="_blank">here</a>.
/desktop/gnome/interface/gtk_theme              Darklooks # this is my main theme, feel free to adapt that to your needs.
/apps/gdm/simple-greeter/logo_icon_name         debian-swirl # this is the default on Debian's systems.
/desktop/gnome/sound/event_sounds               false # I don't like hearing any sound when when I am prompted to insert my user's details on the Login Screen.
/apps/gdm/simple-greeter/disable_user_list      true # users list will be disabled, you won't be able to select your username from a list but you'll have to insert that yourself.
/apps/metacity/general/compositing_manager      false # default, no need to change this.
/apps/gnome-power-manager/ui/icon_policy        never # default, no need to change this.</pre>
</blockquote>
<p>We are close to the end but we are missing an important <strong>detail</strong>: how can you safely remove bottom&#8217;s toolbar and menus for a clearer and cleaner Login Screen? Open up the<strong><em> /var/lib/gdm3/.gconf.mandatory/%gconf-tree.xml</em></strong> file, search for the <strong><em>&lt;dir name=&#8221;general&#8221;&gt;</em></strong> section and apply the following <strong>change</strong>:</p>
<blockquote>
<pre>- &lt;entry name="compositing_manager" mtime="1315580582" type="bool" value="false"/&gt;
+ &lt;entry name="compositing_manager" mtime="1315580582" type="bool" value="true"/&gt;</pre>
</blockquote>
<p>But what if you prefer keeping the toolbar as it is, but you definitely don&#8217;t like seeing the <em><strong>Accessibility </strong></em>icon appearing on your Login Screen? On the same file as above, search for the <em><strong>&lt;dir name=&#8221;accessibility&#8221;&gt;</strong></em> section and <strong>modify</strong> the following string as it follows:</p>
<blockquote>
<pre>- &lt;entry name="enable" mtime="1315580582" type="bool" value="true"/&gt;
+ &lt;entry name="enable" mtime="1315580582" type="bool" value="false"/&gt;</pre>
</blockquote>
<p>See you on my next blog post and don&#8217;t forget to have a look at my GitHub&#8217;s <a href="https://github.com/averi/config-files" target="_blank">repository</a>! Oh&#8230;and follow <a href="http://twitter.com/andrea_veri" target="_blank">me</a> on Twitter!</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/woody/2011/09/11/a-few-other-additions-to-my-mutt-and-desktop-setup/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>New Desktop, Mutt and Irssi setup!</title>
		<link>http://blogs.gnome.org/woody/2011/09/04/new-desktop-mutt-and-irssi-setup/</link>
		<comments>http://blogs.gnome.org/woody/2011/09/04/new-desktop-mutt-and-irssi-setup/#comments</comments>
		<pubDate>Sun, 04 Sep 2011 15:41:10 +0000</pubDate>
		<dc:creator>Andrea Veri</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/woody/?p=162</guid>
		<description><![CDATA[I bought a new PC a few weeks ago and I then decided to renew a bit my Desktop, my Mutt and my Irssi setup. I&#8217;ve been spending several hours cleaning up old scripts, logs and configuration files but the result definitely seems to reward me the right way. But here they come a few [...]]]></description>
			<content:encoded><![CDATA[<p>I bought a new PC a few weeks ago and I then decided to renew a bit my <strong>Desktop</strong>, my <strong>Mutt</strong> and my<strong> Irssi</strong> setup. I&#8217;ve been spending several hours cleaning up old scripts, logs and configuration files but the result definitely seems to reward me the right way. But here they come a few <strong>screenshots</strong>:</p>
<p><strong>Desktop</strong></p>
<p><a href="http://blogs.gnome.org/woody/files/2011/09/my_Desktop.png"><img class="size-full wp-image-170 alignnone" src="http://blogs.gnome.org/woody/files/2011/09/my_Desktop_thumbnail.png" alt="" width="450" height="281" /></a></p>
<p><strong>Irssi</strong></p>
<p><a href="http://blogs.gnome.org/woody/files/2011/09/irssi.png"><img class="size-full wp-image-173 alignnone" src="http://blogs.gnome.org/woody/files/2011/09/irssi_thumbnail.png" alt="" width="450" height="262" /></a></p>
<p><strong>Mutt</strong></p>
<p><a href="http://blogs.gnome.org/woody/files/2011/09/mutt.png"><img class="size-full wp-image-174 alignnone" src="http://blogs.gnome.org/woody/files/2011/09/mutt_thumbnail.png" alt="" width="450" height="262" /></a></p>
<p>If you liked all the above and would like to reproduce everything yourself, you should consider having a look at my GitHub&#8217;s <a href="https://github.com/averi/config-files" target="_blank">repository</a>. See you on the next blog post!</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/woody/2011/09/04/new-desktop-mutt-and-irssi-setup/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Backup your Gmail in a few easy steps!</title>
		<link>http://blogs.gnome.org/woody/2011/07/26/backup-your-gmail-in-a-few-easy-steps/</link>
		<comments>http://blogs.gnome.org/woody/2011/07/26/backup-your-gmail-in-a-few-easy-steps/#comments</comments>
		<pubDate>Mon, 25 Jul 2011 23:50:57 +0000</pubDate>
		<dc:creator>Andrea Veri</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/woody/?p=132</guid>
		<description><![CDATA[I&#8217;ve actually spent a few hours searching around for a good backup solution for my mailbox until I decided to stick with getmail.  What you&#8217;ll be able to achieve after reading this HowTo and deploying the following setup is: A full backup of your e-mail DATA in the Mbox format. (yes, Gmail&#8217;s labels / folders [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve actually spent a few hours searching around for a good backup solution for my mailbox until I decided to stick with <a href="http://pyropus.ca/software/getmail/" target="_blank">getmail</a>.  What you&#8217;ll be able to achieve after reading this HowTo and deploying the following setup is:</p>
<ol>
<li>A full backup of your e-mail DATA in the Mbox format. (yes, Gmail&#8217;s labels / folders as well)</li>
<li>Prevent getmail to mark all mails as<strong><em> read</em></strong> after delivering them. (this was a pretty bad issue since getmail was marking all my mails as read even if I did not access my e-mail at all)</li>
<li>Keep your backups <em><strong>up-to-date</strong></em> with the <em><strong>latest</strong></em> content from your mailbox. (by default getmail grabs all the DATA from your mailbox and fills up the Mbox / Maildir content keeping deleted mails. So let&#8217;s say I deleted a mail two days ago, well it&#8217;ll still appear on today&#8217;s backups. This behaviour is definitely unwanted)</li>
</ol>
<p>I&#8217;ll now move to explain a few details about my new configuration but before moving to tweak getmail&#8217;s main config file, please do the following change on <strong><em> _retrieverbases.py</em></strong>* :</p>
<blockquote><p>return self._getmsgpartbyid(msgid, &#8216;(RFC822)&#8217;)</p>
<p><em><strong>to</strong></em></p>
<p>return self._getmsgpartbyid(msgid, &#8216;(BODY.PEEK[])&#8217;)</p></blockquote>
<p>When done grab the following <em><strong>getmailrc</strong></em> and adapt it to your needs**:</p>
<blockquote><p>[retriever]<br />
type = SimpleIMAPSSLRetriever <em><strong>##</strong></em> or <em><strong>SimplePOP3SSLRetriever</strong></em>.<br />
server = imap.gmail.com ## or <em><strong>pop.gmail.com</strong></em> for POP3.<br />
username = example@gmail.com<br />
password = password</p>
<p>## so-called Gmail&#8217;s <em><strong>labels</strong></em> should be listed <em><strong>one by one</strong></em> here  for getmail to retrieve mail from them successfully.</p>
<p>mailboxes = (&#8220;INBOX&#8221;, &#8220;[Gmail]/Sent mail&#8221;,<br />
&#8220;ubuntu&#8221;, &#8220;gnome/example&#8221;, &#8220;linux/example&#8221;)</p>
<p>[destination]<br />
type = Mboxrd<br />
path = ~/.getmail/backup.mbox</p>
<p>[options]<br />
delivered_to = false ## No <em><strong>delivered_to</strong></em> header added automatically.<br />
received = false ## No <em><strong>received</strong></em> header added automatically.<br />
verbose = 2 ## getmail will print messages about <em><strong>each</strong></em> of its <em><strong>actions</strong></em>.</p></blockquote>
<p>When done we should go ahead setting up getmail&#8217;s directories and config file:</p>
<blockquote><p>mkdir $HOME/.getmail</p>
<p>cp $HOME/getmailrc $HOME/.getmail/ <em><strong></strong></em></p>
<p>## Adapt <strong><em>$HOME/getmailrc</em></strong> to whatever dir you put that file into.</p></blockquote>
<p>But&#8230;pretty much all the remaining work will be done by a small shell script I wrote:</p>
<blockquote><p>#!/bin/sh</p>
<p>WORKDIR=$HOME/.getmail<br />
date=`date &#8220;+%d-%m-%Y_%H:%M&#8221;`</p>
<p>if [ ! -f  $WORKDIR/backup.mbox ]<br />
then<br />
touch $WORKDIR/backup.mbox<br />
fi</p>
<p>getmail &gt; $WORKDIR/getmail.log<br />
OUT=$?<br />
if [ $OUT -eq 0 ]<br />
then<br />
mkdir -p $WORKDIR/backups/ &amp;&amp; { mv $WORKDIR/backup.mbox $WORKDIR/backups/backup_$date.mbox ;}<br />
else [ $OUT -eq 1 ]<br />
exit 1<br />
fi</p>
<p>## Cleanup <em><strong>older than 3</strong></em> days backups<br />
find $WORKDIR/backups/* -mtime +3 -exec rm {} ;<br />
cd $WORKDIR &amp;&amp; { rm -rf oldmail-* ;}</p></blockquote>
<p>This script will:</p>
<ol>
<li>Run getmail using the getmailrc config file you previously worked on.</li>
<li>If the above command will be successful, it&#8217;ll create a<em><strong> backups</strong></em> dir into <strong><em>$HOME/.getmail</em></strong> and move the latest Mbox file there appending a date and time to its name. (by doing this we are sure next getmail run will happen on an empty <em><strong>backup.mbox</strong></em> file, thus it will just contain the <strong><em>latest</em></strong> content from your mailbox)</li>
<li>It&#8217;ll re-create a <em><strong>backup.mbox</strong></em> file on <strong><em>$HOME/.getmail</em></strong> to avoid the next getmail run to fail.</li>
<li>In the end, it&#8217;ll clean up older than 3 days backups to avoid a too crowded<em><strong> backups</strong></em> folder. (it removes the oldmail file as well since it is useless in our case)</li>
</ol>
<p>In the end set up a cronjob that will run the above script and generate the backups for you every one hour:</p>
<blockquote><p>0 * * * * $HOME/.getmail/getmail_run.sh &gt; /dev/null</p></blockquote>
<p>Feel free to let me know if you&#8217;ve encountered any issue while following the above HowTo. Enjoy!</p>
<p>* /usr/share/getmail4/getmailcore/<em><strong>_retrieverbases.py</strong></em> on line <em><strong>901</strong></em>.</p>
<p>** More documentation about the <em><strong>getmailrc</strong></em> file and syntax can be found on getmail&#8217;s <a href="http://pyropus.ca/software/getmail/configuration.html#conf-retriever" target="_blank">documentation</a> page.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/woody/2011/07/26/backup-your-gmail-in-a-few-easy-steps/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Automatic Gmail&#8217;s Trash &amp; Spam folders cleanup</title>
		<link>http://blogs.gnome.org/woody/2011/07/03/automatic-gmails-trash-spam-folders-cleanup/</link>
		<comments>http://blogs.gnome.org/woody/2011/07/03/automatic-gmails-trash-spam-folders-cleanup/#comments</comments>
		<pubDate>Sun, 03 Jul 2011 22:29:35 +0000</pubDate>
		<dc:creator>Andrea Veri</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/woody/?p=104</guid>
		<description><![CDATA[Since some time I&#8217;ve been thinking about a possible way to delete my Gmail&#8217;s Trash &#38; Spam folders content automatically without having to bother doing it manually every single time I wanted to check my mail and clean it up. (I love keeping everything in place and having my Trash&#38;Spam folders empty as they should [...]]]></description>
			<content:encoded><![CDATA[<p>Since some time I&#8217;ve been thinking about a possible way to delete my <strong>Gmail&#8217;s Trash &amp; Spam folders</strong> content automatically without having to bother doing it manually every single time I wanted to check my mail and clean it up. (I <strong>love</strong> keeping everything in place and having my Trash&amp;Spam folders empty as they should be makes me pretty <strong>happy</strong>)</p>
<p>A few years ago when Mutt was my main mail client I had the need to filter my mail through IMAP and while googling around for that I found out a <strong>great</strong> piece of software: <a href="https://github.com/lefcha/imapfilter" target="_blank">imapfilter</a>. Today while analyzing the above quoted issue I suddenly told myself: &#8220;Hey, but why don&#8217;t you use your dear and old friend imapfilter to fulfil your needs?&#8221;</p>
<p>After a few minutes I came up with a small <em>lua</em> script that was doing exactly what I wanted: my<strong> Trash&amp;Spam folders</strong> are no longer crowded and I finally don&#8217;t have to delete mails twice! But here they come a few details about my script:</p>
<blockquote>
<pre>options.timeout = 120
options.subscribe = true

account = IMAP {
 server = 'imap.gmail.com',
 username = 'example@gmail.com',
 password = 'password',
 ssl = 'ssl3'
 }

trash = account['[Gmail]/Trash']:is_undeleted()
account['[Gmail]/Trash']:delete_messages(trash)

spam = account['[Gmail]/Spam']:is_unanswered()
account['[Gmail]/Spam']:delete_messages(spam)</pre>
</blockquote>
<p>The script does two things:</p>
<ol>
<li>It checks whether a mail is <strong>not</strong> marked as &#8220;deleted&#8221; (moving an e-mail into the Trash does <strong>not</strong> mark it as &#8220;<strong>to be deleted</strong>&#8221; automatically) already and removes it.</li>
<li>It checks whether a mail on the Spam folder has been <strong>answered </strong>(I never had to answer a single e-mail contained into my Spam folder)  and if <strong>not</strong> removes it.</li>
</ol>
<p>Using the above script is really easy (you should run imapfilter on <strong>interactive mode</strong> first to generate Gmail&#8217;s <strong>certificates, </strong>do that before having cron to run the script for you or otherwise it&#8217;ll just hang), just make sure to have <strong>imapfilter</strong> installed on your system and then run it through cron every half an hour or less depending on your needs:</p>
<blockquote>
<pre>crontab -e
</pre>
<pre>*/30 * * * * imapfilter -c /home/user/imapfilter.lua &gt;&gt; /home/user/imapfilter.log</pre>
</blockquote>
<p>Please also remember to setup appropriate permissions on the config file since it contains your Gmail&#8217;s <strong>password</strong> and most of all make sure that your Spam folder is <strong>visible</strong> through IMAP (this option can be found on the <strong>label</strong> menu available under your<a href="https://mail.google.com/mail/?hl=it&amp;shva=1#settings" target="_blank"> Gmail&#8217;s settings</a>) otherwise imapfilter will just report an error.</p>
<p>Enjoy!</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/woody/2011/07/03/automatic-gmails-trash-spam-folders-cleanup/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bits from September / October</title>
		<link>http://blogs.gnome.org/woody/2009/10/11/bits-from-september-october/</link>
		<comments>http://blogs.gnome.org/woody/2009/10/11/bits-from-september-october/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 22:17:23 +0000</pubDate>
		<dc:creator>Andrea Veri</dc:creator>
				<category><![CDATA[Debian]]></category>

		<guid isPermaLink="false">http://blog.abluepaper.com/?p=20</guid>
		<description><![CDATA[Debian maintainer: Some days ago I had the great announcement that my Debian Maintainer&#8216;s application was accepted and thanks to Jonathan McDowell my key is finally into the debian-maintainers keyring. (which is now part of the debian-keyring itself thanks to the ftp-masters / keyring maintainer work that made the changes on both DAK and keyring) [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Debian maintainer:</strong></p>
<p>Some days ago I had the great announcement that my <a href="http://wiki.debian.org/Maintainers">Debian Maintainer</a>&#8216;s application was accepted and thanks to Jonathan McDowell my key is finally into the debian-maintainers keyring. (which is now part of the debian-keyring itself thanks to the ftp-masters / keyring maintainer <a href="http://lists.debian.org/debian-devel-announce/2009/08/msg00010.html">work</a> that made the changes on both DAK and keyring)</p>
<p>I <a href="http://lists.debian.org/debian-newmaint/2009/08/msg00083.html">applied</a> on the 22th of August, and thanks to Reinhard&#8217;s <a href="http://lists.debian.org/debian-newmaint/2009/08/msg00090.html">advocation</a>, everything went on the right side. Many thanks to all the people who made this possible.</p>
<p><strong>Pkg-mozext:</strong></p>
<p>Around 3 weeks ago I started being involved with the pkg-mozext team working on the new policy and to <a href="http://packages.debian.org/mozilla-devscripts">mozilla-devscripts </a>transition for all iceweasel / icedove extensions. The work is going great so far and we managed to update several extensions that are now part of the team itself. For a fast look at our package list, feel free to browse pkg-mozext&#8217;s <a href="http://qa.debian.org/developer.php?login=pkg-mozext-maintainers@lists.alioth.debian.org">QA page</a>. A lot of work needs to be done, so if anyone wanna jump in, I would suggest to read our guidelines / policy into the team&#8217;s <a href="http://wiki.debian.org/Teams/DebianMozExtTeam">Wiki Page</a>.</p>
<p><strong>Pkg-gnome:</strong></p>
<p>GNOME 2.28 is now released, and the pkg-gnome team is now working hard to provide all the needed updates into unstable and experimental. Everything is going great and we are cleaning up everything listed on <a href="http://www.0d.be/debian/debian-gnome-2.28-status.html">our schedule</a>.</p>
<p>Ephipany is under transition (gecko &#8211;&gt; webkit) so there are still some open issues / bugs, but now it looks fine so far and it can be used without any particular problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/woody/2009/10/11/bits-from-september-october/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Back</title>
		<link>http://blogs.gnome.org/woody/2009/07/24/back/</link>
		<comments>http://blogs.gnome.org/woody/2009/07/24/back/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 22:26:37 +0000</pubDate>
		<dc:creator>Andrea Veri</dc:creator>
				<category><![CDATA[Debian]]></category>

		<guid isPermaLink="false">http://blog.abluepaper.com/?p=11</guid>
		<description><![CDATA[well yeah, I&#8217;m back. Since like two weeks I restarted doing my work on Debian/Ubuntu taking care of my packages again. Unfortunately with the beginning of semptember I won&#8217;t have a lot of time, so I decided to keep only five of my old packages, they are: cgmail (version 0.5) ctorrent (version dnh3.3.2) gnome-btdownload (version [...]]]></description>
			<content:encoded><![CDATA[<p>well yeah, I&#8217;m back. Since like two weeks I restarted doing my work on Debian/Ubuntu taking care of my packages again. Unfortunately with the beginning of semptember I won&#8217;t have a lot of time, so I decided to keep only five of my old packages, they are:</p>
<ul>
<li><a href="http://packages.debian.org/cgmail">cgmail</a> (version 0.5)</li>
<li><a href="http://packages.debian.org/ctorrent">ctorrent</a> (version dnh3.3.2)</li>
<li><a href="http://packages.debian.org/gnome-btdownload">gnome-btdownload</a> (version 0.0.32)</li>
<li><a href="http://packages.debian.org/bitstormlite">bitstormlite</a> (version 0.2p)</li>
<li><a href="http://packages.debian.org/fische">fische</a> (version 2.0-beta2, soon updated)</li>
</ul>
<p>The greatest thing I saw getting back is that the Open Source world is improving everyday and finally a lot of desktop users are moving to Linux. My old high school just moved quite all computers to Linux, I hope this is the beginning of an Open Source revolution.</p>
<p>P.s. Alexander Sack (asac) and Reinhard Tartler (siretart) it&#8217;s nice to see you both again <img src='http://blogs.gnome.org/woody/wp-content/mu-plugins/tango-smilies/tango/face-wink.png' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/woody/2009/07/24/back/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  blogs.gnome.org/woody/category/debian/feed/ ) in 0.46116 seconds, on May 25th, 2012 at 7:55 pm UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on May 25th, 2012 at 8:55 pm UTC -->
