<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>Advogato blog for stan</title>
    <link>http://www.advogato.org/person/stan/</link>
    <description>Advogato blog for stan</description>
    <language>en-us</language>
    <generator>mod_virgule</generator>
    <pubDate>Wed, 22 May 2013 10:30:20 GMT</pubDate>
    <item>
      <pubDate>Wed, 15 Feb 2012 10:30:21 GMT</pubDate>
      <title>15 Feb 2012</title>
      <link>http://www.advogato.org/person/stan/diary.html?start=7</link>
      <guid>http://www.advogato.org/person/stan/diary.html?start=7</guid>
      <description>&lt;b&gt;python pip non root install&lt;/b&gt;&lt;br/&gt;
&lt;br/&gt;
Ahhh finally found the right options,&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;
pip install ipdb --install-option="--user"&lt;br/&gt;
&lt;/code&gt;&lt;br/&gt;
</description>
    </item>
    <item>
      <pubDate>Mon, 9 Jan 2012 13:24:50 GMT</pubDate>
      <title>9 Jan 2012</title>
      <link>http://www.advogato.org/person/stan/diary.html?start=6</link>
      <guid>http://www.advogato.org/person/stan/diary.html?start=6</guid>
      <description>&lt;b&gt;Quick export of code to testing server&lt;/b&gt;&lt;br/&gt;
&lt;br/&gt;
For bzr and git:&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;
bzr export --format=tar - | ssh -C server tar x -C /path/to/overwrite/files/in&lt;br/&gt;
&lt;br/&gt;
git archive --format=tar HEAD | ssh -C server tar x -C /path/to/overwrite/files/in&lt;br/&gt;
&lt;/code&gt;&lt;br/&gt;
&lt;br/&gt;
Not perfect, as deleted files aren't removed, but good enough most of the time</description>
    </item>
    <item>
      <pubDate>Mon, 2 Jan 2012 20:21:24 GMT</pubDate>
      <title>2 Jan 2012</title>
      <link>http://www.advogato.org/person/stan/diary.html?start=5</link>
      <guid>http://www.advogato.org/person/stan/diary.html?start=5</guid>
      <description>&lt;b&gt;File server encryption setup&lt;/b&gt;&lt;br/&gt;
&lt;br/&gt;
I've been in the process of setting up encryption on my server for a while.  At work we use lvm encryption - which works well.  The lvm server is running debian and has the dropbear package installed.  If it is rebooted, we just ssh in and supply the password.  &lt;br/&gt;
&lt;br/&gt;
My server also provides dhcp service, so unless you manually configure the client's networking the ssh part doesn't work.  So instead I've been setting up ecryptfs, since I use it all my client machines.  The configuration on my server is slightly more manual - I'm using &lt;code&gt;mount -t ecryptfs&lt;/code&gt; directly.&lt;br/&gt;
&lt;br/&gt;
I'm using &lt;a href="http://bazaar.launchpad.net/~stan/tristan.hill/dev/view/head:/ecryptfscgi.py" &gt;a custom cgi script&lt;/a&gt; to allow the  partition to be mounted.  Seems to be working ok.&lt;br/&gt;
&lt;br/&gt;
After thinking about it while writing this I'm preferring making dhcp work somehow (move it somewhere etc) and using lvm in the long run - slight it makes it easier to make sure everything is encrypted.  Also the client part would be slightly harder as you need to use a ssh client rather than a web client.</description>
    </item>
    <item>
      <pubDate>Fri, 24 Sep 2010 21:34:30 GMT</pubDate>
      <title>24 Sep 2010</title>
      <link>http://www.advogato.org/person/stan/diary.html?start=4</link>
      <guid>http://www.advogato.org/person/stan/diary.html?start=4</guid>
      <description>Got annoying&#xD;
&lt;pre&gt;&#xD;
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load&#xD;
&lt;/pre&gt;&#xD;
errors? do&#xD;
&lt;pre&gt;dpkg --purge appmenu-gtk&lt;/pre&gt; to get rid of &#xD;
&lt;pre&gt;/etc/X11/Xsession.d/80appmenu&lt;/pre&gt; that causes this</description>
    </item>
    <item>
      <pubDate>Sat, 27 Jun 2009 16:06:30 GMT</pubDate>
      <title>27 Jun 2009</title>
      <link>http://www.advogato.org/person/stan/diary.html?start=3</link>
      <guid>http://www.advogato.org/person/stan/diary.html?start=3</guid>
      <description>Here's my python implementation of Rob Pike's minimal regex &#xD;
(only supports &lt;code&gt;^.*$&lt;/code&gt; special characters) &#xD;
algorithm:&#xD;
&#xD;
&lt;p&gt; &lt;code&gt;&#xD;
def match(regexp, text):&lt;br&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if regexp.startswith("^"):&lt;br&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return &#xD;
matchhere(regexp[1:], text)&lt;br&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for i in range(len(text) or 1):&lt;br&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if &#xD;
matchhere(regexp, text[i:]):&lt;br&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&#xD;
&amp;nbsp;&amp;nbsp;return True&lt;br&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return False&lt;br&gt;&#xD;
&lt;br&gt;&#xD;
def matchhere(regexp, text):&lt;br&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if len(regexp) == 0:&lt;br&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return &#xD;
True&lt;br&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if regexp[1:].startswith("*"):&lt;br&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return &#xD;
matchstar(regexp[0], regexp[2:], text)&lt;br&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if regexp == "$":&lt;br&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return &#xD;
len(text) == 0&lt;br&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if len(text) &amp;gt; 0 and (regexp[0] == &#xD;
"." or regexp[0] == text[0]):&lt;br&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return &#xD;
matchhere(regexp[1:], text[1:])&lt;br&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return False&lt;br&gt;&#xD;
&lt;br&gt;&#xD;
def matchstar(c, regexp, text):&lt;br&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for i in range(len(text) or 1):&lt;br&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if &#xD;
matchhere(regexp, text[i:]):&lt;br&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&#xD;
&amp;nbsp;&amp;nbsp;return True&lt;br&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if len(text) &#xD;
&amp;lt; 0 or c not in (text[i], "."):&lt;br&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&#xD;
&amp;nbsp;&amp;nbsp;return False&lt;br&gt;&#xD;
&lt;br&gt;&#xD;
import unittest&lt;br&gt;&#xD;
&lt;br&gt;&#xD;
class Test(unittest.TestCase):&lt;br&gt;&#xD;
&lt;br&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;def test(self):&lt;br&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;self.assert_&#xD;
(match("a", "a"))&lt;br&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;self.assert_&#xD;
(not match("a", "b"))&lt;br&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;self.assert_&#xD;
(match("^a$", "a"))&lt;br&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;self.assert_&#xD;
(match("^a*b$", "aaaab"))&lt;br&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;self.assert_&#xD;
(not match("^a*b$", "aaacb"))&lt;br&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;self.assert_&#xD;
(match("a*a", "aa"))&#xD;
&lt;/code&gt;&#xD;
&#xD;
&lt;p&gt; &lt;p&gt;Here's hoping there's no other major bugs.</description>
    </item>
    <item>
      <pubDate>Sat, 9 May 2009 13:21:32 GMT</pubDate>
      <title>9 May 2009</title>
      <link>http://www.advogato.org/person/stan/diary.html?start=2</link>
      <guid>http://www.advogato.org/person/stan/diary.html?start=2</guid>
      <description>&lt;b&gt;What did I do yesterday?&lt;/b&gt;&#xD;
&#xD;
&lt;p&gt; I rigged up a small script to record the title of the active&#xD;
window when it changes (using libwnck).  Generates a log like:&#xD;
&#xD;
&lt;p&gt; &lt;code&gt;&#xD;
2009-05-09 14:16:42,282 gnome-terminal fish  ~/lpth&lt;br&gt;&#xD;
2009-05-09 14:16:53,517 gnome-terminal less  ~/lpth&lt;br&gt;&#xD;
2009-05-09 14:16:55,063 firefox Advogato - Blog: stan -&#xD;
Mozilla Firefox&lt;br&gt;&#xD;
2009-05-09 14:16:55,694 gnome-terminal less  ~/lpth&lt;br&gt;&#xD;
2009-05-09 14:16:55,922 gnome-terminal fish  ~/lpth&lt;br&gt;&#xD;
2009-05-09 14:16:57,861 gnome-terminal less  ~/lpth&lt;br&gt;&#xD;
&lt;/code&gt;&#xD;
&#xD;
&lt;p&gt; Available &lt;a href="http://bazaar.launchpad.net/~stan/tristan.hill/dev/annotate/head%3A/wnck_log.py" &gt;here&lt;/a&gt;.&#xD;
</description>
    </item>
    <item>
      <pubDate>Tue, 17 Mar 2009 22:03:27 GMT</pubDate>
      <title>17 Mar 2009</title>
      <link>http://www.advogato.org/person/stan/diary.html?start=1</link>
      <guid>http://www.advogato.org/person/stan/diary.html?start=1</guid>
      <description>&lt;b&gt;dbus at_console and /var/run/console&lt;/b&gt;&#xD;
&#xD;
&lt;p&gt; The dbus at_console code checks for presence of&#xD;
/var/run/console/$USERNAME to see whether the user is "at&#xD;
console".&#xD;
&#xD;
&lt;p&gt; In previous releases (don't know when it changed exactly)&#xD;
this appears to have been populated by libpam-foreground. &#xD;
Now there is a compatibility script&#xD;
/usr/lib/ConsoleKit/run-session.d/pam-foreground-compat.ck.&#xD;
 This doesn't seem to get run with just a local console&#xD;
login.  Running ck-launch-session explicitly seems to do the&#xD;
job.</description>
    </item>
    <item>
      <pubDate>Mon, 16 Mar 2009 22:01:16 GMT</pubDate>
      <title>16 Mar 2009</title>
      <link>http://www.advogato.org/person/stan/diary.html?start=0</link>
      <guid>http://www.advogato.org/person/stan/diary.html?start=0</guid>
      <description>&lt;b&gt;dbus-monitor and system bus&lt;/b&gt;&#xD;
&#xD;
&lt;p&gt; &lt;p&gt; To try and troubleshoot some network manager problems I&#xD;
wanted to use dbus-monitor with the system bus.  This bus is&#xD;
a lot more locked down than a user's&#xD;
session bus so doesn't work out of the box (at least on&#xD;
jaunty).  Experimentation wasn't helped by the fact that the&#xD;
daemon seems to need a full restart to properly pick up the&#xD;
configuration changes.&#xD;
&#xD;
&lt;p&gt; &lt;p&gt; I have been able to get dbus-monitor working by making the&#xD;
&amp;lt;policy user="root"&amp;gt; section in&#xD;
/etc/dbus-1/system.d/NetworkManager.conf contain&#xD;
the following:&#xD;
&#xD;
&lt;p&gt; &lt;p&gt; &lt;code&gt;&#xD;
&amp;lt;allow eavesdrop="true" receive_requested_reply="false"/&amp;gt; &lt;br&gt;&#xD;
&amp;lt;allow eavesdrop="true" send_requested_reply="false"/&amp;gt;&#xD;
&lt;/code&gt;&#xD;
&#xD;
&lt;p&gt; and in the &amp;lt;policy at_console="true"&amp;gt; section&#xD;
&#xD;
&lt;p&gt; &lt;code&gt;&#xD;
&amp;lt;allow send_destination="org.freedesktop.NetworkManager"&#xD;
eavesdrop="true"/&amp;gt; &lt;br&gt;&#xD;
&amp;lt;allow eavesdrop="true" send_requested_reply="false"/&amp;gt;&#xD;
&lt;/code&gt;&#xD;
&#xD;
&lt;p&gt; This allows dbus-monitor to pick up method calls and replies&#xD;
when run as root with an "at_console" user sending the&#xD;
method calls (e.g. with the network manager applet).&#xD;
&#xD;
</description>
    </item>
  </channel>
</rss>
