Beatnik's Journal Beatnik's use Perl Journal en-us use Perl; is Copyright 1998-2006, Chris Nandor. Stories, comments, journals, and other submissions posted on use Perl; are Copyright their respective owners. 2012-01-25T01:58:46+00:00 pudge Technology hourly 1 1970-01-01T00:00+00:00 Beatnik's Journal Techworld's Open Source Identity series covers Spine The Australian Techworld website recently published an interview with me on Spine, a mod_perl based CMS I created, as part of their Open Source Identity series. It discusses the differences with existing CMSs, RDBMS and language choices. The article is <a href="">here</a> Beatnik 2009-03-06T18:14:49+00:00 others Techworld Interview I was recently interviewed by a reporter from Techworld Australia on a mod_perl based CMS I created. Should this be posted on the mod_perl mailing list or maybe pushed onto use.perl frontpage?<nobr> <wbr></nobr>:)<br> <br> <a href="">Read here</a> Beatnik 2009-03-04T20:58:27+00:00 journal Resident Apple guru As the geekiest Mac hardware guy in the office, I've been asked by a cow-orker to have a look at his spanking new black MacBook. The wireless connection is extremly flakey. It goes from 0% to 85% packet loss, with a preferred access point. I've compared the wireless settings side by side with my own MacBook. I'm clueless on this issue. I sure hope he got decent warranty with his purchase because my best bet is the genius bar.<br> <br> <b>Update</b>: Since installing the latest security patches, everything seems to be stabilized (of course, I tested this around midnight, when I was partly sleeping). Beatnik 2008-10-14T20:50:05+00:00 journal Programming challenge: Cisco configs One of my cow-orkers had a bright idea the other day: Simplify the configuration of tunnel configuration for Cisco routers. By entering 5 IP addresses, it would spit out configuration lines for both sides of the tunnels, auto-incrementing the IP addresses for the tunnels that were required for each line. I ended up hacking something together before coffee break and had the whole thing fine-tuned and running before afternoon coffee. Tools of choice: jQuery and plain HTML. I stayed away from the C#, VB(A), Java Struts or Perl some of my friends would use and chose (hopefully) the cleanest and quickest way. Beatnik 2008-10-12T19:32:44+00:00 journal Bla Bla links Random links thrown in for a laugh or two: <ul> <li> <a href="">Failblog</a>: typical FAIL! situations, ranging from funny to WTF!?!?!</li><li> <a href="">Wrecked Exotics</a>: Expensive cars wrecked.. that's it</li></ul> Beatnik 2008-09-26T18:16:54+00:00 journal New things.. Monday was the first day for both the bowling and the Spanish courses. Status updates: Spanish is fun enough. First lesson focused on introducing yourself, spelling and pronunciation. Summary of the day: El burro sabe m&#225;s que t&#250;.<br> <br>Bowling was good fun but more difficult than on the Wii. 3 game average: a very low 80. Beatnik 2008-09-09T19:46:12+00:00 journal The times, they are a-changing It's that time of the year again. People keep bugging me to put together a wishlist. As before, I have no idea what to ask for my birthday. I managed to put together a list with DVDs and books. Truth of the matter is that I haven't spend as much time on geeky stuff as before. I haven't attended YAPC::Europe this year or learned any new programming languages. I'm prioritizing differently, getting some certifications out of the way and spending some well-deserved time with my girlfriend in our new apartment. In a few weeks, I'll turn 30.. a time to look back and learn from the past 3 decades and plan the next 3. So far, I'm starting Spanish language courses next week, joined a amateur bowling team at work, want to get certified in 2 products by the end of this year and make at least one important career decision in the next decade. Also on the long term, this decade will be (hopefully) one of offspring, marital vows and property deeds. Beatnik 2008-09-01T19:26:31+00:00 journal Shopping on the american economy.. I dropped by the local <a href="">store</a> and picked up some odd items: <ul> <li>Lucky Charms</li><li>Corn dogs</li><li>Sweet pickled relish</li><li>some Mountain Dew</li><li>Coffee Mate</li></ul><p> In short, stuff you normally wouldn't pick up at a local belgian deli.</p> Beatnik 2008-08-28T19:30:54+00:00 journal American iMac I've decided to buy myself an iMac for my birthday. Biggest problem: budget. I figured out that the difference in US dollars to a European version is about 500 <b>euros</b>. I've already figured out a way to get it into the country.. What I haven't checked fully yet is wither or not it can run on local power. AFAIK they use 110volts in the states, we use 230volts. The guy at the Apple store assured me it shouldn't be a problem. Some forums say the same thing. All I'll need is a cable. Any other issues I should be worried about? Anyone else did something similar before? Beatnik 2008-07-26T23:29:20+00:00 journal Quote of the day: Wikipedia From an MSN chat log:<p><div class="quote"><p>lol, I'm not going to crawl wikipedia when I can just download it all.</p></div><p>For the record, it's <i>only</i> 3.4 gb.</p> Beatnik 2008-07-15T18:07:33+00:00 journal iPhone 3G in BE WTF?!?!?!? [parte deux] It seems AT&amp;T is going to sell their unlocked non-plan iphone 3g for the bargain price of $599 (8gb) / $699 (16gb). Getting a 'merican iphone 3G for 380 euros is still cheaper than getting one for 525 euros.<br> <br>Some sites mention that only the AT&amp;T store will force you to activate the phone in-store (while the Apple store might not).. Can someone say "Loophole"?? French unlocked iphones are rumoured to go for 509 euros. <br> <br> In the mean time, belgian politicians are talking about scratching the law that forbids bundled sale (which apparently is also why the price is so high). Purely accidentally, the secretary that started this discussion, got a <a href="">first gen iphone</a>. Beatnik 2008-07-09T08:34:08+00:00 journal iPhone 3G in BE WTF?!?!?!? Still eyeballs deep into boxes, light fixures and bubble wrap, I checked the page that <a href="">Mobistar</a> (the belgian cell phone provider that won the exclusive deal with Apple) sent me.. Finally, some details on getting the iphone. I wasn't expecting low prices like The Netherlands (1 euro for the phone on a 2 year plan, 45 euros per month) or the UK (free iphone for a 1.5 year plan, 45 pounds sterling a month). Knowing the belgian market, I was assuming something closer to the announced $199 ceiling (or ever 199 euros).<br> <br> After reading the announcement page, I wasn't all that eager anymore to get one. It seems that Mobistar is planning on selling these phones for <b>525 euros</b> for the 8 gig and <b>615 euros</b> for the 16 gig version. Serious <b>WTF??!?!?!?!?!</b>. Their plan seems equally retarted: 30 euros for 3 hours voice or 300 text messages + 200 meg data. 45 euros for 6 hours voice or 600 text messages + 500 meg data. 60 euros for 9 hours of voice or 900 text messages + 1 gig dara.<br> <br>I really hope they realize that they're definitly not going to sell like hotcakes. If I had known, I would have bought a hacked first gen for 250 euros ($399) and used it without GPS<nobr> <wbr></nobr>:) Beatnik 2008-07-08T18:39:28+00:00 journal Yet another zombie movie In between all the unpacking and cleaning, I did squeeze in watching <a href="">I am legend</a> on pay per view. To me, it seems like yet another zombie movie, maybe with just another twist. I still like the Resident Evil trilogy more but it beats <a href="">Dawn of the dead</a>. Beatnik 2008-07-06T18:59:25+00:00 journal Fscking sweet software: HP WebInspect Today, I got a demonstration of HP's <a href=";cp=1-11-201-200%5E9570_4000_100__">WebInspect</a>, which is a very nice web application scanner (including a very extensive SQL injection exploit engine). Unfortunatly, with the sweetness comes a price. Beatnik 2008-06-17T16:38:15+00:00 journal Contributing to the american economy We dropped down by a <i>small</i> mall a few miles down from the hotel and picked up some stuff. The loot:<ul> <li>iLife '08 ($78)</li><li>Pink 8 gig iPod ($199.99)</li><li>Wireless Apple keyboard ($79.99)</li><li>Some CDs ($30)</li><li>Some DVDs ($20.99)</li><li>Perfume for the girlfriend ($56,59)</li><li>Some clothes ($100)</li></ul><p> Total amount of euros poured into the American economy: 365. Considering most of these things are either more expense in Belgium or even impossible to find anyway, all in all a very good deal!<br> <br>I also picked up some cigarettes for my sister-in-law, at bargain prices (REALLY). <br> <br>It's quite strange to walk around an area that just breathes "Welcome to America" and only minutes after that get confronted with the evergrowing public waste problem in Naples..</p> Beatnik 2008-05-01T17:24:30+00:00 journal jQuery tricks: hiding body elements <a href="">Someone</a> gestured me towards <a href="">jQuery</a> recently. I've been playing around with it a bit. Yesterday I got the following idea: allow the visitor to minimize the fancy logos and just show the important stuff. I had the following:<blockquote><div><p> <tt>&lt;style type="text/css"&gt;<br>body {<br>&nbsp; &nbsp; &nbsp; &nbsp;<nobr> <wbr></nobr>/* Some other stuff here */<br>&nbsp; &nbsp; &nbsp; &nbsp; background-image: url(http://localhost/images/bg.jpg);<br>&nbsp; &nbsp; &nbsp; &nbsp; background-repeat: repeat-x;<br>}<br>&lt;/style&gt;<br>&lt;body&gt;<br>&lt;!-- Some other stuff here --&gt;<br>&lt;/body&gt;</tt></p></div> </blockquote><p>The background was the element I wanted to hide. I ended up with something like this:</p><blockquote><div><p> <tt>&lt;style type="text/css"&gt;<br>body {<br>&nbsp; &nbsp; &nbsp; &nbsp;<nobr> <wbr></nobr>/* Some other stuff here */<br>&nbsp; &nbsp; &nbsp; &nbsp; background-image: url(http://localhost/images/bg.jpg);<br>&nbsp; &nbsp; &nbsp; &nbsp; background-repeat: repeat-x;<br>}<br>&lt;/style&gt;<br>&lt;script type="text/javascript" language="javascript" src="jquery.js"&gt;&lt;/script&gt;<br>&lt;body&gt;<br>&lt;!-- Some other stuff here --&gt;<br>&lt;a id="mini" href="#" OnClick="<br>if ( $('#mini').text() == '[-]' ) { $('#mini').text('[+]') } else { $('#mini').text('[-]'); }<br>if ($('body').css('background-image') == 'url(http://localhost/images/bg.jpg)')<br>&nbsp; &nbsp;{ $('body').css('background-image','url()'); } else<br>&nbsp; &nbsp;{ $('body').css('background-image','url(http://localhost/images/bg.jpg)'); }<br>return false;"&gt;[-]&lt;/a&gt;<br>&lt;!-- and here --&gt;<br>&lt;/body&gt;</tt></p></div> </blockquote><p>This adds a small [-] link that, when clicked, clears the background and changes to a [+]. Clicking again switches back.</p> Beatnik 2008-04-22T17:37:04+00:00 journal Italy, here I come Looks like I'll be spending 2 weeks in Italy pretty soon. I'll be staying about an hour south of Rome, with some co-workers (working, obviously). We'll have the weekend in between off so I might drop by Rome again. Beatnik 2008-04-17T20:28:29+00:00 journal Lease signed My girlfriend and me signed the lease contract for our very first duplex together this evening. We'll be moving in on the first of July. For my girlfriend, it'll mean a 1 minute walk to work instead of a 5 minute "taxi boyfriend". For me, the drive to work is about the same. Most importantly, we're finally moving in together. Beatnik 2008-04-17T20:12:29+00:00 journal Being able to read is not a requirement for this job You know how sometimes with different platforms, they use different filesystems? This rule also exists with backup tapes. A backup tape on Solaris is usually formatted differently than one on Windows. Although the backup tapes and tape drives are clearly marked, one of my well-trained co-workers managed to put 3 out of 4 tapes in the wrong drive, resulting in a very strange error. Someone's in for some Pwnage tomorrow. Beatnik 2008-04-14T18:17:53+00:00 journal Tips for job searching These almost endless list of <a href="">things not to do in application letters, job interviews, resumes</a> is both funny and sad but definitely educational. Beatnik 2008-04-04T17:52:41+00:00 journal The curse of Facebook Seems like adding <a href="">their application</a> to Facebook had a bit of an opposite effect. Beatnik 2008-03-22T14:39:40+00:00 journal VBA: Generating Word files from Excel data I had data in an Excel file that I wanted to get into Word in a very nice layout, with some fancy introduction text. I came up with the following VBA code:<blockquote><div><p> <tt>Public Sub GenDoc()<br> Dim WordDocument As Word.Document<br> Dim TableTemplate As Word.Document<br> Dim DocumentTemplate As Word.Document<br> Dim WordApplication As Word.Application<br> Dim DocumentRange As Word.Range<br> Dim ExcelWorksheet As Excel.Worksheet<br> <br> Dim i As Integer<br> Set WordApplication = CreateObject("Word.Application")<br> <br> ' Template for fancy introduction<br> ' Open as read-only<br> Set DocumentTemplate = WordApplication.Documents.Open("template1.doc", False, True)<br> <br> ' Template for fancy layout per Excel row<br> ' Open as read-only<br> Set TableTemplate = WordApplication.Documents.Open("template2.doc", False, True)<br> <br> WordApplication.Visible = False<br> Set WordDocument = WordApplication.Documents.Add<br> Set DocumentRange = WordDocument.Content<br> <br> ' This bit apparently guarantees that pasted blocks are appended, not overwriting the selected block<br> DocumentRange.Collapse Direction:=wdCollapseEnd<br> DocumentTemplate.Content.Copy<br> ' Paste the fancy header into the newly created document<br> DocumentRange.Paste<br> Set ExcelWorksheet = ThisWorkbook.Worksheets.Item(1)<br> ' Assume 100 columns<br> For i = 1 To 100<br>&nbsp; DocumentRange.Collapse Direction:=wdCollapseEnd<br>&nbsp; ' Paste the formatted table stuff<br>&nbsp; TableTemplate.Content.Copy<br>&nbsp; DocumentRange.Paste<br> <br>&nbsp; ' In the fancy template, I had some markers..<br>&nbsp; ' Replace counter - NUMBERMARKER<br>&nbsp; WordDocument.ActiveWindow.Selection.Find.ClearFormatting<br>&nbsp; WordDocument.ActiveWindow.Selection.Find.Replacement.ClearFormatting<br>&nbsp; With WordDocument.ActiveWindow.Selection.Find<br>&nbsp; &nbsp;.Text = "NUMBERMARKER"<br>&nbsp; &nbsp;' Replace NUMBERMARKER with i<br>&nbsp; &nbsp;.Replacement.Text = i<br>&nbsp; &nbsp;.Wrap = wdFindStop<br>&nbsp; &nbsp;.Format = False<br>&nbsp; &nbsp;.MatchWholeWord = True<br>&nbsp; &nbsp;.MatchSoundsLike = False<br>&nbsp; &nbsp;.MatchAllWordForms = False<br>&nbsp; End With<br>&nbsp; WordDocument.ActiveWindow.Selection.Find.Execute Replace:=wdReplaceAll<br> Next i<br> <br> ' Wrap it up<br> DocumentTemplate.Close<br> TableTemplate.Close<br> WordApplication.Visible = True<br> WordApplication.Activate<br>End Sub</tt></p></div> </blockquote><p>I also had some fancy progress bar in there somewhere.. I'm getting quite good at this drive-by VBA coding.</p> Beatnik 2008-03-18T19:49:51+00:00 journal Cool T's I somehow found <a href="">these T-shirt prints</a>. Super! Beatnik 2008-03-12T20:00:20+00:00 journal Upgrading Trac #2 After the migration, Trac started throwing <a href="">No changeset X in repository</a>. It took me a few minutes to figure out. The solution: resync Trac with the SVN db:<blockquote><div><p> <tt>trac-admin<nobr> <wbr></nobr>/path/to/tracdb<br>resync</tt></p></div> </blockquote> Beatnik 2008-03-08T23:16:55+00:00 journal Upgrading Trac My webserver crashed a couple of weeks ago so I took some time to install a new disk, install Etch from scratch and move all my old stuff to the new installation. On my old machine, I manually compiled <a href="">Trac</a> but Etch comes with a package. It turns out there are some differences<nobr> <wbr></nobr>:) TagsWikiModule was giving me problems (as described <a href="">here</a>). I fixed it by making sure I had<blockquote><div><p> <tt>default_handler = WikiModule</tt></p></div> </blockquote><p> again and also had </p><blockquote><div><p> <tt> = enabled</tt></p></div> </blockquote><p>I also had the following error:</p><blockquote><div><p> <tt>TracError: Database newer than Trac version</tt></p></div> </blockquote><p>I fixed this by installing SQLite3 and running it on trac.db and applying the following statement:</p><blockquote><div><p> <tt>update system set value = 19 where name = "database_version";</tt></p></div> </blockquote><p> (depending on the current database version.. mine was 20)</p> Beatnik 2008-03-07T22:44:53+00:00 journal Perl script as Windows service I needed this stuff a couple of times but never took the time to document it properly.. Summarized: Use a binary from Microsofts Resource Kit as a called to perl. KB article <a href="">here</a>. <br> <br> Copy the executable files to the system path (or wherever you see fit within the path)<blockquote><div><p> <tt>copy INSTSRV.EXE C:\Windows\System32<br>copy SRVANY.EXE C:\Windows\System32</tt></p></div> </blockquote><p>Create a service called <b>SERVICENAME</b> and point it to SRVANY.EXE that you copied to the system directory.</p><blockquote><div><p> <tt>INSTSRV.EXE SERVICENAME C:\Windows\System32\SRVANY.EXE</tt></p></div> </blockquote><p>Open the Registry Editor (regedit) and look for </p><blockquote><div><p> <tt>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SERVICENAME</tt></p></div> </blockquote><p>Right click on the <b>SERVICENAME</b> in the left column and add a new string value named <b>Description</b>. Double-click on <b>Description</b> and set the value to <b>SERVICENAME DESCRIPTION</b>. <br> <br> Right click on the <b>SERVICENAME</b> in the left column and add a new key named <b>Parameters</b>. Click on <b>Parameters</b> and add a new String Value called <b>Application</b>. Double-click on <b>Application</b> and set the value to </p><blockquote><div><p> <tt>C:\Perl\bin\perl.exe "SCRIPTLOCATION"</tt></p></div> </blockquote><p>Close the Registry Editor. The service show now show up in your Services panel in the <i>Control Panel &gt; Administrative Tools</i>. Change the startup mode from Manual to Automatic if needed. <br> <br>SERVICENAME is whatever you want your service to be called, SERVICENAME DESCRIPTION is whatever you want listed as a description for this service and SCRIPTLOCATION is the path to your script.</p> Beatnik 2008-03-07T22:23:07+00:00 journal Leopard + mod_perl: solution.. definitly! It turns out the error I mentioned <a href="">earlier</a> was a human error.. my error that is. In my code, I was trying to load Apache2::Cookie through an Apache2::Request object (which obviously I misassigned). Rebuilding Apache2 and mod_perl (and all dependencies) from scratch made everything work just fine. Beatnik 2008-03-07T22:06:45+00:00 journal Database challenge: upgrading data [update] I decided to KISS (Keep It Simple, Stupid). I'll split up the SQL dumps into data that definitely needs to be upgraded, data that might be upgraded and data that the user probably does not want to change unless he's reinstalling everything. Beatnik 2008-03-07T22:00:06+00:00 journal Value of degrees and certifications I work in a specialized environment. The 'company' pays a decent chunk of money to get experts in their respective field. Pretty much every one has a masters degree in something, together with a whole bunch of certifications. The other day, I provided one of my co-workers (masters in CompSci, X years of IT experience, CCIE certified,...) with a perl one-liner he could use to change some IP addresses in router config dumps. A few minutes after that, I saw him copy the configs from the router terminal to MS Word, and saving it as a MS Word file.. I asked him if he magically had come across a perl module that parsed MS Word files.. He gave me this very confused look. I explained to him that the one-liner only worked on text files, as MS Word probably didn't allow changing text strings in THAT way. I even tried explaining some of the checksum and end-of-line issues that might occur. He still gave me this confused look and insisted that we'd try it anyway. We did. FAIL!<br> <br>Sometimes work is fun! Beatnik 2008-03-07T21:15:22+00:00 journal Corporate Mind Control One of my old Uni buddies posted something on his blog recently that got me thinking. Apparently he became a Microsoft Regional Director.. To me that sounds like something to do with management stuff. It is in fact far worse. Apparently, Microsoft is giving up these fancy name tags to people in the community to get them to work for Microsoft without actually having them work for Microsoft. Giving out these kind of labels seems a bit like saying "Thank you for your effort in the community. You are now our bitch!". The blog is ofcourse biased towards everything Microsoft. Beatnik 2008-03-01T23:40:17+00:00 journal