Tag Archives: linux

rEFIt Troubles Resolved

refit logoMaybe you dual boot. No, maybe you triple boot. Maybe you have a complicated partition scheme juggling multiple boot record tables, and it just isn’t working.

I use Boot Camp and rEFIt to dual boot between Mac OS X and Windows 7. I recently added Ubuntu to the mix. But rEFIt has trouble synchronizing the GPT and MBR records, and as result, Mac OS X and Ubuntu boot fine, but Windows boot fails with the message:

Windows failed to start.

ENTER=Continue ESC=Exit

Ubuntu’s GRUB overwrote the Windows boot loader, corrupted the GPT-MBR tables, and crashed the GUI every ten minutes. Now I remember why I used to install Ubuntu in a VMware virtual machine. It’s less hassle. I decided to uninstall Ubuntu, fix GPT-MBR for rEFIt, and fix the Windows MBR.

It’s worth trying to sync GPT one last time. Install gptsync, either with Synaptic/apt-get, or if you’re like me and Ubuntu fails to recognized either of your network interfaces, by manual download. Assuming you have only one hard drive, you will target /dev/sda.

$ sudo gptsync /dev/sda
Status: Analysis inconclusive, will not touch this disk.
Error: Not Found returned from gptsync.efi

Rats, that’s the same error rEFIt displays. We might as well use GParted to remove Ubuntu.

You’ll find GParted under System -> Administration -> GParted. After a few minutes, GParted will identify the partitions. If you decide to remove Ubuntu but keep Mac OS X and Windows, you’ll want to delete the ext4 partition then grow Windows to the remaining free space. Don’t forget to apply the changes.

The MBR still needs to be fixed. If you have a Windows or FreeDOS CD handy, you can reboot, use Repair mode, and run fixmbr. I don’t know whether FreeDOS comes with fixmbr, the website’s downright confusing. If you don’t have some sort of livecd with fixmbr, I recommend the ms-sys Ubuntu package. I’ve used it to remove Ubuntu and restore the Windows bootloader on two computers in the last week.

$ sudo ms-sys -m /dev/sda

Then reboot, use rEFIt to sync the GPT-MBR tables, and enjoy Mac OS X and Windows again. In the future, I’ll stick to virtual machines for Linux. Partitioning is not worth the trouble.

A Quaint and Curious Distro

ubuntu logoUbuntu is Linux’s best bet for mainstream adoption. The distro has oodles of drivers, an intuitive interface, an automated installer, a livecd, thousands of apps, and a massive community support.

And yet, in late December 2011, Ubuntu, Linux’s premier desktop environment, still has fatal flaws.

  • The latest version, 11.10, exhibits glaring bugs such as random system freezes.
  • 10.04 lacks crucial drivers, including WiFi and Ethernet drivers for ASUS computers, and WiFi drivers for MacBooks.
  • Many Ubuntu packages (e.g. clisp) are out of date.
  • By default, vi can’t handle arrow keys.
  • Audio is often quiet/muted.
  • One of the first things a user sees in a fresh installation is an annoyingly long list of system updates.
  • It’s unclear whether users should install software with Synaptic, apt-get, aptitude, ppa, or build from source. This is worsened with aptitude competing with specialized package managers such as RubyGems.
  • Grub has way too many menu items. We haven’t needed RAM tests since… ever.
  • GParted lists partitions in terms of MB instead of GB.
  • Ubuntu found zero proprietary drivers for an ASUS A35E. ??

Individually, these problems are fairly Googlable/solvable. However, the aggregate effort required to configure a decent Ubuntu installation is a daunting task. It’s hard to convince nontechnical friends, or even yourself, of the usefulness of Linux. Windows is suboptimal and Mac OS X isn’t all that it could be (try managing packages between Fink, MacPorts, and Homebrew), but for many people, the dollars paid are worth the endless hours saved: Windows and Mac OS X provide basic, reliable functionality. NICs work, speakers work, finding and installing apps is a cinch.

Ubuntu will get there, and we can all save a buck once it happens, but for now I treat Ubuntu the same way I treat Haiku. They’re experiments, worth checking in on every six months, but not worth adopting for everyone.

If you’re lucky enough for Ubuntu to perfectly suit your needs (it really does have a lot of built-in drivers), then enjoy it. If not, maybe hook up an Ethernet cable and check for proprietary hardware drivers. If that doesn’t work, you might as well switch to Gentoo for all the configuring you’ll be doing. Otherwise, I recommend Mac OS X. It’s an expensive FreeBSD clone that seems to always have the right drivers for the hardware. It’s something about how Apple makes the software for its own hardware. Hmm…

Here’s a thought: Bollocks everything but a terminal, a web browser, a media player, a pack of every free/libre media codec known to man, and a pack of every free/libre Linux ethernet and WiFi driver known to man. That way, users can watch a movie while Linux silently installs relevant drivers and system updates.

How to install Haskell Platform in Ubuntu 10.04 Lucid Lynx

sudo apt-get install ghc ghc-prof cabal-install

Haiku: Barriers to Acceptance

haiku logoHaiku is a continuation of the 90’s project BeOS, a novel operating system with emphasis on multimedia and a clean interface, basically Mac OS.

According to Practical File System Design, an excellent book by Dominic Giampaolo that used to be available for free on his website but now must be pirated, BFS is faster than FAT32 and more reliable than ext2. BFS is more powerful than both, offering features such as live file system searches and complex queries. BFS is able to do these things because the file system is organized as a database rather than a simple directory list.

Haiku does indeed have a clean interface. The main elements are the desktop and the Tracker.

screenshot

BeOS lost out to Mac and Windows. Later, Haiku revived BeOS as an open source project. It has a simple installer and a Bash terminal. In a world where Linux and Unix are commonplace, why is Haiku still marginalized?

Newbies

Haiku is currently where Linux was in the 90’s: few applications are available. The computer illiterate are loathe to leave the likes of Microsoft: Windows, Internet Explorer, Office, Express, and a trove of other popular applications. They’re hesitant to try out Ubuntu with its Linux, Chrome, OpenOffice, and Thunderbird. Many are too cautious to try these out on Windows, let alone Ubuntu or Haiku.

Haiku doesn’t have Internet Explorer. Haiku doesn’t have Chrome. It barely has Firefox. The default browser is WebPositive, a horribly incomplete thing (can’t minimize easily, no backspace navigation).

Haiku doesn’t have Office. It doesn’t have OpenOffice. It has AbiWord, a word processing system (no Excel, no PowerPoint) so buggy that there’s a Google Summer of Code 2011 project to reduce AbiWord’s screen flickering.

Haiku doesn’t have Express. It does have Thunderbird, but not by default. You have to search Haikuware for it. Some few ports are available, but they’re hard to install.

Oddities

How do I add icons to the desktop?

  1. Click the Haiku leaf at the top right.
  2. Select Applications.
  3. Right-click the desired application.
  4. Drag to the desktop.
  5. Release.

How do I open a terminal?

  1. Click the leaf.
  2. Select applications.
  3. Select Terminal.

Or

  1. Right-click the desktop.
  2. Select Add-ons.
  3. Select Open Terminal.

Or

  1. Press Option+Alt+T.

The hotkey doesn’t work in VMware Fusion / Mac OS

How do I resize the browser in full screen mode?

  1. Open a new window with Alt+N.
  2. Close the old window.

Or

  1. Click and drag the edge of the current window.

How do I type tilde (~), backtick (`), and other special characters?

  1. Press them twice (~~).
  2. A single character will appear (~).

Or

  1. Click the Haiku leaf.
  2. Select Preferences.
  3. Select Keymap.
  4. In Select Dead Keys, set the characters to None.

How do I cut, copy, and paste text?

Where Windows uses Control, and Mac OS uses Command, use Alt instead. So:

Cut = Alt+X
Copy = Alt+C
Paste = Alt+V

Currently, WebPositive has trouble pasting text in websites like Gmail. So:

  1. Right-click the text.
  2. Select Cut, Copy, or Paste.

How do I install software?

  1. Visit Haikuware.
  2. Search for an application.
  3. Navigate past “Choose which categories to include”.
  4. Navigate past several dozen pages that have nothing to do with your search.
  5. Click Download.
  6. Locate the installer you just downloaded (probably in Home).
  7. Discover that this version is outdated.
  8. Open a terminal and type installoptionalpackage -a SOME_APP.
  9. Discover that the app is missing critical functionality (git has no curl).
  10. Become a software developer.
  11. Port the application.
  12. Use mailing lists, fora, and IRC to debug Makefiles.
  13. Realize the exact same problems were reported and ignored years ago.
  14. Package the binaries.
  15. Upload them to Haikuwhere and wherever the hell installoptionalpackage packages are kept.
  16. Take a vacation.
  17. Format and install Linux.

Documentation

All these issues will plague new Haiku users. Only Google after Google can solve them. Whereas many Linux distributions explicitly offer Windows-style preferences, Haiku doesn’t care. Haiku doesn’t care that millions of users have come to expect certain behaviors from their operating system, and Haiku’s popularity suffers as a result. And it doesn’t document them in central places where users can easily find them.

BeBook doesn’t count. It’s for developers, not users. README would have been more useful.

Experts

For developers, Haiku does not make your life any easier. Missing applications like vim are available after some searching. But they’re out of date. You have to use installoptionalpackage to get a recent version. For some reason, Haikuware and installoptionalpackage do not sync with each other.

Haiku/BeOS is not Linux. It’s not a Unix. It’s almost a POSIX. Because Haiku is not Linux, Unix, or POSIX, many C/C++ projects fail to compile. They fail to configure, because Haiku is rarely added to the various configuration scripts.

Developing for Haiku is easy in Python and Perl, platform-independent scripting languages lucky enough to be ported to Haiku, but hard in C, C++, or Java. There is an OpenJDK port project for Haiku, but the page is too old to matter. The Haiku Java Team is a dead link. And good luck developing in thousands of less popular languages: Node.js, Common Lisp, Erlang, Haskell. If you want it on Haiku, you’ll have to port it yourself.

Haiku has promise, but it needs several man-years of ports before it will be widely used by developers, and much better documentation before it will be considered by consumers.

Just how obscure is Haiku? There’s a subreddit on BeOS with only three links.

top: The poor man’s performance analyzer

hunchentoot logoFor the sake of the future of all mankind, I wrote a tiny web server for proving that Hunchentoot works with certain system specs. “doeshunchentootwork” is only 77 lines long, serves a singe page and its favicon, and the application is compiled, not interpreted. So why does top show it using so many CPU cycles?

Daemonization may have been a bad idea, at least this early in development. The process spends a lot of time… doing what exactly?

Since the app is only 77 lines long, debugging wasn’t that hard. Long story short, CL loads the program and quits, so I was using (loop) to keep the program running. I know, I know, terrible. (read) is a better choice, since it doesn’t waste CPU by looping but merely blocks for command line input that will never arrive to a daemonized web server.

With the new code, top shows almost no activity for doeshunchentootwork unless someone is currently requesting the webpage. Whew! Now the resources can be wasted on other servers.

Cabal Woes

cabal logoProblem

Compilation errors? Installation issues? Upgrade issues? Uninstallation issues? Dependency issues? Broken packages? U JELLY? U PUDDI?

Solution

Uninstall Cabal packages

  1. rm -rf ~/.ghc
  2. rm -rf ~/.cabal

Reinstall Haskell Platform

  1. Download Haskell Platform.
  2. Install GHC and Haskell Platform.

Dependency chain companies will go bankrupt!

Broken package companies will go bankrupt!

Hackage companies will be forever in business!

In Pursuit of a Minimal and Useful Unix

unix license plateUbuntu is the most useful flavor of Unix available today. It has drivers for most hardware you’re likely to encounter, including wireless cards and camera memory sticks. Installation is a breeze, there are tons of ports, and tutorials for anything involving a terminal and an incantation of shell commands. There’s some bloat: Solitaire, instant messagers, OpenOffice, but most apps that ship with Ubuntu have their uses.

At the other end of the spectrum is Gentoo, which sucks. I won’t sugar coat it. Starting from scratch is naturally a difficult task, but it needn’t be that hard. The documentation is too general to be useful–you’ll just have to guess which drivers, libraries, and flags to use. And recompiling KDE every week is a pain, if it compiles at all.

Then there’s Damn Small Linux. It’s small (50MB), maybe too small. While it’s perfect for loading onto a thumb drive, it’s missing critical apps. PowerPoint: no. Java: no. Of all things, Damn Small Linux includes a VoIP client. What the heck?

OpenSUSE is cool for one reason: SUSE Studio. The Studio allows users to make custom livecd SUSE ISOs online for free. I love X software, hate Y, and loathe Z, so that’s perfect. SUSE Studio lets me create JeOS (“Just enough Operating System”) livecds and gigantic app-upon-app carnivals of bloatware, if I so choose. I’d looove to make an OpenSUSE livecd with my critical apps (to be listed shortly), and nothing else, but SUSE Studio still has its bugs.

My Critical Apps

  • Web browser, either Firefox or Chrome. Others like Dillo don’t count, for various HTML5/CSS3/JavaScript/tab support/hotkey-related reasons.
  • File browser. Drag and Drop should move files, because THAT’S WHAT I ALWAYS AND FOREVER WANT TO DO WHEN I DRAG AND DROP. Also, opening a directory should not open a new window. Directories are well nested.
  • USB flash drive support, including reading AND writing to NTFS and HFS+ partitions.
  • MS Office 2007 editors for Word, PowerPoint, and Excel documents.
  • PDF viewer.
  • Flash and Java support for the web browser.
  • Image, audio, and video codecs. Failure to include JPEG, GIF, PNG, BMP, music CD, MP3, WMV, MP4, MPEG, and DVD support is FAIL.
  • BitTorrent client, preferably Transmission.
  • A sane package system such as apt. MINIX‘s numbered list of 80-something packages does not count.
  • Terminal with bash.
  • Graphical text editor. Fuck you, I like to copy, paste, drag, and drop my code.
  • CLI text editor, either Vim or Nano. I also like to edit code remotely.
  • Graphical WiFi manager with support for wireless B, G, and N. Should work with Apple WiFi cards, not because the API’s easy, but because Macs are some of the most common wireless devices on the market.
  • Whichever driver makes the volume buttons on my keyboard work.
  • Programming languages. Minimum: C, Java, Perl, and Python. Strongly desired: Ruby, Haskell.

Update: So it turns out Haiku (based on BeOS) is awesome. The livecd is small (500MB in an age when livecd’s are actually livedvd’s). Tracker and BFS are perfect for each other: Files can be searched while they’re being edited or even moved. It’s got a bunch of the requirements, but some aren’t installed by default (a poor decision, e.g. users must Google their hearts out to find a BitTorrent port for Haiku).