Image credit: Nicholas Moreau at WikiMedia

Jun 23, 2010

GIMP Deskew plugin

When you're scanning hard copy, you inevitably wind up with the image skewed at some perceptible degree, but it's really really hard (and slow!) trying to use GIMP's arbitrary rotation to de-skew the image. So I went looking for auto-rotate/de-skew plugins. I found two:
http://registry.gimp.org/node/22910 (which I haven't tried), and
http://registry.gimp.org/node/2958 (which I used).

The first one apparently requires you to draw a vector (path) to show it what should be perfectly horizontal, in the image. That's more work, and is slower, so I tried the other one first. Caveats:
  • the second is a compiled ELF binary ("deskew: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped") so it isn't very portable.
  • The first link in the plugin registry page apparently doesn't work, as per comments below - so I tried the Google Docs link, which allowed me to download the binary.
I chucked it in ~/.gimp-2.6/plug-ins and did a chmod u+x deskew (which is required for GIMP to exec it as a plugin). On starting GIMP and opening the scanned image, though, I couldn't find the plugin's menu option. That reminded me of the GIMP Procedure Browser on the help menu, so I went to the Help menu trying to find if it had loaded. It was here that I discovered something new (at any rate, I'm seeing it for the first time!): Plug-In Browser! Yup, it lists all loaded plugins, and lets you search them - and shows you where in GIMP's huge menus you can find the plugin's menu... :-) Nice!

Having found that it was at Filters > Misc > Deskew, I ran the filter. It works, and works well - straightened my image beautifully, without requiring any more interaction on my part! Now to crop the image and get on with the rest of my work on it :-)

Ubuntu Simple Scan Rocks!

Today, for the first time with Ubuntu Lucid, I had to scan something. With some trepidation, I ran the 'Simple Scan' utility, and decided to just click the Scan button on the toolbar, to see why it's been getting good press.

There's a good reason... it "just works". I didn't have to configure the scanner myself - the utility just found it on its own. I have an HP OfficeJet MFD, accessible over Ethernet - and the Simple Scan utility found it, and started a scan (flatbed, not ADF - again, correct choice), and let me save it. I made a small mistake of choosing 'Scan Photo', which saves the scanned image as a JPEG - not ideal for text. Still, I was pleasantly surprised - this is one change in Lucid that has actually worked flawlessly the first time I tried it. And what's more, it worked in "dumb user" mode - that is, I didn't have to go looking for Preferences or Options to try and tell it where to look.

I like!! :-)

Killing PulseAudio softly...

I've had rather a lot of complaints about Ubuntu 10.04 "Lucid Lynx", including lots about Gwibber and one or two about Empathy, and about non-working sound on my old low-power-hardware desktop, and my old Acer laptop, which isn't all that outdated.

The desktop sound problem isn't actually Ubuntu's fault alone - it appears to be PulseAudio. I installed Fedora 13 "Goddard" to replace Lucid, on the desktop, just to see if Fedora, at least, could work with the sound card and with Skype, or Empathy for Google Talk.

While the whole struggle is a pretty long tale of woe, the short answer is (after two days of installing, uninstalling, poking around, Googling, and trial and error), I finally decided to kick PulseAudio out of the Fedora picture rather brutally - by renaming its binary to a different name.

This, of course, broke many UI controls and stuff to do with audio - but it made Skype work (though the audio does cut off after about half an hour). Still, that's kind of an OK duration at which to have to reboot the comp to get sound again. My Mum uses the comp to Skype my sis, who's in Canada, and half an hour of chatting is way more than I can take, but they happily chat for a couple of hours, sometimes.

I wish my sis would find some time to try and set up a Google Talk account in Empathy under the Ubuntu Lucid install her hubby has done on their desktop... but I understand that caring for two young kids can take up your whole day and leave you exhausted. Perhaps that'll happen some day, and we can find out if the dropped audio is indeed a local problem, which I suspect it is, or if Skype is cutting short non-paying calls (IIRC I'd seen similar suspicions on the Net a long time ago, but haven't searched for that recently). I can even try re-enabling PulseAudio and see if Empathy plays nice with it (Google searches yielded discussion threads that said that Skype does not play nicely with PA).

I've been trying to find usable* distributions that don't use PulseAudio - plain ALSA - and haven't come up with any yet. Looks like everyone's piling on the PA bandwagon, and integrating it tightly into the distro, making it hard to eliminate without substantial breakage. If you know of any distros that *don't* use PulseAudio, please help me out and let me know which! I'd like to try them out and see if they work better than my self-broken Fedora.

May 28, 2010

Hidden Gems in Compiz Window Management

I came across this info on the Ayatana mailing list. Though the post said it worked with Metacity as well, I couldn't achieve this with Metacity, only with Compiz running (using Ubuntu 10.04 Lucid Lynx).

With an un-maximized window, you can use different mouse buttons while you click the Maximize button on a window, to achieve different results:

  • Right-click the Maximize button to maximize left/right only (the window's height is left unchanged, the width increases to take up the available screen width. Right-click the Maximize button again to return the window to its original dimensions.
  • Middle-click the Maximize button to maximize up/down only (the window's width is left unchanged, the height increases to take up the available screen height. Middle-click the Maximize button again to return the window to its original dimensions.
Quite logically, if you have maximized one dimension of the window, and the other is not maximized (for example, you right-click the Maximize button so the window is horizontally maximized, but is not vertically maximized), then left-clicking the Maximize button maximizes the other dimension of the window as well. A second left-click will then return the window to its original dimensions.

Even if you left-click the Maximize button on a newly-opened (and unmaximized) window, you can right-click or middle-click the Maximize (Restore, actually) button on the maximized window to un-maximize only one dimension to that of the original window size.

Takes some getting used to, but could be useful under some circumstances (for example, you want two windows side-by-side, maximized vertically, or you want two windows, one above the other, maximized horizontally).

May 23, 2010

Cutting loose from Tata Indicom is hard...

TTML's emails and calls about overdue bills are always a nuisance. When it's my fault, that is justified irritation, I guess. But when I've not only paid them, but left a credit balance to boot, it's very upsetting to receive a nasty letter in the mail claiming that I have Rs. 959 owing to them and would I kindly pay it at once!

The reason my payment was overdue this time, was that I received my bill several days after the due date. I decided I might just as well wait for the next bill to come in, and go and pay both. Since I don't have Net banking enabled on my bank account, nor do I have a credit card, I need that paper bill to make my payment! TTML must have been on an economy kick recently, because I received several emails about opting for email-only bills (so they could save printing and postage cost, I guess). I ignored them since I want that paper bill to keep coming. Well, either they dispatched it late, or the P&T department delayed it - I don't know which. What I do know is that I couldn't pay the bill on time because I didn't have a printed copy of the bill. I wasn't about to waste MY inkjet ink (we all know it's more expensive than blood!) on printing a heavy page like the TI bill, replete with logos and all sorts of adornments. Why should I waste around Rs. 15 of my own cash because TTML or Tata Indicom is trying to be cheap? No, thank you - print the bill and send it to me... on time!

Anyway, I've had overdue bills in the past - not because of lack of funds, but simply because it's a PITA to go write a cheque, clip it to the payment slip, drive to town, find a parking space (THAT's usually the hard part!) and go drop the payment in a drop-box. In fact, it's such an irritation that I used to pay for several months in advance, just so I could avoid this rigmarole every month (and also the obnoxious calls from Tata Indicom, demanding to know why I hadn't paid my bill). TI/TTML are very happy to have your money in advance, I guess... and I was happy not to receive annoying phone calls from them!

So to continue my tale... the letter from TTML that I received on the 20th of May threw me into a tizzy, when I was already under pressure to finish up work in hand and send it back. After digging for my bills, I found that I not only had no outstanding amount, but had a credit balance of Rs. 278! Then I looked at the date of the letter: 27th March! That's right - sheer efficiency, I get their letter 53 days after it was printed!!

Now pretty pissed off, I decided to throw away some more time and strike while I was hot. I've been considering disconnecting this service for some time, because I hardly used it. Even on the 512 MB/ Rs. 425 plan, I have hardly done any data transfer on this for months! BSNL broadband has been a pretty good service overall, despite the glitches I've faced recently. With my mood as it was after this debacle, I decided I might as well do it right away. Like I said in an earlier post... I called the Tata Indicom help line with the request to terminate my account, but had a long unfruitful interaction, with the usual pleas of "you're a precious long-time customer" and "sorry, the accounts department is busy and I cannot transfer you there to place your termination request". I kept insisting on (and finally obtained) a docket number for my call. Despite the assurances that "the accounts department will call you back in 4 hours", I received no callback about my termination request. So I typed out a letter as a formal notice of termination, so I could get a copy signed and stamped by the local office (in Panjim). I'm pasting it here - I think this is going to be the longest post on my blog! :-)
==========================================
(address and some details omitted)

I called the Tata Indicom helpline on 20th of May 2010, at 3.40 p.m. My call was taken by a person who identified himself as Mr. Deep Shekhar Roy Choudhury. After answering “account security questions” to verify my ownership of the said account, I repeatedly requested termination of my postpaid account, only to be told that the concerned department was busy and unable to accept my call. I obtained the docket number 221068411 from Mr. Choudhury, for my request to terminate the account, along with his assurance that a representative of the concerned department would call me back on my mobile phone (I supplied the number) within 4 hours. (“It is now 3.51 p.m. and between now and 7.51 p.m. we will call you.”). I am unsurprised that I did not receive any call as promised; it only goes to confirm my opinion of the ever-decreasing “customer service standards” of TTML/Tata Indicom.

I am, therefore, explicitly stating, confirming, and reiterating, in this hand-delivered letter, that:

  • I have given sufficient timely notice to a Tata Indicom representative on the 20th of May, one day before the end of my billing cycle, that I wished to terminate my account forthwith. The failure of Tata Indicom/TTML staff to uphold the representative's promise of calling me back is their lapse, not mine. I have done my best, and awaited a call as promised by the representative I spoke to.
  • Having given timely notice of termination of my account to a representative of Tata Indicom, before the end of the billing period, I fully expect that the last bill I will receive from TTML/Tata Indicom with respect to the above-mentioned connection/account will be that for the period 21st April to 20th May 2010. Note that I will not entertain or pay any bill for any subsequent period.
  • I have a credit balance of Rs. 278 as per my last bill, number 838383969. I expect this to be adjusted against the payable amount of my next and final bill for this account.

My address for postal correspondence is already on file with you, as is my email address, and my mobile phone number.

Kindly stamp, assign an inward number, and sign the copy of this letter, as proof of receipt.

==========================================

Upon finally getting to their office in Panjim, the representative proceeded to peck away at his computer keyboard for a few minutes. I asked if the termination request had been registered, and the answer was 'No'. Nice, eh? I suspect that the methodology is "keep the customer hanging on for a few days more, and sting him with a bill for another month" - all good fun, and means of earning revenue! Too bad I'm a suspicious what-not, and decided to put in a written termination notice too...

After stamping and signing the copy of my letter, the rep helpfully told me there would be a 'last bill' - to which I replied "Of course, for the billing cycle ending 20th May - as I have put in the letter, I'm not paying for any more than that." Then he told me something strange: No, there would be still another bill, for around Rs. 100. I told him I flatly refused to entertain an additional bill, since I had given notice before the end of the billing cycle. To which he tells me "It takes 4 days for the system to process closure of an account." !!! Hahahaha... I wonder what they are running their 'system' on - a PC-XT with an 8088 processor at 4.77 MHz??? How long does it take to click a button, and have an 'ignore this SIM' notification flashed to every switch and cell tower in India? Do they save the request onto floppies and scurry around updating each of the towers, to take four days to close an account?

To this I told him that was TI/TTML's problem, not mine, and that I would not pay for the inefficiencies of their system. I further asked whether such a fact was up on their website - or any requirement that I had to place a termination request more than 4 days before the end of the billing cycle. This was met with silence from him. I thanked him, and walked off, already late for my Linux Users' Group meeting.

At the LUG meet, I naturally wound up explaining why I arrived late, and we spent some time commiserating about TI/TTML's service. Another member, Mr. Shaha, came up with a hilarious and yet annoying anecdote: He went to pay his bill in cash at the TTML office. He didn't have a rupee with him, nor did the cashier have Rs. 9 of change for the odd amount, so the cashier suggested he pay a round amount, and the one rupee could go forward as unpaid, to next month's bill. Mr. Shaha agreed, only to find that from the next day onward, he began receiving SMSs telling him he had an outstanding amount of Rs. 1 !!! Hahahaha... this is from a TATA company?? We used to have high expectations of companies with the Tata name, but this is really pitiful...

Finally, I went Googling the Tata Indicom site (it's really difficult to find anything via their menus) and found http://www.tataindicom.com/download/customercare/mop-english.pdf in which they clearly state:
"Once the disconnection request is received, TTSL will process the same by first disabling the outgoing
service and the rentals for the customer. This will be done within 24 hours (subject to recovery/surrender of Hand set/CPE) of receiving the request"

So much for the 4 days' 'system' requirements. Way to go, TTML service people!



May 22, 2010

Sheer Genius - Tata Indicom Dealer DIS-Locator

I happened to hit the Tata Indicom site, trying to find the address of the True Value shop in Panjim, so I could hand in my letter ordering termination of my account. (I had called the help line, but after an annoying interaction with the usual pleas of "you're a precious long-time customer" and "sorry, the accounts department is busy and I cannot transfer you there to place your termination request" I obtained a docket number, and despite the assurances that "the accounts department will call you back in 4 hours" I received no call.

Well, I've observed "accounting slip-ups" from these people in the past, so I wanted to make doubly darn sure they didn't bill me for an extra month (billing period 21st of the month to 20th of next month) and my call (sadly for them) was on the 20th.

Anyway, long story short, I went to http://tataindicom.com/dealer-locator.aspx from the menu. After being asked to select a state (no "Goa", it appears Panjim is part of Maharashtra according to TTML -- more genius), I get dumped into what looks like an embedded Google Maps map.

After looking at it for a while, I realize they want me to enter MY location, so they can give me directions to the nearest shop. Well, that's a good idea, progressive. I chose my location as Panjim. The "FIND NEARBY TATA INDICOM STORE" button doesn't seem to work - no response - so I clicked the "FIND NEAREST TATA INDICOM STORE ROUTE" button. The results were anything but smart. I then chose my location as Porvorim. I got the same directions... check this out:


That's right... for an address in Panjim, I get directed to Assonora - 22 km in the absolutely wrong direction. Sheer effing genius, isn't it? Imagine the plight of someone new to Goa who follows this map... The joke is that the "genius" who ordered this stupid map to be put on there will probably get promoted on the basis of his or her "genius idea".

Well, just like I no longer trust or like Tata Indicom/TTML's service standards, I no longer trust their site either. The old and simple text address would have been far simpler to read and use... and TTML's notices that my bills were overdue would carry a lot more weight if THEY SENT MY BILLS TO ME ON TIME!!! As it stands, Tata Indicom (TTML in Goa) is becoming more and more of a damn nuisance to me every month, so I'm just cutting loose. I've been paying them 425/- per month when I'm hardly ever using the connection, but after recent irritations from them, would rather do without their """service""" (HA!).

Apr 5, 2010

"aptitude search" and not "dpkg -l" or "dpkg-query -l"

 I ran into this little gotcha near the end of last month, but didn't get around to logging it yet.

As part of my contribution to Acire, I needed to obtain a list of UNinstalled Python library packages (primarily under Ubuntu; I've been coding for days now trying to build in an abstraction layer behind which other contributors can add code for other distros). Rather than deal with the python-apt library at that time, I decided to use the subprocess module to run a command-line query. Yes, when you've used a hammer for years, it tends to become the tool you use for pretty much everything :-(

dpkg was the first command I looked at. Its man page redirected me (for the -l option) to dpkg-query, whose man page blandly states:


-l, --list package-name-pattern...
List  packages  matching  given  pattern.  If no package-name-pattern is given, list all packages in /var/lib/dpkg/status, excluding the ones marked with state purge. Normal shell wildchars are allowed in package-name-pattern. Please note you will probably have to quote package-name-pattern to prevent the  shell  from performing filename expansion. For example this will list all package names starting with “libc6”:
                dpkg-query -l 'libc6*'


Perhaps the quiet "all packages in /var/lib/dpkg/status" carries a world of hidden meaning - I still don't know. What I did find out, during testing of my first-cut code, was that packages that Synaptic Package Manager showed as available were not shown as available by dpkg-query -l!!! From cursory investigation, it appears that dpkg-query only shows packages from Ubuntu's universe and not from other origins. And it shows installed as well as non-installed packages, but just from this one origin.


Later, I found that aptitude search [package-name-pattern] did indeed give me what I wanted, and switched to using that instead. Curiosity led me to get onto the Ubuntu IRC channel, since a Google search for bugs did not yield anything about this behavior of dpkg-query. Folks on IRC said that dpkg only looked at installed packages, which didn't seem to match up with what I'd found.

So I'm still wondering what the correct explanation is, but now I know that if I want to list uninstalled packages from the command line, I use aptitude search and not dpkg-query -l...

Mar 29, 2010

Nokia "Support" - ha!

Well, my irate feedback on the Nokia Support site did yield results quite quickly - they replied via email within the specified 24 hours. I'll include a screenshot for your "enjoyment":



The red-circled areas are:

  • Wrong URL - it's actually "account.nokia.com", not "accont". Speaks worlds about the competence of Nokia Support staff when they can't even get the URL to the website correct.
  • Not only no acknowledgment that their site had a fault, but a haughty "oi! mind your language!" :-\
  • URL if you want to "reply" to this mail - that's right, replying to this mail got me an automated reply telling me to go to this URL and fill out the Contact Us form ALL OVER AGAIN. Brilliant. Absolutely freaking brilliant!

I'm refraining from calling them up because I'd probably wind up blasting some hapless support rep who's neither involved with the website snafu, nor this haughty and rather useless email. Instead, when Nokia's site prompted me to fill in a survey about how satisfied I was, I told them (the Comments box - the rest of the survey indicated my huge dissatisfaction):

I forgot my Nokia Account password. The extreme geniuses who designed the Nokia Account site mailed me s reset link that took me to my account information page (not a password reset page). The Change Password link demanded my old password, which I have forgotten. 


The last complaint that I wrote was responded to by another great genius, signed off as "Seauli Hati" - the reply starts off by advising me to go to "www.accont.nokia.com" which my browser tells me is a non-existent site. Way to go, "support" people!


Moreover, this genius advises me "We also request you to refrain from using unparliamentary words in your e-mail." Do support staff not understand the that the depths of "genius" displayed in not having a proper password reset page is bound to drive customers up the wall? Have they heard of acknowledging an error and apologizing for the fault, and then reminding the customer that his behavior transgressed polite communication standards, and giving the customer a chance to apologize?


The mail from "Seauli Hati" then gives me the procedure to reset my password (which I had already followed and complained that it did not work). At no point does this person acknowledge the website fault that caused me to lose my temper, nor does this support person say it has been fixed - merely rattles off the hackneyed procedure to reset my password. This is extremely nice to know - despite the fault being on Nokia's web site, it's the customer that gets treated like dirt... 
Your Q. 5 below asks how likely I am to recommend Nokia to a friend - well, be assured that this horrible experience with the website, and with haughty and "genius-like" support staff who cannot unbend enough to simply say "Sorry, mistake has been fixed, please try again" - THAT is going to feature first in my advice to friends.


And I will also stress to friends and whoever asks that when Nokia Support says "via email", it means only at their end - you, the "valued" customer, still have to go fill out the form at http://www.nokia.co.in/get-support-and-software/ask-nokia ALL OVER AGAIN, instead of being able to reply to a mail like normal people do.


Further still, I will continue to decry the "genius" in requiring the customer to sign in separately on every site in the Nokia family.

Well, now that I got back into my account and could sign into the Store, I find that to actually choose and download the 100 free tracks promised to me in the voucher that accompanied the phone, I have to either install their great "Nokia Music" app on Windows (which I don't use) or download the tracks on my mobile phone, running up a nice fat bill on GPRS. Wahoo!!!

It's almost funny, actually - it's the 100 free tracks voucher that I was trying to check out when I ran into that website password-reset stupidity... and now it looks like I might not take advantage of it after all. Hah! :-/ C'est la vie...

Mar 26, 2010

Nokia Account website - or - "hire some real developers, stupid!"

I own a Nokia 5800 XpressMusic. To check out the services offered by Nokia to its customers, I'd signed up for a Nokia Account some time back. I re-visited their site today, to realize I'd forgotten the password I'd supplied when creating the account. Well, that should be easy enough to fix, right? Click the "Forgot My Password" link, supply the info they ask, and wait for a password reset link to arrive in my mail.

Ah! It arrived super-fast. But when I clicked it, this is what I saw (some parts redacted for obvious reasons):



After that first "Huh??" moment, I saw the Change Password link, and clicked it:



Yes, you guessed right... the Old Password WAS mandatory entry. For someone who'd applied for a password reset because he'd forgotten the old password. Sheer soaring genius, no?

I re-tried this a couple of times, to check if I was somehow making a mistake in this elementary and often-used ritual at different sites. Then I lost my temper. Having found a "Contact Us" link, I proceeded to Contact Them. Oh, yes, sizzling contact:


Do the morons who designed and coded the Nokia Account website NOT UNDERSTAND WHAT A PASSWORD RESET IS??? WTF is the idea of mailing me a "password reset" link that only takes me to the main page of my account - and when I click the Change Password link, DEMANDS MY OLD PASSWORD BEFORE I CAN CHANGE TO A NEW ONE???!! When are the blasted imbeciles who coded this function going to realize that people ask for a password reset WHEN THEY HAVE FORGOTTEN THEIR PASSWORDS and can't log in to the site in the first place!!! Yet you expect me to enter my old -- FORGOTTEN -- password before I can set a new one - FIX THIS, IDIOTS!!!


If you don't understand what the word "customer" means, Google and others understand very very well. No wonder Nokia is slowly dying, if this is the kind of screaming frustration imposed on users who are trying to use Nokia sites via the Web - and who make the mistake of forgetting their password for the garish, Flash-ridden sales spiel that comprises these sites. 


Which brings me to another huge annoyance - hasn't Nokia dealt with web-sites long enough to learn how to implement single sign-on for all the sites in the Nokia family? What kind of juveniles make you enter your username and password at each and every site?? I am sitting looking at my account information at account.nokia.com - from the reset password link, which I've already blown off about above. I click the Ovi store link IN MY ACCOUNT INFORMATION and arrive at an Ovi site that is totally ignorant of my account information! How much coding effort does it take to pass a UserID number in the querystring of the link to other Nokia sites? Forget about Web 2.0, you people are still trying to get Web 1.0 working - if you're trying at all!


Bah - your website developers are disgusting. Looks like Nokia IS going to die out after all. Pity, because the phones are pretty darn good - I should know, I'm on my third Nokia now after a stint with Motorola.


Since you have demanded my email address, kindly mail me a notice when your idiot web developers have finally managed to create a proper password reset page. Till then, twiddle your thumbs and figure out how many users you're losing that might have converted into paying customers...


I don't know how productive that will be - I got the usual mealy-mouthed acknowledgment page and follow-up automated email that assured me of action within 24 hours.

And yet, I wonder - if the Nokia site has at least a few hundred users, am I really the first to forget my password? Are all the other users of Nokia sites Einstein-like geniuses who never forget a password? Umm... what are the odds of THAT?

So that means that at least a few of the other users who have faced this babbling lunacy from that site have probably complained, and been ignored. Well, perhaps it is time that Nokia dies...

Mar 25, 2010

VirtualBox PUEL, Ubuntu Lucid beta 1, low graphics & hang, kernel 2.6.32

Curious about it, I downloaded Ubuntu Lucid beta 1. Growing wise as I age, I didn't even think of running it on the bare metal, and set about installing it into a VirtualBox VM. After the first reboot, of course Ubuntu came up with a low 800x600 screen resolution, so I installed the VirtualBox Guest Additions and rebooted.

Oops.

When I returned to look at the VM, Lucid was complaining about low graphics and throwing up a series of (X) windows asking me to resolve the problem. None of the options helped, and after a couple of minutes of wandering through those dialogs, Lucid went into hard-hang... so I turned to Google, of course.

Naturally, it turns out it's a known bug, though VirtualBox hasn't yet released a version with the fix included. The answer (for now) is in the post http://www.virtualbox.org/ticket/6198#comment:5 - which advises manually patching a C program file and recompiling the Guest Additions.

Running the Lucid installation in recovery mode, I was glad the patch was only 4 lines of actual code, and did a peek-switch-type-switch-peek (...) copy of the changes into the specified file. Then ran the vboxadd setup command, which compiled the modules, and rebooted.

Well, I got the GUI, minus the mouse. Actually, minus the mouse pointer - moving the mouse caused various areas of the panel to be highlighted, so it was just that the pointer wasn't visible.

Some poking back in browser history brought me back to
http://ubuntuforums.org/showpost.php?p=9012706&postcount=15 and I copied the conf file content, and (thankfully) pasted it into a new /etc/X11/xorg.conf file in the Lucid VM. Log out and log in again, and thankfully the mouse pointer was visible too.

After all that, I wound up getting quite angry, having realized that ALL the darn themes in Lucid place the blasted window control buttons on the left.. AARGGHH! Couldn't they have left ONE theme in there with the buttons in their old place on the right of the title-bar?

I've seen mentions on the Net of having to use gconf-editor to switch the placement of the control buttons back to the right, but I'm not bothering with that right now - had enough of Lucid for one day! :-/

Mar 18, 2010

Free file share site Opendrive (with hotlinking) + Copyscape

I needed to check an article that I was editing for plagiarism, and while Googling for snippets did yield some hits, there were patches of the file that looked suspiciously well-written (in contrast to text that was obviously original to the author). For these blocks of text, Google didn't give me helpful (contiguous) results. Meh.

The most famous site for checking this, is, of course, Copyscape.com. Though, in hindsight, I should have checked for clone sites that might have let me upload a text file for scanning, I didn't do that; I wound up slogging my way through several free file-sharing sites, but apparently all of them protect their downloads - you can't get a direct URL to the file, which was what I needed to give Copyscape. Instead, those sites dish up an HTML page with ads etc - which explained the really crazy results of my first try at Copyscape :-\
(This may sound like I'm being a bit of a cheapo, but sans a credit card, I can't sign up for the Premium service, which I think lets you simply upload a file for checking. I don't see this as being a frequent need, either, and a monthly or yearly subscription to Copyscape would probably just lie unused most of the time. So this is a worthwhile workaround for the rare case when I want to run a document through their plagiarism scanner).

Keeping up with my research, I found that the operative term that some sites used to describe this feature was "hotlink" or "hotlinking". A new search led me to Opendrive. The site info said it allowed hotlinking for free, so I signed up. Good point - they don't force you to verify your email address before letting you use the site. WARNING - bad point - use a throwaway password for this site, not a password you use anywhere else - they belong to the class of "geniuses" that mail you your username and password in their welcome mail, and will probably do the same when you change the password. Obviously, be wary of entrusting such a site with confidential data/documents as well, since the practice of mailing a password indicates (to me at least) that they have no concern for the security of your data. If it wasn't for the fact that the featureset included just what I needed, this would have turned into a rant! Grrrr...

Anyway: I uploaded a text version of the article, and then had to fumble around a bit to get hotlink (direct access):

  1. In Folder Properties for My Documents (default upload folder) I changed it from 'Hidden' to 'Public'.
  2. In the folder listing, below the icon for the file you want direct access to, is a "Properties | Links" hyperlink. Click that to visit the file properties page - there, you have a "Full: (download)" link for the file. I tried that URL in another browser, and voila! direct access to the text file... good to go!
  3. Went back to Copyscape, and pasted this URL in. Copyscape scanned it, and gave me a (very limited) listing of possible sources - including some that Google had not. Still, this served to identify several different sources - now to get back to comparing the sources v/s the article. Copyscape helpfully highlights the common text blocks between source and your checked "page" (obviously, this is the first time I'm using Copyscape, though I remembered the name for some reason).
Well, brain-dump over, back to work. This setup can, hopefully, be used quicker and with more efficiency in the future, than I did today - nearly two hours of digging and annoyance to get the result I wanted!

Mar 1, 2010

PyS60 2.0 install headache on Nokia 5800 XpressMusic

So I just bought the 5800XM a few days ago... the price had dropped enough to make it a rather attractive buy for the features - large screen, 3G, WiFi, A-GPS. Moreover, Nokia has recently (partially?) open-source-licensed Symbian OS code, which appeals to my FOSS sensibilities (yeah, yeah, they were probably forced to do so to compete with the likes of Google's Android, but still!).

Another feature that strongly attracted me toward S60 was the availability of Python, my current favorite programming language, on the platform. It can do some pretty powerful and useful stuff, judging by the modules available, and some of the sample code out there.

The wiki's Installation page was apparently outdated, or did not address some special condition on this phone, since it originally only advised "Download the latest SIS packages of the Python for S60 runtime and the PyS60 Script Shell from the SourceForge project page or maemo garage." (I have since edited the page, but don't know how long that info will last, or whether it is 100% accurate, or will continue to be accurate.)

So I initially installed the two packages, following the wiki. I found, at the Maemo download page for PyS60, an archive named "PyS60_binaries_certificate_error_fixed.zip" which then seemed to be just what I needed - including a fix for some certificate error I didn't have to face. Great, huh? Turns out, not so much...

I installed the two packages, and then tried to run the Python shell. Result? An error message, "Update is mandatory for installing Python Runtime & it's dependencies. Rerun the application for automatic updates". So I looked around, and found the App Update utility on the phone, and ran it. It told me that "Live TV" and "Mailsync for Exchange" (neither of which I needed or would use, and I couldn't understand WTH these had to do with Python anyway) were available for download. Sighh... exiting App Update and trying Python again gave me the same error, so I despondently told it to go ahead and install them.

Still the same error message. Arrghh! Re-ran the App Update, it apparently found even newer versions of the packages, with different sizes, and painfully and slowly (GPRS, no 3G service here yet) downloaded and installed the packages. (Why couldn't it have located the newest versions the first time? Or did I happen to check just before and after release of a new version? Who knows!)

STILL the same error message!!! Some more Google searches... found that I probably needed to reboot the phone. Did that - quite a few times. Nope, no improvement :-(

At this point, I decided the obvious way was probably wrong, and two hours into what should have been a simple and quick install, revisited the Google search I'd abandoned earlier. I kept at it till I found this in the Maemo bug tracker. N97 - another S60 5th Edition phone, but unlike what the wiki stated, this person had a bunch of other packages installed... and his worked after a reboot. Hmm... was I missing some packages, and the stupid error message was wrong? It wouldn't be the first time.

Now where was I supposed to get the packages he mentioned? After looking around the Maemo download page a bit more, I noticed the PythonForS60_2.0.0.tar.gz file. I found it contained pips.sis in the PythonForS60/PyS60Dependencies/ subfolder, as well as ssl and stdioserver packages that the bug report mentioned. I wanted to try them one by one, so I connected the phone via USB cable as a Mass Storage device, and copied the pips.sis file onto the card. I then used the File Manager to locate and install pips.sis. This first package itself fixed the immediate problem with Python - it runs, and I can execute sample scripts. I didn't need to reboot after installing the pips.sis file.

Still miffed, I created an account at the wiki, and added in http://wiki.opensource.nokia.com/projects/Installing_PyS60#For_S60_5th_edition_phones so that at least other users in the same boat might find some semi-accurate information in the wiki! :-/

Probably I'll encounter a need for the ssl and stdioserver packages later, as I get into playing with Python on the phone. For now, other things are holding my attention :-)

Feb 14, 2010

/. Large Codebase and Perl



Thanks, /. :-P I'm glad I didn't get into Perl either. Especially with gas costs the way they are now.

Feb 12, 2010

Brain-dump: Bzr and Bzr-Explorer with Launchpad account


Since it was more than a couple of weeks ago that I got bzr and Bzr-Explorer working on my old Acer laptop, as usual I forgot the salient steps, and spent the better part of half a day futzing around a new install, trying to get it to let me pull down the latest revisions (bzr pull) of Acire

So, here's a brain-dump for (sighh) the next time I have to get a bzr-based setup working with a Launchpad account:
  • Bzr needs command-line init before you can go GUI: If you plan to upload code, or to pull/merge/update an existing branch on your computer, the first two bzr commands you should run in your new installation are:
    bzr whoami your_name_and_email_address   
    bzr launchpad-login your_launchpad_username
    where the info in the first command should ideally be your handle and a real email address, and in the second, the username for your Launchpad account.
    While Bzr-Explorer has a Settings > Credentials menu option, that only opens the bzr authentication.conf file in your chosen editor - and before I ran the two bzr commands above, the file simply did not exist. Apparently there's no way (yet) to do this initial config via Bzr-Explorer.
  • New SSH key for a new hostname: I'd created my SSH key in Ubuntu 9.04 on my Dell laptop, whose hostname remained the Ubuntu-installer-default primary-username-laptop (in my case, "edgar-laptop"). So when I copied it across to my Karmic install on my Acer lappy, it worked - because once again, I accepted the default 'edgar-laptop' hostname. Duh.
    I was beginning to get a major crick in the neck, typing on the Dell keyboard but looking at the Acer screen, where Synergy was funneling my keystrokes - so I decided to create a Virtualbox VM with Karmic on my Dell, under Ubuntu 9.04. In a fit of appositeness, while installing 9.10 I chose a more relevant hostname - 'vm910'. Yay, me! :-/ Ha!
    I rsynced over a goodly bit of stuff from the Acer laptop into the VM, including apt's package cache (which did save a ton of time and bandwidth), and my SSH keys - forgetting that I had a different hostname in my VM :-(
    Long story short: for several attempts at pulling updates for an existing branch on my HDD, I kept getting public-key-access-denied errors.
    Fix 1: Moved the unusable SSH keys out of the way, generated new ones in the VM. Uploaded the new public key text to my Launchpad account's SSH keys page.
    Result 1: New error message "Agent admits it is unable to sign the request" (or words to that effect).
    Fix 2: Restarting Bzr-Explorer had no effect, I guessed probably it was the GNOME keyring that had the wrong key cached, or was heavily confused. Well, Winduhs-style... just reboot the VM! Heh heh...
This sorted out the issue; I could pull down the latest revision of Acire without issues.

Acire - browse Python code snippets



If you use Ubuntu Karmic, and are a Python programmer, or learning Python, then do check out Acire - it's a sweet way to browse Python snippets, run them, edit them in Acire itself, test again, and then copy the edited code into your project. 


N.B.: To get the latest changes that enable edit-and-run, get a local branch of the project (bzr branch lp:acire) instead of downloading the 0.2 release; my changes to enable this haven't been package-released yet. The 0.3 release, when it comes out, should have these features built in.


See the project announcement by Jono Bacon for background info. Also see his blog for version 0.2, including the need to install dependency packages:
sudo apt-get install python-gtksourceview python-gnomeprint

The same advice as for Acire applies for the snippets - use bzr branch lp:python-snippets instead of installing from the PPA, so you can get the latest contributions. To get Acire to use your branch folder as the snippet store, use the SNIPPETS_DIR environment variable to specify the location:
SNIPPETS_DIR="snippets_dir" path/to/acire

edgar@vm910:~$ SNIPPETS_DIR="launchpad/python-snippets/" launchpad/acire/trunk/bin/acire

Do consider submitting code snippets to the python-snippets project, as Jono requests. 

Ubuntu Karmic in Virtualbox VM failed to resume after Hibernate

Resume from hibernation failed with cryptic error messages in the dmesg log:

[    4.816045] PM: Starting manual resume from disk
[    4.816046] PM: Resume from partition 8:5
[    4.816048] PM: Checking hibernation image.
[    4.816092] PM: Resume from disk failed.

I'd created the VM with an initial 1024 MB of RAM, and accepted the Ubuntu installer's automatic partitioning of the 15 GB VDI I'd created for the VM. Apparently the installer isn't smart enough to consider allotting enough swap space for hibernation while creating the swap partition, because it created a 768 MB swap partition. 

Although I didn't see any log messages about running out of swap space to dump memory image while hibernating, I wondered if this might be the problem. After shutting down the VM, I reduced RAM allocation to 512 MB, and restarted the VM. Hibernation and resume worked fine. I repeated this procedure, bumping the allocated RAM up to 768 MB - still worked.

So, if for some reason you need hibernation working with Ubuntu 9.10 inside your Virtualbox VM, and have taken the auto-partitioning scheme, like I did, this is one point to check.

I also discovered that the Virtualbox Guest Additions go crazy after a hibernate/resume inside the VM; the shared X11 clipboard no longer works (can't copy text in the VM and paste in in the host OS); mouse capture and uncapture reverts to the manual mode instead of automatic capture/uncapture; host CPU utilization for an apparently idle VM hits the roof (keeps one core at 100%). 

This means that Virtualbox's own close-window-and-save-VM-state method of suspending a VM is the best. I wound up poking into the guest OS' suspend and hibernate because Virtualbox failed to resume the VM properly - it just discarded state and booted the VM from scratch, which puzzled me. After I reduced the RAM assigned to the VM, apparently Virtualbox's own save-state seems to have started working as well. At least, a couple of tries succeeded. Also, the save-state and resume-state operations seem to have sped up drastically (but maybe disk cache has something to do with that).

Ah, well - just a small brain-dump for the next time I find a VM save-state and resume fails.

UPDATE 28 Feb 2010: That was NOT the end of it... subsequent attempts to use VBox's save-state again gave me problems, at which point I began some determined Googling because this was really pissing me off. Turns out that VBox 3.1.0 onwards has a new bug, where save-state locations other than the default ~/.VirtualBox/Machines/$VMNAME/Snapshots are ignored when looking for saved state while resuming. I added a confirmation of the problem at the Virtualbox Forums, and confirmed that "if the saved-state file is created in the default location (as mentioned above) then resume from saved state works. If it is created in a custom location, the saved-state file is ignored by VB 3.1.x and the VM is booted from scratch. The saved-state file created in the custom location is left there, and not deleted after switching back to the default Snapshot Folder."

Oct 22, 2009

radeonhd 1.3.0 - experimental support for ATI Mobility Radeon HD4570

Hardware: Dell Studio 1555 ("new Studio 15") with ATI Mobility Radeon HD4570. lspci identifies it as:
01:00.0 VGA compatible controller: ATI Technologies Inc M92 [Mobility Radeon HD 4500 Series]

The Ubuntu 9.10 beta copy I am running at the moment has xserver-xorg-video-radeonhd 1.2.5, which did not work with my Mobility Radeon HD4570 when I tried it. However, radeonhd 1.3.0 has just added support for this chipset (a.k.a. "M92"), as per the brief changelog at the X.org wiki page for radeonhd.

Compiling the driver from source (tarball download) gets X working for me - 2D with DRI, as far as I can see. I haven't yet tried enabling 3D.

If you'd like to try out the Free Software driver right now, instead of continuing to use the proprietary ATI Catalyst "fglrx" driver, the procedure below should help. This will probably be of limited usefulness, until Ubuntu brings out radeonhd version 1.3.0 in the package repositories, but could be useful if you want to try compiling future versions of the driver.
You may be interested in this alternate procedure, at the Ubuntu community site.

Warning: This procedure could trash your GUI.

The following procedure assumes you are comfortable with a command-line interface and at least basic system administration in Linux. Mistakes will, in all likelihood, make X stop working - so you should be able to recover (basically, use a root shell to replace /etc/X11/xorg.conf with a backup copy, and reboot). In addition, the driver is marked "experimental" for this GPU. It seems to be working reasonably OK on my system, but YMMV.
I also assume that most pre-requisites for compiling from source are already installed in your copy of Ubuntu; if not, there are many pages out there that explain what to install.


Notes:
I used a slow manual process of running ./configure, grokking the log, adding packages and repeating till the configure script stopped complaining about missing packages. In the following list of dependency packages, it's possible that some of them are actually not necessary for this compile - if so, please add a correction in response to this post - thanks!

I later came across this Ubuntu forum thread, which mentions apt-file - that might have saved me a little guessing. (There's no .dsc file in the tarball, so dpkg-checkbuilddeps mentioned at the page wouldn't work here.)

I used Synaptic to find and mark these for installation - but any method that automatically installs dependency packages should be fine.

Instead of
the default "make install" to splatter the compiled files around the Ubuntu filesystem, I used checkinstall to create a .deb package that I could uninstall later, if I wanted, as described at slack-tux.org. I used the minimum possible inputs to checkinstall - didn't supply documentation, maintainer name, dependencies etc because this was basically just testing. If you want to create a proper package to distribute, see this Ubuntu wiki howto.

Outline procedure:

  1. Download ftp://ftp.freedesktop.org/pub/individual/driver/xf86-video-radeonhd-1.3.0.tar.gz into a temp folder.
  2. Un-tar.
  3. Install the following packages, and their dependencies:

    xserver-xorg-xdev
    libpci-dev
    libdrm-dev
    x11proto-xf86dri-dev
    x11proto-gl-dev
    libgl1-mesa-dev

  4. Run the configure script. I used these parameters to prevent it going under /usr/local, and to ensure DRI would be enabled:

    ./configure --prefix /usr --enable-dri=yes
    [Verify that the output does not end with a NOTE that DRI is disabled - if so, I may have forgotten to log a package name, apologies!]
  5. Run

    make
    I got some warnings, no errors.
  6. Install the "checkinstall" package using Synaptic or apt-get.
  7. Close Synaptic (or any other package management tools like Update Manager etc) if you have one open.
  8. Make sure the folder in which you ran make (the one extracted from the tarball) is your current directory, and run

    sudo checkinstall
    Answer the questions, tweak the package description if you need to send it out to friends (I didn't, because this package was just for trial).
    Checkinstall should automatically install the package after it builds it, but since I had Synaptic running, automatic installation failed. I then closed Synaptic and tried

    sudo dpkg -i xf86-video-radeonhd_1.3.0-1_i386.deb
    It failed again, because my package conflicted with the installed xserver-xorg-video-radeonhd (ver. 1.2.5, which I'd installed in my first attempt to try the driver). If you'd installed that package too, you'll need to remove it like I did:

    sudo dpkg --remove xserver-xorg-video-radeonhd
    Then I ran the dpkg -i command again, and it installed.
  9. Back up your existing /etc/X11/xorg.conf. 
  10. Create a new xorg.conf that uses the radeonhd driver. I grabbed a sample config from the second post at this page; you might want to do that too.
  11. Reboot and see if you have X working...

After rebooting with radeonhd, I found a few small problems like backlight stuck at lowest level, some display flickers and jiggles, GPU temperature quite high - 60 to 68 degrees C, compared to between 46 and 56 with fglrx under Ubuntu 9.04... (but that happens running in fb mode too). However, my session went without crashing for quite a few hours, and shut down beautifully too. Next thing is to try enabling 3D and see what happens.