<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Simone 'Wiz' Tellini - SysAdmin</title>
    <link>http://tellini.info/blog/</link>
    <description>To strive, to seek, to find, and not to yield.</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.5.1 - http://www.s9y.org/</generator>
    <pubDate>Tue, 30 Jun 2009 17:54:45 GMT</pubDate>

    <image>
        <url>http://tellini.info/blog/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Simone 'Wiz' Tellini - SysAdmin - To strive, to seek, to find, and not to yield.</title>
        <link>http://tellini.info/blog/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>LogMiner 1.23</title>
    <link>http://tellini.info/blog/archives/88-LogMiner-1.23.html</link>
            <category>Software</category>
            <category>SysAdmin</category>
    
    <comments>http://tellini.info/blog/archives/88-LogMiner-1.23.html#comments</comments>
    <wfw:comment>http://tellini.info/blog/wfwcomment.php?cid=88</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://tellini.info/blog/rss.php?version=2.0&amp;type=comments&amp;cid=88</wfw:commentRss>
    

    <author>nospam@example.com (Simone)</author>
    <content:encoded>
    Version 1.23 of &lt;a href=&quot;http://logminer.sourceforge.net/&quot;  title=&quot;LogMiner at SourceForge&quot;&gt;LogMiner&lt;/a&gt;, my Apache/IIS log analysis package, is now available.&lt;br /&gt;
&lt;br /&gt;
This release mainly fixes some build problem on modern distributions.&lt;br /&gt;
&lt;br /&gt;
Also it finally includes the &lt;a href=&quot;http://tellini.info/blog/archives/48-LogMiner-purging-old-accesses.html&quot;&gt;cleanup function&lt;/a&gt; I was talking about &lt;em&gt;some&lt;/em&gt; days ago... 
    </content:encoded>

    <pubDate>Tue, 30 Jun 2009 10:42:32 -0700</pubDate>
    <guid isPermaLink="false">http://tellini.info/blog/archives/88-guid.html</guid>
    <category>analysis</category>
<category>apache</category>
<category>iis</category>
<category>logminer</category>
<category>logs</category>
<category>software</category>
<category>sysadmin</category>

</item>
<item>
    <title>Perplexed about Ubuntu's sudoers configuration</title>
    <link>http://tellini.info/blog/archives/80-Perplexed-about-Ubuntus-sudoers-configuration.html</link>
            <category>SysAdmin</category>
    
    <comments>http://tellini.info/blog/archives/80-Perplexed-about-Ubuntus-sudoers-configuration.html#comments</comments>
    <wfw:comment>http://tellini.info/blog/wfwcomment.php?cid=80</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://tellini.info/blog/rss.php?version=2.0&amp;type=comments&amp;cid=80</wfw:commentRss>
    

    <author>nospam@example.com (Simone)</author>
    <content:encoded>
    Recently I&#039;ve been administering my first Ubuntu machine and I already feel a bit perplexed about its security setup.&lt;br /&gt;
&lt;br /&gt;
The issue is that by default, the root account password is locked in Ubuntu and you are encouraged never to use root, but rely on sudoers for system administration.&lt;br /&gt;
&lt;br /&gt;
I&#039;ve read the rationale on &lt;a href=&quot;https://help.ubuntu.com/community/RootSudo&quot;&gt;Ubuntu&#039;s wiki&lt;/a&gt; and I agree on some points, but their mindset is totally biased towards a desktop setup.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider these points from their site:&lt;br /&gt;
&lt;ul&gt;&lt;br /&gt;
   &lt;li&gt; &lt;blockquote&gt;&lt;em&gt;Benefits of using sudo: Users don&#039;t have to remember an extra password.&lt;/em&gt;&lt;/blockquote&gt;  This is cool for Average Joe, but don&#039;t tell me that it&#039;s an advantage on a serious server: it&#039;s actually a downside, see the next point.&lt;br /&gt;
   &lt;/li&gt;&lt;br /&gt;
&lt;br /&gt;
   &lt;li&gt;&lt;blockquote&gt;&lt;em&gt;Every cracker trying to brute-force their way into your box will know it has an account named root and will try that first. What they don&#039;t know is what the usernames of your other users are. Since the root account password is locked, this attack becomes essentially meaningless, since there is no password to crack or guess in the first place.&lt;/em&gt;&lt;/blockquote&gt;&lt;br /&gt;
       Sure, the attack on root becomes useless, too bad that &lt;a href=&quot;http://arstechnica.com/security/news/2008/05/strong-passwords-no-panacea-as-ssh-brute-force-attacks-rise.ars&quot;&gt;SSH brute-force attacks&lt;/a&gt; usually try &lt;strong&gt;lots&lt;/strong&gt; of different usernames. If the manage to break a single account of a sudoer, they automatically have control of your machine. If you had to remember a different password to &lt;a href=&quot;http://en.wikipedia.org/wiki/Su_(Unix)&quot;&gt;su&lt;/a&gt; your way, it would make their life a bit harder.&lt;br /&gt;
   &lt;/li&gt;&lt;br /&gt;
&lt;br /&gt;
   &lt;li&gt;&lt;blockquote&gt;&lt;em&gt;Allows easy transfer for admin rights, in a short term or long term period, by adding and removing users from groups, while not compromising the root account.&lt;/em&gt;&lt;/blockquote&gt;&lt;br /&gt;
       err... what does &quot;not compromising the root account&quot; actually mean? If I get admin rights, I can do whatever I want, including compromising any account. Unless I get authorisation just to run a limited set of commands through sudo, but that&#039;s not the point of this post.&lt;br /&gt;
   &lt;/li&gt;&lt;br /&gt;
&lt;br /&gt;
   &lt;li&gt;&lt;blockquote&gt;&lt;em&gt;The root account password does not need to be shared with everybody who needs to perform some type of administrative task(s) on the system.&lt;/em&gt;&lt;/blockquote&gt;&lt;br /&gt;
      ok, but what problem does it solve? (apart from avoiding people shouting the root password when they shouldn&#039;t &lt;img src=&quot;http://tellini.info/blog/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;)&lt;br /&gt;
&lt;br /&gt;
If I want to remove a person from the admin group, I need to trust her not to have planted any malicious program (rootkits, backdoors...) or rebuild the system if I&#039;m paranoid, if I really want to be on the safe and paranoid side.&lt;br /&gt;
&lt;br /&gt;
IMHO, it&#039;s just the same as changing the root password when one is gone, or even better, periodically.&lt;br /&gt;
   &lt;/li&gt;&lt;br /&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;m not convinced. I still prefer the common su approach typical of almost all the other distributions... 
    </content:encoded>

    <pubDate>Wed, 29 Apr 2009 13:47:47 -0700</pubDate>
    <guid isPermaLink="false">http://tellini.info/blog/archives/80-guid.html</guid>
    <category>security</category>
<category>ssh</category>
<category>su</category>
<category>sudo</category>
<category>sysadmin</category>
<category>ubuntu</category>

</item>
<item>
    <title>mod_tunnel for Apache 2.2.x</title>
    <link>http://tellini.info/blog/archives/79-mod_tunnel-for-Apache-2.2.x.html</link>
            <category>Software</category>
            <category>SysAdmin</category>
    
    <comments>http://tellini.info/blog/archives/79-mod_tunnel-for-Apache-2.2.x.html#comments</comments>
    <wfw:comment>http://tellini.info/blog/wfwcomment.php?cid=79</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://tellini.info/blog/rss.php?version=2.0&amp;type=comments&amp;cid=79</wfw:commentRss>
    

    <author>nospam@example.com (Simone)</author>
    <content:encoded>
    mod_tunnel is a simple Apache module that can be used to create TCP tunnels using your Web server. It is useful to expose services which can be reached through a proxy, bypassing firewalls.&lt;br /&gt;
&lt;br /&gt;
After &lt;em&gt;only&lt;/em&gt; 4 years since the previous version, you can now download version 2.0 which works with Apache 2.2.x (and maybe 2.0.x, but I haven&#039;t tested it).&lt;br /&gt;
&lt;br /&gt;
You&#039;ll find it on &lt;a href=&quot;https://sourceforge.net/projects/mod-tunnel/&quot; title=&quot;mod_tunnel on sourceforge.net&quot;&gt;sourceforge&lt;/a&gt;. 
    </content:encoded>

    <pubDate>Sun, 12 Apr 2009 17:52:07 -0700</pubDate>
    <guid isPermaLink="false">http://tellini.info/blog/archives/79-guid.html</guid>
    <category>apache</category>
<category>firewall</category>
<category>networking</category>
<category>proxy</category>
<category>software</category>
<category>sysadmin</category>
<category>tunnel</category>

</item>
<item>
    <title>Don't shout at your hard drives!</title>
    <link>http://tellini.info/blog/archives/77-Dont-shout-at-your-hard-drives!.html</link>
            <category>Fun</category>
            <category>SysAdmin</category>
    
    <comments>http://tellini.info/blog/archives/77-Dont-shout-at-your-hard-drives!.html#comments</comments>
    <wfw:comment>http://tellini.info/blog/wfwcomment.php?cid=77</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://tellini.info/blog/rss.php?version=2.0&amp;type=comments&amp;cid=77</wfw:commentRss>
    

    <author>nospam@example.com (Simone)</author>
    <content:encoded>
    It appears that hard drives don&#039;t like it...&lt;br /&gt;
&lt;br /&gt;
&lt;object width=&quot;425&quot; height=&quot;344&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/tDacjrSCeq4&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=es&amp;feature=player_embedded&amp;fs=1&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/tDacjrSCeq4&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=es&amp;feature=player_embedded&amp;fs=1&quot; type=&quot;application/x-shockwave-flash&quot; allowfullscreen=&quot;true&quot; width=&quot;425&quot; height=&quot;344&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;
&lt;br /&gt;
It also proves that some sysadmins have far too much time to spare. &lt;img src=&quot;http://tellini.info/blog/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt; 
    </content:encoded>

    <pubDate>Mon, 05 Jan 2009 13:47:43 -0800</pubDate>
    <guid isPermaLink="false">http://tellini.info/blog/archives/77-guid.html</guid>
    <category>drives</category>
<category>fun</category>
<category>shouting</category>
<category>sysadmin</category>

</item>
<item>
    <title>Who's linking to your site?</title>
    <link>http://tellini.info/blog/archives/64-Whos-linking-to-your-site.html</link>
            <category>SysAdmin</category>
    
    <comments>http://tellini.info/blog/archives/64-Whos-linking-to-your-site.html#comments</comments>
    <wfw:comment>http://tellini.info/blog/wfwcomment.php?cid=64</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://tellini.info/blog/rss.php?version=2.0&amp;type=comments&amp;cid=64</wfw:commentRss>
    

    <author>nospam@example.com (Simone)</author>
    <content:encoded>
    If you&#039;re using &lt;a href=&quot;http://logminer.tellini.info/&quot;&gt;LogMiner&lt;/a&gt; to analyse your Apache/IIS logs, here&#039;s an easy recipe to be notified of sites that send visitors your way.&lt;br /&gt;
&lt;br /&gt;
First, let&#039;s define a Pg/PLSQL function to extract the new referrers:&lt;br /&gt;
&lt;div class=&quot;sql geshi&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;CREATE&lt;/span&gt; TYPE new_referrer &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AS&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; site_id &amp;#160; &amp;#160; &amp;#160; &amp;#160; int8&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; site_name &amp;#160; &amp;#160; &amp;#160; text&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; referrer &amp;#160; &amp;#160; &amp;#160; &amp;#160;text&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; hits &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;int&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;CREATE&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;OR&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;REPLACE&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FUNCTION&lt;/span&gt; get_new_referrers&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;RETURNS SETOF new_referrer &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AS&lt;/span&gt; $body$&lt;br /&gt;&amp;#160; &amp;#160; DECLARE&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; rec &amp;#160; &amp;#160; &amp;#160; &amp;#160; new_referrer;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; lastRef &amp;#160; &amp;#160; int8;&lt;br /&gt;&amp;#160; &amp;#160; BEGIN&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;INTO&lt;/span&gt; lastRef CAST&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; value &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AS&lt;/span&gt; int8 &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; catalog&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;WHERE&lt;/span&gt; name &lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;LastReferrer&#039;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;IF&lt;/span&gt; lastRef &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;IS&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;NULL&lt;/span&gt; THEN&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;INSERT&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;INTO&lt;/span&gt; catalog &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; name&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt; value &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;VALUES&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;LastReferrer&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; lastRef :&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; END &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;IF&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FOR&lt;/span&gt; rec &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;IN&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; EXECUTE &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;SELECT s.id AS site_id, s.name AS site_name, r.referrer, tmp.hits &#039;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;||&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;FROM ( &#039;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;||&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039; &amp;#160; SELECT site, referrer, COUNT(*) AS hits &#039;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;||&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039; &amp;#160; FROM accesses &#039;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;||&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039; &amp;#160; WHERE referrer &amp;gt; &#039;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;||&lt;/span&gt; lastRef &lt;span style=&quot;color: #66cc66;&quot;&gt;||&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039; &amp;#160; GROUP BY site, referrer &#039;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;||&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;) tmp &#039;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;||&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;JOIN sites s ON s.id = tmp.site &#039;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;||&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;JOIN referrers r ON tmp.referrer = r.id &#039;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;||&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;WHERE r.extern = true &#039;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;||&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;ORDER BY s.name, tmp.hits DESC, r.referrer&#039;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; LOOP&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;RETURN&lt;/span&gt; NEXT rec;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; END LOOP;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;UPDATE&lt;/span&gt; catalog&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SET&lt;/span&gt; value &lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; MAX&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; id &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; referrers &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;WHERE&lt;/span&gt; name &lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;LastReferrer&#039;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;RETURN&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; END;&lt;br /&gt;$body$ &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;LANGUAGE&lt;/span&gt; plpgsql;&lt;br /&gt;&amp;#160;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Then, a little PHP script to run the query and format the results:&lt;br /&gt;
&lt;div class=&quot;php geshi&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;#!/usr/local/bin/php&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000088;&quot;&gt;$lines&lt;/span&gt; &amp;#160; &amp;#160;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000088;&quot;&gt;$lastSite&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;// quickest and dirtiest way to execute a query in PHP ;-)&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/exec&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;exec&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;echo &#039;SELECT r.* &amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;FROM get_new_referrers() r &amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;LEFT JOIN search_engines se ON ( r.referrer ~* se.pattern AND r.referrer ~* se.query_pattern )&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;WHERE se.id IS NULL&#039; | /usr/local/pgsql/bin/psql -U logminer -At logminer&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000088;&quot;&gt;$lines&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$lines&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;as&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$line&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000088;&quot;&gt;$parts&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.php.net/explode&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;explode&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&#039;|&#039;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$line&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;4&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$lastSite&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;!=&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$parts&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/printf&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;printf&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;-------------------------------------------------------&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;Referrers for &lt;span style=&quot;color: #009933; font-weight: bold;&quot;&gt;%s&lt;/span&gt;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;-------------------------------------------------------&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000088;&quot;&gt;$parts&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000088;&quot;&gt;$lastSite&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$parts&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/printf&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;printf&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;[&lt;span style=&quot;color: #009933; font-weight: bold;&quot;&gt;%d&lt;/span&gt;] &lt;span style=&quot;color: #009933; font-weight: bold;&quot;&gt;%s&lt;/span&gt;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$parts&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;3&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000088;&quot;&gt;$parts&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
The query above grabs the referrers for every site available in the DB, filtering requests coming from known search engines to reduce the level of &quot;noise&quot;.&lt;br /&gt;
&lt;br /&gt;
This script is finally invoked by the cron job that processes the logs:&lt;br /&gt;
&lt;div class=&quot;bash geshi&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;referrers_report.php &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;|&lt;/span&gt; mail &lt;span style=&quot;color: #660033;&quot;&gt;-s&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;New referrers report&#039;&lt;/span&gt; email&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;@&lt;/span&gt;example.com&lt;br /&gt;&amp;#160;&lt;/div&gt; 
    </content:encoded>

    <pubDate>Fri, 20 Jun 2008 14:57:28 -0700</pubDate>
    <guid isPermaLink="false">http://tellini.info/blog/archives/64-guid.html</guid>
    <category>apache</category>
<category>iis</category>
<category>logminer</category>
<category>logs</category>
<category>referrers</category>
<category>sysadmin</category>

</item>
<item>
    <title>lm_sensors config for Asus T3-P5945GCX (P5L13L motherboard)</title>
    <link>http://tellini.info/blog/archives/52-lm_sensors-config-for-Asus-T3-P5945GCX-P5L13L-motherboard.html</link>
            <category>SysAdmin</category>
    
    <comments>http://tellini.info/blog/archives/52-lm_sensors-config-for-Asus-T3-P5945GCX-P5L13L-motherboard.html#comments</comments>
    <wfw:comment>http://tellini.info/blog/wfwcomment.php?cid=52</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://tellini.info/blog/rss.php?version=2.0&amp;type=comments&amp;cid=52</wfw:commentRss>
    

    <author>nospam@example.com (Simone)</author>
    <content:encoded>
    I&#039;ve just installed the latest Mandriva 2008.1 RC on this fine Asus barebone.&lt;br /&gt;
&lt;br /&gt;
Everything went fine, except that the output of sensors showed too many ALARM messages for my taste... so, here&#039;s how I&#039;ve modified the pre-installed &lt;strong&gt;sensors.conf&lt;/strong&gt; to set some min/max values closer to reality and to hide useless lines:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;bash geshi&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;# Winbond W83627EHF configuration originally contributed by Leon Moonen&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;# This is for an Asus P5P800, voltages for A8V-E SE.&lt;/span&gt;&lt;br /&gt;chip &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;w83627ehf-*&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;w83627dhg-*&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; label in0 &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;VCore&amp;quot;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; label in2 &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;AVCC&amp;quot;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; label in3 &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;3VCC&amp;quot;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; label in7 &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;VSB&amp;quot;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; label in8 &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;VBAT&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;# +12V is in1 and +5V is in6 as recommended by datasheet&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; compute in1 &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;@*&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;1&lt;/span&gt;+&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;56&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;, &amp;#160;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;@/&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;1&lt;/span&gt;+&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;56&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; compute in6 &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;@*&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;1&lt;/span&gt;+&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;22&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;, &amp;#160;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;@/&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;1&lt;/span&gt;+&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;22&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;set&lt;/span&gt; in1_min &amp;#160; &lt;span style=&quot;color: #000000;&quot;&gt;12.0&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;0.9&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;set&lt;/span&gt; in1_max &amp;#160; &lt;span style=&quot;color: #000000;&quot;&gt;12.0&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;1.1&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;set&lt;/span&gt; in6_min &amp;#160; &lt;span style=&quot;color: #000000;&quot;&gt;5.0&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;0.95&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;set&lt;/span&gt; in6_max &amp;#160; &lt;span style=&quot;color: #000000;&quot;&gt;5.0&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;1.05&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;set&lt;/span&gt; in4_min &amp;#160; &lt;span style=&quot;color: #000000;&quot;&gt;1.6&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;0.9&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;set&lt;/span&gt; in4_max &amp;#160; &lt;span style=&quot;color: #000000;&quot;&gt;1.6&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;1.05&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;set&lt;/span&gt; in9_min &amp;#160; &lt;span style=&quot;color: #000000;&quot;&gt;1.6&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;0.9&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;set&lt;/span&gt; in9_max &amp;#160; &lt;span style=&quot;color: #000000;&quot;&gt;1.6&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;1.05&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;# Set the 3.3V&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;set&lt;/span&gt; in2_min &amp;#160; &lt;span style=&quot;color: #000000;&quot;&gt;3.3&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;0.95&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;set&lt;/span&gt; in2_max &amp;#160; &lt;span style=&quot;color: #000000;&quot;&gt;3.3&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;1.05&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;set&lt;/span&gt; in3_min &amp;#160; &lt;span style=&quot;color: #000000;&quot;&gt;3.3&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;0.95&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;set&lt;/span&gt; in3_max &amp;#160; &lt;span style=&quot;color: #000000;&quot;&gt;3.3&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;1.05&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;set&lt;/span&gt; in7_min &amp;#160; &lt;span style=&quot;color: #000000;&quot;&gt;3.3&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;0.95&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;set&lt;/span&gt; in7_max &amp;#160; &lt;span style=&quot;color: #000000;&quot;&gt;3.3&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;1.05&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;set&lt;/span&gt; in8_min &amp;#160; &lt;span style=&quot;color: #000000;&quot;&gt;3.3&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;0.95&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;set&lt;/span&gt; in8_max &amp;#160; &lt;span style=&quot;color: #000000;&quot;&gt;3.3&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;1.05&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;# Fans&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;label fan2 &amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;CPU Fan&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; ignore fan1&lt;br /&gt;&amp;#160; ignore fan3&lt;br /&gt;&amp;#160; ignore fan4&lt;br /&gt;&amp;#160; ignore fan5&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;# Temperatures&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;label temp1 &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Sys Temp&amp;quot;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;label temp2 &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;CPU Temp&amp;quot;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;label temp3 &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;AUX Temp&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;set&lt;/span&gt; temp1_over &amp;#160;&lt;span style=&quot;color: #000000;&quot;&gt;45&lt;/span&gt;&lt;br /&gt;&amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;set&lt;/span&gt; temp1_hyst &amp;#160;&lt;span style=&quot;color: #000000;&quot;&gt;40&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Corrections are welcome. 
    </content:encoded>

    <pubDate>Sat, 08 Mar 2008 11:24:00 -0800</pubDate>
    <guid isPermaLink="false">http://tellini.info/blog/archives/52-guid.html</guid>
    <category>asus</category>
<category>linux</category>
<category>lm_sensors</category>
<category>mandriva</category>
<category>sysadmin</category>

</item>
<item>
    <title>LogMiner: purging old accesses</title>
    <link>http://tellini.info/blog/archives/48-LogMiner-purging-old-accesses.html</link>
            <category>SysAdmin</category>
    
    <comments>http://tellini.info/blog/archives/48-LogMiner-purging-old-accesses.html#comments</comments>
    <wfw:comment>http://tellini.info/blog/wfwcomment.php?cid=48</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://tellini.info/blog/rss.php?version=2.0&amp;type=comments&amp;cid=48</wfw:commentRss>
    

    <author>nospam@example.com (Simone)</author>
    <content:encoded>
    I&#039;ve just committed a function to easily purge old data from LogMiner&#039;s database, useful to prevent it from growing too much.&lt;br /&gt;
&lt;br /&gt;
It&#039;ll appear in the next version, but since its release might still be far from now, here&#039;s the code for those who need it:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;sql geshi&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;CREATE&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;OR&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;REPLACE&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FUNCTION&lt;/span&gt; cleanup&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; _site int8&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt; _upToDate date &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;br /&gt;RETURNS INT &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AS&lt;/span&gt; $body$&lt;br /&gt;&amp;#160; &amp;#160; BEGIN&lt;br /&gt;&amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;DELETE&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; accesses&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;WHERE&lt;/span&gt; req_time &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;lt;&lt;/span&gt; _upToDate&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AND&lt;/span&gt; site &lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt; _site;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ALTER&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;TABLE&lt;/span&gt; accesses &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;DROP&lt;/span&gt; CONSTRAINT accesses_request_fkey;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ALTER&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;TABLE&lt;/span&gt; accesses &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;DROP&lt;/span&gt; CONSTRAINT accesses_search_fkey;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ALTER&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;TABLE&lt;/span&gt; accesses &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;DROP&lt;/span&gt; CONSTRAINT accesses_referrer_fkey;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;DELETE&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; requests&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;WHERE&lt;/span&gt; id &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;NOT&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;IN&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;DISTINCT&lt;/span&gt; request &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; accesses &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;DELETE&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; search_referrals&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;WHERE&lt;/span&gt; id &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;NOT&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;IN&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;DISTINCT&lt;/span&gt; search &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; accesses &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;DELETE&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; referrers&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;WHERE&lt;/span&gt; id &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;NOT&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;IN&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;DISTINCT&lt;/span&gt; referrer &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; accesses &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ALTER&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;TABLE&lt;/span&gt; accesses&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ADD&lt;/span&gt; CONSTRAINT &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;accesses_request_fkey&amp;quot;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FOREIGN&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;KEY&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; request &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;REFERENCES&lt;/span&gt; requests&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; id &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ON&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;DELETE&lt;/span&gt; CASCADE;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ALTER&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;TABLE&lt;/span&gt; accesses&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ADD&lt;/span&gt; CONSTRAINT &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;accesses_search_fkey&amp;quot;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FOREIGN&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;KEY&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; search &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;REFERENCES&lt;/span&gt; search_referrals&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; id &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ON&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;DELETE&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SET&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;NULL&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ALTER&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;TABLE&lt;/span&gt; accesses&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ADD&lt;/span&gt; CONSTRAINT &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;accesses_referrer_fkey&amp;quot;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FOREIGN&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;KEY&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; referrer &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;REFERENCES&lt;/span&gt; referrers&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; id &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ON&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;DELETE&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SET&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;NULL&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;RETURN&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; END;&lt;br /&gt;$body$ &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;LANGUAGE&lt;/span&gt; plpgsql;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
For instance, if you want to keep only the last six month of data, you can set up a cron job which runs at the first day of every month executing the command:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;bash geshi&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;# supposing 1 is the id of your site&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;SELECT * FROM cleanup( 1, CAST( date_trunc( &#039;month&#039;, now() ) - interval &#039;5 months&#039; AS date ));&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;|&lt;/span&gt; psql &lt;span style=&quot;color: #660033;&quot;&gt;-U&lt;/span&gt; logminer logminer&lt;/div&gt; 
    </content:encoded>

    <pubDate>Sat, 26 Jan 2008 18:53:22 -0800</pubDate>
    <guid isPermaLink="false">http://tellini.info/blog/archives/48-guid.html</guid>
    <category>logminer</category>
<category>sysadmin</category>

</item>
<item>
    <title>Mac OS X version statistics through CFNetwork analysis</title>
    <link>http://tellini.info/blog/archives/39-Mac-OS-X-version-statistics-through-CFNetwork-analysis.html</link>
            <category>SysAdmin</category>
    
    <comments>http://tellini.info/blog/archives/39-Mac-OS-X-version-statistics-through-CFNetwork-analysis.html#comments</comments>
    <wfw:comment>http://tellini.info/blog/wfwcomment.php?cid=39</wfw:comment>

    <slash:comments>4</slash:comments>
    <wfw:commentRss>http://tellini.info/blog/rss.php?version=2.0&amp;type=comments&amp;cid=39</wfw:commentRss>
    

    <author>nospam@example.com (Simone)</author>
    <content:encoded>
    Recently I needed to gather some statistics about the distribution of the different Mac OS X versions installed by users of a certain application.&lt;br /&gt;
&lt;br /&gt;
Since the application has an update-check feature, I thought I&#039;d use the web server logs to infer the data I was interested in. The only thing I could use was the &lt;strong&gt;User-Agent&lt;/strong&gt; string sent by the application when requesting the file containing the update information.&lt;br /&gt;
&lt;br /&gt;
After some digging in Darwin&#039;s build plists and a bit of googling, I came up with this list of patterns:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
            OS            |                user agent pattern&lt;br /&gt;
--------------------------+---------------------------------------------------&lt;br /&gt;
 Mac OS X 10.2            | ^CFNetwork/1\.1$&lt;br /&gt;
 Mac OS X 10.3.2-10.3.8   | ^CFNetwork/1\.2\.1$&lt;br /&gt;
 Mac OS X 10.3.9          | ^CFNetwork/1\.2\.[2-6]$&lt;br /&gt;
 Mac OS X 10.4            | ^CFNetwork/128$&lt;br /&gt;
 Mac OS X 10.4.10         | ^CFNetwork/129\.21$&lt;br /&gt;
 Mac OS X 10.4.11         | ^CFNetwork/129\.22$&lt;br /&gt;
 Mac OS X 10.4.2          | ^CFNetwork/128\.2$&lt;br /&gt;
 Mac OS X 10.4.3          | ^CFNetwork/(129\.5|10\.4\.3)$&lt;br /&gt;
 Mac OS X 10.4.4          | ^CFNetwork/(129\.(9|10)|10\.4\.4)$&lt;br /&gt;
 Mac OS X 10.4.5          | ^CFNetwork/129\.11$&lt;br /&gt;
 Mac OS X 10.4.6          | ^CFNetwork/129\.13$&lt;br /&gt;
 Mac OS X 10.4.7          | ^CFNetwork/(129\.16|4\.0)$&lt;br /&gt;
 Mac OS X 10.4.8          | ^CFNetwork/129\.1(8|9)$&lt;br /&gt;
 Mac OS X 10.4.9          | ^CFNetwork/129\.20$&lt;br /&gt;
 Mac OS X 10.5            | ^CFNetwork/21[7-9]$&lt;br /&gt;
 Mac OS X 10.5.1          | ^CFNetwork/220$&lt;br /&gt;
 Mac OS X 10.5-prerelease | ^CFNetwork/1[4-9][0-9](\.[0-9])?|20[0-9]|21[0-9]$&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
They might not be 100% correct, but they&#039;re good enough. 
    </content:encoded>

    <pubDate>Fri, 07 Dec 2007 12:05:00 -0800</pubDate>
    <guid isPermaLink="false">http://tellini.info/blog/archives/39-guid.html</guid>
    <category>analysis</category>
<category>logminer</category>
<category>logs</category>
<category>sysadmin</category>

</item>

</channel>
</rss>