<?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>Мой веб-журнал &#187; Programming</title>
	<atom:link href="http://blog.johnford.info/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.johnford.info</link>
	<description>John Ford</description>
	<lastBuildDate>Fri, 02 Jul 2010 23:55:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Figuring out which files are touched while installing software</title>
		<link>http://blog.johnford.info/figuring-out-which-files-are-touched-while-installing-software/</link>
		<comments>http://blog.johnford.info/figuring-out-which-files-are-touched-while-installing-software/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 17:34:07 +0000</pubDate>
		<dc:creator>John Ford</dc:creator>
				<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.johnford.info/?p=223</guid>
		<description><![CDATA[We are working on getting our infrastructure up to speed for Maemo 5 and Maemo 5 QT builds.  A critical part of Maemo5 building is the scratchbox.  This is a toolkit that Nokia uses to make development on for their linux based phones easier.  We have enough linux build slaves in production [...]]]></description>
			<content:encoded><![CDATA[<p>We are working on getting our infrastructure up to speed for Maemo 5 and Maemo 5 QT builds.  A critical part of Maemo5 building is the scratchbox.  This is a toolkit that Nokia uses to make development on for their linux based phones easier.  We have enough linux build slaves in production that it is impractical to deploy scratchbox by hand on each machine.  Scratchbox also does internet package downloads which means that we could get different packages each time we try to install the scratchbox.  We already have a fairly old version of scratchbox which is set up with the Chinook sdk that we have used for doing our Maemo builds thus far.  Originally I was under the impression that we were going to need to have 2 totally seperate scratchbox installations but thanks to Doug T. for showing me how to upgrade our existing scratchbox 4 installation to scratchbox 5.  </p>
<p>My concern with this upgrade, however, was that files outside the <code>/builds/scratchbox</code> directory were going to be touched.  I wanted to be thorough so I did an experiment.  I ran <code>find -mount -type f -exec openssl md5 '{}' \; | tee -a /file-list ; find -mount -type f -exec openssl md5 '{}' \; | tee -a /file-list</code> before and after the scratchbox upgrade.  The <code>-mount</code> and two different runs at our two mountpoints was to ensure that we didn&#8217;t hash things like the <code>/dev, /proc, /sys</code> filesystem.  My original intent was to do <code>diff file-list1 file-list2</code> but that resulted in showing me every single file that changed.  I only wanted to know the files that changed outside of my scratchbox root directory of <code>/builds/scratchbox</code>.  My diff was polluted by 77,000 files that resided in the scratcbox root.  I figured that the best option at the time was to hack up a quick python script:</p>
<pre>
#!/usr/bin/python
#This file is a quick script to process the output of
# find / -mount -type f -exec openssl md5 '{}' \; | tee -a
import sys, os.path, re

if not len(sys.argv) == 3:
    print "purple monkey dishwasher"
    exit(1)
filename_a = sys.argv[1]
filename_b = sys.argv[2]
if not os.path.exists(filename_a) or not os.path.exists(filename_b):
    print "insert change into meter and press green button"
    exit(1)
data={}
pattern = re.compile("^MD5\((?P<file>.*)\)= (?P<hash>.*)$")
#Get the data from A
f = open(filename_a, 'r')
for i in f.readlines():
    m = pattern.search(i)
    data[m.group('file')] = m.group('hash')
f.close()
f = open(filename_b, 'r')
sbfile = re.compile("^/builds/scratchbox") #pattern describing files to ignore
#Figure out diff to B
f = open(filename_b, 'r')
for i in f.readlines():
    m = pattern.search(i)
    if not data.has_key(m.group('file')):
        if not sbfile.search(m.group('file')):
            print 'new file - ', m.group('file')
    else:
         if not sbfile.search(m.group('file')):
             if not data[m.group('file')] == m.group('hash'):
                 print 'updated file - ', m.group('file')
</pre>
<p>This is code I have written to scratch my own itch.  I am posting this as it might be useful to someone else.  if you wanted to ignore a different directory you&#8217;d change <code>sbfile = re.compile("^/builds/scratchbox")</code> to be a pattern describing your path to ignore.  If you wanted to find all things that changed over your whole partition you would remove sbfile and all sbfile checks to have a final bit of code like</p>
<pre>
#Figure out diff to B
f = open(filename_b, 'r')
for i in f.readlines():
    m = pattern.search(i)
    if not data.has_key(m.group('file')):
        print 'new file - ', m.group('file')
    else:
         if not data[m.group('file')] == m.group('hash'):
             print 'updated file - ', m.group('file')
</pre>
<p>In the end, I found that the scratchbox upgrade that I did only changed my bash_history and added some tarballs to /tmp.  I am very glad that this is the case as it really simplifies our deployment of the new scratchbox!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.johnford.info/figuring-out-which-files-are-touched-while-installing-software/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Python Frameworks</title>
		<link>http://blog.johnford.info/python-frameworks/</link>
		<comments>http://blog.johnford.info/python-frameworks/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 22:27:00 +0000</pubDate>
		<dc:creator>John Ford</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://johnford.info/blog/?p=58</guid>
		<description><![CDATA[I came to a descision today that I was going to learn a Python ORM framework to use.  My project is going to require a lot of database access and using an ORM framework simplifies this.  The ORM also hides many of the complexities.  If you are interested, I&#8217;d highly recomend following [...]]]></description>
			<content:encoded><![CDATA[<p>I came to a descision today that I was going to learn a Python ORM framework to use.  My project is going to require a lot of database access and using an ORM framework simplifies this.  The ORM also hides many of the complexities.  If you are interested, I&#8217;d highly recomend following this <a href='http://www.sqlalchemy.org/docs/05/ormtutorial.html#building-a-relation'>tutorial</a>.</p>
<p>In doing some research into my CGI + SQLite issue I have been constantly asked &#8220;&#8230;but why are you using CGI&#8221;.  It turns out that CGI + Python is not really used much.  Many people recomend using mod_wsgi, and I think that instead of using raw wsgi I would like to use a framework.  So far, CherryPy is what is sticking out to me because it is very lightweight and includes its own development server.  This makes it easier to test my code because I (hopefully) would be able to use the Eclipse/Pydev debugger.  This is something I have wanted to for quite some time.  The main reason I am looking into CherryPy is that it seems to not worry itself with forcing a templating system on you.</p>
<p>In a related note, I found a JavaScript jQuery plugin which looks really neat and could prove to be very valuable.  It is called TableSorter.  There is an example of a pagination system that really caught my eye <a href='http://tablesorter.com/docs/example-pager.html'>here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.johnford.info/python-frameworks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSX Development</title>
		<link>http://blog.johnford.info/osx-development/</link>
		<comments>http://blog.johnford.info/osx-development/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 03:16:00 +0000</pubDate>
		<dc:creator>John Ford</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://johnford.info/blog/?p=39</guid>
		<description><![CDATA[I am noticing that a lot of people are having trouble getting used to developing on OSX.  I hope that this is useful to those people, I am targeting someone who has at least some experience with Linux or another unix-like OS.  I haven&#8217;t been using OSX long myself, but I have adapted [...]]]></description>
			<content:encoded><![CDATA[<p>I am noticing that a lot of people are having trouble getting used to developing on OSX.  I hope that this is useful to those people, I am targeting someone who has at least some experience with Linux or another unix-like OS.  I haven&#8217;t been using OSX long myself, but I have adapted quickly <img src='http://blog.johnford.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span style="font-weight:bold;">What is XCode?</span><br />XCode is more than an application, it is a complete development environment.  When someone &#8216;installs xcode&#8217; they are installing compilers, frameworks, headers and build tools.  If you can compile a C program you have XCode.  Just to be sure, you can check by using commands like this
<pre>vortex:~ jhford$ which gcc/usr/bin/gccvortex:~ jhford$ which g++/usr/bin/g++vortex:~ jhford$ which make/usr/bin/makevortex:~ jhford$ which xcodebuild/usr/bin/xcodebuild</pre>
<p><span style="font-weight:bold;">What is MacPorts</span><br />MacPorts is a system utility to ease installing non-apple unix software.  This program is used to install things like subversion, mercurial, libidl, autoconf213 and ccache.  Basically, what this program does is fetch sources, patches and build instructions and compiles the program for your system.  This is very similar to BSD ports.  To use the utility, you use the <code>port</code> command.  Some sample uses:
<pre>sudo port install ccache mercurial libidl autoconf213port search subversionport list installed</pre>
<p>The man page is the best place to go for help with MacPorts (<code>man port</code>).  Unlike Fink, which uses Debian/Ubuntu&#8217;s apt-get internally, all things you install through MacPorts are compiled on your machine during install.  Word of warning: don&#8217;t need anything in a hurry!  Our network is <a href="http://jamesboston.ca/cms/?q=node/70">notoriously slow</a> with MacPorts.</p>
<p><span style="font-weight:bold;">What is a .dmg?</span><br />A .dmg is a compressed disc image format.  It contains one or more filessytems, usually HFS+ (read: mac filesystem).  This is how most .app and .pkg files are distributed because it maintains the mac specific file meta data.</p>
<p><span style="font-weight:bold;">What is a .app? .pkg?</span><br />You might have noticed that some applications are just icons, like Firefox or OpenOffice.  To install them you drag the icon into your /Applications folder and boom, intalled.  The most important thing to remember here is .app is just a folder! I will prove it<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_8ipG4VXvP2c/SZJH3qMXGBI/AAAAAAAAADk/DAoPNriNPrc/s1600-h/Picture+1.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 320px;" src="http://2.bp.blogspot.com/_8ipG4VXvP2c/SZJH3qMXGBI/AAAAAAAAADk/DAoPNriNPrc/s400/Picture+1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5301378732913006610" /></a><br />This means that if you want to start an application that is in a .app from the command line to see console output, you can do something like <code>$ /Applications/Firefox.app/Contents/MacOS/firefox</code> or <code>/Applications/OpenOffice.org.app/Contents/MacOS/soffice</code>.  Usually your application will live under <code>Appname.app/Contents/MacOS/</code></p>
<p>A .pkg file is an installer file, kind of like a .run script on linux or a .msi file in windows.  It is too just a folder.  Lots of things that are folders have file extensions on OSX.  If in doubt, run file on it in Terminal</p>
<p><span style="font-weight:bold;">Universal Binary?</span><br />In case you didn&#8217;t know, Macs used to have PowerPC cpus.  To ease the transition from PowerPC to Intel, Apple created something called a &#8216;Universal Binary&#8217;.  These are basically executable files which can be run on either processor.  If you want to check if you have made one you can use the unix command &#8216;file&#8217; on the application.  An example of a Firefox release binary shows that this is a universal binary:
<pre>vortex:Firefox.app jhford$ file Contents/MacOS/firefox-bin Contents/MacOS/firefox-bin: Mach-O universal binary with 2 architecturesContents/MacOS/firefox-bin (for architecture i386): Mach-O executable i386Contents/MacOS/firefox-bin (for architecture ppc): Mach-O executable ppc</pre>
<p>Sometimes the second architecture will mention ppc7440 or something similar, this means it is a G4+ binary (i.e. requires altivec, similar to MMX/SSE).</p>
<p><span style="font-weight:bold;">Command, Option, Control?</span><br />I guess this is only applicable if you are in front of the machine.  Command, Option and Control are similar to but not identical to Start, Alt and Control.  In OSX, things are a little more logical.  If the key combo you want to use involves doing something, say, close a tab, it is Command + W.  In Windows/Linux it is Control + W.  Keep this in mind, nearly all ctrl or alt key combos for GUI programs on Windows or Linux are the same on Mac but with Command.  Option, like the name implies, give you an option.  Say you have save and save as.  Command + S is like save and since save all is so similar, it may have Command + Option + S.  Worst case, you can look around in the menu bar at the top of the screen.  A clover-ish thing means Command, a downward sloping line is Option and an up arrow is Shift.</p>
<p>On the command line, Control works just like ctrl in Windows or Linux.  Control + D will give you EOF, Control + C will quit the application.</p>
<p><span style="font-weight:bold;">Screenshots!</span><br />To take a screenshot simple press one of:<br />  Command + Shift + 3 &#8211; Fullscreen<br />  Command + Shift + 4 &#8211; An area of the screen, like Snipping Tool in Vista<br />  Command + Shift + 4 then release and press space &#8211; A &#8216;view&#8217;, could be a window or a sheet.  Like Alt+Printscreen<br />These commmands will place the pictures on your desktop in the format PictureX.png where X is automatically incrementing.</p>
<p>Hopefully this helps you get the hang of Mac.  If you have any questions feel free to leave a comment or ping me in IRC at <a href="irc://irc.mozilla.org/#seneca">irc://irc.mozilla.org/#seneca</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.johnford.info/osx-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pydoc Server ?!?!</title>
		<link>http://blog.johnford.info/pydoc-server/</link>
		<comments>http://blog.johnford.info/pydoc-server/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 05:33:00 +0000</pubDate>
		<dc:creator>John Ford</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://johnford.info/blog/?p=37</guid>
		<description><![CDATA[For all of you working on anything python:pydoc -p 3500. This will create an http server at http://localhost:3500/ to browse all the python module documentation currently loaded.
]]></description>
			<content:encoded><![CDATA[<p>For all of you working on anything python:<code>pydoc -p 3500</code>. This will create an http server at <code>http://localhost:3500/</code> to browse all the python module documentation currently loaded.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.johnford.info/pydoc-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DistCC on OSX for Mozilla Builds</title>
		<link>http://blog.johnford.info/distcc-on-osx-for-mozilla-builds/</link>
		<comments>http://blog.johnford.info/distcc-on-osx-for-mozilla-builds/#comments</comments>
		<pubDate>Sat, 07 Feb 2009 01:18:00 +0000</pubDate>
		<dc:creator>John Ford</dc:creator>
				<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://johnford.info/blog/?p=31</guid>
		<description><![CDATA[I have gotten Mozilla to build using DistCC on Mac.  Luckily, everything you need is already installed with XCode.  If you can build Mozilla in the machine, you should be good to build using DistCC.  DistCC is a wrapper for the compiler which distributes portions of the build process to other machines. [...]]]></description>
			<content:encoded><![CDATA[<p>I have gotten Mozilla to build using DistCC on Mac.  Luckily, everything you need is already installed with XCode.  If you can build Mozilla in the machine, you should be good to build using DistCC.  DistCC is a wrapper for the compiler which distributes portions of the build process to other machines.  Some things which can&#8217;t be done in a distributed way like linking are done on the machine in the driver&#8217;s seat.  In DistCC you have one client and many servers.  I found this confusing at first, because I was thinking of the computer driving the build as serving jobs for clients, but in fact, it is the client which is using &#8216;compile servers&#8217;.  </p>
<p>This is actually a very simple thing to set up, once you know what you are doing.  For this blog post, I tested using two of our school macs.  I have spain (142.204.133.122) as a build server and canada (142.204.133.7) as a client.  On all the server machines I have started the DistCC daemon by running <code>distccd --daemon</code>.  It is possible to run this with only allowing jobs from specified IPs but this is easier.  Make sure that port 3632 is reachable by your servers as that is where the jobs are sent and results received.  On the client machine (in this case canada) I need to configure distcc to make use of the build servers.  With the included version of DistCC on Leopard, you have to specify this using an exported environmental variable.  I used <code>export DISTCC_HOSTS='localhost 142.204.133.122'</code> in the shell I ran the build from.  Next you are going to need to wrap the compilers to make use of DistCC.  I have done this by overriding the default C and C++ compilers in my .mozconfig file (below) with the CC and CXX environment variable in my make flags.  You will want to specify a job count (-j6 in this instance) to make use of DistCC.  It is hard to pick a good number, but it should definitely be greater than the number of total processor cores and some say an extra two for good measure. </p>
<p><code>canada:~ jhford$ cat ~/.mozconfig <br />mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj<br />ac_add_options --enable-application=browser<br />mk_add_options MOZ_MAKE_FLAGS="CC='distcc /usr/bin/gcc' CXX='distcc /usr/bin/g++' -j6"</code> </p>
<p>When you start your build with <code>make -f client.mk build</code> you will be able to monitor the status of your distribution using the also included <code>distccmon-text</code>.  An important thing to note, which caused me much grief, is that this program is run on the DistCC client (the driver). This program will give you a nice little bit of output like this:</p>
<p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_8ipG4VXvP2c/SYznOsRHePI/AAAAAAAAADU/Q4BWw3lNFY4/s1600-h/Picture+3.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 306px;" src="http://4.bp.blogspot.com/_8ipG4VXvP2c/SYznOsRHePI/AAAAAAAAADU/Q4BWw3lNFY4/s400/Picture+3.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5299865101095368946" /></a></p>
<p>This shows you which jobs are going to which machines.  Another thing that indicates that distcc is working is the g++ build steps, which should now look like this (greatly abridged) example:</p>
<p><code>distcc /usr/bin/g++ -o nsMorkHistoryImporter.o -c -I../../../../dist/include/system_wrappers -include /Users/jhford/mozilla-central/config/gcc_hidden.h -DXPCOM_TRANSLATE_NSGM_ENTRY_POINT=1 -DMOZILLA_INTERNAL_API -D_IMPL_NS_COM -DEXPORT_XPT_API -DEXPORT_XPTC_API -D_IMPL_NS_COM_OBSOLETE -D_IMPL_NS_GFX -D_IMPL_NS_WIDGET -DIMPL_XREAPI -DIMPL_NS_NET -DIMPL_THEBES  -DZLIB_INTERNAL -DOSTYPE=\"Darwin9.6.0\" -DOSARCH=Darwin</code></p>
<p>As far as results go: with an iMac that has 1GB of memory as client I got these times for the DistCC with a Mac Mini as a server (-j6):<br /><code>real    20m41.704s<br />user    22m5.748s<br />sys     5m22.026s</code></p>
<p>With 12 jobs (-j12) I got:<br /><code>real    19m54.374s<br />user    20m39.539s<br />sys     5m20.019s</code></p>
<p>And with just the single iMac with 1GB (-j4):<br /><code>real    20m25.626s<br />user    27m3.408s<br />sys     4m22.820s</code></p>
<p>I watched the output of the distccmon-text and noticed that only about half of the files get distributed, with the other half being done on localhost.  I am thinking that it would be good to test this with a more powerful machine as the client and more servers, but as this is right now, there is nearly zero benefit to this configuration.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.johnford.info/distcc-on-osx-for-mozilla-builds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My thoughts on Fedora</title>
		<link>http://blog.johnford.info/my-thoughts-on-fedora/</link>
		<comments>http://blog.johnford.info/my-thoughts-on-fedora/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 17:28:00 +0000</pubDate>
		<dc:creator>John Ford</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://johnford.info/blog/?p=30</guid>
		<description><![CDATA[I wouldn&#8217;t normally write this, but someone asked me what my thoughts are regarding Fedora and Ubuntu on IRC.  A bit of background:  I started using RHL 5.2 and stuck with it until Fedora Core 1 was out.  I strongly disliked FC1 and moved to SuSE(9.1) and later Ubuntu.  I used [...]]]></description>
			<content:encoded><![CDATA[<p>I wouldn&#8217;t normally write this, but someone asked me what my thoughts are regarding Fedora and Ubuntu on IRC.  A bit of background:  I started using RHL 5.2 and stuck with it until Fedora Core 1 was out.  I strongly disliked FC1 and moved to SuSE(9.1) and later Ubuntu.  I used Ubuntu for a long time (5.04 until 8.04) then went back to Fedora in a big way (F8-F11Alpha, CentOS).</p>
<p>I guess what I love about Fedora is that it uses the latest versions of software because.  Patches are either pushed upstream or killed.  This means that the software is distributed as the authors intended.  This also means that Fedora is a team player, Fedora gives back to the developers and respects the upstream developer&#8217;s judgement.  This is important to me, especially as highlighted by the <a href="http://www.itnews.com.au/News/76080,openssl-bug-found-in-debian-linux.aspx">Debian OpenSSL kerfuffle</a>.  It is also interesting to note that much of the software used by Linux distributions was written by Fedora contributors.</p>
<p>Another thing is forward thinking.  Fedora doesn&#8217;t worry about what we have now,  Fedora is working on the future.  This means that occasionally certain functionality is broken in a new version but in the long run the situation is improved.  An example of this is the Plymouth boot screen application.  It requires a relatively new feature (KMS, Kernel Mode Setting) to work properly.  This doesn&#8217;t work with closed source drivers but it is definitely the way to go. </p>
<p>A <a href="http://brainstorm.ubuntu.com/idea/11165/">post on the Ubuntu Brainstorm</a> by <a href="http://brainstorm.ubuntu.com/contributor/ajjeckmans/" class="authorlink">ajjeckmans</a> seems to sum up my thoughts of how ubuntu works in respect to their use of open source software &#8220;I support the idea but I do think that it should only be considered after Fedora has done all the dirty work of getting it to work at all <img src='http://blog.johnford.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> &#8221;.  While this only be one user, it occurs in a setting that if anything, encourages this behaviour.  This post highlights everything I dislike about ubuntu.</p>
<p>I also like that Fedora is purely Free and Open Source.  Like being agile, this annoys some people, but I feel that this is probably the key differentiation between Fedora and ubuntu.  Fedora will not bend on its promise to be free and freely distributable.  ubuntu used to have this promise, but seemed to loose its focus when they started including proprietary drivers and even encourages their use with the &#8216;Hardware Drivers&#8217; application.  Again, they are becoming less worried about Open Source as if memory serves me correctly, it used to be called &#8216;Restricted Drivers&#8217;.  This transforms proprietary software from &#8220;scary, don&#8217;t use this&#8221; to &#8220;par for the course&#8221;.  This is highly indicative of the chant I seem to hear from the ubuntu ecosystem: &#8220;Make it work for me now! I don&#8217;t care how, I don&#8217;t care about helping out, I don&#8217;t care about the people who wrote this&#8221;.  Maybe that is just my own cynicism. </p>
<p>Credit where credit is due though,  ubuntu does put together a very polished and easy to use product.  It is simply an amazing <span style="font-weight: bold;">use</span> of open source software, but it isn&#8217;t for me.</p>
<p>btw, the straw that broke the camels back: Alsa 1.0.16.  Ubuntu 8.04 didn&#8217;t have it and Fedora 8 did.  Without this version of Alsa, my desktop soundcard didn&#8217;t work at all and my laptop didn&#8217;t mute with headphones.  Every time I look at Linux operating systems, I am thankful for this.  I am also especially thankful for Red Hat&#8217;s support of an awesome project!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.johnford.info/my-thoughts-on-fedora/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First Core i7 Mozilla build. It was quick!</title>
		<link>http://blog.johnford.info/first-core-i7-mozilla-build-it-was-quick/</link>
		<comments>http://blog.johnford.info/first-core-i7-mozilla-build-it-was-quick/#comments</comments>
		<pubDate>Tue, 25 Nov 2008 21:08:00 +0000</pubDate>
		<dc:creator>John Ford</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://johnford.info/blog/?p=18</guid>
		<description><![CDATA[I finally got my desktop back together with a shiny new Intel Core i7 920, 6GB of DDR3.  I haven&#8217;t overclocked anything yet and my entire build tree and operating system is on one 7200RPM drive.  This thing is really fast for builds!  I just built Firefox in less than 5 minutes. [...]]]></description>
			<content:encoded><![CDATA[<p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_8ipG4VXvP2c/SSxq_dM2JLI/AAAAAAAAACI/JFy4O4bUPl8/s1600-h/core-i7-build.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 238px;" src="http://2.bp.blogspot.com/_8ipG4VXvP2c/SSxq_dM2JLI/AAAAAAAAACI/JFy4O4bUPl8/s400/core-i7-build.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5272706902146819250" /></a><br />I finally got my desktop back together with a shiny new Intel Core i7 920, 6GB of DDR3.  I haven&#8217;t overclocked anything yet and my entire build tree and operating system is on one 7200RPM drive.  This thing is really fast for builds!  I just built Firefox in less than 5 minutes.  I did <code>make -s -j16 -f client.mk clean</code> then <code>time make -s -j16 -f client.mk build</code> and got the following output.<code><br />real 4m50.217s<br />user 2m44.854s<br />sys 0m55.450s</code></p>
<p>I used this as my mozconfig:<code><br />#John Ford's MozConfig file</p>
<p>ac_add_options --enable-application=browser<br />ac_add_options --disable-tests<br />ac_add_options --enable-official-branding</p>
<p>mk_add_options MOZ_CO_PROJECT=browser<br />mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-@CONFIG_GUESS@</code></p>
<p>I should have done a build before I went to the new hardware as a comparison, but my old hardware is essentially the same as liberia and china over at CDOT.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.johnford.info/first-core-i7-mozilla-build-it-was-quick/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grokzilla &#8211; Code indexing revisited</title>
		<link>http://blog.johnford.info/grokzilla-code-indexing-revisited/</link>
		<comments>http://blog.johnford.info/grokzilla-code-indexing-revisited/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 15:35:00 +0000</pubDate>
		<dc:creator>John Ford</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://johnford.info/blog/?p=15</guid>
		<description><![CDATA[I finally decided to write a script to automate setting up OpenGrok for Mozilla&#8217;s Mercurial Repository.  This script creates a new repository the first time it is run then updates it on subsequent runs.  The output of all programs is logged to files to aid in debugging.  To set this script up [...]]]></description>
			<content:encoded><![CDATA[<p>I finally decided to write a <a href="http://zenit.senecac.on.ca/wiki/index.php/OpenGrok">script </a>to automate setting up OpenGrok for Mozilla&#8217;s Mercurial Repository.  This script creates a new repository the first time it is run then updates it on subsequent runs.  The output of all programs is logged to files to aid in debugging.  To set this script up on a local machine you will need to have a Java Application Server, such as <a href="http://jboss.org/">JBoss </a>or <a href="http://tomcat.apache.org/">Tomcat </a>and all related dependancies (<a href="http://java.net/">Java</a>), <a href="http://ctags.sourceforge.net/">Exuberant Ctags</a>, <a href="http://www.gnu.org/software/bash/">bash</a>, <a href="http://opensolaris.org/os/project/opengrok/">OpenGrok</a> and <a href="http://www.selenic.com/mercurial/wiki/">Mercurial</a>.  The details of this script are posted on my Wiki page for it and I can be reached on Mozilla&#8217;s IRC in #seneca as John64 if you need a little help with it.</p>
<p>I&#8217;d like to take this further if it is seen as valuable to the Mozilla community.  Currently, OpenGrok considers all top level directories to be a project within it&#8217;s code.  I can change this to be whatever needed.  I have a sample instance running at <a href="http://142.204.133.36:8080/grokzilla/">http://142.204.133.36:8080/grokzilla/</a> but that might be up or down depending on many things.  It is very possible for me to theme the web application and if there is interest in setting up this for community use I am willing to work on that.  Should I file a bug on Mozilla&#8217;s Bugzilla to track this?  I don&#8217;t know.</p>
<p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_8ipG4VXvP2c/SSLks3sQk6I/AAAAAAAAABY/ELROp7uDlv0/s1600-h/OpenGrok-Annotate.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://4.bp.blogspot.com/_8ipG4VXvP2c/SSLks3sQk6I/AAAAAAAAABY/ELROp7uDlv0/s400/OpenGrok-Annotate.jpg" alt="" id="BLOGGER_PHOTO_ID_5270025973491864482" border="0" /></a><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_8ipG4VXvP2c/SSLk4TKX4QI/AAAAAAAAABg/9qemYZMxO4g/s1600-h/OpenGrok-Diff.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://1.bp.blogspot.com/_8ipG4VXvP2c/SSLk4TKX4QI/AAAAAAAAABg/9qemYZMxO4g/s400/OpenGrok-Diff.jpg" alt="" id="BLOGGER_PHOTO_ID_5270026169844490498" border="0" /></a><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_8ipG4VXvP2c/SSLlED6vdRI/AAAAAAAAABo/O4nlhnJvGDY/s1600-h/OpenGrok-History.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://4.bp.blogspot.com/_8ipG4VXvP2c/SSLlED6vdRI/AAAAAAAAABo/O4nlhnJvGDY/s400/OpenGrok-History.jpg" alt="" id="BLOGGER_PHOTO_ID_5270026371910825234" border="0" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.johnford.info/grokzilla-code-indexing-revisited/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing the gold linker on Mozilla</title>
		<link>http://blog.johnford.info/testing-the-gold-linker-on-mozilla/</link>
		<comments>http://blog.johnford.info/testing-the-gold-linker-on-mozilla/#comments</comments>
		<pubDate>Sun, 19 Oct 2008 18:53:00 +0000</pubDate>
		<dc:creator>John Ford</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://johnford.info/blog/?p=13</guid>
		<description><![CDATA[I decided it is time to do something that isn&#8217;t Fedora or JBoss related.  I noticed that Dave Humphrey would like to test the new Gold linker included in binutils with Firefox.
I used kvm test this.I launched kvm with sudo qemu-kvm -hda gold-tests -cdrom F10-Snap2-i686-Live.iso -boot d -smp 2 -m 3500. I installed the [...]]]></description>
			<content:encoded><![CDATA[<p>I decided it is time to do something that isn&#8217;t Fedora or JBoss related.  I noticed that Dave Humphrey would like to test the new Gold linker included in binutils with Firefox.</p>
<p>I used kvm test this.<br />I launched kvm with <code>sudo qemu-kvm -hda gold-tests -cdrom F10-Snap2-i686-Live.iso -boot d -smp 2 -m 3500</code>. I installed the required software to build Firefox then make 2 additional copies of the hard disk image, giving me three in total.  One as backup, one for regular ld and one for gold.  I compiled binutils from source without using RPM because this is a one off test system which I don&#8217;t care about breaking.  If I was going to continue using this system I would have modified the package descriptor for binutils to enable gold.</p>
<p>The Following packages were installed to facilitate compilation:
<ul>
<li>groupinstall &#8220;Development Tools&#8221;</li>
<li>gtk2-devel</li>
<li>libXt-devel</li>
<li>freetype-devel</li>
<li>dbus-glib-devel</li>
<li>alsa-lib-devel</li>
<li>curl-devel</li>
<li>ORBit2-devel</li>
<p></ul>
<p>According to this <a href="http://sourceware.org/ml/binutils/2008-03/msg00162.html">news list post</a> when you compile binutils you either get the regular linker or the gold linker.  To do this you specify <code>--enable-gold</code> when running ./configure.  I am going to install binutils using both to test both with the same version of binutils.  I will start from my clean image each time.</p>
<p>Since the version of binutils in my installation is different to my tarball, i used the &#8211;version option to verify that it installed successfully.  As suggested in the original contributions page, I will export LD=gold as an environmental variable, but only on the vm with gold for obvious reasons.  I am compiling firefox with the default options from the <a href="ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/3.0/source/">tarball</a> as <code>./configure --prefix=/home/jhford --enable-application=browser; time make -j8 -s > ~/mozbuildtime; make install</code>.  I also bumped my -smp flag to 4 to match my host and to ensure I get the best possible performance out of my vms.</p>
<p>Here is the time for a non-gold build.<br />
<table>
<tbody>
<tr>
<td>real</td>
<td>9m3.720s</td>
</tr>
<tr>
<td>user</td>
<td>4m28.562s</td>
</tr>
<tr>
<td>sys</td>
<td>11m1.834s</td>
</tr>
</tbody>
</table>
<p>And the times for a gold build I aliased ld to &#8216;ld &#8211;threads &#8211;thread-count 4&#8242; for these runs as well as exporting LD=gold.<br />
<table>
<tbody>
<tr>
<td>real</td>
<td>8m41.445s</td>
</tr>
<tr>
<td>user</td>
<td>4m18.749s</td>
</tr>
<tr>
<td>sys</td>
<td>10m45.263s</td>
</tr>
</tbody>
</table>
<p>Initially, I was getting that gold was cutting my builds in half, but it turns out I accidentally did make with j4 instead of j8.  I found that consistently, gold builds were faster but not by a substantial enough amount to justify having to manually enable it in your package manager of choice.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.johnford.info/testing-the-gold-linker-on-mozilla/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Compiz on Fedora 9</title>
		<link>http://blog.johnford.info/compiz-on-fedora-9/</link>
		<comments>http://blog.johnford.info/compiz-on-fedora-9/#comments</comments>
		<pubDate>Thu, 09 Oct 2008 18:57:00 +0000</pubDate>
		<dc:creator>John Ford</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://johnford.info/blog/?p=9</guid>
		<description><![CDATA[Since switching to Fedora I have figured out how to configure everything the way I like it, except for Compiz.  I found that while Compiz works with Fedora out of the box, it isn&#8217;t configured as I like it, and the tool included only has support to enable a desktop cube and wobbly windows. [...]]]></description>
			<content:encoded><![CDATA[<p>Since switching to Fedora I have figured out how to configure everything the way I like it, except for Compiz.  I found that while Compiz works with Fedora out of the box, it isn&#8217;t configured as I like it, and the tool included only has support to enable a desktop cube and wobbly windows.  The annoying thing is that there is a great program called ccsm (Compiz Config Settings Manager) which works out of the box on Ubuntu but wouldn&#8217;t work for me in Fedora.  The program ran exactly as it should but none of the settings were applied.  I started by installing <code>fusion-icon</code> and starting it.  After doing this, I found that I had no window decorations.  I fixed this by installing <code>compiz-gnome</code> which provides a program called <code>gtk-window-decorator</code>.  This progam decorates windows, but it uses a very plain decoration which I don&#8217;t particularly like.  My next attempt was to install the beryl emerald them engine.  I have never liked emerald because of the themes available.  I really wanted my metacity themes in compiz.  After googling for a while, i struck gold!  There is a gconf key to set gtk-window-decorator to use metacity themes  </p>
<p>Here is the command to change the required key:<br /><code>gconftool-2 -s /apps/gwd/use_metacity_theme -t bool true</code></p>
<p>Thanks to &#8216;David&#8217; for his <a href="http://osdir.com/ml/video.opengl.compiz.general/2006-09/msg00045.html">post on OSDir.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.johnford.info/compiz-on-fedora-9/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
