Thursday, February 6, 2014

Volumes

Where the hell are my disks? Even more generally, where are my storage devices and their volumes? I'm coming from this:

Finder, Macintosh System Software 7

I'd like to see my volumes, especially removable storage devices, appear like they do in Macintosh. NeXTSTEP, a distant cousin of Macintosh (without trying to copy it too much), could access volumes in its file manager. So, too, can GWorkspace, I'm told. Is it too much to ask to show me a USB flash drive on the desktop? Yes, it's a lot to ask I found out.

I plugged in the USB drive first.

Since I didn't know where my computer detects devices when they're plugged in, I had to list all of the devices first. This can be done with Linux's fdisk program, available to root users only. That means I had to become a super-user. Once I was super, I typed
fdisk -l
(that's a hyphen and lowercase "L") which lists available partitions/filesystems/volumes... whatever. Correct my nomenclature, computer scientists.

fdisk -l lists available partitions. The USB drive device is highlighted.
On this computer, the USB drive happens to be found at "/dev/sdb1". This location may be different on other computers.

Now I have to tell Linux where to mount the USB drive, which makes it available to play with. The "mount points" are found in a text file named fstab which is short for "filesystem table." Again, only super-users are allowed to make changes to fstab.

As a former SimpleText junkie on Macintosh, I prefered to try GNUstep's version, TextEdit, to add info to fstab. If you prefer vim or some other text editor, use it.

Type
TextEdit /etc/fstab

Editing the filesystem table.

Click to the very last line and type
/dev/sdb1 /media/usb0 auto defaults,users 0 0
Press Enter to insert a blank line at the end. You can put in more spaces to make the sections line up, but one space between each section is sufficient. The first section, "/dev/sdb1", is the device where the USB drive is located. "/media/usb0" is a directory that we haven't made yet. The other sections tell Linux to automatically mount the device and make it available to everyone. Press Alt-S and Alt-Q to save and quit.

Almost done, we have to create the "mount point" directory. Just type
mkdir /media/usb0
We need to tell GWorkspace to look at the mount points. In XTerm, first return to normal user mode, then invoke SystemPreferences. Type
exit
SystemPreferences
Click the Volumes icon.

Adding mount points to the Volumes preferences.

Under "mount points for removable media", click the "remove" button a few times to clear out the placeholders. In the entry field, enter /media/cdrom0, and click the "add" button. Enter our new directory, /media/usb0 and click add again. Click the "set" button to save and quit System Preferences.


Finally, quit XTerm and GWorkspace (Shift-Alt-Q). Load GWorkspace again. The USB drive should appear on the desktop. You may also scan for drives using GWorkspace's menu command Tools > Check For Disks.

The drives have appeared.

Now how to eject the volume?

Monday, January 27, 2014

Network

Once when I was king...

I'm sorry, but the days of installing programs from disks are over. In fact, the days of having a localized operating system are over, since computer-like devices seem to be reverting back to empty network terminals. It's a grand idea: keep your operating system, programs, and files on servers so you can access them anywhere. Linux is heavily dependent on a network, though you can get a relatively recent distribution of it by downloading several gigabytes of DVD images. The fun begins when you make the choices about what you want on your system. Aside from a window manager and file manager, you may wish to have an internet browser to research what you don't know about Linux (like me).

Despite Window Maker's vestigial Netscape icons taken from the NeXTSTEP interface, that browser won't work so well on today's internet. Under normal circumstances, I would have installed Firefox, except...

Oh dear. There's no Firefox.

...the standard Debian software repositories don't have Firefox. That's not to say it's impossible to get genuine Firefox installed; there are ways to do it. To keep things easy and simple, I went for Iceweasel, which is the exact same browser, but without the Firefox logo. Our contemporary internet is quite dependent on Adobe's Flash player, so you may want that, too.

If you're in Window Maker already, open XTerm. First become a super-user and then type:
aptitude install iceweasel flashplugin-nonfree
Assuming you granted access to non-free software during the Debian installation, this should give you a working browser. But how to start it? How do you start any program?

First return to being a regular user (type exit) and in XTerm type
iceweasel
Boom!
Now how to get a double-clickable Iceweasel icon on the workspace that's always there? Drag the window up to the right and you will see a new icon in the lower-left corner. Drag it under the last icon in the dock and it will stay put forever.

Move the window a bit to the right. Hello little weasel!

Drag the Iceweasel icon to the dock.

Now you don't have to type a command to start Iceweasel. Just double-click it!

Wednesday, January 15, 2014

Desktop

GNOME, Unity, KDE, LXDE, and Xfce are all common desktop environments for Linux. If I had to choose one of them, it would be GNOME 2 which is a pain to install now because typing aptitude install gnome will get you GNOME 3 instead. No, I want to create my own environment, which admittedly, is a highly unpleasant task for a Macintosh user. Honestly, I've already typed more commands than I wanted to.

The one requirement: this desktop needs to get the hell out of my way. The result: Window Maker, as recommended by several forums of satisfied users. Window Maker is a window manager which simulates using the NeXTSTEP interface, though many actual users of NeXT computers seem to dislike it, or even have outright contempt for it.

GNUstep, the collection of tools which complements Window Maker, gives you the file manager. Though they are completely separate projects, together Window Maker and GNUstep compose what I call a desktop environment.

Install Window Maker and GNUstep.
As a super-user, type
aptitude install wmaker gnustep
Something new I learned: you can install multiple items in the same command. Just separate the package names with space.

To start Window Maker and get back to civilization, exit super-user mode first and start X.
exit
startx

Window Maker's first start

After a few moments, you will be greeted by the Debian spiral, a few icons, and most importantly, a pointer.

Window Maker relies heavily on the right mouse button. At the first right-click, you will be greeted by the Applications menu. You can point through deepening levels of menus from this main one. I decided to first change the background to a solid color.


For the other half of the desktop, the file manager, let's add it to the list of icons. The file manager part of the GNUstep package is called GWorkspace. Officially, GWorkspace is considered a "workspace manager," but since it can play with files and directories, I'm using it as a file manager. Right now, GWorkspace can only be opened by a typed command. Right-click to show the Applications menu and click XTerm to open a terminal.

Starting XTerm

 Type
GWorkspace
Use XTerm to start GWorkspace.
GWorkspace
Now we have a graphical way to play with files! Notice at the bottom left corner there are two icons: a computer monitor and a filing cabinet. These icons tell you what applications are currently running. GWorkspace is the filing cabinet. Since I wanted to quickly access GWorkspace, I made it a dock icon by dragging the icon up to the right.

Create a new dock icon by dragging to the dock area.
In Macintosh, Windows, GNOME, and others, the desktop is always present. It's actually a real directory in which you can make a big mess. I wanted the desktop to always be present on startup, so I had to tell GWorkspace to start when Window Maker starts. Quit GWorkspace first.

Quit GWorkspace. Hit the road, Jack!
Open popup menu on the GWorkspace icon by right-clicking its dots.
Right-click on the three dots at the corner of the GWorkspace icon and choose Settings...

Start GWorkspace automatically on startup.
Check the box labeled "Start when Window Maker is started".
(Just a note: you may find that having GWorkspace always present is a just a nuisance. It's not required to have it start when Window Maker starts.)

Last for this day: saving the session automatically. In Macintosh, when you change something, it's more or less permanent until you change it again. In Window Maker, you have to save your current state by choosing Session > Save Session from the Applications menu. Let's make this automatic.

Double-click the "circle stairs triangle" icon (Window Maker logo) at the top right. This opens a program named WPrefs, which is kind of like the General Controls panel on Macintosh.

Expert User Preferences
Drag the upper scroll bar to the right and click on the professor's cap (Expert User Preferences).
Check the box which reads "Automatically save session when exiting Window Maker." Click the Save button.

Shut Down
There is no command (yet) to shut down the computer from Window Maker. You have to make one. That'll be for next time. For now, I will exit the session by choosing Session > Exit Session from the Applications menu.


Once I'm back at a command prompt, I become a super-user and type
poweroff
This shuts down my computer. In Linux, the command "shutdown" does something different from what you might expect. Somebody tell me about it because I don't know.

Using "poweroff" to shut down system

Tuesday, January 14, 2014

Sound

Getting sound to work has always been a pain on Linux. Not Macintosh, what with its standardized hardware and drivers written especially for it. I got sound to work like this:

Install ALSA.
Ensure you are a super-user and type:
aptitude install alsa-base
Answer "Y". This gives you ALSA, the set of drivers and utilities for making sound. Guess what? Often times, it doesn't work as-is. You may need to initialize it.

Initializing ALSA
Type:
alsactl init
Initializing resets the sound mixer to mid-range defaults for the system.
To take a look at this, type:
alsamixer
ALSA Mixer

Press Esc to exit the mixer.

Now test the speaker, again as a super-user:
speaker-test
Speaker test
which should make some noise. Press Control-Break to exit the test.

X Window System and Beyond

The X logo from A/UX.
If we're going to talk about the fatty foods of Linux, users of the freaking amazing Raspberry Pi microcomputer will tell you the X Window System is one of many greaseballs to avoid.

Except I need X.

Why? I want windows. That's why. Besides, even Apple's distribution of UNIX, A/UX, had X, and that was crazy bananas. Honestly, who creates a UNIX environment that will only run on hardware with a real floating-point unit and paged memory management unit? Stupid Apple Computer. Anyway, I digest... X, that is.

What in the hell is X? It's one of the mysterious piles of goo in Linux that can send you toward a graphical user interface. But, as I can understand, X itself does not produce a graphical interface. Instead, a window manager uses routines in X to generate the interface. Correct me if I'm dumb, but that's how I understand it.

To get X, I needed to access something called the "Debian package repository," and to do this, Linux people use a program called a "package manager." One such package manager, aptitude, automatically downloads all of the modules and installs the software for you.

Of course, you must be a super-user to install software. If the command prompt is a number sign "#", then you're a super-user.

To install the X Window System, we install "xorg"
Type:
aptitude install xorg
Answer "Y" because you actually want to install xorg.

Move on with life.

Wednesday, January 8, 2014

Simulation

Research has suggested the key to running efficiently on a low-performance machine is to remove the stuff that eats processor cycles. I began by ditching Ubuntu in favor of Debian, a long-lived and well-developed distribution of Linux,... that is, GNU/Linux. In reality, I don't think it really matters. What matters is the desktop environment.

In the cutie pie Hello-Kitty-world of Macintosh, that is Macintosh running System 7 through 9, the essence of the operating system was easy to find. There was one main file: the System "suitcase", which contained ROM patching routines, GUI elements, and the reactor core that got disks booting. The other critical file, the Finder, gave you a desktop to copy files, make directories, and erase volumes among other things. Since a working Debian installation was the goal, I thought I'd be getting a nice GUI and a graphical way to manipulate files and volumes. I came to understand this combination of functions composes a "window manager" and a "file manager".

Linux by itself is a file manager: it can make files, delete files, make directories, copy files all by typing commands you have to remember. I didn't want to do that... all of the time.

Researching again, Xfce and LXDE came up. LXDE, in particular, was recommended for low-performance systems because it does not use a compositing window manager. Delight! I tried it. After an hour, I found it to be intolerable. I don't know why. I just didn't like it. My brother, the Linux boy, said, "Try Xfce."

I tried it. I didn't care for it.

These installers just give you tons of trash programs I don't want, like LibreOffice. Then it hit me: these are desktop environments. GNOME, Unity, Xfce, and LXDE are all basically window managers and file managers which have been configured to work together with a common graphical theme. Why can't I build such a thing?

Once again, I inserted the Debian "Wheezy" CD. It was officially called the "Net Install", which means, the crucial modules to the operating system are contained on the disc, but all of the utilities, drivers, and other fluff had to be downloaded via internet. This time around, though, there would be no regular desktop environment.

The next screens were simulated in Oracle VirtualBox, a great way to test out Linux in Windows and recover from your stupid mistakes (plus it's free). Incredibly, you can also install this on Linux and emulate Linux in Linux.

Select "Advanced Options"

Select "Expert Install"

Answer their silly questions.

Debian's install procedure is fairly straightforward: detect devices, erase the target disk, define who can use the computer, and put a basic operating system on the disk.

Use non-free software? You betcha!

When it asked, "Do you want to use non-free software?" I had to look this up. It seems "non-free" means software (mainly device drivers) that cannot be freely maintained by the Linux community because it is the intellectual property of corporations. It boiled down to: do you want to use your video card or not? Um, yes!

Don't install the desktop environment. Print server? Who needs that crap?

Do I want to install the "Debian desktop environment"? No! Hit Space Bar to clean out the fat.

A while later, the disc shot out of the drive like a crazed slice of toast, and after a brief intermission with the power on self-test, I was greeted with "debian login:" How endearing.

The first login

I remembered my password!

At this point, I'd had some experience with Linux, rather, UNIX, since that's what the servers at UCSD used when I attended school there. I also knew from Ubuntu, that to do much else, I needed to be a super-user.

And now we are "root". Jolly toot.

To become a super-user, you type "su" and enter a password. How easy! Now instead of a dollar sign prompt, I have a number sign prompt! A super-user has access to the intimate files that define the operating system. He can install files, delete files, and rename them silly things to cause confusion. I needed to install files. Where to begin? Oh yes... the X Window System.

In a nutshell:
  1. Download a copy of the Debian "Wheezy" Net Install ISO file.
  2. Make a CD from the ISO file (such as with ImgBurn, Nero, Toast)
  3. Put the CD in the target computer.
  4. Install Debian, don't install a desktop environment.
  5. Restart and login.
  6. Become a super-user.

Tuesday, January 7, 2014

Change: It was hard.

Macintosh IIci Owner's Guide, p. 82
I've been using Macintosh just about my whole life. Our family purchased a Macintosh IIci sometime in 1989. It was secondhand from my grandmother, a hilarious woman who meant well, but was talked into buying an $8,000 computer system. Large corporations wouldn't have invested in such power at the time, but here we were with this machine that could fly circles around the globe compared to my friends' IBMs. My dad was a designer, though before the entire industry digitized itself, he saw the majesty of such potential at his own company. Why contract out design work when it could be accomplished on a IIci with Adobe Illustrator in-house? His proposal to get these machines fell on deaf ears. Nevertheless, our family remained loyal to the Apple line, following with a Power Macintosh 7200, and ending with my iMac G3.

While in college in the early 2000s, I experimented with Mac OS X, though my iMac still seemed to prefer for Mac OS 9. It was only 700 MHz in the first place. Why would Apple think the Mac OS X compositing window manager would run tolerably in such tight quarters? As such, I remained with System 9 until quite recently, when the iMac's CD drive failed. It had been replaced once before, along with the speakers, the hard drive, the keyboard—I kept the magic alive. At this point, I'd had enough of disassembling the insane polycarbonate puzzle that concealed the iMac's guts. The 1990s Macintosh vs. Intel war finally ended in my mind... I was ready to jump to the "new" world.

New for me meant switching to a more open-source world. More of a "Woz" world, and less of the appliance-y "Jobs" world. Particularly, it would be a world that did not involve the obligation to protect oneself from viruses. I had seen my father struggle with antivirus software when he made the switch to Windows in the year 2000. No, if I was going to make the jump to an Intel machine, I would use Linux.

Linux in the '90s was a scary proposition, especially if you were a "dumb" Mac user. I had no real programming experience, and my only exposure to a text command terminal was from the Apple IIe I had bought at a garage sale in 1998. At the recommendation of my brother who lives in Linuxland, I should begin with Ubuntu, which I think means "Linux for dumb-butts."

But what to put it on?

My dad had long-since abandoned his Dell OptiPlex in the closet for a doped-out 64-bit system he built himself. Seeing as the Dell was trash, starting in 2010, it would be my new Linux baby.

For about three years, I used Ubuntu "Lucid Lynx." Ubuntu delights in code-naming its operating systems with alliterative animal names. (See what I did there?) I delighted in the user experience under the GNOME 2 desktop environment. What had always been a pox on Linux users, the drivers, were now only mildly unpleasant to configure. Of course, we Macintosh users never really had to worry about drivers because the hardware was all mostly standardized. Oh, so much to learn!

Unity: Fatty fatty 2 by 4, can't get through the kitchen door!
 Then the Unity and GNOME 3 environments came out. What I didn't know at the time was that GNOME, the go-to desktop environment for many Linux distributions employs what's called a "compositing window manager." This makes your windows all glassy and see-through which is fine on machines that have the resources to support such a light show. I don't have one.

Dell OptiPlex GX400—the glowing phosphors
My Dell uses an Intel Pentium 4 chip, and at 1.3 GHz, it's still faster than most netbooks out there today. Not bad for a machine built in the year 2000. Still, I'm leaving Ubuntu for a new operating system (and window manager) that's not such a pig. Here is what I learned: