<?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>Michele&#039;s blog</title>
	<atom:link href="http://acksyn.org/diary/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://acksyn.org/diary</link>
	<description>Random geeky ramblings...</description>
	<lastBuildDate>Tue, 06 Dec 2011 08:09:12 +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>List all your Forwarders with Powershell</title>
		<link>http://acksyn.org/diary/?p=738</link>
		<comments>http://acksyn.org/diary/?p=738#comments</comments>
		<pubDate>Tue, 06 Dec 2011 08:09:12 +0000</pubDate>
		<dc:creator>Michele Baldessari</dc:creator>
				<category><![CDATA[en]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://acksyn.org/diary/?p=738</guid>
		<description><![CDATA[I clearly lied about on my previous post about being the last Microsoft-based post. Here&#8217;s what I did to check all our forwarders in our forest: $domain = "corp.local" $myForest = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest() $dc_list = $myforest.Sites &#124; % { $_.Servers } &#124; Select Name foreach ($dc in $dc_list) {     $DCName = $dc.Name     $Server = [...]]]></description>
			<content:encoded><![CDATA[<p>I clearly lied about on my previous post about being the last Microsoft-based post. Here&#8217;s what I did to check all our forwarders in our forest:</p>
<pre>$domain = "corp.local"
$myForest = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest()
$dc_list = $myforest.Sites | % { $_.Servers } | Select Name

foreach ($dc in $dc_list) {
    $DCName = $dc.Name
    $Server = Get-WMIObject -Computer $DCName -Namespace "root\MicrosoftDNS" -Class "MicrosoftDNS_Server"
    $Forwarders = $Server.Forwarders
    Write-Host $DCName ":" $Forwarders
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://acksyn.org/diary/?feed=rss2&#038;p=738</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lync Contact Groups and Powershell</title>
		<link>http://acksyn.org/diary/?p=734</link>
		<comments>http://acksyn.org/diary/?p=734#comments</comments>
		<pubDate>Sun, 27 Nov 2011 23:02:06 +0000</pubDate>
		<dc:creator>Michele Baldessari</dc:creator>
				<category><![CDATA[en]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://acksyn.org/diary/?p=734</guid>
		<description><![CDATA[This will be likely one of my last Windows posts (more on that later). At work we did upgrade our OCS Server to Lync. Besides the annoyance of changing product name every two releases, this new version removed the possibility that existed in OCS to provision the contact groups for the ocs client. It was [...]]]></description>
			<content:encoded><![CDATA[<p>This will be likely one of my last Windows posts (more on that later). At work we did upgrade our OCS Server to Lync. Besides the annoyance of changing product name every two releases, this new version removed the possibility that existed in OCS to provision the contact groups for the ocs client. It was a WMI interface and it was quite <a href="http://blogs.technet.com/b/csps/archive/2010/11/15/r2manageusercontactlists.aspx">handy</a>.</p>
<p>Especially in cases where the rollout is not company-wide and users aren&#8217;t sure who has Lync and who doesn&#8217;t, having groups provisioned administratively is very handy. So I spent a couple of evenings solving this topic and it turned out that it&#8217;s not really *that* difficult <img src='http://acksyn.org/diary/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>After poking a bit in the DB I noticed some handy stored procedures that would be quite handy. So I cooked up a script that takes a folder and for every csv file stored in that folder (one samaccount per line), it creates a group named as the file and it populates it with the users contained in that file. I.e.: the file <strong>IT-Dept.csv </strong>that contains users <strong>jon123</strong> and <strong>joe456</strong>, will create a group called &#8220;IT-Dept&#8221; which contains both users and only for those two users.</p>
<p>Disclaimer: this script is still buggy, it&#8217;s coded horrendously and it&#8217;s a very quick hack. Backup your db before toying with it. I won&#8217;t have time to clean it up or refine it so feel free to tweak it, put it on github etc <img src='http://acksyn.org/diary/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Here it is: <a href="http://acksyn.org/files/sync-lync-rosters.ps1">sync-lync-rosters.ps1</a></p>
]]></content:encoded>
			<wfw:commentRss>http://acksyn.org/diary/?feed=rss2&#038;p=734</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft PKI and Powershell</title>
		<link>http://acksyn.org/diary/?p=729</link>
		<comments>http://acksyn.org/diary/?p=729#comments</comments>
		<pubDate>Mon, 12 Sep 2011 08:52:52 +0000</pubDate>
		<dc:creator>Michele Baldessari</dc:creator>
				<category><![CDATA[en]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://acksyn.org/diary/?p=729</guid>
		<description><![CDATA[I need to check among all issued certificates from a Microsoft PKI if there is a disabled or non valid Active Directory account. Since powershell seems to be the future for scripting on Microsoft platform, I cooked up the following script: check-ad-pki.ps1 It uses the powershell PKI module which can be found here. It&#8217;s my [...]]]></description>
			<content:encoded><![CDATA[<p>I need to check among all issued certificates from a Microsoft PKI if there is a disabled or non valid Active Directory account. Since powershell seems to be the future for scripting on Microsoft platform, I cooked up the following script: <a href="http://acksyn.org/files/check-ad-pki.ps1">check-ad-pki.ps1</a> It uses the powershell PKI module which can be found<a href="http://pspki.codeplex.com/"> here</a>.</p>
<p>It&#8217;s my first stab at something with powershell, so I do appreciate any feedback on this. If anyone has better approaches to check the issue of certificates for a user that is now disabled or expired, that would be cool too <img src='http://acksyn.org/diary/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://acksyn.org/diary/?feed=rss2&#038;p=729</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nagios Check for Fortigate Clusters</title>
		<link>http://acksyn.org/diary/?p=724</link>
		<comments>http://acksyn.org/diary/?p=724#comments</comments>
		<pubDate>Thu, 08 Sep 2011 09:48:58 +0000</pubDate>
		<dc:creator>Michele Baldessari</dc:creator>
				<category><![CDATA[en]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://acksyn.org/diary/?p=724</guid>
		<description><![CDATA[It&#8217;s the month of nagios checks I guess.. I needed to monitor the status of the HA Fortigate clusters we have around the world. There is a very rudimentary plugin on the nagios exchange site, but it is a perl script that forks another perl script a bunch of times and I already have 600 [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s the month of nagios checks I guess.. I needed to monitor the status of the HA Fortigate clusters we have around the world. There is a very rudimentary <a href="http://exchange.nagios.org/directory/Plugins/Uncategorized/Software/SNMP/Cluster-Fortigates/details">plugin </a>on the nagios exchange site, but it is a perl script that forks another perl script a bunch of times and I already have 600 hosts and more than a thousand services, so I thought I&#8217;d implement something a bit cleaner in python <img src='http://acksyn.org/diary/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>The only documentation on the Fortigate HA Mibs I was able to find is here: http://www.oidview.com/mibs/12356/FORTINET-MIB-280.html</p>
<p>Interestingly enough the OID that contains the names of the nodes in the cluster (SNMPv2-SMI::enterprises.12356.1.100.6.1.11.) is nowhere mentioned there. The standard Fortigate cluster is a fairly strange beast in the sense that there is only one ip address (no physical ip&#8217;s plus the virtual one like in most clusters) and the firewalls exchange all the configuration and info through multicast on a separate link. That&#8217;s why the first time the script runs it stores the names and the serial numbers of the nodes in a file and then checks that the order is the same in its subsequent runs.</p>
<p>Here is the script: <a href="http://acksyn.org/files/fortinet-ha.py">fortinet-ha.py</a></p>
<p>I didn&#8217;t add any snmp v1 or snmp v3 support as I have no time at the moment, but that should be quite trivial to add.</p>
]]></content:encoded>
			<wfw:commentRss>http://acksyn.org/diary/?feed=rss2&#038;p=724</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>dd &amp; mount</title>
		<link>http://acksyn.org/diary/?p=719</link>
		<comments>http://acksyn.org/diary/?p=719#comments</comments>
		<pubDate>Mon, 05 Sep 2011 16:05:44 +0000</pubDate>
		<dc:creator>Michele Baldessari</dc:creator>
				<category><![CDATA[en]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://acksyn.org/diary/?p=719</guid>
		<description><![CDATA[Long time no blog. As a note to myself, so I won&#8217;t forget anymore: When you pull a full disk image (sda.disk) with dd and it contains more than one partition just do the following (multiply times 512 bytes the sector start, mount will figure the rest out by itself): bazz:/mnt/ntfs/# sfdisk -l -uS sda.disk [...]]]></description>
			<content:encoded><![CDATA[<p>Long time no blog. As a note to myself, so I won&#8217;t forget anymore:</p>
<p>When you pull a full disk image (sda.disk) with dd and it contains more than one partition just do the following (multiply times 512 bytes the sector start, mount will figure the rest out by itself):</p>
<pre>bazz:/mnt/ntfs/# sfdisk -l -uS sda.disk
Disk sda.disk: cannot get geometry

Disk sda.disk: 9729 cylinders, 255 heads, 63 sectors/track
Units = sectors of 512 bytes, counting from 0

 Device Boot    Start       End   #sectors  Id  System
sda.disk1            63 156296384  156296322   7  HPFS/NTFS
sda.disk2   *  19438650  19470779      32130   e  W95 FAT16 (LBA)
 start: (c,h,s) expected (1023,254,63) found (1023,0,1)
sda.disk3             0         -          0   0  Empty
sda.disk4             0         -          0   0  Empty
bazz:/mnt/ntfs/# mount -oloop,offset=$(echo "63*512" | bc) sda.disk /mnt/foo</pre>
]]></content:encoded>
			<wfw:commentRss>http://acksyn.org/diary/?feed=rss2&#038;p=719</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mediawiki and greensql</title>
		<link>http://acksyn.org/diary/?p=714</link>
		<comments>http://acksyn.org/diary/?p=714#comments</comments>
		<pubDate>Sat, 15 Jan 2011 19:36:13 +0000</pubDate>
		<dc:creator>Michele Baldessari</dc:creator>
				<category><![CDATA[en]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://acksyn.org/diary/?p=714</guid>
		<description><![CDATA[If you want to use the green sql firewall with mediawiki, you&#8217;ll need a small patch that disables the SQL comments in every query: diff -up ./includes/db/Database.php.orig ./includes/db/Database.php --- ./includes/db/Database.php.orig    2011-01-15 20:31:07.000000000 +0100 +++ ./includes/db/Database.php    2011-01-15 20:31:48.000000000 +0100 @@ -473,19 +473,19 @@ abstract class DatabaseBase { # Add a comment for easy SHOW PROCESSLIST interpretation [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to use the <a href="http://www.greensql.net/">green sql firewall</a> with <a href="http://www.mediawiki.org">mediawiki</a>, you&#8217;ll need a small patch that disables the SQL comments in every query:</p>
<pre>diff -up ./includes/db/Database.php.orig ./includes/db/Database.php
--- ./includes/db/Database.php.orig    2011-01-15 20:31:07.000000000 +0100
+++ ./includes/db/Database.php    2011-01-15 20:31:48.000000000 +0100
@@ -473,19 +473,19 @@ abstract class DatabaseBase {

 # Add a comment for easy SHOW PROCESSLIST interpretation
 #if ( $fname ) {
-            global $wgUser;
-            if ( is_object( $wgUser ) &amp;&amp; !($wgUser instanceof StubObject) ) {
-                $userName = $wgUser-&gt;getName();
-                if ( mb_strlen( $userName ) &gt; 15 ) {
-                    $userName = mb_substr( $userName, 0, 15 ) . '...';
-                }
-                $userName = str_replace( '/', '', $userName );
-            } else {
-                $userName = '';
-            }
-            $commentedSql = preg_replace('/\s/', " /* $fname $userName */ ", $sql, 1);
+        #    global $wgUser;
+        #    if ( is_object( $wgUser ) &amp;&amp; !($wgUser instanceof StubObject) ) {
+        #        $userName = $wgUser-&gt;getName();
+        #        if ( mb_strlen( $userName ) &gt; 15 ) {
+        #            $userName = mb_substr( $userName, 0, 15 ) . '...';
+        #        }
+        #        $userName = str_replace( '/', '', $userName );
+        #    } else {
+        #        $userName = '';
+        #    }
+    #    #    $commentedSql = preg_replace('/\s/', " /* $fname $userName */ ", $sql, 1);
 #} else {
-        #    $commentedSql = $sql;
+            $commentedSql = $sql;
 #}

 # If DBO_TRX is set, start a transaction
</pre>
]]></content:encoded>
			<wfw:commentRss>http://acksyn.org/diary/?feed=rss2&#038;p=714</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Firefox Pdf printing woes</title>
		<link>http://acksyn.org/diary/?p=699</link>
		<comments>http://acksyn.org/diary/?p=699#comments</comments>
		<pubDate>Tue, 11 Jan 2011 20:25:05 +0000</pubDate>
		<dc:creator>Michele Baldessari</dc:creator>
				<category><![CDATA[en]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://acksyn.org/diary/?p=699</guid>
		<description><![CDATA[When printing to a PDF file in Firefox gives horrible and broken spacing between characters, disable autohinting in your ~/.fonts.conf and restart it : &#60;match target="font" &#62; &#60;edit mode="assign" name="hintstyle" &#62; &#60;const&#62;hintnone&#60;/const&#62; &#60;/edit&#62; &#60;/match&#62; The problem is known in the Firefox community but it&#8217;s not solved. This is especially useful if you use mozilla2ps in [...]]]></description>
			<content:encoded><![CDATA[<p>When printing to a PDF file in Firefox gives horrible and broken spacing between characters, disable autohinting in your ~/.fonts.conf and restart it :</p>
<pre> &lt;match target="font" &gt;
   &lt;edit mode="assign" name="hintstyle" &gt;
     &lt;const&gt;hintnone&lt;/const&gt;
   &lt;/edit&gt;
&lt;/match&gt;</pre>
<p>The problem is <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=403513">known</a> in the Firefox community but it&#8217;s not solved. This is especially useful if you use <a href="http://acksyn.org/mozilla2ps/index.html">mozilla2ps</a> in Xvfb on your server and the problem is noticeable.</p>
]]></content:encoded>
			<wfw:commentRss>http://acksyn.org/diary/?feed=rss2&#038;p=699</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Nagios check_crl.py</title>
		<link>http://acksyn.org/diary/?p=690</link>
		<comments>http://acksyn.org/diary/?p=690#comments</comments>
		<pubDate>Sat, 01 Jan 2011 12:12:12 +0000</pubDate>
		<dc:creator>Michele Baldessari</dc:creator>
				<category><![CDATA[en]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://acksyn.org/diary/?p=690</guid>
		<description><![CDATA[Here&#8217;s a different approach to check your PKI&#8217;s crl than the one existing on the nagios plugins website. I rewrote it in python in order to be able to fetch CRLs from a web server: http://acksyn.org/files/check_crl.py Note: Updated it to python3 and with correct exit codes. Not too tested still.]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a different approach to check your PKI&#8217;s crl than the one existing on the nagios plugins website. I rewrote it in python in order to be able to fetch CRLs from a web server: <a href="http://acksyn.org/files/check_crl.py">http://acksyn.org/files/check_crl.py</a></p>
<p>Note:</p>
<p>Updated it to python3 and with correct exit codes. Not too tested still.</p>
]]></content:encoded>
			<wfw:commentRss>http://acksyn.org/diary/?feed=rss2&#038;p=690</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Toying with IPv6</title>
		<link>http://acksyn.org/diary/?p=679</link>
		<comments>http://acksyn.org/diary/?p=679#comments</comments>
		<pubDate>Wed, 20 Oct 2010 21:06:49 +0000</pubDate>
		<dc:creator>Michele Baldessari</dc:creator>
				<category><![CDATA[en]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://acksyn.org/diary/?p=679</guid>
		<description><![CDATA[During my summer holidays I started reading up a bit in IPv6. Partly out of sheer curiosity and partly because in 2011 the real fun will start. I started reading the excellent &#8220;Running IPv6&#8221; book by Apress. I can heartily recommend this book: practical, detailed and with a lot of background information on the choices [...]]]></description>
			<content:encoded><![CDATA[<p>During my summer holidays I started reading up a bit in IPv6. Partly out of sheer curiosity and partly because in 2011 the real fun will start. I started reading the excellent &#8220;<a href="http://www.amazon.de/Running-IPv6-Iljitsch-Van-Beijnum/dp/1590595270/ref=sr_1_1?ie=UTF8&amp;s=books-intl-de&amp;qid=1287608027&amp;sr=8-1">Running IPv6</a>&#8221; book by Apress. I can heartily recommend this book: practical, detailed and with a lot of background information on the choices that have been made during the IETF IPv6 standardization processes.</p>
<p>After having read a few chapters, I needed to get my feet wet with IPv6 and so I went for the hunt for an IPv6 tunnel broker&#8230; First I checked if my current ISP (Telecom Italia..[sic]) had something available. Apparently, they had a project called <a href="http://www.ngnet.it/">ngnet.it</a> going on for their ipv6 testbed, but their site seems to be down so I presume that it has been discontinued. The choice came down to SixXS and Hurricane Electric. I chose Hurricane Electric because they seemed less intrusive with the registration process. The setup was trivial and everything was up and running quite smoothly.</p>
<p>The only hiccup was to remember to clamp the mss to the mtu also with ip6tables and not only with iptables. Once I figured that out the whole IPv6 experience was pretty smooth:</p>
<pre>ip6tables -t mangle -A FORWARD -o hurricane -p tcp -m tcp --tcp-flags SYN,RST SYN -m tcpmss --mss 1250:1536 -j TCPMSS --clamp-mss-to-mtu</pre>
<p>Setting up IPv6 connectivity on my server was trivial since no IPv6-in-IPv4 tunnels were needed. A couple of AAAA records and Imap, Dns, Ssh and Http were working without any problems at all.</p>
<p>Just for the fun of it I took their quiz <img src='http://acksyn.org/diary/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><a href="http://ipv6.he.net/certification/scoresheet.php?pass_name=mbaldessari" target="_blank"><img src="http://ipv6.he.net/certification/create_badge.php?pass_name=mbaldessari&amp;badge=1" border="0" alt="IPv6 Certification Badge for mbaldessari" width="128" height="128" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://acksyn.org/diary/?feed=rss2&#038;p=679</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>New domain</title>
		<link>http://acksyn.org/diary/?p=670</link>
		<comments>http://acksyn.org/diary/?p=670#comments</comments>
		<pubDate>Sat, 09 Oct 2010 06:51:59 +0000</pubDate>
		<dc:creator>Michele Baldessari</dc:creator>
				<category><![CDATA[en]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://acksyn.org/diary/?p=670</guid>
		<description><![CDATA[So after about 10 years of using the pupazzo.org, I decided it was time for a change. I did not like the domain name any longer. That&#8217;s why I switched to the new acksyn.org name. With this change I completely changed the mail server setup and moved to dovecot and postfix with virtual users mapped [...]]]></description>
			<content:encoded><![CDATA[<p>So after about 10 years of using the pupazzo.org, I decided it was time for a change. I did not like the domain name any longer. That&#8217;s why I switched to the new acksyn.org name. With this change I completely changed the mail server setup and moved to dovecot and postfix with virtual users mapped to system users. I still need to fix a couple of things here and there, but most of the services should be in place.</p>
<p>I will still be reading my mail to the old domain for some time, but please use the new one if you read this.</p>
<p>As an added bonus smtp, www and imap are now reachable via IPv6 <img src='http://acksyn.org/diary/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://acksyn.org/diary/?feed=rss2&#038;p=670</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

