<?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>GL.IB.LY &#187; grep</title>
	<atom:link href="http://gl.ib.ly/tag/grep/feed/" rel="self" type="application/rss+xml" />
	<link>http://gl.ib.ly</link>
	<description>Thoughts on security, computing, business and stuff!</description>
	<lastBuildDate>Sun, 18 May 2014 11:51:56 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.1</generator>
	<item>
		<title>Ann skips bail. Cue forensics puzzle.</title>
		<link>http://gl.ib.ly/computing/2009/11/27/ann-skips-bail-cue-forensics-puzzle/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ann-skips-bail-cue-forensics-puzzle</link>
		<comments>http://gl.ib.ly/computing/2009/11/27/ann-skips-bail-cue-forensics-puzzle/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 09:00:01 +0000</pubDate>
		<dc:creator><![CDATA[tariq]]></dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[forensics]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[puzzle]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[tcpdump]]></category>
		<category><![CDATA[wireshark]]></category>

		<guid isPermaLink="false">http://gl.ib.ly/?p=69</guid>
		<description><![CDATA[<p>Found a website and a forensics contest yesterday quite by accident. I was waiting for somebody before going out for the night and I thought this might be a little fun while I waited. Now the contest had closed and<span class="ellipsis">&#8230;</span><div class="read-more"><a href="http://gl.ib.ly/computing/2009/11/27/ann-skips-bail-cue-forensics-puzzle/">Read more &#8250;</a></div><!-- end of .read-more --></p><p>The post <a href="http://gl.ib.ly/computing/2009/11/27/ann-skips-bail-cue-forensics-puzzle/">Ann skips bail. Cue forensics puzzle.</a> appeared first on <a href="http://gl.ib.ly">GL.IB.LY</a>.</p>]]></description>
				<content:encoded><![CDATA[<p><span style="color: #545454;">Found a website and a forensics contest yesterday quite by accident. I was waiting for somebody before going out for the night and I thought this might be a little fun while I waited. Now the contest had closed and the results where available, which I ignored until the end and went straight to </span><a style="color: #7da939;" title="http://forensicscontest.com/2009/10/10/puzzle-2-ann-skips-bail" href="https://web.archive.org/web/20100526211205/http://gl.ib.ly/exit.php?url_id=105&amp;entry_id=39">Puzzle #2: Ann skips bail</a><span style="color: #545454;">.</span><br style="color: #545454;" /><br style="color: #545454;" /><span style="color: #545454;">The puzzle revolves around a packet capture of Ann&#8217;s network taken by wily investigators before she skipped bail. Police are confident that she communicated with a secret lover prior to her disappearance. And so follows a number of competition questions. It is important to note that the organizers are looking for the most elegant solutions, and you won&#8217;t see that here. What you will see is how to solve the puzzle very quickly.</span></p>
<p style="padding-left: 30px;"><span style="color: #545454;">1. What is Ann’s email address?</span><br style="color: #545454;" /><span style="color: #545454;">2. What is Ann’s email password?</span><br style="color: #545454;" /><span style="color: #545454;">3. What is Ann’s secret lover’s email address?</span><br style="color: #545454;" /><span style="color: #545454;">4. What two items did Ann tell her secret lover to bring?</span><br style="color: #545454;" /><span style="color: #545454;">5. What is the NAME of the attachment Ann sent to her secret lover?</span><br style="color: #545454;" /><span style="color: #545454;">6. What is the MD5sum of the attachment Ann sent to her secret lover?</span><br style="color: #545454;" /><span style="color: #545454;">7. In what CITY and COUNTRY is their rendez-vous point?</span><br style="color: #545454;" /><span style="color: #545454;">8. What is the MD5sum of the image embedded in the document?</span></p>
<p><br style="color: #545454;" /><span style="color: #545454;">I downloaded the </span><a style="color: #7da939;" title="http://forensicscontest.com/contest02/evidence02.pcap" href="https://web.archive.org/web/20100526211205/http://gl.ib.ly/exit.php?url_id=106&amp;entry_id=39">packet dump file</a><span style="color: #545454;"> from the organiser&#8217;s site and verified the hash using </span><code style="color: #545454;">md5</code><span style="color: #545454;"> as I am on a Mac, otherwise </span><code style="color: #545454;">md5sum</code><span style="color: #545454;"> does the job.</span><br style="color: #545454;" /><br style="color: #545454;" /><span style="color: #545454;">I fired up </span><code style="color: #545454;">wireshark</code><span style="color: #545454;"> and opened the packet capture file. There appeared to be a good bit of SMTP traffic. So I did a quick</span></p>
<pre style="color: #545454; padding-left: 30px;">grep -an "To:.*\|From:*\|Subject:.*" evidence02.pcap</pre>
<p><br style="color: #545454;" /><span style="color: #545454;">on the packet dump which revealed the following.</span><br style="color: #545454;" /><code style="color: #545454;"></code></p>
<p style="padding-left: 30px;"><code style="color: #545454;"><br />
From: "Ann Dercover" &lt;sneakyg33k@aol.com&gt;<br />
To: &lt;sec558@gmail.com&gt;<br />
Subject: lunch next week<br />
From: "Ann Dercover" &lt;sneakyg33k@aol.com&gt;<br />
To: &lt;mistersecretx@aol.com&gt;<br />
Subject: rendezvous</code></p>
<p><span style="color: #545454;">Its clear that Ann Dercover&#8217;s email address is </span><code style="color: #545454;">sneakyg33k@aol.com</code><span style="color: #545454;">. This is the answer to question 1. We also see she sent two emails. One to </span><code style="color: #545454;">mistersecretx@aol.com</code><span style="color: #545454;">, could this be Ann&#8217;s secret lover? I expanded the grep to </span></p>
<pre style="color: #545454; padding-left: 30px;">grep -aA50 "mistersecretx@aol.com" evidence02.pcap</pre>
<p><br style="color: #545454;" /><span style="color: #545454;">This gives me 50 lines after and including lines matching </span><code style="color: #545454;">mistersecretx@aol.com</code><span style="color: #545454;">. </span></p>
<p style="padding-left: 30px;"><code style="color: #545454;">To: &lt;mistersecretx@aol.com&gt;<br />
Subject: rendezvous<br />
Date: Sat, 10 Oct 2009 07:38:10 -0600<br />
MIME-Version: 1.0<br />
Content-Type: multipart/mixed;<br />
boundary="----=_NextPart_000_000D_01CA497C.9DEC1E70"<br />
X-Priority: 3<br />
X-MSMail-Priority: Normal<br />
X-Mailer: Microsoft Outlook Express 6.00.2900.2180<br />
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180</code></p>
<p>This is a multi-part message in MIME format.</p>
<p>&#8212;&#8212;=_NextPart_000_000D_01CA497C.9DEC1E70<br />
Content-Type: multipart/alternative;<br />
boundary=&#8221;&#8212;-=_NextPart_001_000E_01CA497C.9DEC1E70&#8243;</p>
<p>&#8212;&#8212;=_NextPart_001_000E_01CA497C.9DEC1E70<br />
Content-Type: text/plain;<br />
charset=&#8221;iso-8859-1&#8243;<br />
Content-Transfer-Encoding: quoted-printable</p>
<p>Hi sweetheart! Bring your fake passport and a bathing suit. Address =<br />
attached. love, Ann<br />
&#8212;&#8212;=_NextPart_001_000E_01CA497C.9DEC1E70<br />
Content-Type: text/html;<br />
charset=&#8221;iso-8859-1&#8243;<br />
Content-Transfer-Encoding: quoted-printable</p>
<p>&#8230;SNIP&#8230;</p>
<p>Hi sweetheart! Bring your fake passport =<br />
and a=20<br />
bathing suit. Address attached. love, Ann</p>
<p>&#8230;SNIP&#8230;</p>
<p>&#8212;&#8212;=_NextPart_000_000D_01CA497C.9DEC1E70<br />
Content-Type: application/octet-stream;<br />
name=&#8221;secretrendezvous.docx&#8221;<br />
Content-Transfer-Encoding: base64<br />
Content-Disposition: attachment;<br />
filename=&#8221;secretrendezvous.docx&#8221;<br />
<br style="color: #545454;" /><br style="color: #545454;" /></p>
<p><span style="color: #545454;">Wow. So </span><code style="color: #545454;">mistersecretx@aol.com</code><span style="color: #545454;"> IS the email address of Ann&#8217;s lover. This is the answer to question 3. We also see in her message she instructs them to &#8220;bring your fake passport and bathing suit&#8221;, this is the answer to question 4. Towards the bottom we see an attachment that probably appears later than the lines we grep&#8217;d called </span><code style="color: #545454;">secretrendezvous.docx</code><span style="color: #545454;"> which will appear base64 encoding. This is the answer to question 5.</span><br style="color: #545454;" /><br style="color: #545454;" /><span style="color: #545454;">I then returned to </span><code style="color: #545454;">wireshark</code><span style="color: #545454;">, looking down through the packets I quickly see SMTP traffic with </span><i style="color: #545454;">C: DATA fragment</i><span style="color: #545454;"> which tells us this traffic was broken up into smaller pieces. This is likely to be an email with a large attachment. I right clicked on one of these packets as shown below and clicked on </span><i style="color: #545454;">Follow TCP Stream</i><span style="color: #545454;"> as shown below.</span><br style="color: #545454;" /><br style="color: #545454;" /></p>
<p><center style="color: #545454;"><img src="https://web.archive.org/web/20100526211205im_/http://gl.ib.ly/uploads/forensicspuzzle2/wireshark.png" alt="" width="500px" /></center><br style="color: #545454;" /><br style="color: #545454;" /><span style="color: #545454;">This gives me the following.</span><br style="color: #545454;" /><code style="color: #545454;"><br />
</code></p>
<p style="padding-left: 30px;"><code style="color: #545454;">220 cia-mc07.mx.aol.com ESMTP mail_cia-mc07.1; Sat, 10 Oct 2009 15:37:56 -0400<br />
<span style="color: #ff0000;">EHLO annlaptop</span><br />
250-cia-mc07.mx.aol.com host-69-140-19-190.static.comcast.net<br />
250-AUTH=LOGIN PLAIN XAOL-UAS-MB<br />
250-AUTH LOGIN PLAIN XAOL-UAS-MB<br />
250-STARTTLS<br />
250-CHUNKING<br />
250-BINARYMIME<br />
250-X-AOL-FWD-BY-REF<br />
250-X-AOL-DIV_TAG<br />
250-X-AOL-OUTBOX-COPY<br />
250 HELP<br />
<span style="color: #ff0000;">AUTH LOGIN</span><br />
334 VXNlcm5hbWU6<br />
<span style="color: #ff0000;">c25lYWt5ZzMza0Bhb2wuY29t</span><br />
334 UGFzc3dvcmQ6<br />
<span style="color: #ff0000;">NTU4cjAwbHo=</span><br />
235 AUTHENTICATION SUCCESSFUL<br />
<span style="color: #ff0000;">MAIL FROM: &lt;sneakyg33k@aol.com&gt;</span><br />
250 OK<br />
<span style="color: #ff0000;">RCPT TO: &lt;mistersecretx@aol.com&gt;</span><br />
250 OK<br />
<span style="color: #ff0000;">DATA</span><br />
354 START MAIL INPUT, END WITH "." ON A LINE BY ITSELF<br />
<span style="color: #ff0000;">Message-ID: &lt;001101ca49ae$e93e45b0$9f01a8c0@annlaptop&gt;<br />
From: "Ann Dercover" &lt;sneakyg33k@aol.com&gt;<br />
To: &lt;mistersecretx@aol.com&gt;<br />
Subject: rendezvous<br />
Date: Sat, 10 Oct 2009 07:38:10 -0600<br />
MIME-Version: 1.0<br />
Content-Type: multipart/mixed;<br />
.boundary="----=_NextPart_000_000D_01CA497C.9DEC1E70"<br />
X-Priority: 3<br />
X-MSMail-Priority: Normal<br />
X-Mailer: Microsoft Outlook Express 6.00.2900.2180<br />
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180</span></code></p>
<p>This is a multi-part message in MIME format.</p>
<p>&#8212;&#8212;=_NextPart_000_000D_01CA497C.9DEC1E70<br />
Content-Type: multipart/alternative;<br />
.boundary=&#8221;&#8212;-=_NextPart_001_000E_01CA497C.9DEC1E70&#8243;</p>
<p>&#8212;&#8212;=_NextPart_001_000E_01CA497C.9DEC1E70<br />
Content-Type: text/plain;<br />
.charset=&#8221;iso-8859-1&#8243;<br />
Content-Transfer-Encoding: quoted-printable</p>
<p>Hi sweetheart! Bring your fake passport and a bathing suit. Address =<br />
attached. love, Ann<br />
&#8212;&#8212;=_NextPart_001_000E_01CA497C.9DEC1E70<br />
Content-Type: text/html;<br />
.charset=&#8221;iso-8859-1&#8243;<br />
Content-Transfer-Encoding: quoted-printable</p>
<p>&lt;!DOCTYPE HTML PUBLIC &#8220;-//W3C//DTD HTML 4.0 Transitional//EN&#8221;&gt;<br />
&lt;HTML&gt;&lt;HEAD&gt;<br />
&lt;META http-equiv=3DContent-Type content=3D&#8221;text/html; =<br />
charset=3Diso-8859-1&#8243;&gt;<br />
&lt;META content=3D&#8221;MSHTML 6.00.2900.2853&#8243; name=3DGENERATOR&gt;<br />
&lt;STYLE&gt;&lt;/STYLE&gt;<br />
&lt;/HEAD&gt;<br />
&lt;BODY bgColor=3D#ffffff&gt;<br />
&lt;DIV&gt;&lt;FONT face=3DArial size=3D2&gt;Hi sweetheart! Bring your fake passport =<br />
and a=20<br />
bathing suit. Address attached. love, Ann&lt;/FONT&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</p>
<p>&#8212;&#8212;=_NextPart_001_000E_01CA497C.9DEC1E70&#8211;</p>
<p>&#8212;&#8212;=_NextPart_000_000D_01CA497C.9DEC1E70<br />
Content-Type: application/octet-stream;<br />
.name=&#8221;secretrendezvous.docx&#8221;<br />
Content-Transfer-Encoding: base64<br />
Content-Disposition: attachment;<br />
.filename=&#8221;secretrendezvous.docx&#8221;</p>
<p><span style="color: #0000ff;">UEsDBBQABgAIAAAAIQDleUAGfwEAANcFAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAAC<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC0<br />
VMluwjAQvVfqP0S+VsTQQ1VVBA5dji1S6QcYexKsepNttr/vOEBEKQSpwCVSPH7LPI/dHy61yubg<br />
g7SmIL28SzIw3AppqoJ8jd86jyQLkRnBlDVQkBUEMhzc3vTHKwchQ7QJBZnG6J4oDXwKmoXcOjBY<br />
Ka3XLOKvr6hj/JtVQO+73QfKrYlgYicmDjLov0DJZipmr0tcXjtxpiLZ83pfkiqI1Amf1ulBhAcV<br />
9iDMOSU5i9gbnRux56uz8ZQjst4TptKFOzR+RCFVfnvaFdjgPjBMLwVkI+bjO9PonC6sF1RYPtPY<br />
dd5Oc8CnLUvJocEnNucthxDwlLTKm4pm0mz9H/VhZnoCHpGXN9JQnzQR4kpBuLyDNW+bPIY18tYF<br />
imd3tj6kgRUgOngeDnyU0MzP0fwDxIjpX6P5DXNb+/UoRrymQOtv7+wMapqTkiVe5TGbKDhb78/4<br />
N9QnTSxg8nm19HfI24w088et/0cY2zcroQ9MHa2f5cEPAAAA//8DAFBLAwQUAAYACAAAACEAHpEa<br />
t/MAAABOAgAACwAIAl9yZWxzLy5yZWxzIKIEAiigAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIyS20oDQQyG7wXfYch9N9sKItLZ3kihdyLr<br />
A4SZ7AF3Dsyk2r69oyC6UNte5vTny0/Wm4Ob1DunPAavYVnVoNibYEffa3htt4sHUFnIW5qCZw1H<br />
zrBpbm/WLzyRlKE8jDGrouKzhkEkPiJmM7CjXIXIvlS6kBxJCVOPkcwb9Yyrur7H9FcDmpmm2lkN<br />
aWfvQLXHWDZf1g5dNxp+Cmbv2MuJFcgHYW/ZLmIqbEnGco1qKfUsGmwwzyWdkWKsCjbgaaLV9UT/<br />
X4uOhSwJoQmJz/N8dZwDWl4PdNmiecevOx8hWSwWfXv7Q4OzL2g+AQAA//8DAFBLAwQUAAYACAAA<br />
ACEApOAquCABAAA6BAAAHAAIAXdvcmQvX3JlbHMvZG9jdW1lbnQueG1sLnJlbHMgogQBKKAAAQAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACsk01OwzAQhfdI3MHynjgpUBCq0w1C6hbCAdxkkljE<br />
P7KnQG7PKFKbVJSwycbSvCjvfZ7xbLbfpmOfEKJ2VvIsSTkDW7pK20by9+Ll5pGziMpWqnMWJO8h<br />
8m1+fbV5hU4h/RRb7SMjFxslbxH9kxCxbMGomDgPlr7ULhiFVIZGeFV+qAbEKk3XIkw9eH7myXaV<br />
5GFX3XJW9J6S//d2da1LeHblwYDFCxEiAiLdLJKnCg2g5EclIU4uLiM8LImA1BoY84dSDGc2x7Ba<br />
kiFi39EcxyYM9Vx8tmS8PZg9BJrDSHCS5iDWS0LUzmKh9t1kFidpDuJ+SQhtaBfGLhiotBKDmCWe</span></p>
<p>&#8230;SNIP: not publishing the whole thing, its a bit long. <a style="color: #7da939;" href="https://web.archive.org/web/20100526211205/http://gl.ib.ly/uploads/forensicspuzzle2/attachment.b64" target="_blank">See the whole thing?</a></p>
<p>JZ2ekPwNAAD//wMAUEsBAi0AFAAGAAgAAAAhAOV5QAZ/AQAA1wUAABMAAAAAAAAAAAAAAAAAAAAA<br />
AFtDb250ZW50X1R5cGVzXS54bWxQSwECLQAUAAYACAAAACEAHpEat/MAAABOAgAACwAAAAAAAAAA<br />
AAAAAAC4AwAAX3JlbHMvLnJlbHNQSwECLQAUAAYACAAAACEApOAquCABAAA6BAAAHAAAAAAAAAAA<br />
AAAAAADcBgAAd29yZC9fcmVscy9kb2N1bWVudC54bWwucmVsc1BLAQItABQABgAIAAAAIQA6Q0kI<br />
FQQAAFgKAAARAAAAAAAAAAAAAAAAAD4JAAB3b3JkL2RvY3VtZW50LnhtbFBLAQItAAoAAAAAAAAA<br />
IQBg7VaATPYCAEz2AgAVAAAAAAAAAAAAAAAAAIINAAB3b3JkL21lZGlhL2ltYWdlMS5wbmdQSwEC<br />
LQAUAAYACAAAACEAlrWt4pYGAABQGwAAFQAAAAAAAAAAAAAAAAABBAMAd29yZC90aGVtZS90aGVt<br />
ZTEueG1sUEsBAi0AFAAGAAgAAAAhAIkUT0qVAwAAcQgAABEAAAAAAAAAAAAAAAAAygoDAHdvcmQv<br />
c2V0dGluZ3MueG1sUEsBAi0AFAAGAAgAAAAhAErYipK7AAAABAEAABQAAAAAAAAAAAAAAAAAjg4D<br />
AHdvcmQvd2ViU2V0dGluZ3MueG1sUEsBAi0AFAAGAAgAAAAhADVKHsm+CgAALFoAAA8AAAAAAAAA<br />
AAAAAAAAew8DAHdvcmQvc3R5bGVzLnhtbFBLAQItABQABgAIAAAAIQCQUuGobwEAANcCAAARAAAA<br />
AAAAAAAAAAAAAGYaAwBkb2NQcm9wcy9jb3JlLnhtbFBLAQItABQABgAIAAAAIQAXVdHWCQQAAMsZ<br />
AAASAAAAAAAAAAAAAAAAAAwdAwB3b3JkL251bWJlcmluZy54bWxQSwECLQAUAAYACAAAACEAu6G5<br />
NXECAACGCAAAEgAAAAAAAAAAAAAAAABFIQMAd29yZC9mb250VGFibGUueG1sUEsBAi0AFAAGAAgA<br />
AAAhAKVR8wbYAQAA2QMAABAAAAAAAAAAAAAAAAAA5iMDAGRvY1Byb3BzL2FwcC54bWxQSwUGAAAA<br />
AA0ADQBEAwAA9CYDAAAA</p>
<p>&#8212;&#8212;=_NextPart_000_000D_01CA497C.9DEC1E70&#8211;</p>
<p>.<br />
250 OK<br />
<span style="color: #ff0000;">QUIT</span><br />
221 SERVICE CLOSING CHANNEL</p>
<p><span style="color: #545454;">You may or may not realise that parts of the communication are base64 encoded. Lets take a look at some information encoded at the beginning of this communication again. </span><code style="color: #545454;"><br />
</code></p>
<p style="padding-left: 30px;"><code style="color: #545454;"><span style="color: #ff0000;">AUTH LOGIN</span><br />
334 VXNlcm5hbWU6<br />
<span style="color: #ff0000;">c25lYWt5ZzMza0Bhb2wuY29t</span><br />
334 UGFzc3dvcmQ6<br />
<span style="color: #ff0000;">NTU4cjAwbHo=</span><br />
235 AUTHENTICATION SUCCESSFUL</code></p>
<p><span style="color: #545454;">Here Ann is authenticating with the service. Her responses are shown in red, and as you can see they&#8217;re a bit cryptic; however, they look like they are encoded in base64. So we run the following two commands.</span></p>
<p style="padding-left: 30px;"><code style="color: #545454;">$ echo "c25lYWt5ZzMza0Bhb2wuY29t" | openssl base64 -d<br />
<span style="color: #008800;">sneakyg33k@aol.com</span><br />
$ echo "NTU4cjAwbHo=" | openssl base64 -d<br />
<span style="color: #008800;">558r00lz</span><br />
</code><br style="color: #545454;" /><i style="color: #545454;"></i></p>
<p><i style="color: #545454;">Note: $ is the command prompt, what follows it is the command with output in green.</i><br style="color: #545454;" /><br style="color: #545454;" /><span style="color: #545454;">So we find Ann&#8217;s email password is </span><code style="color: #545454;">558r00lz</code><span style="color: #545454;">. This the answer to question 2. </span><br style="color: #545454;" /><br style="color: #545454;" /><span style="color: #545454;">Next we have a look at the attachment which is base64 encoded. We copy all the blue text above and paste into a file called </span><code style="color: #545454;">attachment.b64</code><span style="color: #545454;"> and issue the following commands.</span><code style="color: #545454;"><br />
</code></p>
<p style="padding-left: 30px;"><code style="color: #545454;">$ openssl base64 -d &lt; attachment.b64 &gt; secretrendezvous.docx<br />
$ md5 secretrendezvous.docx<br />
<span style="color: #008800;">MD5 (secretrendezvous.docx) = 9e423e11db88f01bbff81172839e1923</span><br />
</code></p>
<p><br style="color: #545454;" /><span style="color: #545454;">This decodes the data and outputs to </span><code style="color: #545454;">secretrendezvous.docx</code><span style="color: #545454;">. We can open the file, verifying it is good and thus the md5 sum of </span><code style="color: #545454;">9e423e11db88f01bbff81172839e1923</code><span style="color: #545454;"> is the answer to question 6. When we open the file we see an image like the one below.</span><br style="color: #545454;" /><br style="color: #545454;" /></p>
<p><center style="color: #545454;"><img src="https://web.archive.org/web/20100526211205im_/http://gl.ib.ly/uploads/forensicspuzzle2/map.png" alt="" width="500px" /></center><br style="color: #545454;" /><br style="color: #545454;" /><span style="color: #545454;">This tells us that Ann was off to Playa del Carmen in Mexico. This is the answer to question 7. We only now need to get the md5 sum of the image in the document. This is easy enough as we can just do the following:</span><br style="color: #545454;" /><br style="color: #545454;" /><code style="color: #545454;"><br />
</code></p>
<p style="padding-left: 30px;"><code style="color: #545454;">$ unzip secretrendezvous.docx -d attachment<br />
<span style="color: #008800;">Archive: out-1.docx<br />
inflating: attachment/[Content_Types].xml<br />
inflating: attachment/_rels/.rels<br />
inflating: attachment/word/_rels/document.xml.rels<br />
inflating: attachment/word/document.xml<br />
extracting: attachment/word/media/image1.png<br />
inflating: attachment/word/theme/theme1.xml<br />
inflating: attachment/word/settings.xml<br />
inflating: attachment/word/webSettings.xml<br />
inflating: attachment/word/styles.xml<br />
inflating: attachment/docProps/core.xml<br />
inflating: attachment/word/numbering.xml<br />
inflating: attachment/word/fontTable.xml<br />
inflating: attachment/docProps/app.xml </span></code></p>
<p><br style="color: #545454;" /><span style="color: #545454;">The only image file in there is </span><code style="color: #545454;">attachment/word/media/image1.png</code><span style="color: #545454;">. Open it up to verify it is the business and then just do </span></p>
<p style="padding-left: 30px;"><code style="color: #545454;">$ md5 attachment/word/media/image1.png<br />
<span style="color: #008800;">MD5 (attachment/word/media/image1.png) = aadeace50997b1ba24b09ac2ef1940b7</span></code></p>
<p><span style="color: #545454;">This is the answer to question 8, and we&#8217;re finished. That was quick! The </span><a style="color: #7da939;" title="http://forensicscontest.com/2009/11/24/puzzle-2-answers" href="https://web.archive.org/web/20100526211205/http://gl.ib.ly/exit.php?url_id=107&amp;entry_id=39">answers</a><span style="color: #545454;"> have been published so you can verify. Now that person has turned up and is dragging me away from my computer so that&#8217;s all for now.</span></p>
<p><span style="color: #545454; font-family: Arial, Verdana, sans-serif; font-size: 14px; line-height: normal;"> </span></p>
<p>The post <a href="http://gl.ib.ly/computing/2009/11/27/ann-skips-bail-cue-forensics-puzzle/">Ann skips bail. Cue forensics puzzle.</a> appeared first on <a href="http://gl.ib.ly">GL.IB.LY</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://gl.ib.ly/computing/2009/11/27/ann-skips-bail-cue-forensics-puzzle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>All configuration variables in Moodle code &#8211; Part two</title>
		<link>http://gl.ib.ly/computing/2009/06/24/configuration-variables-moodle-code-part-two/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=configuration-variables-moodle-code-part-two</link>
		<comments>http://gl.ib.ly/computing/2009/06/24/configuration-variables-moodle-code-part-two/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 17:53:03 +0000</pubDate>
		<dc:creator><![CDATA[tariq]]></dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Stuff]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[cfg]]></category>
		<category><![CDATA[computers]]></category>
		<category><![CDATA[configuration variables]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[moodle]]></category>
		<category><![CDATA[one liners]]></category>

		<guid isPermaLink="false">http://gl.ib.ly/?p=73</guid>
		<description><![CDATA[<p>Earlier we looked at how you can extract a list of all the $CFG variables in your Moodle code. Now that&#8217;s not of much use! We need to know where in the code all these variables hide. I feel some spooky awk a<span class="ellipsis">&#8230;</span><div class="read-more"><a href="http://gl.ib.ly/computing/2009/06/24/configuration-variables-moodle-code-part-two/">Read more &#8250;</a></div><!-- end of .read-more --></p><p>The post <a href="http://gl.ib.ly/computing/2009/06/24/configuration-variables-moodle-code-part-two/">All configuration variables in Moodle code &#8211; Part two</a> appeared first on <a href="http://gl.ib.ly">GL.IB.LY</a>.</p>]]></description>
				<content:encoded><![CDATA[<p><a style="color: #7da939;" title="http://gl.ib.ly/archives/8-All-configuration-variables-in-Moodle-code.html" href="http://gl.ib.ly/archives/8-All-configuration-variables-in-Moodle-code.html">Earlier</a><span style="color: #545454;"> we looked at how you can extract a list of all the </span><code style="color: #545454;">$CFG</code><span style="color: #545454;"> variables in your Moodle code. Now that&#8217;s not of much use! We need to know where in the code all these variables hide. I feel some spooky awk a coming on.</span></p>
<div class="serendipity_entry_extended" style="color: #545454;"><i>Please note this doesn&#8217;t show all the variables available in Moodle, it shows all the Moodle variables in a particular codebase. Below output is shown from one of my own codebases which is a little different to what you might expect to see in MOODLE_19_STABLE</i>In <a style="color: #7da939;" title="http://gl.ib.ly/archives/8-All-configuration-variables-in-Moodle-code.html" href="http://gl.ib.ly/archives/8-All-configuration-variables-in-Moodle-code.html">All configuration variables in Moodle code</a> we came up with:</p>
<div class="geshi"><span style="font-weight: bold; color: #c20cb9;">grep</span> -r &#8211;no-filename -o &#8216;\$CFG-&gt;<span style="font-weight: bold; color: #7a0874;">[</span>a-z<span style="font-weight: bold; color: #7a0874;">]</span><span style="font-weight: bold; color: #7a0874;">[</span>a-z<span style="font-weight: bold; color: #7a0874;">]</span>*&#8217; &lt;path_to_moodle&gt; | <span style="font-weight: bold; color: #c20cb9;">sort</span> -u</div>
<p>This gives us some useful information but hides a lot of the detail. Let&#8217;s try and include which files the variable appears in even the line numbers. For this we&#8217;ll go back to:</p>
<div class="geshi"><span style="font-weight: bold; color: #c20cb9;">grep</span> -r -no &#8216;\$CFG-&gt;<span style="font-weight: bold; color: #7a0874;">[</span>a-z<span style="font-weight: bold; color: #7a0874;">]</span><span style="font-weight: bold; color: #7a0874;">[</span>a-z<span style="font-weight: bold; color: #7a0874;">]</span>*&#8217;</div>
<p>This will print line numbers for matches. Hmmm, what happens if two or more matches are found on one line? Well the second var will be printed without the file and line number &#8212; silly badness, see below!</p>
<pre>./admin/auth.php:11:$CFG-&gt;libdir
./admin/auth.php:12:$CFG-&gt;libdir
./admin/auth.php:17:$CFG-&gt;wwwroot
<span style="color: #ff0000;">$CFG-&gt;admin</span>
./admin/auth.php:26:$CFG-&gt;auth
./admin/auth.php:29:$CFG-&gt;auth
./admin/auth.php:52:$CFG-&gt;registerauth
./admin/auth_config.php:7:$CFG-&gt;libdir
./admin/auth_config.php:11:$CFG-&gt;pagepath
</pre>
<p>To add some context to <span style="color: #ff0000;">$CFG-&gt;admin</span> (which appears on line 17 of admin/auth.php) we introduce <code>awk</code> to the fray.</p>
<div class="geshi"><span style="font-weight: bold; color: #c20cb9;">grep</span> -r -no &#8216;\$CFG-&gt;<span style="font-weight: bold; color: #7a0874;">[</span>a-z<span style="font-weight: bold; color: #7a0874;">]</span><span style="font-weight: bold; color: #7a0874;">[</span>a-z<span style="font-weight: bold; color: #7a0874;">]</span>*&#8217; . | <span style="font-weight: bold; color: #c20cb9;">awk</span> -F: &#8216;BEGIN<span style="font-weight: bold; color: #7a0874;">{</span> s=<span style="color: #ff0000;">&#8220;&#8221;</span> <span style="font-weight: bold; color: #7a0874;">}</span><span style="font-weight: bold; color: #7a0874;">{</span> <span style="font-weight: bold; color: #000000;">if</span><span style="font-weight: bold; color: #7a0874;">(</span>$<span style="color: #000000;">3</span><span style="font-weight: bold; color: #7a0874;">)</span> <span style="font-weight: bold; color: #7a0874;">{</span> print $<span style="color: #000000;">0</span>; s=$1<span style="color: #ff0000;">&#8220;:&#8221;</span>$2<span style="color: #ff0000;">&#8220;:&#8221;</span>; <span style="font-weight: bold; color: #7a0874;">}</span><span style="font-weight: bold; color: #000000;">else</span>  print s$<span style="color: #000000;">0</span>; <span style="font-weight: bold; color: #7a0874;">}</span>&#8216;</div>
<p>Here, <code>awk</code> saves the previous line&#8217;s first and second fields (separated by &#8216;:&#8217;) if the third field is not empty. If the third field is empty it prepends the first and second fields of the previous line to whatever is on the current line. Nifty, eh? So when we run our command line we now get:</p>
<pre>./admin/auth.php:11:$CFG-&gt;libdir
./admin/auth.php:12:$CFG-&gt;libdir
./admin/auth.php:17:$CFG-&gt;wwwroot
./admin/auth.php:17:$CFG-&gt;admin
./admin/auth.php:26:$CFG-&gt;auth
./admin/auth.php:29:$CFG-&gt;auth
./admin/auth.php:52:$CFG-&gt;registerauth
./admin/auth_config.php:7:$CFG-&gt;libdir
./admin/auth_config.php:11:$CFG-&gt;pagepath</pre>
<p>Much better! Now that we are getting all the data we can do something useful. Let&#8217;s sort everything for convenience.</p>
<div class="geshi"><span style="font-weight: bold; color: #c20cb9;">grep</span> -r -no &#8216;\$CFG-&gt;<span style="font-weight: bold; color: #7a0874;">[</span>a-z<span style="font-weight: bold; color: #7a0874;">]</span><span style="font-weight: bold; color: #7a0874;">[</span>a-z<span style="font-weight: bold; color: #7a0874;">]</span>*&#8217; . | <span style="font-weight: bold; color: #c20cb9;">awk</span> -F: &#8216;BEGIN<span style="font-weight: bold; color: #7a0874;">{</span> s=<span style="color: #ff0000;">&#8220;&#8221;</span> <span style="font-weight: bold; color: #7a0874;">}</span><span style="font-weight: bold; color: #7a0874;">{</span> <span style="font-weight: bold; color: #000000;">if</span><span style="font-weight: bold; color: #7a0874;">(</span>$<span style="color: #000000;">3</span><span style="font-weight: bold; color: #7a0874;">)</span> <span style="font-weight: bold; color: #7a0874;">{</span> print $<span style="color: #000000;">0</span>; s=$1<span style="color: #ff0000;">&#8220;:&#8221;</span>$2<span style="color: #ff0000;">&#8220;:&#8221;</span>; <span style="font-weight: bold; color: #7a0874;">}</span><span style="font-weight: bold; color: #000000;">else</span>  print s$<span style="color: #000000;">0</span>; <span style="font-weight: bold; color: #7a0874;">}</span>&#8216; | <span style="font-weight: bold; color: #c20cb9;">sort</span> -t: -k3</div>
<p>We are sorting our data by the third field in each row. So we tell sort to use &#8216;:&#8217; as our field delimiter with the <code>-t</code> and we tell <code>sort</code> to use the third field with <code>-k3</code>.</p>
<p>Now we&#8217;ll make everything prettier by using <code>awk</code> again (our data should be small enough). We use <code>awk</code> to keep track of the last file and variable <code>awk</code> sees and then make formatting improvements as these values change; e.g. if the Variable changes from $CFG-&gt;admin to $CFG-&gt;wwwroot then prepend variable name with <code>\n\n</code> which inserts two line returns. This all looks pretty scary&#8230;</p>
<div class="geshi"><span style="font-weight: bold; color: #c20cb9;">grep</span> -r -no &#8216;\$CFG-&gt;<span style="font-weight: bold; color: #7a0874;">[</span>a-z<span style="font-weight: bold; color: #7a0874;">]</span><span style="font-weight: bold; color: #7a0874;">[</span>a-z<span style="font-weight: bold; color: #7a0874;">]</span>*&#8217; . | <span style="font-weight: bold; color: #c20cb9;">awk</span> -F: &#8216;BEGIN<span style="font-weight: bold; color: #7a0874;">{</span> s=<span style="color: #ff0000;">&#8220;&#8221;</span> <span style="font-weight: bold; color: #7a0874;">}</span><span style="font-weight: bold; color: #7a0874;">{</span> <span style="font-weight: bold; color: #000000;">if</span><span style="font-weight: bold; color: #7a0874;">(</span>$<span style="color: #000000;">3</span><span style="font-weight: bold; color: #7a0874;">)</span> <span style="font-weight: bold; color: #7a0874;">{</span> print $<span style="color: #000000;">0</span>; s=$1<span style="color: #ff0000;">&#8220;:&#8221;</span>$2<span style="color: #ff0000;">&#8220;:&#8221;</span>; <span style="font-weight: bold; color: #7a0874;">}</span><span style="font-weight: bold; color: #000000;">else</span>  print s$<span style="color: #000000;">0</span>; <span style="font-weight: bold; color: #7a0874;">}</span>&#8216; | <span style="font-weight: bold; color: #c20cb9;">sort</span> -t: -k3 | <span style="font-weight: bold; color: #c20cb9;">awk</span> -F: &#8216;BEGIN<span style="font-weight: bold; color: #7a0874;">{</span> v=<span style="color: #ff0000;">&#8220;&#8221;</span>; f=<span style="color: #ff0000;">&#8220;&#8221;</span>; <span style="font-weight: bold; color: #7a0874;">}</span><span style="font-weight: bold; color: #7a0874;">{</span> <span style="font-weight: bold; color: #000000;">if</span><span style="font-weight: bold; color: #7a0874;">(</span>v!=$<span style="color: #000000;">3</span><span style="font-weight: bold; color: #7a0874;">)</span> <span style="font-weight: bold; color: #7a0874;">{</span> v = $<span style="color: #000000;">3</span>; f=<span style="color: #ff0000;">&#8220;&#8221;</span>; <span style="font-weight: bold; color: #7a0874;">printf</span> <span style="color: #ff0000;">&#8220;\n\n&#8221;</span>$<span style="color: #000000;">3</span>; <span style="font-weight: bold; color: #7a0874;">}</span> <span style="font-weight: bold; color: #000000;">if</span><span style="font-weight: bold; color: #7a0874;">(</span>f!=$<span style="color: #000000;">1</span><span style="font-weight: bold; color: #7a0874;">)</span> <span style="font-weight: bold; color: #7a0874;">{</span> f = $<span style="color: #000000;">1</span>; <span style="font-weight: bold; color: #7a0874;">printf</span> <span style="color: #ff0000;">&#8220;\n\t&#8221;</span>$<span style="color: #000000;">1</span>; <span style="font-weight: bold; color: #7a0874;">}</span> <span style="font-weight: bold; color: #7a0874;">printf</span> <span style="color: #ff0000;">&#8220;:&#8221;</span>$<span style="color: #000000;">2</span> <span style="font-weight: bold; color: #7a0874;">}</span>&#8216;</div>
<p>This gives us something nice and pretty for our terminal window.</p>
<pre>...
$CFG-&gt;apachemaxmem
        ./lib/moodlelib.php:7544:7545:7547:7548
$CFG-&gt;aspellextradicts
        ./lib/speller/server-scripts/spellchecker.php:27:28
$CFG-&gt;aspellpath
        ./admin/settings/appearance.php:57
        ./lib/adminlib.php:2870:2881
        ./lib/editor/htmlarea/htmlarea.php:174:174:279:279
        ./lib/javascript.php:8
        ./lib/speller/changes.txt:19:1:29
        ./lib/speller/server-scripts/spellchecker.php:14:5
        ./lib/weblib.php:4988
...
</pre>
<p>We can, however, spruce things up a bit for the web:</p>
<div class="geshi"><span style="font-weight: bold; color: #c20cb9;">grep</span> -r -no &#8216;\$CFG-&gt;<span style="font-weight: bold; color: #7a0874;">[</span>a-z<span style="font-weight: bold; color: #7a0874;">]</span><span style="font-weight: bold; color: #7a0874;">[</span>a-z<span style="font-weight: bold; color: #7a0874;">]</span>*&#8217; . | <span style="font-weight: bold; color: #c20cb9;">awk</span> -F: &#8216;BEGIN<span style="font-weight: bold; color: #7a0874;">{</span> s=<span style="color: #ff0000;">&#8220;&#8221;</span> <span style="font-weight: bold; color: #7a0874;">}</span><span style="font-weight: bold; color: #7a0874;">{</span> <span style="font-weight: bold; color: #000000;">if</span><span style="font-weight: bold; color: #7a0874;">(</span>$<span style="color: #000000;">3</span><span style="font-weight: bold; color: #7a0874;">)</span> <span style="font-weight: bold; color: #7a0874;">{</span> print $<span style="color: #000000;">0</span>; s=$1<span style="color: #ff0000;">&#8220;:&#8221;</span>$2<span style="color: #ff0000;">&#8220;:&#8221;</span>; <span style="font-weight: bold; color: #7a0874;">}</span><span style="font-weight: bold; color: #000000;">else</span>  print s$<span style="color: #000000;">0</span>; <span style="font-weight: bold; color: #7a0874;">}</span>&#8216; | <span style="font-weight: bold; color: #c20cb9;">sort</span> -t: -k3 | <span style="font-weight: bold; color: #c20cb9;">awk</span> -F: &#8216;BEGIN<span style="font-weight: bold; color: #7a0874;">{</span> v=<span style="color: #ff0000;">&#8220;&#8221;</span>; f=<span style="color: #ff0000;">&#8220;&#8221;</span>; <span style="font-weight: bold; color: #7a0874;">}</span><span style="font-weight: bold; color: #7a0874;">{</span> <span style="font-weight: bold; color: #000000;">if</span><span style="font-weight: bold; color: #7a0874;">(</span>v!=$<span style="color: #000000;">3</span><span style="font-weight: bold; color: #7a0874;">)</span> <span style="font-weight: bold; color: #7a0874;">{</span> v = $<span style="color: #000000;">3</span>; f=<span style="color: #ff0000;">&#8220;&#8221;</span>; <span style="font-weight: bold; color: #7a0874;">printf</span> <span style="color: #ff0000;">&#8220;&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;&#8221;</span>$3<span style="color: #ff0000;">&#8220;&lt;/h1&gt;&#8221;</span>; <span style="font-weight: bold; color: #7a0874;">}</span>  <span style="font-weight: bold; color: #000000;">if</span><span style="font-weight: bold; color: #7a0874;">(</span>f!=$<span style="color: #000000;">1</span><span style="font-weight: bold; color: #7a0874;">)</span> <span style="font-weight: bold; color: #7a0874;">{</span> f = $<span style="color: #000000;">1</span>; <span style="font-weight: bold; color: #7a0874;">printf</span> <span style="color: #ff0000;">&#8220;&lt;br&gt;&lt;span style=\&#8221;</span>font-weight: bold\<span style="color: #ff0000;">&#8220;&gt;&#8221;</span>$1<span style="color: #ff0000;">&#8220;&lt;/span&gt;&#8221;</span>; <span style="font-weight: bold; color: #7a0874;">}</span> <span style="font-weight: bold; color: #7a0874;">printf</span> <span style="color: #ff0000;">&#8220;:&#8221;</span>$<span style="color: #000000;">2</span> <span style="font-weight: bold; color: #7a0874;">}</span>&#8216;</div>
<p>This gives us something like the following output:</p>
<h3 style="color: #5f5f5f;">$CFG-&gt;ADMIN</h3>
<p><span style="font-weight: bold;">./admin/auth.php</span>:17<br />
<span style="font-weight: bold;">./admin/auth_config.php</span>:18<br />
<span style="font-weight: bold;">./admin/block.php</span>:44<br />
<span style="font-weight: bold;">./admin/blocks.php</span>:157:172:237<br />
<span style="font-weight: bold;">./admin/collect/cron.php</span>:11<br />
<span style="font-weight: bold;">./admin/collect/index.php</span>:108:114:120:126:14:22:22:43:80:91<br />
<span style="font-weight: bold;">./admin/collect/lib.php</span>:31:709:75:76<br />
<span style="font-weight: bold;">./admin/collect/queue.php</span>:105:106:123:13<br />
<span style="font-weight: bold;">./admin/cron.php</span>:168:170<br />
<span style="font-weight: bold;">./admin/environment.php</span>:124<br />
<span style="font-weight: bold;">./admin/filter.php</span>:16<br />
<span style="font-weight: bold;">./admin/filters.php</span>:11<br />
<span style="font-weight: bold;">./admin/index.php</span>:422:427:432:437:441:445:448:451:456:459:460:463:464:465:468:471:471:523:602<br />
<span style="font-weight: bold;">./admin/lang.php</span>:102:122:127:130:131:132:142:493:754<br />
<span style="font-weight: bold;">./admin/langdoc.php</span>:101<br />
<span style="font-weight: bold;">./admin/mnet/access_control.php</span>:48:63:76:87<br />
<span style="font-weight: bold;">./admin/mnet/adminlib.php</span>:75<br />
<span style="font-weight: bold;">./admin/mnet/delete.html</span>:3:4<br />
<span style="font-weight: bold;">./admin/mnet/enr_courses.php</span>:40<br />
<span style="font-weight: bold;">./admin/mnet/enr_hosts.php</span>:40:52<br />
<span style="font-weight: bold;">./admin/module.php</span>:41<br />
<span style="font-weight: bold;">./admin/modules.php</span>:201<br />
<span style="font-weight: bold;">./admin/pagelib.php</span>:72<br />
<span style="font-weight: bold;">./admin/register.php</span>:37<br />
<span style="font-weight: bold;">./admin/report/assess/index.php</span>:12:13:193:50<br />
<span style="font-weight: bold;">./admin/report/certify/index.php</span>:11:159:270<br />
<span style="font-weight: bold;">./admin/report/courseoverview/index.php</span>:18:88<br />
<span style="font-weight: bold;">./admin/report/courseoverview/reportsgraph.php</span>:32<br />
<span style="font-weight: bold;">./admin/report/lastaccess/index.php</span>:12<br />
<span style="font-weight: bold;">./admin/report/lateforleveltwo/index.php</span>:14:86:90<br />
<span style="font-weight: bold;">./admin/report/numberofcourses/index.php</span>:12<br />
<span style="font-weight: bold;">./admin/report/stats/index.php</span>:31:47<br />
<span style="font-weight: bold;">./admin/roles/assign.php</span>:381<br />
<span style="font-weight: bold;">./admin/roles/managetabs.php</span>:10:12:14<br />
<span style="font-weight: bold;">./admin/roles/override.php</span>:160:187<br />
<span style="font-weight: bold;">./admin/roles/tabs.php</span>:182:190<br />
<span style="font-weight: bold;">./admin/settings.php</span>:19:42:6<br />
<span style="font-weight: bold;">./admin/settings/collect.php</span>:12:17:18:19<br />
<span style="font-weight: bold;">./admin/settings/courses.php</span>:12<br />
<span style="font-weight: bold;">./admin/settings/frontpage.php</span>:56<br />
<span style="font-weight: bold;">./admin/settings/language.php</span>:24:25<br />
<span style="font-weight: bold;">./admin/settings/location.php</span>:23<br />
<span style="font-weight: bold;">./admin/settings/misc.php</span>:19:23:24:25:26<br />
<span style="font-weight: bold;">./admin/settings/mnet.php</span>:13:16:19:22:9<br />
<span style="font-weight: bold;">./admin/settings/plugins.php</span>:141:33:41:64<br />
<span style="font-weight: bold;">./admin/settings/server.php</span>:161:218:219:247:248<br />
<span style="font-weight: bold;">./admin/settings/top.php</span>:16:19:36:46:55<br />
<span style="font-weight: bold;">./admin/settings/unsupported.php</span>:10:7:8:9<br />
<span style="font-weight: bold;">./admin/settings/users.php</span>:58:71:72:74:75:81:82<br />
<span style="font-weight: bold;">./admin/stickyblocks.php</span>:47:73<br />
<span style="font-weight: bold;">./admin/upgradesettings.php</span>:31<br />
<span style="font-weight: bold;">./admin/uploaduser.php</span>:65:66<br />
<span style="font-weight: bold;">./admin/user/user_bulk.php</span>:22:23:24:25:26:5:6<br />
<span style="font-weight: bold;">./admin/user/user_bulk_confirm.php</span>:14<br />
<span style="font-weight: bold;">./admin/user/user_bulk_delete.php</span>:14<br />
<span style="font-weight: bold;">./admin/user/user_bulk_display.php</span>:11<br />
<span style="font-weight: bold;">./admin/user/user_bulk_download.php</span>:14<br />
<span style="font-weight: bold;">./admin/user/user_bulk_message.php</span>:13<br />
<span style="font-weight: bold;">./admin/xmldb/actions/XMLDBAction.class.php</span>:161<br />
<span style="font-weight: bold;">./admin/xmldb/index.php</span>:106:78:88<br />
<span style="font-weight: bold;">./admin/xmldb/javascript.php</span>:42:43:49:50<br />
<span style="font-weight: bold;">./backup/backup.php</span>:104:76:91<br />
<span style="font-weight: bold;">./backup/backup_scheduled.php</span>:180<br />
<span style="font-weight: bold;">./backup/log.php</span>:11<br />
<span style="font-weight: bold;">./backup/restore.php</span>:103:96<br />
<span style="font-weight: bold;">./backup/restore_check.html</span>:268<br />
<span style="font-weight: bold;">./blocks/admin/block_admin.php</span>:67<br />
<span style="font-weight: bold;">./blocks/admin_bookmarks/block_admin_bookmarks.php</span>:55<br />
<span style="font-weight: bold;">./blocks/admin_bookmarks/create.php</span>:36<br />
<span style="font-weight: bold;">./blocks/admin_bookmarks/delete.php</span>:32<br />
<span style="font-weight: bold;">./blocks/admin_tree/block_admin_tree.php</span>:212:67<br />
<span style="font-weight: bold;">./blocks/certify/certify.php</span>:11<br />
<span style="font-weight: bold;">./blocks/certify/close.php</span>:86<br />
<span style="font-weight: bold;">./blocks/certify/config_instance.html</span>:13<br />
<span style="font-weight: bold;">./blocks/course_summary/block_course_summary.php</span>:33<br />
<span style="font-weight: bold;">./blocks/moodleblock.class.php</span>:475<br />
<span style="font-weight: bold;">./blocks/reports/block_reports.php</span>:41:50:85<br />
<span style="font-weight: bold;">./blocks/trouble_ticket/thanks.php</span>:25<br />
<span style="font-weight: bold;">./calendar/event.php</span>:64<br />
<span style="font-weight: bold;">./calendar/export.php</span>:19<br />
<span style="font-weight: bold;">./calendar/view.php</span>:54<br />
<span style="font-weight: bold;">./config-dist.php</span>:125<br />
<span style="font-weight: bold;">./config.php</span>:23<br />
<span style="font-weight: bold;">./course/category.php</span>:140:384<br />
<span style="font-weight: bold;">./course/delete.php</span>:34:65<br />
<span style="font-weight: bold;">./course/edit.php</span>:118:150<br />
<span style="font-weight: bold;">./course/editcategory.php</span>:179:323<br />
<span style="font-weight: bold;">./course/importstudents.php</span>:19<br />
<span style="font-weight: bold;">./course/mod.php</span>:706<br />
<span style="font-weight: bold;">./course/modedit.php</span>:446<br />
<span style="font-weight: bold;">./course/report/stats/index.php</span>:28<br />
<span style="font-weight: bold;">./course/search.php</span>:275<br />
<span style="font-weight: bold;">./enrol/authorize/enrol.php</span>:414:746<br />
<span style="font-weight: bold;">./enrol/imsenterprise/importnow.php</span>:13<br />
<span style="font-weight: bold;">./filter/algebra/algebradebug.php</span>:261<br />
<span style="font-weight: bold;">./filter/tex/texdebug.php</span>:263<br />
<span style="font-weight: bold;">./grade/report/grader/preferences.php</span>:87<br />
<span style="font-weight: bold;">./index.php</span>:38:56:62:74:83<br />
<span style="font-weight: bold;">./install.php</span>:139:547<br />
<span style="font-weight: bold;">./lib/adminlib.php</span>:3458:3498:3822:3972:3977:3985:4172:4175:4176:4335:776<br />
<span style="font-weight: bold;">./lib/db/mysql.php</span>:1473<br />
<span style="font-weight: bold;">./lib/db/postgres7.php</span>:1216<br />
<span style="font-weight: bold;">./lib/ddllib.php</span>:818:820<br />
<span style="font-weight: bold;">./lib/dmllib.php</span>:510<br />
<span style="font-weight: bold;">./lib/environmentlib.php</span>:320:323<br />
<span style="font-weight: bold;">./lib/moodlelib.php</span>:5099<br />
<span style="font-weight: bold;">./lib/pagelib.php</span>:471<br />
<span style="font-weight: bold;">./lib/setup.php</span>:184:185<br />
<span style="font-weight: bold;">./login/index.php</span>:9<br />
<span style="font-weight: bold;">./mod/assignment/lib.php</span>:2837<br />
<span style="font-weight: bold;">./mod/glossary/formats.php</span>:27:39<br />
<span style="font-weight: bold;">./mod/hotpot/db/update_to_v2.php</span>:519<br />
<span style="font-weight: bold;">./my/pagelib.php</span>:59<br />
<span style="font-weight: bold;">./question/upgrade.php</span>:90<br />
<span style="font-weight: bold;">./user/editadvanced.php</span>:153:158<br />
<span style="font-weight: bold;">./user/index.php</span>:100:542:548<br />
<span style="font-weight: bold;">./user/tabs.php</span>:225:233:235</p>
<h3 style="color: #5f5f5f;">$CFG-&gt;ADMINBLOCKS</h3>
<p><span style="font-weight: bold;">./admin/index.php</span>:522</p>
<h3 style="color: #5f5f5f;">$CFG-&gt;ADMINEDITALWAYS</h3>
<p><span style="font-weight: bold;">./config-dist.php</span>:147<br />
<span style="font-weight: bold;">./search/documents/forum_document.php</span>:169</p>
<h3 style="color: #5f5f5f;">$CFG-&gt;ADMINSEESALL</h3>
<p><span style="font-weight: bold;">./calendar/lib.php</span>:1426:1427</p>
<h3 style="color: #5f5f5f;">$CFG-&gt;ADMINUSEHTMLEDITOR</h3>
<p><span style="font-weight: bold;">./admin/settings.php</span>:166<br />
<span style="font-weight: bold;">./admin/upgradesettings.php</span>:58<br />
<span style="font-weight: bold;">./lib/adminlib.php</span>:2607:2608</p>
<h3 style="color: #5f5f5f;">$CFG-&gt;AJAXCAPABLE</h3>
<p><span style="font-weight: bold;">./course/format/topics/ajax.php</span>:7<br />
<span style="font-weight: bold;">./course/format/weeks/ajax.php</span>:7<br />
<span style="font-weight: bold;">./course/view.php</span>:153:158</p>
<h3 style="color: #5f5f5f;">$CFG-&gt;AJAXTESTEDBROWSERS</h3>
<p><span style="font-weight: bold;">./course/format/topics/ajax.php</span>:8<br />
<span style="font-weight: bold;">./course/format/weeks/ajax.php</span>:8<br />
<span style="font-weight: bold;">./course/view.php</span>:154:161</p>
<h3 style="color: #5f5f5f;">$CFG-&gt;ALLOWCATEGORYTHEMES</h3>
<p><span style="font-weight: bold;">./course/category.php</span>:97<br />
<span style="font-weight: bold;">./course/editcategory.php</span>:64<br />
<span style="font-weight: bold;">./course/editcategory_form.php</span>:20<br />
<span style="font-weight: bold;">./lib/weblib.php</span>:3003</p>
<h3 style="color: #5f5f5f;">$CFG-&gt;ALLOWCOURSETHEMES</h3>
<p><span style="font-weight: bold;">./course/edit_form.php</span>:143<br />
<span style="font-weight: bold;">./lib/weblib.php</span>:2998<br />
<span style="font-weight: bold;">./theme/chameleon/ui/chameleon.php</span>:14<br />
<span style="font-weight: bold;">./theme/chameleon/ui/css.php</span>:18</p>
<h3 style="color: #5f5f5f;">$CFG-&gt;ALLOWEMAILADDRESSES</h3>
<p><span style="font-weight: bold;">./lib/moodlelib.php</span>:4440:4441:4457</p>
<h3 style="color: #5f5f5f;">$CFG-&gt;ALLOWOBJECTEMBED</h3>
<p><span style="font-weight: bold;">./lib/weblib.php</span>:6584:6590</p>
<h3 style="color: #5f5f5f;">$CFG-&gt;ALLOWTHEMECHANGEONURL</h3>
<p><span style="font-weight: bold;">./lib/setup.php</span>:599</p>
<h3 style="color: #5f5f5f;">$CFG-&gt;ALLOWUNENROL</h3>
<p><span style="font-weight: bold;">./lib/db/access.php</span>:383</p>
<h3 style="color: #5f5f5f;">$CFG-&gt;ALLOWUSERBLOCKHIDING</h3>
<p><span style="font-weight: bold;">./blocks/moodleblock.class.php</span>:376<br />
<span style="font-weight: bold;">./lib/weblib.php</span>:6479</p>
</div>
<p>The post <a href="http://gl.ib.ly/computing/2009/06/24/configuration-variables-moodle-code-part-two/">All configuration variables in Moodle code &#8211; Part two</a> appeared first on <a href="http://gl.ib.ly">GL.IB.LY</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://gl.ib.ly/computing/2009/06/24/configuration-variables-moodle-code-part-two/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Searching compressed Apache logs</title>
		<link>http://gl.ib.ly/stuff/2009/06/23/searching-compressed-apache-logs/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=searching-compressed-apache-logs</link>
		<comments>http://gl.ib.ly/stuff/2009/06/23/searching-compressed-apache-logs/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 06:27:23 +0000</pubDate>
		<dc:creator><![CDATA[tariq]]></dc:creator>
				<category><![CDATA[Stuff]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[bunzip2]]></category>
		<category><![CDATA[compressed]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[gzip]]></category>
		<category><![CDATA[logs]]></category>
		<category><![CDATA[one liners]]></category>
		<category><![CDATA[tidbits]]></category>
		<category><![CDATA[xargs]]></category>

		<guid isPermaLink="false">http://gl.ib.ly/?p=35</guid>
		<description><![CDATA[<p>From time to time things tend to go wrong and systems tend to go crazy. Sometimes these errors are more of nuisance than anything else, an intermittent annoyance you&#8217;d prefer not to investigate &#8212; trawling through logs is a pain in<span class="ellipsis">&#8230;</span><div class="read-more"><a href="http://gl.ib.ly/stuff/2009/06/23/searching-compressed-apache-logs/">Read more &#8250;</a></div><!-- end of .read-more --></p><p>The post <a href="http://gl.ib.ly/stuff/2009/06/23/searching-compressed-apache-logs/">Searching compressed Apache logs</a> appeared first on <a href="http://gl.ib.ly">GL.IB.LY</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>From time to time things tend to go wrong and <a title="http://gl.ib.ly/archives/10-Deleting-specific-emails-from-the-postfix-mail-queue.html" href="http://web.archive.org/web/20090814080809/http://gl.ib.ly/exit.php?url_id=65&amp;entry_id=27">systems tend to go crazy</a>. Sometimes these errors are more of nuisance than anything else, an intermittent annoyance you&#8217;d prefer not to investigate &#8212; trawling through logs is a pain in the backside. Now you need to take a peak at those compressed Apache error log files, ugh! Well before you look for suitable places to hang some rope try running some expressions across a certain number of files. Normally you&#8217;d only want to look at logs for the last 7 days, so lets give that a go.</p>
<div>The error messages I am interested in all contain the text <code>Healthcheck</code> so I will use trusty <code>grep</code>find matching lines in the logs. I will use <code>find</code> to get me all the files modified in the last seven days. A program called <code>xargs</code> will then be used to call <code>cat</code> which will pipe to a compression program which finally pipes to <code>grep</code>. Put this all together and you get something like this:</p>
<div>
<pre>find /var/log/apache2 -type f -name "error_*.bz2" -mtime -7 | sort | xargs cat | bunzip2 | grep"Healthcheck"</pre>
</div>
<p>If your files are <i>tar.gz</i> then you&#8217;ll need to replace <code>bunzip2</code> with gzip -dc. So that would look like:</p>
</div>
<div>
<pre>find /var/log/apache2 -type f -name "error_*.tar.gz" -mtime -7 | sort | xargs cat | gzip -dc |grep "Healthcheck"</pre>
<p>Have fun!</p>
</div>
<p>The post <a href="http://gl.ib.ly/stuff/2009/06/23/searching-compressed-apache-logs/">Searching compressed Apache logs</a> appeared first on <a href="http://gl.ib.ly">GL.IB.LY</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://gl.ib.ly/stuff/2009/06/23/searching-compressed-apache-logs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Common translation errors in Moodle language packs</title>
		<link>http://gl.ib.ly/stuff/2009/02/06/common-translation-errors-moodle-language-packs/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=common-translation-errors-moodle-language-packs</link>
		<comments>http://gl.ib.ly/stuff/2009/02/06/common-translation-errors-moodle-language-packs/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 06:34:33 +0000</pubDate>
		<dc:creator><![CDATA[tariq]]></dc:creator>
				<category><![CDATA[Stuff]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[language pack]]></category>
		<category><![CDATA[moodle]]></category>
		<category><![CDATA[moodle 1.9]]></category>
		<category><![CDATA[one liners]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://gl.ib.ly/?p=83</guid>
		<description><![CDATA[<p>If you have ever had to deal with language packs you will know how much of a pain they can be. I regularly interact with 9 Moodle language packs and I don&#8217;t like doing that much. For some reason, can&#8217;t<span class="ellipsis">&#8230;</span><div class="read-more"><a href="http://gl.ib.ly/stuff/2009/02/06/common-translation-errors-moodle-language-packs/">Read more &#8250;</a></div><!-- end of .read-more --></p><p>The post <a href="http://gl.ib.ly/stuff/2009/02/06/common-translation-errors-moodle-language-packs/">Common translation errors in Moodle language packs</a> appeared first on <a href="http://gl.ib.ly">GL.IB.LY</a>.</p>]]></description>
				<content:encoded><![CDATA[<p><span style="color: #545454;">If you have ever had to deal with language packs you will know how much of a pain they can be. I regularly interact with 9 Moodle language packs and I don&#8217;t like doing that much. For some reason, can&#8217;t remember why now, we gave people the raw language string files (PHP code files) to translate and they translated these files and sent them back. Only these people are not PHP coders and they make mistakes. Here is my list of what goes wrong and how to solve.</span></p>
<div class="serendipity_entry_extended" style="color: #545454;"><a id="extended"></a><br />
*Incorrect syntax*<br />
They edit the files and send them back to us, but they delete a semicolon or something. Check all language pack files with the following shell script.</p>
<div class="geshi"><span style="font-style: italic; color: #666666;">#!/bin/bash</span><br />
<span style="font-weight: bold; color: #000000;">for</span> i <span style="font-weight: bold; color: #000000;">in</span> $<span style="font-weight: bold; color: #7a0874;">(</span> <span style="font-weight: bold; color: #c20cb9;">ls</span> *.php<span style="font-weight: bold; color: #7a0874;">)</span>; <span style="font-weight: bold; color: #000000;">do</span><br />
php -l $i<br />
<span style="font-weight: bold; color: #000000;">done</span></div>
<p>On windows try:</p>
<div class="geshi">@<span style="font-weight: bold; color: #7a0874;">echo</span> off<br />
FOR %%A IN <span style="font-weight: bold; color: #7a0874;">(</span>*.php<span style="font-weight: bold; color: #7a0874;">)</span> DO php -l %%A</div>
<p>*UTF8 Header*<br />
This is prepended to the start of some files by certain editors. As the header comes before the<code>&lt;?PHP</code> tag the header gets output and this will do all sorts of nasty things like corrupting user sessions. The solution is to strip utf headers from all files.</p>
<p>I use a script to add and <a style="color: #7da939;" href="http://gl.ib.ly/uploads/moodle/check.php.txt">strip UTF8 headers</a> from entire directories.</p>
<p>*Translated variable names*<br />
When the translators see something like <code>$a-&gt;name</code> they sometimes translate name. Again this isn&#8217;t easy to find but I use the following line to get malformed variable names.</p>
<div class="geshi"><span style="font-weight: bold; color: #c20cb9;">grep</span> -nroe <span style="color: #ff0000;">&#8220;\$a-&gt;[^ .\&lt;&gt;/';:\!,\?)(]*&#8221;</span> PATH_TO_DIR | <span style="font-weight: bold; color: #c20cb9;">grep</span> -v <span style="color: #ff0000;">&#8220;\$a-&gt;[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*&#8221;</span></div>
<blockquote style="color: #76767a;">
<pre>PATH_TO_DIR/block_class_list.php:14:$a-&gt;
PATH_TO_DIR/block_task_list.php:30:$a-&gt;
PATH_TO_DIR/block_task_list.php:34:$a-&gt;
PATH_TO_DIR/block_task_list.php:34:$a-&gt;ì ëª©</pre>
</blockquote>
<p>This has caught all issues of this kind to date (for me), but it does rely on illegal variable names. A better approach would be to keep a whitelist of variables extracted from a known good language pack. If we find anything that looks like a variable in a another language pack and doesn&#8217;t appear on this list we can throw an error.</p>
<p>*Converting files to UTF-8 format*<br />
Sometimes countries (especially those using accented languages) tend to send us ASCII encoded files, these files will have to be converted to UTF-8 format so that accented characters are display correctly.</p>
<p>Here is a one liner to convert all files in the current directory to UTF-8 format:</p>
<div class="geshi"><span style="font-weight: bold; color: #000000;">for</span> f <span style="font-weight: bold; color: #000000;">in</span> ./*; <span style="font-weight: bold; color: #000000;">do</span> `<span style="font-weight: bold; color: #c20cb9;">mv</span> $f $f<span style="color: #ff0000;">&#8220;.bak&#8221;</span>; iconv &#8211;from-code iso-<span style="color: #000000;">8859</span>-<span style="color: #000000;">1</span> &#8211;to-code UTF-<span style="color: #000000;">8</span> $f<span style="color: #ff0000;">&#8220;.bak&#8221;</span> &gt; $f`;<span style="font-weight: bold; color: #000000;">done</span></div>
<p>If you are happy with changes do a</p>
<div class="geshi"><span style="font-weight: bold; color: #c20cb9;">rm</span> *.bak</div>
<p>See also: <a style="color: #7da939;" title="http://en.wikipedia.org/wiki/ISO_8859-1" href="http://web.archive.org/web/20110212133444/http://gl.ib.ly/exit.php?url_id=78&amp;entry_id=23">ISO 8859-1</a> and <a style="color: #7da939;" title="http://docs.moodle.org/en/Converting_files_to_UTF-8" href="http://web.archive.org/web/20110212133444/http://gl.ib.ly/exit.php?url_id=79&amp;entry_id=23">Converting files to UTF-8</a>.</p>
<p>*Other things which go wrong*<br />
Translators might change <code>$string['mystring'] = 'Hello $a!';</code> to <code>$string['mystring'] = "Hello $a!";</code>. Subtly $a will just not appear in the output as the double quoted string will be evaluated before Moodle can swap $a with some dynamic data. The following one liner catches most errors for me even though it isn&#8217;t complete.</p>
<div class="geshi"><span style="font-weight: bold; color: #c20cb9;">grep</span> -nro <span style="color: #ff0000;">&#8220;= \&#8221;</span><span style="color: #ff0000;">&#8221; PATH_TO_DIR</span></div>
<p>I guess you could lump all that together in one nice big shell script. If you do send me a copy <img class="emoticon" src="http://web.archive.org/web/20110212133444im_/http://gl.ib.ly/templates/default/img/emoticons/wink.png" alt=";-)" /></p>
</div>
<p>The post <a href="http://gl.ib.ly/stuff/2009/02/06/common-translation-errors-moodle-language-packs/">Common translation errors in Moodle language packs</a> appeared first on <a href="http://gl.ib.ly">GL.IB.LY</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://gl.ib.ly/stuff/2009/02/06/common-translation-errors-moodle-language-packs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>All configuration variables in Moodle code?</title>
		<link>http://gl.ib.ly/uncategorized/2008/12/15/configuration-variables-moodle-code-2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=configuration-variables-moodle-code-2</link>
		<comments>http://gl.ib.ly/uncategorized/2008/12/15/configuration-variables-moodle-code-2/#comments</comments>
		<pubDate>Mon, 15 Dec 2008 07:10:15 +0000</pubDate>
		<dc:creator><![CDATA[tariq]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cfg]]></category>
		<category><![CDATA[configuration variables]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[moodle]]></category>
		<category><![CDATA[moodle_19]]></category>
		<category><![CDATA[one liners]]></category>
		<category><![CDATA[sort]]></category>

		<guid isPermaLink="false">http://gl.ib.ly/?p=89</guid>
		<description><![CDATA[<p>Sometimes Moodle introduces some nice new configuration variables and I like to make sure that I know what they are and where they are. So to begin my investigation without heading off to the web I use the following command<span class="ellipsis">&#8230;</span><div class="read-more"><a href="http://gl.ib.ly/uncategorized/2008/12/15/configuration-variables-moodle-code-2/">Read more &#8250;</a></div><!-- end of .read-more --></p><p>The post <a href="http://gl.ib.ly/uncategorized/2008/12/15/configuration-variables-moodle-code-2/">All configuration variables in Moodle code?</a> appeared first on <a href="http://gl.ib.ly">GL.IB.LY</a>.</p>]]></description>
				<content:encoded><![CDATA[<p><span style="color: #545454;">Sometimes Moodle introduces some nice new configuration variables and I like to make sure that I know what they are and where they are. So to begin my investigation without heading off to the web I use the following command to get me a sorted list of the $CFG variables.</span></p>
<div class="serendipity_entry_extended" style="color: #545454;"><a id="extended"></a></p>
<div class="geshi"><span style="font-weight: bold; color: #c20cb9;">grep</span> -r &#8211;no-filename -o &#8216;\$CFG-&gt;<span style="font-weight: bold; color: #7a0874;">[</span>a-z<span style="font-weight: bold; color: #7a0874;">]</span><span style="font-weight: bold; color: #7a0874;">[</span>a-z<span style="font-weight: bold; color: #7a0874;">]</span>*&#8217; &lt;path_to_moodle&gt; | <span style="font-weight: bold; color: #c20cb9;">sort</span> -u</div>
<p>Good old trusty grep is used once again. We use grep to recursively, <i>-r</i>, look at all the files in the <i>path_to_moodle</i>. We tell grep to not print out the file names that patterns where found in with <i>&#8211;no-filename</i> and the <i>-o</i> option tells grep to output the exact pattern matched. The pattern itself is of the form: starts with <i>&#8220;$CFG-&gt;&#8221;</i> and is followed by one, or more lowercase characters. The pipe to <i>sort -u</i> sorts output and removes duplicate strings.</p>
<p>This command will produce something like the following list which I made using <a style="color: #7da939;" title="http://moodle.org" href="http://web.archive.org/web/20110315054119/http://gl.ib.ly/exit.php?url_id=11&amp;entry_id=8">Moodle</a> 1.9.2.</p>
<p><code>$CFG-&gt;admin<br />
$CFG-&gt;adminblocks<br />
$CFG-&gt;admineditalways<br />
$CFG-&gt;adminseesall<br />
$CFG-&gt;adminusehtmleditor<br />
$CFG-&gt;ajaxcapable<br />
$CFG-&gt;ajaxtestedbrowsers<br />
$CFG-&gt;allowcategorythemes<br />
$CFG-&gt;allowcoursethemes<br />
$CFG-&gt;allowemailaddresses<br />
$CFG-&gt;allowobjectembed<br />
$CFG-&gt;allowthemechangeonurl<br />
$CFG-&gt;allowunenrol<br />
$CFG-&gt;allowuserblockhiding<br />
$CFG-&gt;allowusermailcharset<br />
$CFG-&gt;allowuserthemes<br />
$CFG-&gt;allowvisiblecoursesinhiddencategories<br />
$CFG-&gt;allusersaresitestudents<br />
$CFG-&gt;alternateloginurl<br />
$CFG-&gt;an<br />
$CFG-&gt;apacheloguser<br />
$CFG-&gt;apachemaxmem<br />
$CFG-&gt;aspellextradicts<br />
$CFG-&gt;aspellpath<br />
$CFG-&gt;assignment<br />
$CFG-&gt;attemptuniqueid<br />
$CFG-&gt;auth<br />
$CFG-&gt;autolang<br />
$CFG-&gt;autologinguests<br />
$CFG-&gt;backup<br />
$CFG-&gt;block<br />
$CFG-&gt;blocks<br />
$CFG-&gt;blocksdrag<br />
$CFG-&gt;blog<br />
$CFG-&gt;bloglevel<br />
$CFG-&gt;bounceratio<br />
$CFG-&gt;cachetext<br />
$CFG-&gt;cachetype<br />
$CFG-&gt;calendar<br />
$CFG-&gt;chat<br />
$CFG-&gt;clamfailureonupload<br />
$CFG-&gt;config<br />
$CFG-&gt;cookiehttponly<br />
$CFG-&gt;cookiesecure<br />
$CFG-&gt;country<br />
$CFG-&gt;coursemanager<br />
$CFG-&gt;coursemanagers<br />
$CFG-&gt;coursesperpage<br />
$CFG-&gt;coursetheme<br />
$CFG-&gt;creatornewroleid<br />
$CFG-&gt;cronclionly<br />
$CFG-&gt;cronremotepassword<br />
$CFG-&gt;currenttextiscacheable<br />
$CFG-&gt;customersupportemail<br />
$CFG-&gt;customersupportemaildisplay<br />
$CFG-&gt;customscripts<br />
$CFG-&gt;data<br />
$CFG-&gt;datadir<br />
$CFG-&gt;dataroot<br />
$CFG-&gt;dbfamily<br />
$CFG-&gt;dbhost<br />
$CFG-&gt;dblogerror<br />
$CFG-&gt;dbname<br />
$CFG-&gt;dbpass<br />
$CFG-&gt;dbpersist<br />
$CFG-&gt;dbsessions<br />
$CFG-&gt;dbtype<br />
$CFG-&gt;dbuser<br />
$CFG-&gt;debug<br />
$CFG-&gt;debugdisplay<br />
$CFG-&gt;debugsmtp<br />
$CFG-&gt;decsbureauid<br />
$CFG-&gt;decsitemtypeid<br />
$CFG-&gt;defaultallowedmodules<br />
$CFG-&gt;defaultblocks<br />
$CFG-&gt;defaultcourseroleid<br />
$CFG-&gt;defaultfrontpageroleid<br />
$CFG-&gt;defaultrequestcategory<br />
$CFG-&gt;defaultuserroleid<br />
$CFG-&gt;deleteunconfirmed<br />
$CFG-&gt;denyemailaddresses<br />
$CFG-&gt;detect<br />
$CFG-&gt;digestmailtime<br />
$CFG-&gt;digestmailtimelast<br />
$CFG-&gt;directorypermissions<br />
$CFG-&gt;dirroot<br />
$CFG-&gt;disablebyteserving<br />
$CFG-&gt;disablecourseajax<br />
$CFG-&gt;disableglobalshack<br />
$CFG-&gt;disablegradehistory<br />
$CFG-&gt;disablemycourses<br />
$CFG-&gt;disablescheduledbackups<br />
$CFG-&gt;disablestatsprocessing<br />
$CFG-&gt;disableupgradelogging<br />
$CFG-&gt;disableuserimages<br />
$CFG-&gt;displaydebug<br />
$CFG-&gt;displayloginfailures<br />
$CFG-&gt;docroot<br />
$CFG-&gt;doctonewwindow<br />
$CFG-&gt;eaccelerator<br />
$CFG-&gt;editorbackgroundcolor<br />
$CFG-&gt;editordictionary<br />
$CFG-&gt;editorfontfamily<br />
$CFG-&gt;editorfontlist<br />
$CFG-&gt;editorfontsize<br />
$CFG-&gt;editorformatlist<br />
$CFG-&gt;editorhidebuttons<br />
$CFG-&gt;editorkillword<br />
$CFG-&gt;editorspelling<br />
$CFG-&gt;editorsrc<br />
$CFG-&gt;emailconnectionerrorsto<br />
$CFG-&gt;emoticons<br />
$CFG-&gt;enableajax<br />
$CFG-&gt;enablecourserequests<br />
$CFG-&gt;enableglobalsearch<br />
$CFG-&gt;enableglobalshack<br />
$CFG-&gt;enablegroupings<br />
$CFG-&gt;enablehtmlpurifier<br />
$CFG-&gt;enableoutcomes<br />
$CFG-&gt;enablerecordcache<br />
$CFG-&gt;enablerssfeeds<br />
$CFG-&gt;enablestats<br />
$CFG-&gt;enabletrusttext<br />
$CFG-&gt;enrol<br />
$CFG-&gt;errordocroot<br />
$CFG-&gt;exercise<br />
$CFG-&gt;extendedusernamechars<br />
$CFG-&gt;extratabs<br />
$CFG-&gt;filelifetime<br />
$CFG-&gt;filter<br />
$CFG-&gt;filterall<br />
$CFG-&gt;filtermatchoneperpage<br />
$CFG-&gt;filtermatchonepertext<br />
$CFG-&gt;filteruploadedfiles<br />
$CFG-&gt;footer<br />
$CFG-&gt;footerlinks<br />
$CFG-&gt;forcefirstname<br />
$CFG-&gt;forcelastname<br />
$CFG-&gt;forcelogin<br />
$CFG-&gt;forceloginforprofiles<br />
$CFG-&gt;forcetimezone<br />
$CFG-&gt;forgottenpasswordurl<br />
$CFG-&gt;formatstring<br />
$CFG-&gt;formatstringstriptags<br />
$CFG-&gt;forum<br />
$CFG-&gt;framename<br />
$CFG-&gt;frametarget<br />
$CFG-&gt;frontpage<br />
$CFG-&gt;frontpageloggedin<br />
$CFG-&gt;fullnamedisplay<br />
$CFG-&gt;gdversion<br />
$CFG-&gt;geoipfile<br />
$CFG-&gt;glossary<br />
$CFG-&gt;googlemapkey<br />
$CFG-&gt;grade<br />
$CFG-&gt;gradebookroles<br />
$CFG-&gt;gradeexport<br />
$CFG-&gt;gradehistorylifetime<br />
$CFG-&gt;gradepublishing<br />
$CFG-&gt;guestloginbutton<br />
$CFG-&gt;guestroleid<br />
$CFG-&gt;handlebounces<br />
$CFG-&gt;header<br />
$CFG-&gt;hiddenuserfields<br />
$CFG-&gt;hideactivitytypenavlink<br />
$CFG-&gt;hivecbid<br />
$CFG-&gt;hivehost<br />
$CFG-&gt;hivepassword<br />
$CFG-&gt;hivepath<br />
$CFG-&gt;hiveport<br />
$CFG-&gt;hiveprotocol<br />
$CFG-&gt;hiveusername<br />
$CFG-&gt;hotpot<br />
$CFG-&gt;hotpotismobile<br />
$CFG-&gt;hotpotroot<br />
$CFG-&gt;hotpottemplate<br />
$CFG-&gt;htmleditor<br />
$CFG-&gt;httpsthemewww<br />
$CFG-&gt;httpswwwroot<br />
$CFG-&gt;ignoresesskey<br />
$CFG-&gt;intcachemax<br />
$CFG-&gt;iplookup<br />
$CFG-&gt;javascript<br />
$CFG-&gt;journal<br />
$CFG-&gt;keeptagnamecase<br />
$CFG-&gt;lams<br />
$CFG-&gt;lang<br />
$CFG-&gt;langcache<br />
$CFG-&gt;langlist<br />
$CFG-&gt;langmenu<br />
$CFG-&gt;lastexpirynotify<br />
$CFG-&gt;lastnotifyfailure<br />
$CFG-&gt;latinexcelexport<br />
$CFG-&gt;ldap<br />
$CFG-&gt;libdir<br />
$CFG-&gt;local<br />
$CFG-&gt;locale<br />
$CFG-&gt;loginaspassword<br />
$CFG-&gt;loginhttps<br />
$CFG-&gt;loglifetime<br />
$CFG-&gt;logsql<br />
$CFG-&gt;longtimenosee<br />
$CFG-&gt;maildomain<br />
$CFG-&gt;mailnewline<br />
$CFG-&gt;mailprefix<br />
$CFG-&gt;max<br />
$CFG-&gt;maxbytes<br />
$CFG-&gt;maxeditingtime<br />
$CFG-&gt;memcachedhosts<br />
$CFG-&gt;memcachedpconn<br />
$CFG-&gt;message<br />
$CFG-&gt;messagewasjustemailed<br />
$CFG-&gt;messaging<br />
$CFG-&gt;migrated<br />
$CFG-&gt;minbounces<br />
$CFG-&gt;minpassworddigits<br />
$CFG-&gt;minpasswordlength<br />
$CFG-&gt;minpasswordlower<br />
$CFG-&gt;minpasswordnonalphanum<br />
$CFG-&gt;minpasswordupper<br />
$CFG-&gt;mnet<br />
$CFG-&gt;moddata<br />
$CFG-&gt;modpixpath<br />
$CFG-&gt;my<br />
$CFG-&gt;mymoodleredirect<br />
$CFG-&gt;noconvertjournals<br />
$CFG-&gt;nodefaultuserrolelists<br />
$CFG-&gt;noemailever<br />
$CFG-&gt;nofixday<br />
$CFG-&gt;nolastloggedin<br />
$CFG-&gt;nonmetacoursesyncroleids<br />
$CFG-&gt;noreplyaddress<br />
$CFG-&gt;notifyloginfailures<br />
$CFG-&gt;notifyloginthreshold<br />
$CFG-&gt;notloggedinroleid<br />
$CFG-&gt;old<br />
$CFG-&gt;opentogoogle<br />
$CFG-&gt;os<br />
$CFG-&gt;ostype<br />
$CFG-&gt;pagepath<br />
$CFG-&gt;pagetheme<br />
$CFG-&gt;passwordpolicy<br />
$CFG-&gt;passwordsaltmain<br />
$CFG-&gt;pathtoclam<br />
$CFG-&gt;pathtodu<br />
$CFG-&gt;perfdebug<br />
$CFG-&gt;pixpath<br />
$CFG-&gt;preferlinegraphs<br />
$CFG-&gt;prefix<br />
$CFG-&gt;preventaccesstohiddenfiles<br />
$CFG-&gt;protectusernames<br />
$CFG-&gt;proxyhost<br />
$CFG-&gt;proxypassword<br />
$CFG-&gt;proxyport<br />
$CFG-&gt;proxytype<br />
$CFG-&gt;proxyuser<br />
$CFG-&gt;qtype<br />
$CFG-&gt;quarantinedir<br />
$CFG-&gt;quiz<br />
$CFG-&gt;rcache<br />
$CFG-&gt;rcachettl<br />
$CFG-&gt;recaptchaprivatekey<br />
$CFG-&gt;recaptchapublickey<br />
$CFG-&gt;registerauth<br />
$CFG-&gt;registered<br />
$CFG-&gt;release<br />
$CFG-&gt;repository<br />
$CFG-&gt;repositoryactivate<br />
$CFG-&gt;repositorywebroot<br />
$CFG-&gt;resource<br />
$CFG-&gt;resourcetrimlength<br />
$CFG-&gt;respectsessionsettings<br />
$CFG-&gt;restrictbydefault<br />
$CFG-&gt;restrictmodulesfor<br />
$CFG-&gt;rolesactive<br />
$CFG-&gt;runclamonupload<br />
$CFG-&gt;running<br />
$CFG-&gt;scorm<br />
$CFG-&gt;search<br />
$CFG-&gt;session<br />
$CFG-&gt;sessioncookie<br />
$CFG-&gt;sessioncookiepath<br />
$CFG-&gt;sessiontimeout<br />
$CFG-&gt;showblocksonmodpages<br />
$CFG-&gt;showcrondebugging<br />
$CFG-&gt;showcronsql<br />
$CFG-&gt;siteblocksadded<br />
$CFG-&gt;siteidentifier<br />
$CFG-&gt;sitemailcharset<br />
$CFG-&gt;sitepolicy<br />
$CFG-&gt;slasharguments<br />
$CFG-&gt;smartpix<br />
$CFG-&gt;smtphosts<br />
$CFG-&gt;smtpmaxbulk<br />
$CFG-&gt;smtppass<br />
$CFG-&gt;smtpuser<br />
$CFG-&gt;sso<br />
$CFG-&gt;statscatdepth<br />
$CFG-&gt;statsfirstrun<br />
$CFG-&gt;statsmaxruntime<br />
$CFG-&gt;statsrolesupgraded<br />
$CFG-&gt;statsruntimestarthour<br />
$CFG-&gt;statsruntimestartminute<br />
$CFG-&gt;statsuserthreshold<br />
$CFG-&gt;stringfilters<br />
$CFG-&gt;stylesheets<br />
$CFG-&gt;supportemail<br />
$CFG-&gt;supportname<br />
$CFG-&gt;supportpage<br />
$CFG-&gt;tagsort<br />
$CFG-&gt;template<br />
$CFG-&gt;textfilters<br />
$CFG-&gt;textfilterx<br />
$CFG-&gt;theme<br />
$CFG-&gt;themedir<br />
$CFG-&gt;themelist<br />
$CFG-&gt;themeorder<br />
$CFG-&gt;themewww<br />
$CFG-&gt;timezone<br />
$CFG-&gt;tracksessionip<br />
$CFG-&gt;type<br />
$CFG-&gt;unicodecleanfilename<br />
$CFG-&gt;unicodedb<br />
$CFG-&gt;unzip<br />
$CFG-&gt;upgrade<br />
$CFG-&gt;usepaypalsandbox<br />
$CFG-&gt;usesid<br />
$CFG-&gt;usetags<br />
$CFG-&gt;version<br />
$CFG-&gt;wiki<br />
$CFG-&gt;wordlist<br />
$CFG-&gt;workshop<br />
$CFG-&gt;wwwdir<br />
$CFG-&gt;wwwroot<br />
$CFG-&gt;xml<br />
$CFG-&gt;xmldbdisablecommentchecking<br />
$CFG-&gt;xmldbdisablenextprevchecking<br />
$CFG-&gt;xmldbreconstructprevnext<br />
$CFG-&gt;xmlstrictheaders<br />
$CFG-&gt;zip</code></div>
<p>The post <a href="http://gl.ib.ly/uncategorized/2008/12/15/configuration-variables-moodle-code-2/">All configuration variables in Moodle code?</a> appeared first on <a href="http://gl.ib.ly">GL.IB.LY</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://gl.ib.ly/uncategorized/2008/12/15/configuration-variables-moodle-code-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
