<?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>Lynxworks &#187; Ubuntu</title>
	<atom:link href="http://blog.lynxworks.eu/category/ubuntu/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.lynxworks.eu</link>
	<description>I don&#039;t think there are any dragons here</description>
	<lastBuildDate>Sat, 31 Mar 2012 12:42:41 +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>A quick thank you</title>
		<link>http://blog.lynxworks.eu/2012/03/packaging/</link>
		<comments>http://blog.lynxworks.eu/2012/03/packaging/#comments</comments>
		<pubDate>Sun, 18 Mar 2012 19:34:00 +0000</pubDate>
		<dc:creator>Dougie</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[CAS]]></category>
		<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[Maxima]]></category>
		<category><![CDATA[Packaging]]></category>
		<category><![CDATA[Planet Ubuntu]]></category>
		<category><![CDATA[Thanks]]></category>

		<guid isPermaLink="false">http://blog.lynxworks.eu/?p=2246</guid>
		<description><![CDATA[I needed wxMaxima but the version in the repositories is a little older (one major revision). Compiling from source is straightforward but a recent discussion I had with students showed they shied away from it. So I figured I&#8217;d try &#8230; <a href="http://blog.lynxworks.eu/2012/03/packaging/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I needed <a href="http://andrejv.github.com/wxmaxima/">wxMaxima</a> but the version in the repositories is a little older (one major revision). Compiling from source is straightforward but a recent discussion I had with students showed they shied away from it.</p>
<p>So I figured I&#8217;d try packaging and a couple of hours later and I&#8217;ve a copy in my PPA. I&#8217;m unsure who maintains the <a href="https://wiki.ubuntu.com/PackagingGuide/Complete">packaging guide</a> so I wanted to say thank you on Ubuntu Planet hoping those involved see it. Its great when you want to try something, find comprehensive instructions and can wrap it up in a few hours.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lynxworks.eu/2012/03/packaging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Forget everything you knew about coding (or perhaps remember, depending on your age)</title>
		<link>http://blog.lynxworks.eu/2011/12/forget-everything-you-knew-about-coding-or-perhaps-remember-depending-on-your-age/</link>
		<comments>http://blog.lynxworks.eu/2011/12/forget-everything-you-knew-about-coding-or-perhaps-remember-depending-on-your-age/#comments</comments>
		<pubDate>Sun, 25 Dec 2011 20:34:06 +0000</pubDate>
		<dc:creator>Dougie</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[COBOL]]></category>
		<category><![CDATA[Planet Ubuntu]]></category>
		<category><![CDATA[Project Euler]]></category>

		<guid isPermaLink="false">http://blog.lynxworks.eu/?p=2037</guid>
		<description><![CDATA[This Christmas I&#8217;m going to embrace the past. COmmon Business Oriented Language (COBOL) 85 standard was the first language I was taught. Napier University was a feeder into the banking and insurance industries in Edinburgh at the time and they &#8230; <a href="http://blog.lynxworks.eu/2011/12/forget-everything-you-knew-about-coding-or-perhaps-remember-depending-on-your-age/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This Christmas I&#8217;m going to embrace the past.</p>
<p>COmmon Business Oriented Language (COBOL) 85 standard was the first language I was taught. Napier University was a feeder into the banking and insurance industries in Edinburgh at the time and they had sizeable COBOL farms. It proved profitable too, as a number of students I knew went to the US to alleviate Y2K bugs in thousands of legacy applications. COBOL had fallen out of favour in US colleges.</p>
<p><span id="more-2037"></span>I was talking to someone the other day who mentioned that he maintains COBOL legacy applications. Apparently things have gone full circle for the UK, where COBOL is no longer taught so his company outsources to India. I&#8217;m not overly surprised COBOL is dying out as an educational tool because as languages go its not like much else &#8211; Dijkstra certainly didn&#8217;t <a href="http://www.cs.utexas.edu/users/EWD/transcriptions/EWD04xx/EWD498.html">rate it</a>:</p>
<blockquote><p>The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offence.</p></blockquote>
<p>Who am I to argue with the man who <a href="http://www.cs.utexas.edu/users/EWD/transcriptions/EWD02xx/EWD215.html">killed the</a> <em>goto</em> statement? Certainly as a language it has issues &#8211; the 86 standard wasn&#8217;t totally compatible with the previous 74 standard; it has no functions; and it has no pointers. Then again it was in part based around the work of <a href="http://en.wikipedia.org/wiki/Grace_Hopper">Rear Admiral Grace Hopper</a>, the coolest woman ever in computer science, so it couldn&#8217;t be all bad could it? She believed that programming languages in mathematical notation were generally not well understood &#8211; COBOL is about as self documenting as it gets. It is a product of its time &#8211; for example the first six columns are reserved for sequence numbers, this came about as forms were used to write programs which were in turn converted to punch cards.</p>
<p>An example is the best way to explain this, so I decided to <a title="Find the sum of all the multiples of 3 or 5 below 1000" href="http://blog.lynxworks.eu/2011/06/find-the-sum-of-all-the-multiples-of-3-or-5-below-1000/">revisit</a> Project Euler&#8217;s first problem and code it in COBOL, something I haven&#8217;t touched in <em>years</em>. As Rear Admiral Grace Hopper said:</p>
<blockquote><p>It&#8217;s easier to ask for forgiveness than it is to get permission.</p></blockquote>
<p>Of course we need a compiler, Ubuntu has <a href="http://www.opencobol.org/">Open COBOL</a> available:</p>
<pre class="brush: bash; gutter: true">sudo apt-get install open-cobol</pre>
<p>Lets consider the problem again:</p>
<blockquote><p>If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.</p>
<p>Find the sum of all the multiples of 3 or 5 below 1000.</p></blockquote>
<p>My solution is to iterate through every number from 1 to 1000, test if it divides by 3 or 5 without a remainder and if so then add it to a counter. In pseudocode:</p>
<pre class="brush: text; gutter: true">For counter = 1 to 1000 Step 1
    If counter % 3 = 0 or number % 5 = 0 Then
        total = total + counter
    End If
End For
Display total</pre>
<p>But wait &#8211; this is COBOL, a language that doesn&#8217;t include the word &#8220;terse&#8221;. So let&#8217;s adapt this to a more verbose piece of pseudocode:</p>
<pre class="brush: text; gutter: true">For counter = 1 To 1000
    If counter % 3 = 0 Then
        Set flag To TRUE
    End If
    If counter % 5 = 0 Then
        Set flag To TRUE
    End If
    If flag = TRUE Then
        total = total + counter
        Set flag To FALSE
    End If
    Display total
End For</pre>
<p>Right, here we go. Its been a <em>long time</em>.  COBOL is organised into divisions, sections, paragraphs, sentences and statements &#8211; all are terminated by a period. There are four divisions:</p>
<ul>
<li>Identification. Unsurprisingly contains information about the program.</li>
<li>Environment. This isn&#8217;t initially obvious but is concerned with portability &#8211; this section allows you to isolate anything that is platform specific. So in theory only the environment division needs changing between platforms.</li>
<li>Data. This holds all the variables and has four sections &#8211; file (file handling); linkage (used with sub-routines); report (for report writers); and the one you almost always need, working-storage (where all your working variables are).</li>
<li>Procedure. Guess what? Yes this is where the program itself is.</li>
</ul>
<div><span style="font-size: small;"><span style="line-height: 24px;">Let&#8217;s start with the beginning:</span></span></div>
<pre class="brush: text; gutter: true">        IDENTIFICATION DIVISION.
        PROGRAM-ID. EULER_PROBLEM_ONE.</pre>
<p>Not much explanation required there then. We don&#8217;t need an environment division, it doesn&#8217;t hurt to populate the division name anyway.</p>
<p>The next division requires a little more explanation. We need a working-storage section but COBOL defines variables using level, name, picture clause and optionally a value.</p>
<p>Picture clauses define a variable&#8217;s format. Levels allow data to be grouped, for example if you defined a student as having an ID and a name you might have:</p>
<pre class="brush: text; gutter: true">01 student.
    02 identifier          PIC A9(7).
    02 name                PIC A(30).</pre>
<p>Level numbers are for the most part arbitrary as long as the lower the number the higher the level, with the exception of 66 (deprecated), 77 (individual elements) and 88 (used to define conditions). Picture clauses can use: 9 (digit); A (letter); X (digit or letter); V (decimal point); S (sign). You can use A(30) rather than typing loads of A&#8217;s.</p>
<p>That just leaves us a procedure division. If you have ever coded assembler then you&#8217;ll probably find this easier than if you&#8217;ve used C. You need to describe every step. The main iteration construct we need from our pseudocode is a For Loop. COBOL has a PERFORM statement, you need to increment your counter yourself:</p>
<pre class="brush: text; gutter: true">PERFORM UNTIL counter = 3
    ADD 1 TO counter GIVING counter
END-PERFORM.</pre>
<p>A general convention is to use upper-case for reserved words and lower-case for variables. Pretty much all operations follow this command&#8217;s format &#8211; do something (ADD 1) to something (counter) and store it somewhere (counter).</p>
<pre class="brush: text; gutter: true">IF condition1 &gt; condition2 THEN
   STATEMENT
ELSE
   STATEMENT
END-IF.</pre>
<p>You can nest if statements (there&#8217;s no Else If statement). Its not uncommon to find a lot of legacy code that only uses IF statements, why I don&#8217;t know because it has a Case statement called EVALUATE.</p>
<p>That just leaves us assignment:</p>
<pre class="brush: text; gutter: true">MOVE value TO variable</pre>
<p>Putting it all together, you need variables to Hold temporary values used to calculate answers, I always call it <em>junk</em>:</p>
<pre class="brush: text; gutter: true">        IDENTIFICATION DIVISION.
        PROGRAM-ID. EULER_PROBLEM_ONE.

        ENVIRONMENT DIVISION.

        DATA DIVISION.
        WORKING-STORAGE SECTION.
        01 total        PIC 999999     VALUE 0.
        01 counter      PIC 9999       VALUE 1.
        01 junk         PIC 999999     VALUE 0.
        01 flag         PIC 9          VALUE 0.

        PROCEDURE DIVISION.
        PERFORM UNTIL counter = 1000
             COMPUTE junk = FUNCTION MOD (counter, 3)
             IF junk = 0 THEN
                 MOVE 1 TO flag
             END-IF
             COMPUTE junk = FUNCTION MOD (counter, 5)
             IF junk = 0 THEN
                MOVE 1 TO flag
             END-IF
             IF flag = 1 THEN
                ADD counter TO total GIVING total
                MOVE 0 TO flag
             END-IF
             ADD 1 TO counter GIVING counter
        END-PERFORM.
        DISPLAY total.
        STOP RUN.</pre>
<p>Remember that indentation is important (despite the code formatting here not wanting to do it) &#8211; areas A and B take the first 6 characters so you need to begin in column 7.</p>
<p>Save the file as euler.cob, compile and run it:</p>
<pre class="brush: bash; gutter: true">cobc -x euler.cob
./euler</pre>
<p>Giving the correct answer of 233168, albeit without any frills.</p>
<div id="attachment_2059" class="wp-caption alignnone" style="width: 291px"><a href="http://blog.lynxworks.eu/wp-content/uploads/2011/12/Capture.png"><img class="size-full wp-image-2059" title="Hold on to your hats..." src="http://blog.lynxworks.eu/wp-content/uploads/2011/12/Capture.png" alt="Output" width="281" height="106" /></a><p class="wp-caption-text">Hold on to your hats...</p></div>
<p>It took me a while to get this to compile &#8211; <a href="http://www.opencobol.org/">Open COBOL</a> doesn&#8217;t care for the AUTHOR statement in the IDENTIFICATION DIVISION so I removed it.</p>
<p>What this snippet of code doesn&#8217;t show us is that larger projects are unbelievably verbose, lines and lines of code. Nor does it cover the hilarity of design using <a href="http://en.wikipedia.org/wiki/Data_flow_diagram">Data Flow Diagrams</a> - queuing for hours to collect printouts from the University&#8217;s only <a href="http://en.wikipedia.org/wiki/Dot_matrix_printer">132 column</a> printer.</p>
<p>Well that&#8217;s been a fun trip down memory lane, I don&#8217;t remember why I started this post.</p>
<p>Now get off my lawn.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lynxworks.eu/2011/12/forget-everything-you-knew-about-coding-or-perhaps-remember-depending-on-your-age/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Best Linux comment ever</title>
		<link>http://blog.lynxworks.eu/2011/10/best-linux-comment-ever/</link>
		<comments>http://blog.lynxworks.eu/2011/10/best-linux-comment-ever/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 19:56:22 +0000</pubDate>
		<dc:creator>Dougie</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Planet Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.lynxworks.eu/?p=1976</guid>
		<description><![CDATA[Extract from an article over at &#8220;The Art of Manliness&#8221; that gives instructions on editing hosts to block time wasting sites: Linux If you’re using Linux, you’re probably a geek and don’t need some guy who blogs about manliness to &#8230; <a href="http://blog.lynxworks.eu/2011/10/best-linux-comment-ever/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Extract from an <a href="http://artofmanliness.com/2011/10/17/how-to-quit-mindlessly-surfing-the-internet-and-actually-get-stuff-done/ ">article</a> over at &#8220;The Art of Manliness&#8221; that gives instructions on editing hosts to block time wasting sites:</p>
<blockquote><p><strong>Linux</strong><br />
If you’re using Linux, you’re probably a geek and don’t need some guy who blogs about manliness to tell you how to edit your host file.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.lynxworks.eu/2011/10/best-linux-comment-ever/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>I killed my PS3</title>
		<link>http://blog.lynxworks.eu/2011/01/i-killed-my-ps3/</link>
		<comments>http://blog.lynxworks.eu/2011/01/i-killed-my-ps3/#comments</comments>
		<pubDate>Sun, 02 Jan 2011 15:53:05 +0000</pubDate>
		<dc:creator>Dougie</dc:creator>
				<category><![CDATA[Rant]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Planet Ubuntu]]></category>
		<category><![CDATA[Video Games]]></category>

		<guid isPermaLink="false">http://blog.lynxworks.eu/?p=1669</guid>
		<description><![CDATA[I&#8217;ve been playing the brilliant &#8220;Assassin&#8217;s Creed &#8211; Brotherhood&#8221;. So much so that I&#8217;ve killed my PS3 &#8211; it now overheats and turns itself off after about three minutes (if its booted from cold), beeps three times and flashes the &#8230; <a href="http://blog.lynxworks.eu/2011/01/i-killed-my-ps3/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been playing the brilliant &#8220;Assassin&#8217;s Creed &#8211; Brotherhood&#8221;. So much so that I&#8217;ve killed my PS3 &#8211; it now overheats and turns itself off after about three minutes (if its booted from cold), beeps three times and flashes the power light. Mind you I&#8217;ve had it for about four years.</p>
<p>I bought a new one (surprised that the hard disk size going up seems to have reduced any price decreases over time).</p>
<p>Seems like a faulty fan &#8211; sounds like a bearing grinding. Anyone any experience with them?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lynxworks.eu/2011/01/i-killed-my-ps3/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Linux is not a get of jail free card</title>
		<link>http://blog.lynxworks.eu/2010/12/linux-is-not-a-get-of-jail-free-card/</link>
		<comments>http://blog.lynxworks.eu/2010/12/linux-is-not-a-get-of-jail-free-card/#comments</comments>
		<pubDate>Thu, 16 Dec 2010 17:15:43 +0000</pubDate>
		<dc:creator>Dougie</dc:creator>
				<category><![CDATA[Rant]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Planet Ubuntu]]></category>
		<category><![CDATA[Rants]]></category>

		<guid isPermaLink="false">http://blog.lynxworks.eu/?p=1649</guid>
		<description><![CDATA[I&#8217;ve been having line problems with my ISP &#8211; British Telecom. To cut a long story short we see a 75% speed drop, phone BT, jump through umpteen hoops and they reset the profile at the exchange. The fault is &#8230; <a href="http://blog.lynxworks.eu/2010/12/linux-is-not-a-get-of-jail-free-card/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been having line problems with my ISP &#8211; British Telecom. To cut a long story short we see a 75% speed drop, phone BT, jump through umpteen hoops and they reset the profile at the exchange. The fault is with the line and it&#8217;s intermittent.</p>
<p>That doesn&#8217;t really bother me. The customer support agent told me to use BT&#8217;s speed diagnostic tool. Now aside from why their tool would be better, its not really an option as its a poorly written Java applet that doesn&#8217;t seem to work with Firefox or Chromium in Linux. Now I dare say I could get it to work but why spend the energy? When I mentioned it to the agent, he told me BT doesn&#8217;t officially support Linux and helpfully suggested I keep a Windows laptop handy.</p>
<p>Are you kidding? Keep a Windows laptop handy? There are reasons why I use Linux, there are reasons people use Macs and Windows too &#8211; they chose to. What the hell has that got to do with my ISP? I have no software from them, it&#8217;s a wireless access point they provide. Do you know what operating system <em>it</em> runs? Linux.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lynxworks.eu/2010/12/linux-is-not-a-get-of-jail-free-card/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Samsung ML-1915 with Ubuntu</title>
		<link>http://blog.lynxworks.eu/2010/11/samsung-ml-1915-with-ubuntu/</link>
		<comments>http://blog.lynxworks.eu/2010/11/samsung-ml-1915-with-ubuntu/#comments</comments>
		<pubDate>Wed, 03 Nov 2010 12:10:32 +0000</pubDate>
		<dc:creator>Dougie</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Planet Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.lynxworks.eu/?p=1555</guid>
		<description><![CDATA[I picked up a cheap laser printer, a Samsung ML-1915. It isn&#8217;t automatically configured by Ubuntu 10.10 as it requires the Samsung Unified Linux Print Driver. The page explains what to do but in synopsis, you need to add the &#8230; <a href="http://blog.lynxworks.eu/2010/11/samsung-ml-1915-with-ubuntu/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I picked up a cheap laser printer, a Samsung ML-1915. It isn&#8217;t automatically configured by Ubuntu 10.10 as it requires the <a href="http://www.bchemnet.com/suldr/index.html">Samsung Unified Linux Print Driver</a>.</p>
<p>The page explains what to do but in synopsis, you need to add the repository and install two packages, obviously check out the site before blindly following me:</p>
<p>Add the repository to /etc/apt/sources.list:</p>
<pre>deb http://www.bchemnet.com/suldr/ debian extra</pre>
<p>Now, I know Ubuntu has the <code>apt-add-repository</code> command, however it will create a source entry too, which will give you an error:</p>
<pre>W: Failed to fetch http://www.bchemnet.com/suldr/dists/debian/Release
Unable to find expected entry  extra/source/Sources in Meta-index file
(malformed Release file?)</pre>
<p>If you did then you need to remove the offending <code>deb-src http://www.bchemnet.com/suldr/ debian extra</code> entry.</p>
<p>That done, add the GPG key and update the apt cache.</p>
<pre>wget -O - http://www.bchemnet.com/suldr/suldr.gpg | sudo apt-key add -
sudo apt-get update
sudo apt-get install samsungmfp-driver samsungmfp-data</pre>
<p>It will then pick up and install when you plug it in. Samsung themselves provide a 30 odd Mb driver file, <a href="http://www.samsung.com/uk/support/detail/supportPrdDetail.do?menu=SP01&amp;prd_mdl_cd=&amp;prd_mdl_name=ML-1915&amp;prd_ia_sub_class_cd=P">here</a>. There are a whole list of the differences <a href="http://www.bchemnet.com/suldr/repository.html">here</a> but for me, I prefer Debian compliance and not installing anything I don&#8217;t need.</p>
<p>Oh and a big thank you to everyone who sent me suggestions of what to do in San Diego. People can be surprisingly open and friendly &#8211; especially within our community.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lynxworks.eu/2010/11/samsung-ml-1915-with-ubuntu/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Any colour will do</title>
		<link>http://blog.lynxworks.eu/2010/10/a-bike-shed-any-colour-will-do-on-greener-grass/</link>
		<comments>http://blog.lynxworks.eu/2010/10/a-bike-shed-any-colour-will-do-on-greener-grass/#comments</comments>
		<pubDate>Mon, 18 Oct 2010 16:45:09 +0000</pubDate>
		<dc:creator>Dougie</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Planet Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.lynxworks.eu/?p=1483</guid>
		<description><![CDATA[I hope Dustin Kirkland wont mind me re-posting this but it&#8217;s so insightful I felt I must. Poul-Henning Kamp posted this concerning Free BSD development over eleven years ago&#8230;]]></description>
			<content:encoded><![CDATA[<p>I hope Dustin Kirkland wont mind me <a href="http://blog.dustinkirkland.com/2010/10/introducing-bikeshed-package.html">re-posting</a> this but it&#8217;s so insightful I felt I must. Poul-Henning Kamp posted <a href="http://www.freebsd.org/cgi/getmsg.cgi?fetch=506636+517178+/usr/local/www/db/text/1999/freebsd-hackers/19991003.freebsd-hackers">this</a> concerning Free BSD development over eleven years ago&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lynxworks.eu/2010/10/a-bike-shed-any-colour-will-do-on-greener-grass/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Twitter vulnerabilities, using Windows, studying and new WordPress themes.</title>
		<link>http://blog.lynxworks.eu/2010/09/twitter-vulnerabilities-using-windows-and-studying/</link>
		<comments>http://blog.lynxworks.eu/2010/09/twitter-vulnerabilities-using-windows-and-studying/#comments</comments>
		<pubDate>Sun, 26 Sep 2010 13:17:15 +0000</pubDate>
		<dc:creator>Dougie</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open University]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Planet Ubuntu]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://blog.lynxworks.eu/?p=1420</guid>
		<description><![CDATA[Graham Cluley, a Senior Technology Consultant at Sophos, has a nice blog piece on the Twitter worm from earlier this week. To cut a long story short, he reminds us of the importance of sanitizing inputs. Still, it was more &#8230; <a href="http://blog.lynxworks.eu/2010/09/twitter-vulnerabilities-using-windows-and-studying/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Graham Cluley, a Senior Technology Consultant at Sophos, has a <a href="http://www.sophos.com/blogs/gc/g/2010/09/22/names-faces-twitter-worm-attack/">nice blog piece</a> on the Twitter worm from earlier this week. To cut a long story short, he reminds us of the importance of <a href="http://xkcd.com/327/">sanitizing inputs</a>.</p>
<p><a href="http://blog.lynxworks.eu/wp-content/uploads/2010/09/exploits_of_a_mom.png"><img class="alignnone size-full wp-image-1609" title="exploits_of_a_mom" src="http://blog.lynxworks.eu/wp-content/uploads/2010/09/exploits_of_a_mom.png" alt="" width="666" height="205" /></a></p>
<p>Still, it was more productive than my week with my <a href="http://www.open.ac.uk/">Open University</a> module that starts in October &#8211; T175 (<a href="http://www3.open.ac.uk/study/undergraduate/course/t175.htm">Networked living: exploring information and communication technologies</a>). The OU can be very Windows dependent but this course seems to be pretty much delivered in Virtual Learning Environment (what the OU calls Moodle). I ran the course DVD, which is a Windows Flash standalone thing which got me to revive the <a href="https://launchpad.net/~open-university-ubuntu">OU Ubuntu Users group</a>, sending out emails, starting a mailing list and trying to get things going again.</p>
<p>So why was it unproductive? Well, I haven&#8217;t booted Windows in ages &#8211; there were a million updates, one of which was for the wireless driver. Update completely borked the wireless and I wound up restoring the drive. That aside, one thing I really like about Ubuntu (and most distributions) is a centralised update manager &#8211; Windows has Adobe, Java, Windows Update, Firefox and McAfee all trying to pull updates at the same time. It makes the system completely unusable for the first ten minutes it&#8217;s on!</p>
<p>Any way, I decided to build a new WordPress theme. Same colour scheme, more rounded edges &#8211; should be available in the next few days.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lynxworks.eu/2010/09/twitter-vulnerabilities-using-windows-and-studying/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bash</title>
		<link>http://blog.lynxworks.eu/2010/09/bash/</link>
		<comments>http://blog.lynxworks.eu/2010/09/bash/#comments</comments>
		<pubDate>Sat, 18 Sep 2010 10:13:12 +0000</pubDate>
		<dc:creator>Dougie</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Planet Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.lynxworks.eu/?p=1412</guid>
		<description><![CDATA[Two things that improve my bash productivity &#8211; stopping the cursor keys inserting characters in vim and history search in bash. Edit ~/.vimrc or /etc/vim/vimrc (for system wide) and add turn off vi compatibility: set nocompatible The latter can be &#8230; <a href="http://blog.lynxworks.eu/2010/09/bash/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Two things that improve my bash productivity &#8211; stopping the cursor keys inserting characters in vim and history search in bash.</p>
<p>Edit ~/.vimrc or /etc/vim/vimrc (for system wide) and add turn off vi compatibility:</p>
<p><code>set nocompatible</code></p>
<p>The latter can be improved by editing ~/.inputrc (or /etc/inputrc for everyone). Pressing the up key scrolls through all the commands you&#8217;ve typed but by adding:</p>
<p><code>"\e[A":history-search-backward<br />
"\e[B":history-search-forward</code></p>
<p>You can type the first letter or two and get the command you need, so if you typed &#8220;mysql -u root -p&#8221; last Tuesday but can&#8217;t remember the options, typing &#8220;my&#8221; and pressing the up key will find it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lynxworks.eu/2010/09/bash/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Install web applications locally on Ubuntu</title>
		<link>http://blog.lynxworks.eu/2010/09/install-web-applications-locally-on-ubuntu/</link>
		<comments>http://blog.lynxworks.eu/2010/09/install-web-applications-locally-on-ubuntu/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 11:46:56 +0000</pubDate>
		<dc:creator>Dougie</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Planet Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.lynxworks.eu/?p=1351</guid>
		<description><![CDATA[I was talking with someone yesterday who is hacking a WordPress theme together. If you work with web sites, being able to run a site locally allows testing, experimentation, developing new themes and even just checking that a software update &#8230; <a href="http://blog.lynxworks.eu/2010/09/install-web-applications-locally-on-ubuntu/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was talking with someone yesterday who is hacking a <a href="http://wordpress.org/extend/themes/">WordPress theme</a> together. If you work with web sites, being able to run a site locally allows testing, experimentation, developing new themes and even just checking that a software update isn&#8217;t going to break your site. You might want to keep a web application on a local network and away from the Internet &#8211; such as StatusNet, a Wiki or a project management application. All we need is to install a LAMP stack &#8211; Linux Apache MySQL and PHP. We&#8217;ve already got the &#8220;L&#8221;! So let&#8217;s walk through installing WordPress.<span id="more-1351"></span></p>
<p>Synaptic (<em>System→Administration→Synaptic Package Manager</em>) lets you install common groups of packages (<em>Edit-&gt;Mark packages by task&#8230;</em>) in this case a LAMP server. You can do the same from a command line using &#8220;<em>sudo tasksel install lamp-server</em>&#8220;. Since Ubuntu 10.10, you need to install tasksel to install by task either way &#8211; &#8220;sudo apt-get install tasksel&#8221;.</p>
<p><a href="http://blog.lynxworks.eu/wp-content/uploads/2010/09/install-web-applications-locally-on-ubuntu-01.png"><img class="alignnone size-medium wp-image-1626" title="install-web-applications-locally-on-ubuntu-01" src="http://blog.lynxworks.eu/wp-content/uploads/2010/09/install-web-applications-locally-on-ubuntu-01-300x271.png" alt="" width="300" height="271" /></a></p>
<p><a href="http://blog.lynxworks.eu/wp-content/uploads/2010/09/install-web-applications-locally-on-ubuntu-02.png"><img class="alignnone size-medium wp-image-1627" title="install-web-applications-locally-on-ubuntu-02" src="http://blog.lynxworks.eu/wp-content/uploads/2010/09/install-web-applications-locally-on-ubuntu-02-300x256.png" alt="" width="300" height="256" /></a></p>
<p>Once the components are installed, you&#8217;ll be asked for a root password &#8211; this is used by MySQL and is not the system&#8217;s root password.</p>
<p>The default web root is <code>/var/www</code> &#8211; if you check it now there is an index.html. Open a browser and goto <a href="http://localhost">http://localhost</a>, you&#8217;ll be greeted with the contents of that file so we know the system is working. So how do we get our own files up?</p>
<p>You need to consider permissions, this is the casue of &#8220;Forbidden/You don&#8217;t have permission to access / on this server&#8221; error messages . There are a couple of ways but I recommend using the www-data group. You could use a folder in your home folder, however I have never got this will not work with encrypted home folders. I would leave /var/www in root&#8217;s ownership and add each subsite as belonging to www-data then give that group write access:﻿</p>
<p><code>sudo mkdir /var/www/wordpress; sudo chown :www-data wordpress; sudo chmod g+w wordpress</code></p>
<p>The first user will have been added to this group during installation (you may need to logout) but further users can be added using System→Administration→Users and Groups or by:</p>
<p><code>sudo useradd -G www-data username</code></p>
<p>Apache uses virtual hosts &#8211; multiple sites on the same server. Each site is defined by a configuration file in <em>/etc/apache2/sites-available</em>. If you look there now, you&#8217;ll see the default site, we can use this as a template for a new site:</p>
<p><code>sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/wordpress<br />
gksu gedit /etc/apache2/sites-available/wordpress</code></p>
<p>You need to add a <em>ServerName</em>, change the <em>VirtualHost</em>, <em>DocumentRoot</em> and <em>Directory</em> to point to the folder your site is going to be in, changes are in <span style="color: #ff0000;">red</span>.<br />
<code>&lt;VirtualHost <span style="color: #ff0000;">wordpress</span>:80&gt;<br />
ServerAdmin webmaster@localhost<br />
<span style="color: #ff0000;"> ServerName wordpress</span><br />
DocumentRoot <span style="color: #ff0000;">/var/www/wordpress</span><br />
&lt;Directory /&gt;<br />
Options FollowSymLinks<br />
AllowOverride None<br />
&lt;/Directory&gt;<br />
&lt;Directory <span style="color: #ff0000;">/var/www/wordpress</span>&gt;<br />
Options Indexes FollowSymLinks MultiViews<br />
AllowOverride None<br />
Order allow,deny<br />
allow from all<br />
&lt;/Directory&gt;<br />
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/<br />
&lt;Directory "/usr/lib/cgi-bin"&gt;<br />
AllowOverride None<br />
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch<br />
Order allow,deny<br />
Allow from all<br />
&lt;/Directory&gt;<br />
ErrorLog ${APACHE_LOG_DIR}/error.log<br />
# Possible values include: debug, info, notice, warn, error, crit,<br />
# alert, emerg.<br />
LogLevel warn<br />
CustomLog ${APACHE_LOG_DIR}/access.log combined<br />
Alias /doc/ "/usr/share/doc/"<br />
&lt;Directory "/usr/share/doc/"&gt;<br />
Options Indexes MultiViews FollowSymLinks<br />
AllowOverride None<br />
Order deny,allow<br />
Deny from all<br />
Allow from 127.0.0.0/255.0.0.0 ::1/128<br />
&lt;/Directory&gt;<br />
&lt;/VirtualHost&gt;</code><br />
You can then add &#8220;<em>wordpress</em>&#8221; to <em>/etc/hosts</em> (change the line that reads <em>127.0.0.1 localhost</em> to <em>127.0.0.1 localhost wordpress</em>) and use the address &#8220;<em>http://wordpress</em>&#8221; to access your site.</p>
<p>Apache needs to know about the site:</p>
<p><code>sudo a2ensite wordpress; sudo /etc/init.d/apache2 reload</code></p>
<p>Now with the letter &#8220;A&#8221; out of the way we can deal with the &#8220;M&#8221;. Most web applications need at least one database. Remember that MySQL password?</p>
<p><code>mysql -u root -p</code></p>
<p>A good example is installing WordPress. <a href="http://wordpress.org/download/">Download</a> and extract the contents to /var/www/wordpress &#8211; remember the wordpress folder already exists so put the <em>contents</em> in there. Create a new database called &#8220;<em>wordpress</em>&#8220;, with a user called &#8220;<em>wordpress</em>&#8221; and a password of &#8220;<em>wordpress</em>&#8221; by entering each command at the prompt:</p>
<p><code>create database wordpress;<br />
grant usage on wordpress.* to wordpress@localhost identified by 'wordpress';<br />
grant all privileges on wordpress.* to wordpress@localhost;</code></p>
<p><a href="http://blog.lynxworks.eu/wp-content/uploads/2010/09/install-web-applications-locally-on-ubuntu-04.png"><img class="alignnone size-medium wp-image-1629" title="install-web-applications-locally-on-ubuntu-04" src="http://blog.lynxworks.eu/wp-content/uploads/2010/09/install-web-applications-locally-on-ubuntu-04-300x197.png" alt="" width="300" height="197" /></a></p>
<p>Type &#8220;<em>\q</em>&#8221; to exit then open a browser and go to your site, for me that&#8217;s <em>http://localhost/dougie</em>.</p>
<p>So lastly we get on to the &#8220;P&#8221; &#8211; PHP. Apache will recognise and run PHP, however be aware of a caveat I&#8217;ve noticed in Ubuntu. If you try to use your system hostname instead of localhost in Firefox, it will try to download rather than run PHP files. I believe this is due to the system hostname resolving to 127.0.1.1, a solution to <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=316099">Debian bug #316099</a>.</p>
<p>PHP applications often have their own installation scripts, which WordPress does. Enter the database details we just created on the WordPress install screen:</p>
<p><a href="http://blog.lynxworks.eu/wp-content/uploads/2010/09/install-web-applications-locally-on-ubuntu-05.png"><img class="alignnone size-medium wp-image-1630" title="install-web-applications-locally-on-ubuntu-05" src="http://blog.lynxworks.eu/wp-content/uploads/2010/09/install-web-applications-locally-on-ubuntu-05-300x217.png" alt="" width="300" height="217" /></a></p>
<p>Once the rest of the screens are complete, you&#8217;ll have WordPress installed.</p>
<p>So to summarise:</p>
<ol>
<li>Install a LAMP stack &#8211; <code>sudo tasksel install lamp-serve</code>r</li>
<li>Create a folder and set the correct permissions &#8211; <code>sudo mkdir /var/www/wordpress; sudo chown :www-data wordpress; sudo chmod g+w wordpress</code></li>
<li>Download WordPress and put the contents in /var/www/wordpress</li>
<li>Open mysql:<code>mysql -u root -p</code></li>
<li>Set up database: <code>create database wordpress; grant usage on wordpress.* to wordpress@localhost identified by 'wordpress'; grant all privileges on wordpress.* to wordpress@localhost; \q</code></li>
<li>Run <a href="http://wordpress/install.php">http://wordpress/install.php</a></li>
</ol>
<p>So to recap, all we need to do to add an application is create a virtual host so Apache can serve it up; create a database for it to store data; and configure the application &#8211; often via a browser interface. Now you can hack away at those WordPress themes to your heart&#8217;s content.</p>
<p>More information is available from the <a href="https://help.ubuntu.com/10.04/serverguide/C/lamp-applications.html">Ubuntu Server Guide</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lynxworks.eu/2010/09/install-web-applications-locally-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

