<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: This isn&#8217;t your grandpappy&#8217;s dd command</title>
	<atom:link href="http://magazine.redhat.com/2008/10/02/this-isnt-your-grandpappys-dd-command/feed/" rel="self" type="application/rss+xml" />
	<link>http://magazine.redhat.com/2008/10/02/this-isnt-your-grandpappys-dd-command/</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Mon, 30 Nov 2009 15:42:00 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: GaloAlgof</title>
		<link>http://magazine.redhat.com/2008/10/02/this-isnt-your-grandpappys-dd-command/#comment-3709</link>
		<dc:creator>GaloAlgof</dc:creator>
		<pubDate>Wed, 15 Apr 2009 21:45:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.redhatmagazine.com/2008/10/02/this-isnt-your-grandpappys-dd-command/#comment-3709</guid>
		<description>emm. thank you :)</description>
		<content:encoded><![CDATA[<p>emm. thank you <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Smith</title>
		<link>http://magazine.redhat.com/2008/10/02/this-isnt-your-grandpappys-dd-command/#comment-3097</link>
		<dc:creator>Joe Smith</dc:creator>
		<pubDate>Fri, 12 Dec 2008 19:13:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.redhatmagazine.com/2008/10/02/this-isnt-your-grandpappys-dd-command/#comment-3097</guid>
		<description>I&#039;ve been using dd to measure disk write speeds on 500 GB disk drives.  I use this perl script to compare throughput of single disks, RAID1, RAID5, RAID1+0, etc.

http://www.inwap.com/mybin/miscunix/?z1gb</description>
		<content:encoded><![CDATA[<p>I&#8217;ve been using dd to measure disk write speeds on 500 GB disk drives.  I use this perl script to compare throughput of single disks, RAID1, RAID5, RAID1+0, etc.</p>
<p><a href="http://www.inwap.com/mybin/miscunix/?z1gb" rel="nofollow">http://www.inwap.com/mybin/miscunix/?z1gb</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Yocum</title>
		<link>http://magazine.redhat.com/2008/10/02/this-isnt-your-grandpappys-dd-command/#comment-3096</link>
		<dc:creator>Dan Yocum</dc:creator>
		<pubDate>Mon, 08 Dec 2008 17:14:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.redhatmagazine.com/2008/10/02/this-isnt-your-grandpappys-dd-command/#comment-3096</guid>
		<description>&quot;I&#039;m 37!&quot;
&quot;What?&quot;
&quot;I said, I&#039;m 37.  I&#039;m not old!&quot;

You snarky little git who thinks that dd is only used by guys over 60 years old.  Humph.</description>
		<content:encoded><![CDATA[<p>&#8220;I&#8217;m 37!&#8221;<br />
&#8220;What?&#8221;<br />
&#8220;I said, I&#8217;m 37.  I&#8217;m not old!&#8221;</p>
<p>You snarky little git who thinks that dd is only used by guys over 60 years old.  Humph.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Finnbarr P. Murphy</title>
		<link>http://magazine.redhat.com/2008/10/02/this-isnt-your-grandpappys-dd-command/#comment-3095</link>
		<dc:creator>Finnbarr P. Murphy</dc:creator>
		<pubDate>Sun, 23 Nov 2008 21:44:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.redhatmagazine.com/2008/10/02/this-isnt-your-grandpappys-dd-command/#comment-3095</guid>
		<description>Here is a modified script which directly calls Google Charts and displays the resulting chart in a Gnome window using pygtk+

#!/usr/bin/env python
#
# FPMurphy 11/21/08 - Based on Redhat Magazine article
#

import sys
import os
import commands
import re
from optparse import OptionParser
import urllib
import urllib2
import pygtk
pygtk.require(&#039;2.0&#039;)
import gtk

class DisplayGraph:

    def delete_event(self, widget, event, data=None):
        return False

    def destroy(self, widget, data=None):
        gtk.main_quit()

    def __init__(self):
        self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
        self.window.connect(&quot;delete_event&quot;, self.delete_event)
        self.window.connect(&quot;destroy&quot;, self.destroy)
        self.window.set_border_width(10)
        self.window.set_position(gtk.WIN_POS_CENTER)
        self.window.set_title(&quot;Disk Throughput&quot;)
        pixbuf = gtk.gdk.pixbuf_new_from_file(&quot;/tmp/dd.png&quot;)
        os.remove(&quot;/tmp/dd.png&quot;)

        self.image = gtk.Image()
        self.image.set_from_pixbuf(pixbuf)
        self.image.show()
        self.window.add(self.image)
        self.window.show()

    def main(self):
        gtk.main()

class GoogleChart:

    def __init__(self):
        self.gchart_url = &quot;http://chart.apis.google.com/chart?&quot;
        self.gchart_type = &quot;cht=bvs&quot;
        self.gchart_size = &quot;&amp;chs=400x250&quot;
        self.gchart_axis_labels = &quot;&amp;chxt=x,y,x,y&quot;
        self.gchart_axis_position = &quot;&amp;chxp=2,50&#124;3,50&quot;
        self.gchart_data = &quot;&amp;chd=t:&quot;
        self.gchart_labels = &quot;&amp;chxl=0:&#124;&quot;
        self.gchart_title = &quot;&amp;chtt=&quot;
        self.gchart_bar_settings = &quot;&amp;chbh=30,15&quot;

    def title(self,title):
        self.gchart_title = self.gchart_title + title

    def write(self, data, labels, max_t):
        self.gchart_data = self.gchart_data + data.rstrip(&#039;,&#039;)
        self.gchart_labels = self.gchart_labels + labels + &quot;2:&#124;Block%20Size&#124;3:&#124;Mb/s&quot;
        self.gchart_axis_range = &quot;&amp;chxr=1,0,&quot; + str(max_t+10.0)
        self.gchart_scaling = &quot;&amp;chds=0,&quot; + str(max_t+10.0)
        self.gchart_url += self.gchart_type + self.gchart_title + self.gchart_size
        self.gchart_url += self.gchart_bar_settings + self.gchart_data + self.gchart_labels
        self.gchart_url += self.gchart_axis_labels + self.gchart_axis_position
        self.gchart_url += self.gchart_axis_range + self.gchart_scaling

        opener = urllib2.urlopen(self.gchart_url)
        if opener.headers[&#039;content-type&#039;] != &#039;image/png&#039;:
            raise BadContentTypeException(&#039;Server responded with a &#039; \
                 &#039;content-type of %s&#039; % opener.headers[&#039;content-type&#039;])
        open(&quot;/tmp/dd.png&quot;, &#039;wb&#039;).write(opener.read())


def get_disk_throughput(device, blocksize):
    blocksize = str(blocksize) + &#039;k&#039;
    cmd = &quot;dd if=/dev/zero of=%s bs=%s&quot; % (device, blocksize)
    output = commands.getoutput(cmd)
    throughput = 0
    unit = &quot;&quot;
    for line in output.split(&#039;n&#039;):
        s = re.search(&#039; copied,.*, (\S+) (\S+)$&#039;, line)
        if s:
            throughput = s.group(1)
            unit = s.group(2)
            break
    return (throughput, unit)

if __name__ == &quot;__main__&quot;:
    usage = &quot;usage: %prog options&quot;
    parser = OptionParser(usage=usage)
    parser.add_option(&quot;-d&quot;, &quot;--device&quot;, dest=&quot;device&quot;, \
        help=&quot;Disk device to operate on (NOTE: any data on that device will be lost)&quot;)
    (options, args) = parser.parse_args()
    device = options.device
    if not device:
        parser.print_help()
        sys.exit(1)

    max_t = 0.0
    blocksizes = [128, 256, 512, 1024, 2048, 4096, 8192]
    data=&quot;&quot;
    labels=&quot;&quot;
    for blocksize in blocksizes:
        (t, u) = get_disk_throughput(device, blocksize)
        if float(t) &gt; max_t:
             max_t = float(t)
        data += str(t) + &quot;,&quot;
        labels += str(blocksize) + &quot;k&quot; + &quot;&#124;&quot;

    chart = GoogleChart()
    chart.title(device)
    chart.write(data, labels, max_t)

    graph = DisplayGraph()
    graph.main()</description>
		<content:encoded><![CDATA[<p>Here is a modified script which directly calls Google Charts and displays the resulting chart in a Gnome window using pygtk+</p>
<p>#!/usr/bin/env python<br />
#<br />
# FPMurphy 11/21/08 &#8211; Based on Redhat Magazine article<br />
#</p>
<p>import sys<br />
import os<br />
import commands<br />
import re<br />
from optparse import OptionParser<br />
import urllib<br />
import urllib2<br />
import pygtk<br />
pygtk.require(&#8216;2.0&#8242;)<br />
import gtk</p>
<p>class DisplayGraph:</p>
<p>    def delete_event(self, widget, event, data=None):<br />
        return False</p>
<p>    def destroy(self, widget, data=None):<br />
        gtk.main_quit()</p>
<p>    def __init__(self):<br />
        self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)<br />
        self.window.connect(&#8220;delete_event&#8221;, self.delete_event)<br />
        self.window.connect(&#8220;destroy&#8221;, self.destroy)<br />
        self.window.set_border_width(10)<br />
        self.window.set_position(gtk.WIN_POS_CENTER)<br />
        self.window.set_title(&#8220;Disk Throughput&#8221;)<br />
        pixbuf = gtk.gdk.pixbuf_new_from_file(&#8220;/tmp/dd.png&#8221;)<br />
        os.remove(&#8220;/tmp/dd.png&#8221;)</p>
<p>        self.image = gtk.Image()<br />
        self.image.set_from_pixbuf(pixbuf)<br />
        self.image.show()<br />
        self.window.add(self.image)<br />
        self.window.show()</p>
<p>    def main(self):<br />
        gtk.main()</p>
<p>class GoogleChart:</p>
<p>    def __init__(self):<br />
        self.gchart_url = &#8220;http://chart.apis.google.com/chart?&#8221;<br />
        self.gchart_type = &#8220;cht=bvs&#8221;<br />
        self.gchart_size = &#8220;&amp;chs=400&#215;250&#8243;<br />
        self.gchart_axis_labels = &#8220;&amp;chxt=x,y,x,y&#8221;<br />
        self.gchart_axis_position = &#8220;&amp;chxp=2,50|3,50&#8243;<br />
        self.gchart_data = &#8220;&amp;chd=t:&#8221;<br />
        self.gchart_labels = &#8220;&amp;chxl=0:|&#8221;<br />
        self.gchart_title = &#8220;&amp;chtt=&#8221;<br />
        self.gchart_bar_settings = &#8220;&amp;chbh=30,15&#8243;</p>
<p>    def title(self,title):<br />
        self.gchart_title = self.gchart_title + title</p>
<p>    def write(self, data, labels, max_t):<br />
        self.gchart_data = self.gchart_data + data.rstrip(&#8216;,&#8217;)<br />
        self.gchart_labels = self.gchart_labels + labels + &#8220;2:|Block%20Size|3:|Mb/s&#8221;<br />
        self.gchart_axis_range = &#8220;&amp;chxr=1,0,&#8221; + str(max_t+10.0)<br />
        self.gchart_scaling = &#8220;&amp;chds=0,&#8221; + str(max_t+10.0)<br />
        self.gchart_url += self.gchart_type + self.gchart_title + self.gchart_size<br />
        self.gchart_url += self.gchart_bar_settings + self.gchart_data + self.gchart_labels<br />
        self.gchart_url += self.gchart_axis_labels + self.gchart_axis_position<br />
        self.gchart_url += self.gchart_axis_range + self.gchart_scaling</p>
<p>        opener = urllib2.urlopen(self.gchart_url)<br />
        if opener.headers['content-type'] != &#8216;image/png&#8217;:<br />
            raise BadContentTypeException(&#8216;Server responded with a &#8216; \<br />
                 &#8216;content-type of %s&#8217; % opener.headers['content-type'])<br />
        open(&#8220;/tmp/dd.png&#8221;, &#8216;wb&#8217;).write(opener.read())</p>
<p>def get_disk_throughput(device, blocksize):<br />
    blocksize = str(blocksize) + &#8216;k&#8217;<br />
    cmd = &#8220;dd if=/dev/zero of=%s bs=%s&#8221; % (device, blocksize)<br />
    output = commands.getoutput(cmd)<br />
    throughput = 0<br />
    unit = &#8220;&#8221;<br />
    for line in output.split(&#8216;n&#8217;):<br />
        s = re.search(&#8216; copied,.*, (\S+) (\S+)$&#8217;, line)<br />
        if s:<br />
            throughput = s.group(1)<br />
            unit = s.group(2)<br />
            break<br />
    return (throughput, unit)</p>
<p>if __name__ == &#8220;__main__&#8221;:<br />
    usage = &#8220;usage: %prog options&#8221;<br />
    parser = OptionParser(usage=usage)<br />
    parser.add_option(&#8220;-d&#8221;, &#8220;&#8211;device&#8221;, dest=&#8221;device&#8221;, \<br />
        help=&#8221;Disk device to operate on (NOTE: any data on that device will be lost)&#8221;)<br />
    (options, args) = parser.parse_args()<br />
    device = options.device<br />
    if not device:<br />
        parser.print_help()<br />
        sys.exit(1)</p>
<p>    max_t = 0.0<br />
    blocksizes = [128, 256, 512, 1024, 2048, 4096, 8192]<br />
    data=&#8221;"<br />
    labels=&#8221;"<br />
    for blocksize in blocksizes:<br />
        (t, u) = get_disk_throughput(device, blocksize)<br />
        if float(t) > max_t:<br />
             max_t = float(t)<br />
        data += str(t) + &#8220;,&#8221;<br />
        labels += str(blocksize) + &#8220;k&#8221; + &#8220;|&#8221;</p>
<p>    chart = GoogleChart()<br />
    chart.title(device)<br />
    chart.write(data, labels, max_t)</p>
<p>    graph = DisplayGraph()<br />
    graph.main()</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Finnbarr P. Murphy</title>
		<link>http://magazine.redhat.com/2008/10/02/this-isnt-your-grandpappys-dd-command/#comment-3094</link>
		<dc:creator>Finnbarr P. Murphy</dc:creator>
		<pubDate>Sat, 22 Nov 2008 22:04:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.redhatmagazine.com/2008/10/02/this-isnt-your-grandpappys-dd-command/#comment-3094</guid>
		<description>This is the correction for the regular expression:
s = re.search(&#039; copied,.*, (\S+) (\S+)$&#039;, line)</description>
		<content:encoded><![CDATA[<p>This is the correction for the regular expression:<br />
s = re.search(&#8216; copied,.*, (\S+) (\S+)$&#8217;, line)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ivan Baldin</title>
		<link>http://magazine.redhat.com/2008/10/02/this-isnt-your-grandpappys-dd-command/#comment-3093</link>
		<dc:creator>Ivan Baldin</dc:creator>
		<pubDate>Fri, 03 Oct 2008 21:29:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.redhatmagazine.com/2008/10/02/this-isnt-your-grandpappys-dd-command/#comment-3093</guid>
		<description>Really interesting way of doing that but the script is missing few escape chars (&#039;\&#039;) on lines 11 and 12.</description>
		<content:encoded><![CDATA[<p>Really interesting way of doing that but the script is missing few escape chars (&#8216;\&#8217;) on lines 11 and 12.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ruth Suehle</title>
		<link>http://magazine.redhat.com/2008/10/02/this-isnt-your-grandpappys-dd-command/#comment-3092</link>
		<dc:creator>Ruth Suehle</dc:creator>
		<pubDate>Fri, 03 Oct 2008 13:04:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.redhatmagazine.com/2008/10/02/this-isnt-your-grandpappys-dd-command/#comment-3092</guid>
		<description>Jeff--we added the complete piece.</description>
		<content:encoded><![CDATA[<p>Jeff&#8211;we added the complete piece.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Russle</title>
		<link>http://magazine.redhat.com/2008/10/02/this-isnt-your-grandpappys-dd-command/#comment-3091</link>
		<dc:creator>Mike Russle</dc:creator>
		<pubDate>Thu, 02 Oct 2008 21:10:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.redhatmagazine.com/2008/10/02/this-isnt-your-grandpappys-dd-command/#comment-3091</guid>
		<description>There is also a Python module that does Google Charts for you without having to construct the URL yourself. It&#039;s called &lt;a&gt;pygooglechart&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>There is also a Python module that does Google Charts for you without having to construct the URL yourself. It&#8217;s called <a>pygooglechart</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Schroeder</title>
		<link>http://magazine.redhat.com/2008/10/02/this-isnt-your-grandpappys-dd-command/#comment-3090</link>
		<dc:creator>Jeff Schroeder</dc:creator>
		<pubDate>Thu, 02 Oct 2008 17:07:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.redhatmagazine.com/2008/10/02/this-isnt-your-grandpappys-dd-command/#comment-3090</guid>
		<description>Can you put the script online as a whole so we don&#039;t have to copy / paste snippets?

The version in this article _does not work_

Traceback (most recent call last):
  File &quot;foo.py&quot;, line 34, in
    (t, u) = get_disk_throughput(device, blocksize)
  File &quot;foo.py&quot;, line 19, in get_disk_throughput
    return (throughput, unit)
UnboundLocalError: local variable &#039;unit&#039; referenced before assignment


Copy here:
http://pastebin.com/m7526b1ea</description>
		<content:encoded><![CDATA[<p>Can you put the script online as a whole so we don&#8217;t have to copy / paste snippets?</p>
<p>The version in this article _does not work_</p>
<p>Traceback (most recent call last):<br />
  File &#8220;foo.py&#8221;, line 34, in<br />
    (t, u) = get_disk_throughput(device, blocksize)<br />
  File &#8220;foo.py&#8221;, line 19, in get_disk_throughput<br />
    return (throughput, unit)<br />
UnboundLocalError: local variable &#8216;unit&#8217; referenced before assignment</p>
<p>Copy here:<br />
<a href="http://pastebin.com/m7526b1ea" rel="nofollow">http://pastebin.com/m7526b1ea</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
