Feb. 13th, 2008

Ubuntu Packages and PHP

(Hello, Planet Ubuntu Users!  I'm looking for a second MOTU on my php-xdebug package as well as someone to revu my libapache-test-perl package.  Any takers?)

Emacs CVS now includes XFT (i.e. smooth fonts) in the main branch, so I'm discontinuing my old emacs-xft-snapshot build.  Still, the other emacs-snapshot package is targeted to Debian and I'm running Ubuntu Gutsy.  So I've uploaded a snapshot build to my PPA on Launchpad.

One thing that I included is flymake support for PHPCarl asked me earlier today if I knew how to get the compilation mode in Emacs to work with PHP's lint function to find highlight problems.  I said flymake would be better, but didn't know how to do that right off, either.

After a bit of twiddling, I figured it out and, as a bonus, got compilation mode figured out, too.

If you want to enable flymake for PHP-mode (yes, I have a Debian package for that, too) in a version of Emacs you already have installed, add the following code to your .emacs file:
;; Flymake PHP Extension
(require 'flymake)
(unless (fboundp 'flymake-php-init)
  (defun flymake-php-init ()
    (let* ((temp-file (flymake-init-create-temp-buffer-copy
                       'flymake-create-temp-inplace))
           (local-file (file-relative-name
                        temp-file
                        (file-name-directory buffer-file-name))))
      (list "php" (list "-f" local-file "-l")))))

(let ((php-ext-re "\\.php[345]?\\'")
      (php-error-re
       "\\(?:Parse\\|Fatal\\) error: \\(.*\\) in \\(.*\\) on line \\([0-9]+\\)"))
  (unless (assoc php-ext-re flymake-allowed-file-name-masks)
    (add-to-list 'flymake-allowed-file-name-masks
                 (list php-ext-re
                   'flymake-php-init
                   'flymake-simple-cleanup
                   'flymake-get-real-file-name))
    (add-to-list 'compilation-error-regexp-alist-alist
                 (list 'compilation-php
                   php-error-re  2 3 nil nil))
    (add-to-list 'compilation-error-regexp-alist 'compilation-php)
    (add-to-list 'flymake-err-line-patterns
                 (list php-error-re 2 3 nil 1))))
Now, whether you're using the emacs you started with or the latest emacs-snapshot, you need to tell emacs to use flymake on PHP files.  Add:
(add-hook 'php-mode-hook (lambda () (flymake-mode t)))
to your .emacs file and you're good to go.

Jan. 26th, 2008

Ubuntu hates XFS

I was a little worried that the hard drive in my laptop was dying (though, looking at the Load_Cycle_Count, I don't think it is Ubuntu's fault, at least not because of cycle time) and since I was on-site, I was able to get a loaner laptop.  I decided to use XFS (/boot would be ext3).

Big Mistake.

Everything worked great on the installation, but as soon as I installed all the updates and rebooted, gnome-terminal wouldn't start. Took a little doing, but I discovered that my XFS partition had become corrupted.  Ran xfs_repair and it dumped a few files in /lost+found. But now things work.

Take heed.
Tags: ,

Jan. 25th, 2008

Linux on the desktop is definitely here

In talking to some people about my mother's experience with Ubuntu, I decided that the one thing Canonical could do to make it all easier would be to build a Windows- or C#-based downloader-and-cd-burner. (C# so that it would work on a Mac or Linux as well as Windows.)

Using this hypothetical app, people like my mother could download an ISO, fetch and verify a GPG-signed MD5 checksum, and burn a cd using a single application. No more fumbling with multiple unfamiliar applications to accomplish a single task.

Still, with prominent mention of Dell computers on Ubuntu's front page, with the advent of $200 computers loaded with Linux, with nerdy sons like me, even the streamlined ISO burner may not be as urgent to get Ubuntu on Grandma's desktop.

But it would really help.
Tags: ,

Jan. 22nd, 2008

The Freetard gives his Mama a bit of Ubuntu

How is it that some fancy-pants framework is always the right tool for an abstract job and PHP is the right tool for a real job? (The right tool for the slob)

Exactly. Though I would say "Why do all these freetards talk about freedom, but then give their Mama a Mac?"

So it is good that an idealist, freetard like myself actual tests his ideals in the real world. In this case, the test subject was an important one: my mother.

A couple of weeks ago, Mark Pilgram's post about switching his father to Ubuntu reminded me that I had told my mother she should try Ubuntu since her Windows laptop was slowing down. That weekend, I mentioned it to her again in email. Her response was “Ubuntu is what? ... oh I see something about printing. That would be GREAT if I could communicate from my computer to the printer.” (You can read our whole email exchange, if you like.)

Given her limited knowlege of Linux, I asked her to try it out. In fact, I made it more challenging. I pointed her to the Ubuntu download page and asked her to download the ISO and burn it … and I wouldn't help her. She managed to get a Dapper installation CD burned (I didn't tell her which version to try) but ended up thinking she had failed because the MD5 checksum process didn't work. Or maybe it did and the download was bad. Still, I was able to use the CD when we met up a week later.

In the end, that part of the experiment showed part of the failures of Ubuntu's efforts. At least when it come to 56 year-old grandmothers, Ubuntu's download page is too filled with jargon to be really useful. And I don't know where to report this bug.

Even though we live a thousand or so miles apart, we happened to be getting together the next weekend. So I got a Gutsy CD ready so that I could walk her through the Ubuntu installation and finish it up.

Even then, my faith in Ubuntu was shattered. When I asked her to boot off the CD, she did, but she started it in safe mode (which probably created other problems). Still, there were a few bright spots.

Perhaps the biggest thing Ubuntu got right was converting her existing Windows user, including bookmarks and IM account, over to the equivilent programs in Linux. That feat, in and of itself, makes me almost forgive all else.

Still, there were a number of things that the installation didn't get right:
  1. When it is converting the only existing Windows user, it asks for a username and password. And then it asks for the “default” username and password on the next screen. Why?
  2. Resizing the disk when you want to preserve the existing Windows installation is too confusing. Still.
  3. The Live CD installation tells you to “remove the CD and reboot”, but you can't remove it when the Live CD environment is still running.
  4. The boot splash screen was a blank screen and you would have thought the installation failed if you hadn't seen this before and watched the drive activity light
  5. She has a widescreen laptop, but it defaulted to 1024x768 and a VESA driver instead of 1280x768 and an ATI driver
  6. Suspend on her Compaq Pressario V2000 doesn't work.
  7. Her broadcom wireless meant I had to download drivers on my laptop and transfer them to hers.
(Yes, I still need to report these bugs.)

But even after all this, I was still encouraged when I explained that we wanted to preserve her Windows partition and she asked “Why? I won't be needing it any more!”

In the end, she went home with Ubuntu running on her laptop and seemed pretty happy with it. Hopefully, in a few weeks I can write more about any snags she has run into.
Tags: ,