Archive for the 'Unix / Linux / *BSD software' Category

Firefox 3.0b5!

Mozilla Firefox 3.0 beta 5 is out (portable version), and it’s better than ever. I haven’t used my still-installed 2.x version for weeks now.

While many of Firefox 3’s new features are mostly of interest to web developers, “the rest of us” can also find much to like in it. It’s faster, takes up less memory, looks better, seems incredibly to be more stable than the stable version (!), and I love the new URL bar, where you can start typing something and it usually suggests what you want after just a few characters. In Firefox 2 you had to start typing from the beggining of an URL (which is always the hostname), but now you can type any part of URLs (including paths after the hostname), site names, and it also looks through your bookmarks, so it can work even if you’ve just cleared your browsing history.

Firefox 3.0 beta 4

As of yesterday, I’m using Firefox 3.0 (currently beta 4) as my primary browser. I’m using the portable version, which can be installed separate from Firefox 2, without sharing configurations, but I haven’t needed to use the old version for anything so far — this beta is much more polished than the term “beta” suggests. Fast, stable (zero crashes so far), and with some very interesting features. Plus, the couple extensions I need (as opposed to “it’d be nice to have them) already support Firefox 3 officially (that is, no need to uncompress and edit the version requirements).

Try it — by using the portable version, it won’t affect your Firefox 2 installation in any way. You may find that soon you’ll be using it all the time, just like me. :)

Goodbye, Apache; hello, lighttpd!

Fed up with how Apache memory usage grows (and grows, and grows), I’ve changed all of my sites on my external server (where, for instance, this very blog is hosted) to lighttpd, a.k.a. Lighty.

I began by changing the most problematic site to Lighty (listening on port 81), and using Apache’s proxy module to redirect it there. After the results were promising, I went and changed each site at a time, dealing with the particular problems of each (I use lots of redirects, and the syntax is a bit different, and, furthermore, Lighty doesn’t support .htaccess files.

WordPress was relatively easy (just one line). MyBB would have been even easier (nothing to do), if not for the fact that I use an SEO mod which uses an .htaccess file for nicer URLs. But everything was easier than I expected.

After each site had been “moved”, it was just a matter of stopping Apache and moving Lighty to port 80.

Memory usage is way down, and so is swap file usage (basically, it’s not being used, and it was, before — a lot). Barring any future problems, I’m quite happy with this set-up, and would advise this change to anyone who’s never tried anything other than Apache on an Unix system. I’ll probably try doing the same thing on my home server, too.

More additions to the PA top Technorati ranks table

The top technorati ranks table for Planet Atheism members has been improved again. :) In addition to showing the Technorati rank, number of incoming links (from Technorati as well), and Google Pagerank, the table now shows Alexa ranks as well.

You can now also click on any of the above column titles to sort the table by that particular value/rank. Incoming links and Pagerank are “the more, the merrier”, while Technorati rank and Alexa rank are “the lower, the better”, so sorting takes that into account.

A note of warning: I’ve mentioned before that you shouldn’t really take any of these ranks too seriously, and this is especially true for the Alexa ranks. Alexa is a nice idea (it’s the only one that measures traffic instead of incoming links), but it has the following problems:

  • it only counts hits if the user has installed either the Alexa toolbar (for Internet Explorer) or the SearchStatus Firefox extension (I recommend the latter, since, as everyone knows, MSIE sucks), and
  • it often lumps all subdomains for a particular domain together (i.e. doesn’t distinguish between aaa.domain.com and bbb.domain.com, even though they may be totally unrelated). It apparently has some hard coded exceptions for some (not all) blogspot.com blogs… but the values aren’t really reliable. Still, you can use it to measure the changes in traffic for one site.

Incidentally, the application I’ve coded (and have been improving) to generate this table from a list of blogs is almost ready for public release. :)

My Technorati ranks "toy"

Inspired by Carlos Andrade’s own tool, I’ve just coded a couple of scripts to take an OPML file and show an ordered table of Technorati ranks. Naturally, I used it for my own Planet site, Planet Atheism.

Here it is: Technorati Ranks for Planet Atheism members

The implementation was ridiculously simple (and there’s a lot of room for improvement), but, other than Carlos’ tool, I didn’t find any scripts or utilities to do this. And, yes, I searched. Therefore I may release the code soon, as the 2nd project on software.dehumanizer.com, since this can be a fun “toy”. :)

[EDIT: added each blog's Google PageRank to the table. Why not? :) ]

Using 64-bit Firefox on Linux

Since the dawn of 64-bit Linux distros, they have included 32-bit versions of browsers such as Firefox, because there aren’t 64-bit versions of plugins such as Java (the 64-bit version doesn’t have a plugin) or Flash.

A couple of days ago, however, I was reading the “what’s new” list for Suse 10.3 Alpha 3, and found this entry:

On x86-64: Firefox is now a 64-bit package and uses nspluginwrapper to handle 32-bit i386 plugins if needed.

Naturally, I had to investigate. I downloaded a 64-bit build of Firefox from Autofox, and nspluginwrapper. With that wrapper, I can use Flash without any problems. (Not Java, though; I think Blackdown offers a 64-bit plugin, but it’s Java 1.4.2 only. But I have found out that I don’t miss Java in the browser at all, for the past few days.)

The browser feels faster. I tend to use bookmark folders to open dozens of bookmarks at the same time on different tabs, which actually makes the browser “hang” for a couple of seconds, and those delays seem shorter now. No, I didn’t do any benchmarks. But the overall experience just “feels” better. It even appears to be more stable, though that may actually come from the fact that I’m using a 2.0.0.4pre build, which is the latest version (2.0.0.3) plus bugfixes… or maybe it’s because this version was built with a non-ancient, and possibly less buggy compiler.

Announcing DailyTasks 0.1

A few minutes ago, I submitted my first piece of software to Freshmeat (it hasn’t been approved yet; it will probably take a few hours): DailyTasks. It’s a small utility, written in PHP, with both a command line mode and a web interface, which, surprisingly enough, reminds you of daily tasks. :)

The web page linked above tells the “story” in more detail, but, basically, I’m much too chaotic to use traditional task management programs (every time I tried, I seemed to spend more time updating tasks than actually doing them), but I wanted something to remind me, every day, of doing something — from “clean up GMail’s spam folder” through “update a blog” to “do the laundry, if necessary”. :) There was already a similar program (frequent-task-reminder), but it lacked some features that I wanted (such as non-accumulating tasks), and so I wrote my own.

It’s really basic stuff, with no bells and whistles, and the PHP code would probably scare you, so impressionable young people should avoid looking at it. :) But maybe — just maybe — you’ll find it useful.

More about tidying up HTML

If you’re curious about the last post

I accept that making some HTML code validate in validator.w3.org shouldn’t be the be all, end all of the problem. A piece of code can validate and yet be… horrible. On the other hand, a piece of code may not validate because of a minor problem, and yet be better than 99% of what you see out there.

Still, that applies mainly to your code. What if you’re aggregating other people’s code? What if they’re using bad HTML, which their blogging systems (mostly Blogger or WordPress) automatically converts to a feed, which is then converted back to (simplified) HTML by a Planet? And what if you want all of that to validate?

Well, tidy works very well; it fixes the worst problems, mainly, badly nested code, and unclosed tags. But… well, if you’re being pedantic (like the W3 validator is), then there are still problems.

They’re mostly one of the following: 1) img tags without an “alt” attribute, and 2) proprietary attributes.

tidy, by default, doesn’t deal with those (since its point is for you to correct your code, and those problems should really be fixed in the code itself). But you can make it do so.

How? Well, here’s the command line I’m using for Planet Atheism:

/usr/local/bin/tidy -wrap 79 -m -i -utf8 --alt-text "" --drop-proprietary-attributes 1 -asxhtml filename

It should be obvious what each parameter does. The “ alt-text "" ” part adds some empty alt text to any img tag that hasn’t got one. The “--drop-proprietary-attributes 1” part removes those weird attributes inside other tags, which make the W3 validator choke. I don’t want them anyway, since a Planet site is supposed to display a basic version of a post — not a Flash-y, YouTube-d, animated one.

The result is: complete W3 validation, and readable code. From many other blogs, by many different authors. Automatically. What more could anyone want? :)

Adventures with moonmoon and tidy

As I’ve mentioned here before, for Planet Atheism I’m using moonmoon, mostly because 1) everyone else uses planetplanet, and 2) it’s in PHP instead of Python, and I know a little PHP. :)

moonmoon is still on version 0.2, however, and, while it removes “dangerous” tags from feeds automatically, it doesn’t (yet?) deal with unclosed tags. As most of PA’s members are as far from being geeks as possible, they tend to use WYSIWYG editors, and aren’t really worried about “validating HTML”. So, from time to time, a post would make every other post after it show in bold or italic. Annoying, to say the least.

Yesterday, it was even worse: some posts “spilled over” to the sidebar. And it wasn’t just one post causing it, but two, from different blogs, at the same time!

Well, enough was enough.

“Fixing” moonmoon (or, more precisely, SimplePie) was out of the question; I simply don’t know enough PHP / XML parsing to do it. But I tried something else: I saved the generated HTML to a file on the site’s directory, and used tidy on it. Surprise: this new version was perfect! So, I got the idea of using tidy on the generated HTML every time.

Now, PHP has a tidy module, but in PHP5 I would have to compile PHP by hand. Ubuntu doesn’t have a package for that module, unfortunately, and I really didn’t want to make an exception from using apt packages on that server. So, I had to find another way.

My solution was to dump all the page into a buffer (using the ob_ functions in PHP), save it to a temporary file, use the system command to apply tidy on it, load the altered file, and show it to the browser. It’s probably not very efficient, but it works… better than I expected, too. It may be a crude solution, but I’m proud of it anyway. ;)

Blog moved

I finally had some time today to move Way of the Mind (note the new URL) to my Slicehost virtual server. The new WotM Forum is also up, using MyBB, instead of phpBB like my other two. So far, I’m liking it (MyBB) a lot, though it’s a bit weird to have the entire theme inside the MySQL database instead of normal .php or .css files. :)

Moving the WordPress blog was simply a question of following these instructions. Basically, you go to the WP options in the old blog, change the 2 URL fields to the new address, dump the database, do a search & replace to change any images and other URLs in the database to the new address, import the database to the new server, copy the files, and that’s the proverbial “it”.

As for redirection, there came the eternal dilemma: if you redirect everything, then people will be lazy and keep using the old address (thus wasting your bandwidth); if you don’t, it’s inconvenient, and you lose everything you had in terms of incoming links and SEO.

What I did was to redirect (301, to signify a permanent move) every URL except the front page, which shows a message telling people about the change, and redirects after 5 seconds. I believe that this is the best of both worlds. Any link to an individual post will be redirected transparently, but whoever arrives at the front page will told about the change of address, encouraging them to update their bookmarks.

That user-friendliness thing again

I was replying to the following comment by Bruno Rodrigues in the Firefox tab annoyances post, but I think that this deserves a new post; it’s a different subject, and longer than an average comment. :)

Uhhh? Obviously everyone *knew* that triple-click-control-middle-abcde-enter-enter-space(*) with your leg above your back would close a tab. What would *you* be thinking about? If Apple has close buttons on each tab, and not a single close at the right side, nor no-buttons at all, what do you think is the best user experience?

(*) did you know that most computer-savy users *still* don’t know about the right mouse button? Unbelievable, but true.

Two big problems tere, IMO. First, “triple-click-control-middle-abcde-enter-enter-space with your leg above your back” is a strawman attack. You can’t present something absurd as your opponent’s position, show that it is indeed absurd, and then pretend that you have refuted his original position as well. Middle-click is simple, quick and pratical, and your example isn’t. Sorry, I’ve been reading a lot about logical fallacies on Wikipedia. :)

Second, you seem to equate Apple with user-friendliness, which is an argument to authority: if Apple does it, then it must be correct. If Apple does it that way, then that must be the most user-friendly way possible.

Well, telling people about the middle button would be a much better idea than introducing multiple “dangerous” close buttons that only get in the way anyway… but maybe that’s just me.

Should the close buttons be added simply because Apple does it? Like I said, I don’t agree that Apple should be considered the “standard” for user-friendliness. If it was, then it would never change, would it? It would already be perfect. But it isn’t.

A thing should be as simple as possible, but not simpler (paraphrasing Einstein). If you take away usefulness (note that I don’t say “features”, but real usefulness) just to make it simpler, you’re making the software less useful. If the software doesn’t do what I want it to do, then it’s not useful to me, even if it’s the most easy to use piece of software in the world… right?

And, historically, that’s what Apple did (I admit that I haven’t used MacOS X yet, though I was familiar with previous versions). Their philosophy was: “normal” users should never need to do this, so we’ll actively prevent people from doing it - even if they happen to be advanced users. For some reason, I have a problem with this kind of attitude. To be fair, I don’t know if it’s changed in OS X.

Besides, “user-friendliness” is a subjective concept. To most people, the most important thing for a piece of software isn’t really being simple, clean, or logical, but simply being what they already know. Between Windows XP and MacOS X, they’d say Windows was more “user-friendly”, merely because, with MacOS, they’d have to learn new stuff - which is the thing people hate the most about computers.

The close buttons on tabs waste space, make it easy to close tabs by mistake, are harder to click on than the entire tab, and there was already a quicker, easier way to do it. People don’t know about it? Find a way to tell them. Hell, pop up an information window the first time a user opens a new tab, or something. It’s much better than adding a redundant, confusing feature that will only make the browser more difficult to use to anyone who already knew how to close tabs quickly.

What’s next? Take tabs away completely, because many people don’t know how to use them anyway, and they only make the browser “more confusing”?

Fixing tab annoyances in Firefox 2.0

Firefox 2.0 has been out for a while, and the response to it has been mostly positive.

However, there were a couple of changes to how tabs work, and I, for one, didn’t like them at all. Looking around, I found the solution to one of them, and the other one was pretty easy to figure out.

Here’s the changes, and how to “undo” them:

1- “X” close button on every tab

This one, to me, qualifies for the “What were they thinking?” award. :) Don’t people know that you can close any tab simply by middle-clicking on it (yes, even on Linux)? Not to mention that the “X” button is both harder to click on than the entire tab, and makes it easy to close tabs by mistake, when you just wanted to select it? In other words, there’s already an easy way, and they add a more difficult way, which, besides, can easy lead to mistakes?

Sigh. Sorry about the rant. :)

Fix: open about:config, look for browser.tabs.closeButtons, and set it to 2 (no close buttons) or 3 (a single close button on the right of the tabs, like in previous Firefoxes - though, again, middle-click makes it useless).

2- tabs don’t get smaller past a certain point; if you have too many, you need to scroll the tab bar to see them all

Maybe I’m weird, but I have tab folders with 10-15 bookmarks of a particular subject, and I like to open them all, with a single click, daily. In Firefox 1.x, the tabs would get as small as they needed to be, to fit in the window. Now, they don’t get smaller than a certain size, and force the user to scroll.

To me, this is annoying. I haven’t found an option to completely disable this behavior, but I can make it virtually go away by reducing the minimum tab width to a much smaller value.

Fix: open about:config, and change browser.tabs.tabMinWidth to a much smaller value, like 1.




Creative Commons Attribution-NonCommercial-NoDerivs 2.5 Portugal
Creative Commons Attribution-NonCommercial-NoDerivs 2.5 Portugal