Linux

Articles about the Linux operating system.

Adobe releases pre-release Flash 10 for 64-bit Linux

Today, Adobe released 64-bit Flash for Linux. Finally, I can waste time watching ugly, pixelated Internet video on my 64-bit Linux desktop and laptop, just like all of my 32-bit-confined brothers and sisters on the Internet! (Yes, I know about npviewer---let's not go there.)

What's really interesting is that this is Adobe's first 64-bit release of Flash. That is, Linux users got it first, before users of Windows Vista x64 and and MacOS X. It probably does not mean anything, especially since Adobe has mentioned 64-bit flash will be released at the same time across platforms, but you can't help but feel good inside.

Go download it now and remember to report good bugs.

Update: Some quick notes...

  • The tarball provided on the labs website is not the conventional Adobe Flash installer--it just contains the plugin. To use the plugin, drop the .so file into your ~/.mozilla/plugins/ directory.
  • Make sure to uninstall your npviewer-powered 32-bit Flash completely (disabling the plugin within Firefox is not enough). I personally uninstalled it from my system to prevent any conflict.

Creating your own personal aspell dictionary

Something that has bothered me forever is that applications that use GNU aspell for spell checking kept marking my name as a misspelling (I'm looking at you, KMail). Most front-end applications don't provide a way for you to add your own custom words.

Apparently, creating your own personal dictionary is ridiculous easy with aspell.

If your language is English, create a file in your home directory called ".aspell.en.pws":

personal_ws-1.1 en 0
Samat
quasirhombicosidodecahedron

The first line is a required header. Every subsequent line is a word you want to add to your dictionary. I can't believe I've let this sit for so long. Because it's a nice text file, syncing this file between machines to take your dictionary with you is trivially easy.

Taking Drupal sites offline via mysql and the command line

Drupal-powered websites can be put into an "offline mode." This is much better than most alternatives (such as taking the web server offline), especially for search engines, as the message and HTTP status codes given to users and robots alike will tell them to patiently come back later.

I've found that putting the site into offline mode makes database backups go much faster on heavily trafficked sites (which is obvious). However, for a particular site I was working with, this needed to be done in an automated manner, and on a dedicated database server that did not have access to the Drupal installation.

Most people take their Drupal sites offline through Drupal's web-based administration interface. They can also be put offline through the Drupal Shell. Neither were suitable for me: the former cannot be automated easily, and the latter requires access to the Drupal installation. Fortunately, Drupal sites can easily be taken offline by setting things in the database, which can easily be done via bash scripts and the command-line MySQL client.

Given your database user is my_db_user, password my_password, and database my_drupal_db, the backup script would look something similar to:

#!/bin/bash

# Take site offline
mysql --user my_db_user --password=my_password my_drupal_db << EOF
UPDATE variable SET value='s:1:"1";' WHERE name = 'site_offline';
DELETE FROM cache WHERE CID = 'variables';
EOF

# Do stuff here while the site is offline (e.g. backup)

# Bring site online
mysql --user my_db_user --password=my_password my_drupal_db << EOF
UPDATE variable SET value='s:1:"0";' WHERE name = 'site_offline';
DELETE FROM cache WHERE CID = 'variables';
EOF

Update: The original version of this article had some problems on some setups with the variables table being cached. I added another SQL statement to make sure this cache is flushed so the site actually reflects its configuration.

Update: This method really doesn't work that well, and the more I think about it, there isn't a way to get around writing something that interacts with Drupal. I'm working on a script that will be more fool-proof.

Amarok 2 uses MySQL embedded as a metadata store

There's been a bit of turmoil in the Amarok and KDE communities the past week with Amarok's decision to only support MySQL Embedded in Amarok 2. Jeff Mitchell has written about the Amarok design decisions made.

I'm a little bothered by this, as it forgeos all the "semantic desktop" work that has gone into KDE 4, namely what's provided by the Strigi and Nepomuk libraries. One thing the whole semantic desktop concept entails is that other applications will be able use data another application stored, but without care to what that other application was or how it was stored. For example, I should be able to share the list of all tracks in my music library, how many times I've played tracks, what tracks I think are my favorite, etc across music players. This kind of abstraction is, obviously, good for users, but bad for developers of proprietary software. They don't want you to easily switch between applications that they do not control. Amarok switching to it's own database store is a stab at this kind of desktop interoperability. I've my own thoughts to add, though, that support what the developers are doing...

Amarok is an awesome application. Dare I say, it's a killer application on Linux---on several occasions this past year I've recommended people install Linux just so that they could play with Amarok and see how much better it is compared to what they were using (yes, I'm looking at you, iTunes).

Before Amarok, I used Music Player Daemon (mpd). I stopped using it after a while: the playlist management wasn't very good; it would eat those playlists that I spent a lot of effort to make; the GUIs available at the time were lacking; and it was very slow when working with tens of thousands of songs. Some of this may have changed but I've not been motivated to look back.

Enter Amarok: I switched because the playlist management was so much better. I setup a MySQL server on my workstation to store metadata, as SQLite was much too slow. Amarok backed with MySQL is very fast---I dare others to find a library-based music manager that is faster with the number of songs I've thrown at it.

Balancing desktop interoperability with performance is a delicate balancing act. Interoperability is the hot thing these days---look at how Apple's line of integrated software and hardware continue to sip market share from the Microsoft-powered desktop. But when it comes down to it, performance and other more perceived benefits are going to win out over desktop interoperability. The Amarok developers' decision to go with MySQL embedded is a good one that will hopefully keep people moving to Amarok over proprietary alternatives.

Speeding up SpamAssassin rule processing on Debian and Ubuntu

SpamAssassin is one of the most-used spam filtering systems in use today. Unfortunately, because there are so many different ways SpamAssassin can be used, SpamAssassin remains subject to many performance problems. Fortunately, there are several speed-ups and optimizations that can be applied to most SpamAssassin installations to speed up its rule processing, especially on Debian and Ubuntu GNU/Linux-based systems. These instructions can be adopted to other operating systems as well.

This article does not discuss configuring your mail filtering system (i.e. procmail, maildrop). This depends completely on your setup, and more than likely there are plenty of other articles that describe the best way to setup what you want.

The number one thing Dell customers want... Linux

Dell Ideastorm is a Dell-run website where users can post and vote (anonymously) for ideas for Dell products. What's the number one thing people want...?

People want Linux on their Dell machines. Remember to click the "promote" icon and make your vote count.

GPG public key signing post-party automation with KMail

This past Ubucon's key signing party was my first key signing party. One thing I noticed--signing keys after a key signing party is a boring repetitive task. Summarized from the Ubuntu wiki entry on typical key signing post-party protocol:

  1. Retrieve all public keys of key signing party participants, using gpg –-recv-key
  2. Compare the hardcopy fingerprint from the keysigning party to the fingerprint of the retrieved public keys, using gpg –-fingerprint
  3. Sign the key, using gpg –-sign Send the signed key back, either by
    • E-mail: export the key, then e-mail it to the key owner, using gpg –-export -a | mail -s “Your signed key” user@example.com
    • Key server: send the key to a public keyserver, using gpg –send-keys

This is incredibly monotonous—and people have to wonder why Web of Trust-based encryption is not more popular?

The Debian signing-party package provides the utility caff to automate some of this. It's not very friendly to “desktop” users, however:

  • it's a CLI application
  • it requires a local MTA (/usr/sbin/sendmail in particular), or an “open” SMTP server, with no support for authenticated SMTP or SMTP/SSL
  • the configuration file syntax is Perl and confusing; there are also few examples on the Internet

You could add authenticated SMTP or SMTP/SSL support to the script, but having to know how to hack Perl definitely disqualifies caffe from being a desktop-friendly application.

So, I hacked together my own key signing party script in Python that would send signed keys back to people via KMail. To use it, create a text file listing all key IDs you wish to sign, one per line. Pipe the contents of this list into the script:

cat list-of-ids.txt | key-signing-party-batch-process-via-kmail.py

The script will download each key, ask you to verify the fingerprint, and then sign it. It then will open a KMail composer window, pre-filled with the key owner's e-mail address, a friendly template message (customizable in the script), and attached key. Review each e-mail to make sure it is kosher, and click send. Other than continuing to be a CLI program, I think this is much friendlier--the only manual work done is the creation of list of keys to sign, comparing fingerprints (this could be automated, but it seems in the spirit of the Web of Trust-based systems not to), and clicking send in a familiar desktop e-mail client.

Now for some notes...

It uses the DCOP automation features of KDE's Kmail to send messages. You could similarly use Evolution and D-Bus, but I don't use Evolution so I can't contribute that bit of functionality. Mozilla's Thunderbird unfortunately does not yet support any kind of automation features (as far as I know, anyway), so you're completely out of luck if you use it.

DCOP with Python is a complete, utter, pain. The easy way to drag-and-drop boiler-plate code with kdcop did not work, as it appears the APIs have changed. A problem with KDE/Python dcopext's module and multiple identically-named-functions sealed the deal for me and I gave up trying to use DCOP with Python, and instead settled for a hack of using the shell instead. I'm looking forward the one Linux desktop IPC protocol to rule them all, D-Bus, to debut in KDE4.

My script does not provide all the functionality of caffe. It, for example, does not encrypt the messages and their keys back to their owners. There doesn't appear to be an easy way to do this with KMail and DCOP, so it's a feature that will have to wait.

The GNOME font dialog, why?

Fredico M Quintero pointed out some serious flaws in GNOME's font configuration dialog; the Novell Product Design wiki also describes some problems. In a sentence that fits in with what I believe is GNOME's “simplicity mantra”, GNOME should just get rid of its useless, confusing fonts configuration dialog.

Why does it have a font configuration dialog anyway? Well, unfortunately, GNOME's setting daemon completely ignores several fontconfig settings and instead uses its own settings for things like antialiasing type, whether hinting is used, DPI, etc. You need the font configuration dialog to change these settings, or you have to dig through gconf. Most of this was put in place probably to subvert a broken X setup; instead of implementing these hack-ish workarounds GNOME should instead push to fix X instead.

It's extremely difficult to discern the difference between the different types of antialiasing. GNOME's dialog doesn't let you select arbitrary text, or let you render text in-place so that you can quickly compare between different antialiasing styles and subpixel orderings. These settings, along with DPI, are unlike the rest of the settings in the font configuration dialog because they don't apply immediately. They only affect newly started applications, and the dialog does nothing to alert you of this.

Do users really need to be able to select subpixel ordering from a dialog? There are very few LCD monitors that do not use an RGB subpixel ordering. The very few people who rotate their LCD monitors into portrait mode (including me, see my past article Misery with online reading of PDFs and the need for portrait monitors) would use VRGB. Why not just set RGB subpixel ordering if the user is using an LCD? VRGB if their display is rotated? Again, these are things GNOME could discover by querying X...

Lastly, do users need to change the fonts used by their UI in the first place? The majority of Windows and MacOS X users don't deviate from the defaults at all—why would GNOME users be given a choice through this confusing dialog? GNOME instead should use the fontconfig aliases “Sans”, “Sans Serif”, and “Monospace” rather than letting users choose fonts. A fresh GNOME setup already uses these aliases as the defaults anyway.

Of the settings in the font configuration dialog users may actually want to set, whether to use antialiasing or not is the only one that sticks out to me as needing an option. I think that the dialog could be replaced with a simple, descriptive checkbox somewhere that read “Antialias text” that would toggle all the heuristics I've described above.

Yes, GNOME is limiting!

There's been a lot of fallout from Linus' latest criticism of the GNOME desktop, with which I complete agree. I feel as if I need to comment on some of the responses.

Carthik Sharma writes in Of Apples and Oranges, GNOME and KDE:

I dread having to find something, since it most definitely will be placed in some non-intuitive sub-menu.

KDE has no control over where applications decide to place themselves.

I like the way GNOME display fonts on the screen. I don’t want to have to change every little variable to get the perfect system.

GNOME pioneered use of fontconfig; in fact, lately, GNOME has been pioneering the use of many next-gen APIs and technologies (e.g. AIGLX, Beryl, etc). But Qt/KDE have also been using fontconfig for several years now—what's different?

Interesting enough, there has been criticism about how GNOME handles fonts. Taking points from that article, GNOME's font configuration is a mess:

  • What's a “Terminal” font (it should be called “Monospace,” as it is in KDE, because this is how it's also used throughout GNOME)?
  • What does “size” mean (apparently, it's not what you think)?
  • Why do I care about the subpixel ordering of my fonts' antialiasing?
  • Why would I need to set fonts at all (see my weblog entry The GNOME font dialog, why?)?

KDE is no different than GNOME in trying to provide “sensible” defaults, defaults that its developers have decided are intrinsic to a “perfect desktop.” But, what the developers have decided is the perfect desktop may not be your perfect desktop—and here lies the essence of Linus' argument, and the difference with KDE and GNOME. With KDE, you may have an option to make a setup “perfect”; with GNOME, quite often the option won't exist and you are limited to what the powers that be decided was perfect for them, not you. This is Linus' argument: GNOME is limiting.

Sprint's EVDO Mobile Broadband on Ubuntu GNU/Linux

sprint-mobile-broadband-card.jpgand your connection will work

So, you've gotten your shiny new EVDO datacard working under Linux (if not, see High-speed cellular wireless modems (e.g. EVDO, HSPDA) in Ubuntu GNU/Linux 6.10) and you want to now setup the actual Internet connection?

In this article I document how I setup Sprint's Mobile Broadband service with ppp in Ubuntu GNU/Linux 6.10.

High-speed cellular wireless modems (e.g. EVDO, HSPDA) in Ubuntu GNU/Linux 6.10

novatel-s720.gif

Note: If you are running Ubuntu 7.04 or greater, this article is no longer relevant. Your EVDO modem should be detected and run at a higher speed automatically.

I've been raving about cellular wireless modems/data cards for a while now. While they've been available for a long while, they've finally become practical with networks such as EVDO and HSPDA that offer broadband-like speeds. I personally own a Novatel Merlin S720 that I use with Sprint's Mobile Broadband service.

Most of these datacards are easy to get running in Linux--I actually setup mine in Linux faster than I did in Microsoft Windows. However, due to some shortcomings in the kernel used by Ubuntu GNU/Linux 6.10, you cannot take advantage of the speeds that these modern wireless networks offer.

This article talks about some of the problems of the often-used usbserial driver, and how to use the better-performing airprime driver instead.

High-speed Internet access through cellular phone networks

I'm a T-Mobile Hotspot subscriber, but I cannot say I'm particularly happy with it. Reliability is in general pretty good, but there have been a few times a certain hotspot has been flaky, and these tend to be the times I needed access the most. It's also a pain to have to go somewhere to get Internet access, especially when, for example, I don't like Starbuck's coffee. I rather have the Internet come to me.

Enter EVDO. It's a 3rd generation cellular technology that allows for broadband-like speeds, typically almost everywhere you have a cellular phone signal. There are different speeds depending on what network is available in a particular location:

  • 1xRTT, allowing for 144 Kbps/144 Kbps download/upload speeds
  • EVDO 1x Rev 0, allowing for 2.45 Mbps/150 Kbps
  • EVDO 1x Rev A, allowing for 3.1 Mbps/1.8 Mbps speeds.

All three types of networks are available can be found in the United States, and a typical provider's access plan lets you roam between them anywhere in the country for free.

Access comes through a provider-specific modem (i.e. you cannot use one provider's modem with another provider). These usually are PCMCIA cards, reminiscent of the 802.11b network cards people used before WiFi was built-into notebook computers. Connection to a provider usually is provided through PPP software. Most the modems available on the market today are a little oddball: they expose a USB controller, which then exposes a USB serial interface which controls a virtual modem. Yes, it's strange, especially when these devices aren't actually modems (there is no MOdulation or DEModulation taking place, the devices are more “network bridges”), but thankfully it allows these devices to easily work with alternative operating systems like Linux and MacOS X.

In the USA, there are essentially three major EVDO providers: Sprint, Verizon Wireless, and Alltell, with Sprint and Verizon having the largest networks by far. What differentiates the Sprint and Verizon, I think, is pricing and policies. If you do not want to sign a contract, both providers cost the same. If you want to sign a contract for 2 yrs, you only get a discount rate with Verizon if you've a qualifying voice plan—Sprint has no such limitation to get a discounted rate.

Verizon does a bit of questionable marketing: they advertise their service as “unlimited,” but they pull a trick often used in contract writing and specifically define “unlimited” as 5 GB/month. If you go over this limit, you're breaking Verizon's terms of service. Verizon often cancels subscribers accounts, and assumes you are a criminal, downloading illegal music or software. An article in the Washington Post, Bandwidth Bandit, discusses about one subscriber's woes. Their terms of service disallows many popular Internet applications as well, such as VoIP, video conferencing, or any online gaming. Sprint's terms of service are more vague and do not explicitly disallow these things, but reports from their subscribers say that they don't have unreasonably low bandwidth limits nor have draconian policy enforcement assuming you guilty until proven innocent.

This wouldn't be a good summary without me discussing what new bleeding-edge technology was right around the corner. EVDO Rev B, allowing for at least 4.9 Mbps/1.8 Mbps speeds, has been deployed in a few places in Asia, but given how backward North America tends to be in technology adoption, won't be in the United States anytime soon. WiMAX, a 4th generation cellular technology allowing for speeds of at least 10 Mbps, will probably take the place of EVDO. Sprint is the only major provider dedicated to building a WiMAX network, with plans to begin deployment at the end of 2007.

Some external links with good information:

Connecting to the Columbia Medical Center's Athens WiFi network with Linux

Columbia University's Medical Center, like many university campuses, has many WiFi access points. To meet HIPAA privacy regulations all their wireless networks require use of VPNs or sophisticated encryption protocols.

Connecting to their athens wireless network, which uses IEEE-802.1x authentication, is a little non-obvious with Linux, but is possible given your wireless card supports WPA and works with wpa_supplicant.

To save the many weeks I spent fiddling, the magic wpa_supplicant.conf stanza that works for me:

network={
  ssid="athens"
  key_mgmt=WPA-EAP
  eap=TTLS
  pairwise=TKIP
  group=TKIP
  phase2="auth=PAP"
  identity="foo"
  password="bar"
  priority=2
}

Replace foo with your Columbia University UNI and bar with your password.

American McGee switches to Ubuntu

Former id games mapper, and creator of the classic 3rd person game Alice, American McGee has switched to Ubuntu Linux.

Ubuntu Linux only gets more and more popular...

T-Mobile WiFi Hotspot login script

T-Mobile's WiFi Hotspot service, thankfully, forgoes a proprietary authentication mechanism for a solution that while cross platform (i.e. it works with Linux), can be extremely annoying. On opening a web browser and attempting to go to any website, you're required to login on an SSL-protected website with your account username and password before you can use the connection. If your web browser automatically tries to open many pages on startup, such as when you're using the Session Saving extension for Firefox, you get T-Mobile's Hotspot login page in every tab--extremely annoying!

I've written a small Python script that can login programatically without use of a web browser.

Syndicate content