<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://poisson.phc.unipi.it/~mantova/io"  xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>Vincenzo Mantova - Software</title>
 <link>http://poisson.phc.unipi.it/~mantova/io/software</link>
 <description>A few things I wrote.
I&#039;ve also contributed once to the macam project with a port of the OV519 Linux driver.
</description>
 <language>en</language>
<item>
 <title>LaTeX in Empathy and Adium</title>
 <link>http://poisson.phc.unipi.it/~mantova/io/latex-empathy-adium</link>
 <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot; property=&quot;content:encoded&quot;&gt;&lt;p&gt;This is a little tutorial on how to embed &lt;a href=&quot;http://attachments/latex-empathy-adium/ubuntu-message-style+mathjax.patchwww.mathjax.org/&quot;&gt;MathJax&lt;/a&gt; in Empathy&#039;s and Adium&#039;s chat windows, making it possible to use LaTeX formulas in chats without resorting to plugins or calling external scripts.&lt;/p&gt;&lt;p&gt;&lt;!--break--&gt;&lt;span style=&quot;line-height: 1.538em;&quot;&gt;I tested this change only in Empathy 3.6 on Ubuntu 12.10 with the &quot;Ubuntu&quot; message style, and other configurations may require different changes. Do not forget to make a backup of the files you are going to modify.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;TO DO:&lt;/strong&gt; call &quot;Typeset&quot; on the new fragment only, attach a screenshot (&lt;a href=&quot;https://attachments/latex-empathy-adium/ubuntu-message-style+mathjax.patchbugs.archlinux.org/task/31087&quot;&gt;Nvidia&#039;s fault&lt;/a&gt;).&lt;/p&gt;&lt;h2&gt;Embedding MathJax into an AdiumMessageStyle&lt;/h2&gt;&lt;p&gt;Empathy and Adium use HTML+Javascript templates to display the content of the chat windows. Since they actually use Gecko and Webkit, it is possible to embed pretty much any code you like.&lt;/p&gt;&lt;p&gt;MathJax is a handy Javascript library that converts LaTeX formulas inside &lt;code&gt;$$ ... $$&lt;/code&gt; and &lt;code&gt;\[ ... \]&lt;/code&gt; into MathML or images, depending on the configuration. In order to enable the MathJax library inside an Empathy chat window it is enough to do the following.&lt;/p&gt;&lt;p&gt;Install the MathJax library somewhere (either via your package manager or &lt;a href=&quot;http://www.mathjax.org/download/&quot;&gt;downloading it&lt;/a&gt;), copy/extract your favourite message style into the folder &lt;code&gt;~/.local/share/adium/message-styles/&lt;/code&gt; and modify its &lt;code&gt;Template.html&lt;/code&gt; in the following way:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;add the line &lt;code&gt;&amp;lt;script type=&quot;text/javascript&quot; src=&quot;/~mantova/io/%3Cstrong%3E%5Blocation%20of%20MathJax%5D%3C/strong%3E/MathJax.js?config=default&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/code&gt; just before the first &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tag; this will import MathJax in the message style;&lt;/li&gt;&lt;li&gt;add the line &lt;code&gt;MathJax.Hub.Queue([&quot;Typeset&quot;, MathJax.Hub]);&lt;/code&gt; inside the body of the &lt;code&gt;appendMessage&lt;/code&gt;, near the end of the function, &lt;em&gt;after&lt;/em&gt; the new message has been added to the page but &lt;em&gt;before&lt;/em&gt; any other formatting commands (e.g., a call to &lt;code&gt;alignChat&lt;/code&gt;); this tells MathJax to look for new LaTeX code every time a new message is displayed on the screen;&lt;/li&gt;&lt;li&gt;repeat the last step inside the body of the function &lt;code&gt;appendMessageNext&lt;/code&gt;, unless the function calls &lt;code&gt;appendMessage&lt;/code&gt;.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;I suggest to modify the file &lt;code&gt;Info.plist&lt;/code&gt; as well appending a &quot;+ MathJax&quot; to the style name.&lt;/p&gt;&lt;h2&gt;Instructions for Ubuntu 12.10&lt;/h2&gt;&lt;p&gt;If you use Ubuntu 12.10 and the &quot;Ubuntu&quot; message style in Empathy, you can use the attached patch.&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Download the attached &lt;code&gt;ubuntu-message-style+mathjax.patch&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Install &lt;code&gt;libjs-mathjax&lt;/code&gt;:&lt;blockquote&gt;&lt;code&gt;sudo apt-get install libjs-mathjax&lt;/code&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;li&gt;Create a directory in your home folder to host the new message style:&lt;blockquote&gt;&lt;code&gt;mkdir -p ~/.local/share/adium/message-styles&lt;/code&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;li&gt;Copy the default Ubuntu message style to your home folder:&lt;blockquote&gt;&lt;code&gt;cp -r /usr/share/adium/message-styles/ubuntu.AdiumMessageStyle ~/.local/share/adium/message-styles/ubuntu+mathjax.AdiumMessageStyle&lt;/code&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;li&gt;Go inside the directory of the new message style:&lt;blockquote&gt;&lt;code&gt;cd ~/.local/share/adium/message-styles/ubuntu+mathjax.AdiumMessageStyle&lt;/code&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;li&gt;Apply the patch:&lt;blockquote&gt;&lt;code&gt;patch -p1 &amp;lt; &lt;strong&gt;[location of the downloaded patch]&lt;/strong&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;li&gt;Choose the new theme &quot;Ubuntu + MathJax&quot; in Empathy&#039;s preferences.&lt;/li&gt;&lt;li&gt;Open a new chat tab and write some LaTeX code inside &lt;code&gt;$$ ... $$&lt;/code&gt; or &lt;code&gt;\[ ... \]&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Enjoy!&lt;/li&gt;&lt;/ol&gt;&lt;p&gt; &lt;/p&gt;



&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-field-files field-type-file field-label-above&quot;&gt;&lt;h3 class=&quot;field-label&quot;&gt;Attachments&amp;nbsp;&lt;/h3&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;span class=&quot;file&quot;&gt;&lt;img class=&quot;file-icon&quot; alt=&quot;File&quot; title=&quot;text/x-diff&quot; src=&quot;/~mantova/io/modules/file/icons/text-x-generic.png&quot; /&gt; &lt;a href=&quot;http://poisson.phc.unipi.it/~mantova/io/files/attachments/latex-empathy-adium/ubuntu-message-style%2Bmathjax.patch&quot; type=&quot;text/x-diff; length=1951&quot;&gt;ubuntu-message-style+mathjax.patch&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Tue, 26 Mar 2013 17:25:51 +0000</pubDate>
 <dc:creator>Vincenzo Mantova</dc:creator>
 <guid isPermaLink="false">31 at http://poisson.phc.unipi.it/~mantova/io</guid>
</item>
<item>
 <title>PAM SASL authentication module</title>
 <link>http://poisson.phc.unipi.it/~mantova/io/pam-sasl</link>
 <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot; property=&quot;content:encoded&quot;&gt;&lt;p&gt;&lt;img  alt=&quot;SASL logo&quot; src=&quot;/~mantova/io/files/images/pam-sasl/SASL-logo-web.jpg&quot; style=&quot;float: right; width: 48px; height: 48px; &quot; title=&quot;&quot; / &gt;A PAM module for &lt;a href=&quot;http://asg.web.cmu.edu/sasl/index.html&quot;&gt;SASL&lt;/a&gt; password authentication.&lt;/p&gt;&lt;p&gt;The source code is &lt;a href=&quot;http://sourceforge.net/projects/pam-sasl/&quot;&gt;hosted on SourceForge&lt;/a&gt;.&lt;br /&gt; Packages for Ubuntu can be downloaded from the official &lt;a href=&quot;https://launchpad.net/~xworld21/+archive/pam-sasl&quot;&gt;PPA&lt;/a&gt;.&lt;/p&gt;&lt;h2&gt;Usage case&lt;/h2&gt;&lt;p&gt;This module is useful when combined with the &lt;code&gt;saslauthd&lt;/code&gt; service, if you want to let some low privilege process, such as &lt;code&gt;gnome-screensaver&lt;/code&gt;, to be able to authenticate the user using information not accessible to the process, e.g., to the system Kerberos keytab &lt;code&gt;/etc/krb5.keytab&lt;/code&gt; or the LDAP password stored in &lt;code&gt;/etc/ldap.conf&lt;/code&gt;.&lt;/p&gt;&lt;h2&gt;Example with &lt;code&gt;gnome-screensaver&lt;/code&gt;&lt;/h2&gt;&lt;p&gt;This example is modelled around Debian, Ubuntu and other similar distributions.&lt;br /&gt; We will configure &lt;code&gt;gnome-screensaver&lt;/code&gt; so that the user can unlock the screen even if he has no privileges to read some necessary files.&lt;/p&gt;&lt;p&gt;First, you have to install the module and the service &lt;code&gt;saslauthd&lt;/code&gt; (in Debian/Ubuntu, it is contained in the &lt;code&gt;sasl2-bin&lt;/code&gt; package).&lt;/p&gt;&lt;p&gt;Modify the system files in the following way:&lt;/p&gt;&lt;dl&gt;&lt;dt&gt;&lt;strong&gt;/etc/pam.d/gnome-screensaver&lt;/strong&gt;&lt;/dt&gt;&lt;dd&gt;
&lt;pre&gt;auth    required    pam_sasl.so
auth    optional    pam_gnome_keyring.so&lt;/pre&gt;
&lt;/dd&gt;&lt;dt&gt;&lt;strong&gt;/etc/pam.d/sasl-gnome-screensaver&lt;/strong&gt;&lt;/dt&gt;&lt;dd&gt;
&lt;pre&gt;@include common-auth&lt;/pre&gt;
&lt;/dd&gt;&lt;dt&gt;&lt;strong&gt;/etc/sasl/sasl-gnome-screensaver.conf&lt;/strong&gt;&lt;/dt&gt;&lt;dd&gt;
&lt;pre&gt;pwcheck_method: saslauthd&lt;/pre&gt;
&lt;/dd&gt;&lt;dt&gt;&lt;strong&gt;/etc/default/saslauthd&lt;/strong&gt;&lt;/dt&gt;&lt;dd&gt;
&lt;pre&gt;[...]
# Should saslauthd run automatically on startup? (default: no)
&lt;strong&gt;START=yes&lt;/strong&gt;

[...]
# Example: MECHANISMS=&quot;pam&quot;
&lt;strong&gt;MECHANISMS=&quot;pam&quot;&lt;/strong&gt;

[...]&lt;/pre&gt;
&lt;/dd&gt;&lt;dt&gt;&lt;strong&gt;/etc/security/group.conf&lt;/strong&gt;&lt;/dt&gt;&lt;dd&gt;
&lt;pre&gt;[...]
#xsh; tty* ;sword;!Wk0900-1800;sound, play
#xsh; tty* ;*;Al0900-1800;floppy

&lt;strong&gt;login;*;*;Al0000-2400;cdrom,audio,video,sasl
gdm;*;*;Al0000-2400;cdrom,audio,video,sasl&lt;/strong&gt;

[...]
&lt;/pre&gt;
&lt;/dd&gt;&lt;/dl&gt;&lt;p&gt;Under this configuration, when the user tries to unlock the screen the following happens:&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;code&gt;gnome-screensaver&lt;/code&gt; gives the password to the module &lt;code&gt;pam_sasl.so&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;pam_sasl.so&lt;/code&gt; reads the configuration file &lt;code&gt;/etc/sasl/sasl-gnome-screensaver.conf&lt;/code&gt;, and decides to use the &lt;code&gt;saslauthd&lt;/code&gt; service&lt;/li&gt;&lt;li&gt;&lt;code&gt;pam_sasl.so&lt;/code&gt; contacts the &lt;code&gt;saslauthd&lt;/code&gt; service through a socket accessible only to members of the &lt;code&gt;sasl&lt;/code&gt; group (hence the configuration of &lt;code&gt;/etc/security/group.conf&lt;/code&gt;)&lt;/li&gt;&lt;li&gt;&lt;code&gt;saslauthd&lt;/code&gt; is configured to use the PAM library, so it checks the password using the modules configured in &lt;code&gt;/etc/pam.d/sasl-gnome-screensaver&lt;/code&gt;&lt;/li&gt;&lt;li&gt;the password is finally checked in the same way as it was before installing &lt;code&gt;pam_sasl&lt;/code&gt;, but this time the check is done by the &lt;code&gt;saslauthd&lt;/code&gt; daemon which runs as root.&lt;/li&gt;&lt;/ol&gt;



&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Tue, 15 Feb 2011 18:55:35 +0000</pubDate>
 <dc:creator>Vincenzo Mantova</dc:creator>
 <guid isPermaLink="false">4 at http://poisson.phc.unipi.it/~mantova/io</guid>
</item>
<item>
 <title>YouTube Adium plugin</title>
 <link>http://poisson.phc.unipi.it/~mantova/io/youtubeadium</link>
 <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot; property=&quot;content:encoded&quot;&gt;&lt;p&gt;A plugin to show YouTube videos right inside the chat window of Adium.&lt;br /&gt;The plugin can be found at &lt;a href=&quot;http://www.adiumxtras.com/index.php?a=xtras&amp;amp;xtra_id=6655&quot;&gt;Adium - Xtras&lt;/a&gt;.&lt;br /&gt;The source code and the binary releases are &lt;a href=&quot;http://sourceforge.net/projects/youtubeadium/&quot;&gt;hosted on SourceForge&lt;/a&gt;.&lt;/p&gt;&lt;h2&gt;Known Issues&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;The video cannot be resized.&lt;/li&gt;&lt;li&gt;There is no localization support (i.e. the video controls will always appear in English and the &quot;close&quot; link will always be &quot;close&quot;).&lt;/li&gt;&lt;li&gt;The video will move together with the text! You&#039;ll have to stay quiet till the end.&lt;/li&gt;&lt;li&gt;The plugin only works with links beginning with &lt;code&gt;http://www.youtube.com/watch?v=&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;It can be used only with version 4 message styles (those provided with Adium are ok).&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Screenshots&lt;/h2&gt;&lt;p style=&quot;text-align: center; &quot;&gt;&lt;img  alt=&quot;Chat window&quot; src=&quot;/~mantova/io/files/images/youtubeadium/chat.png&quot; style=&quot;width: 732px; height: 513px; &quot; title=&quot;&quot; / &gt;&lt;/p&gt;&lt;p style=&quot;text-align: center; &quot;&gt;&lt;img  alt=&quot;Preferences&quot; height=&quot;456&quot; src=&quot;/~mantova/io/files/images/youtubeadium/preferences.png&quot; title=&quot;&quot; width=&quot;558&quot; / &gt;&lt;/p&gt;



&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Tue, 15 Feb 2011 18:54:51 +0000</pubDate>
 <dc:creator>Vincenzo Mantova</dc:creator>
 <guid isPermaLink="false">3 at http://poisson.phc.unipi.it/~mantova/io</guid>
</item>
</channel>
</rss>
