rblog

What caused my svn checksum mismatch problem

@Update: See post 2011/01/17/what-really-caused-my-svn-checksum-mismatch-problem for final solution

Have been struggling with svn checksum mismatch problem which is annoying, but no show stopper due to the problem being possible to solve by workarounds as described in this blogpost glob.bushi.net.nz/…/subversion-checksum-mismatch-easy-workaround/

But still, I needed to figure out what the root cause was, and it turned out that the Perl search/replace was the sinner.
Issuing the command

perl -pi -e ‘s#ojdbc14_10.2.0.2.jar#ojdbc6_11.1.0.7.0.jar#g’ `find . | grep jdbc.xml`

then verifying the change by looking at the file using VI. But when issuing

svn status

svn was not able to see any changes. Then I added a xml-comment describing the change, saving and then svn commit I got the checksum error. After doing the workaround and then editing the file all manually, not issuing the Perl-command…voila, no problem. Have not been able yet to figure out why svn don’t like Perl search/replace changing the file…not sure if the -pi -e could be causing the problem, but I’m quite sure it has been accepted before.

NRK on Apple Tv (v1) using XBMC 10.0

Last week I had some struggle trying to enable NRK Nett-TV. The patchstick I had used installed XBMC 9.11, and I found the plugin described in this thread on freak.no. Could not get it to work, suspecting the mplayer-version causing the problem.

So I restored the box using factory restore, then created a patchstick by using the magical piece of software created by the guys behind atvusb-creator. A lot of cursing at first, since none of my usb-sticks would load (Kingston 8Gb), and also another stick of unknown make. Got to borrow a stick from Lars Tormod, one of many of a unknown make he had been handed at some event – but it did the trick. Patch booted, and now I’m running XBMC 10.0. In the list of video addons there is an addon named NRK…installed it and now out the box, we have NRK Nett-TV on our tv using the Apple-TV.

Also – remember to install Nito TV, then goto Settings –> Install Software –> Smart Installer. Thanks to http://www.todaywasawesome.com/enable-usb-on-the-apple-tv/ for reminding me by providing the post found when desperatly searching for help when my usb hard drive was not found. Note, you do not need to download up front, Smart Installer fixes that for you.

Find text between double brackets using regex

Just needed to post this one as a reminder to myself. Once in a while I need to update text between double brackets, often values of parameters like the case now

password="thepassword"
...
password="yetanotherpassoword"

Having a lot of this makes it annoying to update it manually, but by using Notepad++ which also have a regex-search-replace option it is easy

password=".*"

did the trick for me.

Ripping our cd collection

Two weeks ago we bought an Apple TV so now I have to start the work of ripping our entire cd collection. Have spent some time figuring out the best way to do it, which software to use and most important of all, which format to rip to. The Apple Tv is as any product from Apple superb when it comes to iTunes integration. But, and that was a huge but for me, you are then bound to any file format Steve Jobs decides are ok. So to h#$” with iTunes and Apple formats. I went for the lossless format flac, Free Lossless Audio Codec, because then I can do pretty much whatever I want afterwards, keep it and use only flac, or even transcode it all to mp3, mp4 or whatever iTunes support and import it to the iTunes-library.

Anyhow, after doing some heavy Googling for a few days here is my software stack of choice: Using Max to rip the cd’s to flac. One thing that I realized was a little drawback of choosing Max is that is uses MusicBraninz to lookup information abut the cd’s. Since we have quite a lot of Norwegian music, considered rare when it comes to Musicbrainz I initially had to type in a lot of info. That was pretty annoying when I knew that iTunes could retrieve the info from Gracenote. But then I found this apple script created by the same guy behind Max, which grabs the cd-info from iTunes and updates Max with it…cool stuff, which saves me A LOT of work!! Just not enable Max to automatically encode cd’s when inserted, first make sure that all info is present, then encode. Or else you will get a folder structure like this “Unknown artist / Unknown album / 01 Unknown trac.flac” which is kinda messy.

I also bought a 2TB external harddrive, formated it to FAT32, since I did not want to bother to install any NTFS drivers on our MacBook (found a forum post which said it had messed up that guys MacBook). Since I’m not going to save any > 4GB files on the disk, FAT32 is the weapon of choice since it is the file system supported by most operating systems. (Mac OS can only read from NTFS out of the box right now, not write to it, blame Bill Gates for that!!!)

GIMP with non locale menus

Must admit that I do not find translating everything into Norwegian a good thing, for instance I have Gimp installed on our MacBook. Since I’m not a hardcore photo editing kinda guy I need help from online tutorials to even do the simplest things. But that is almost impossible when you have menus in Norwegian and all tutorials are referring to menus and such in English. So I had to do a bit of surfing on Google, and luckily I found http://hints.macworld.com/article.php?story=20070423133918443.

More simply, I dug into The Gimp’s package, and moved the locale folder (found in Contents » Resources » share). I created a new folder, at the same level as Resources, named Resources Disabled, and dragged locale into that folder. This way, I can get the other languages back if I need them. The application now is running smoothly, in English. And one icon in the Dock is enough for either launch or launch via drag-n-drop.

Facebook Tracks and Traces Everyone: Like This!

Read this article digi…/slik-sporer-facebook-alle about how Facebook keeps track of your websurfing, even if you are not a member of Facebook at all. The article is based upon this paper Facebook Tracks and Traces Everyone: Like This!.

Numerous websites have implemented the Facebook Like button to let Facebook members share their interests, therewith promoting websites or news items. It is, thus, an important business tool for content providers. However, this article shows that the tool is also used to place cookies on the user’s computer, regardless whether a user actually uses the button when visiting a website. As an alternative business model this allows Facebook to track and trace users and to process their data. It appears that non-Facebook members can also be traced via the Like button…..

It clearly raises some issues, realizing that the best way to avoid being tracked by Facebook is to keep a separate browser only for checking your Facebook account, where you also deletes all cookies everytime you shut it down. If I bother I would then use on my corporate laptop IE for corporate websites (it is the default browser with much autologin enabled), then Firefox for normal surfing, and at last Chrome for Facebook. It will keep me anonymous when it comes to Facebook, they will still be able to keep track of me, but by deleting the cookies each time and only surf on Facebook, the data will be quite irrelevant.

Changing XML attributes using Python

Doing some work trying to update J2C resources defined in WebSphere using Rational Automation Framework, actually about the same thing as described in the article “A step-by-step guide to automating the deployment of a data source by using Rational Build Forge” and I needed to do some changes in jaas.xml. Won’t go into the details why editing XML using for instance “normal” Perl is hard, but I ended up using Python and ElementTree to edit the file with a structure like this

<jaas>
	<JAASAuthData 
		alias="dmgr/databaseuser" 
		description="The database user" 
		password="thepassword" 
		userId="dbid">
	</JAASAuthData>
</jaas>

Used plenty of sources to help me out, but I do think I did use http://effbot.org/ the most – super when it comes to figuring out Python, but http://www.rexx.com/~dkuhlman/pyxmlfaq.html was also of great help!

The script I created is available here updateJaas.py The script is bound to changing jaas.xml-files, but it should be quite easy to change it for other needs as well.

How to compare files? Notepad++ to the rescue

Have been using Notepad++ for quite a while now, but have not dived into the various plugins to much yet. But today I needed to compare two files and had no available comparators, or…could have used Rational Application Developer – but that is overkill for comparing two Jython scripts. But then Notepadd++ plugins to the rescue. Found this blogpost http://www.cottonrohrscheib.com/blog/notepad-compare-plugin/, downloaded the plugin and followed this simple how-to installing it. Up and running in less than five minutes!

How to undelete files in subversion

I accidentally deleted a bunch of directories using “svn delete” about a month ago, and now we realized that we needed them. So, question was – how to do undelete in Subversion since svn does not have a undelete-command. Then ‘svn copy -r REVISON’ to the rescue. First attempt solution found at jappler.com

svn copy -r NUMBER NAMEOFDIRECTORY NAMEOFDIRECTORY

The above command resulted in “NAMEOFDIRECTORY not a working copy”…damn!!! But then I found a slightly different way of doing it at www.canfield.com and I did

svn copy -r NUMBER https://{URL}/NAMEOFDIRECTORY NAMEOFDIRECTORY

Success…and if you are unsure of your svn url, just type ‘svn info’

Then to commit a list of folders in one operation I found the solution at Stackoverlow.com

cat mblade_list.txt | xargs svn commit -m “Restored”

Up yours fuc#”#$ spammers!!!

The past few weeks there has been a boost in comment spamming in my blog. Quite annoying when I have to delete 5 to 10 spam comments each day. So I decided to disable comments on old posts, but it was not as straight forward as I wanted. It is possible to disable pr. post, but with 10 years of blogging doing it manually is no option. But luckily I found this SQL statement

UPDATE evo_items__item SE T post_comment_status = "closed" WHERE NOW() > DATE_ADD(post_datecreated, INTERVAL 10 DAY)  

Solution found on the B2Evolution forum. Must admit that even though it is a one liner, it goes way above my head 🙂

Hjem