mdlbear: (technonerdmonster)
2019-09-28 04:43 pm

Sable and the turtles: laptop configuration made easy

I recently bought a new-to-me Thinkpad X230, and in keeping with my ongoing theme of naming thinkpads after their color, I called it Sable, which in addition to being the heraldic name for the colour black is also a small dark-brown animal in the mustelid (weasel) family.

I've become quite fond of Sable. It's only an inch wider than my former laptop, Cygnus (named after Cygnus X-1, the first X-ray source to be widely accepted as a black hole), about ten times faster, and the same weight. The extra inch makes it exactly the right size for me to put one of my Thinkpad USB keyboards flat on top of it. One may wonder why I would even want to do this, but I can move the keyboard to my lap when one of the cats wants to sit on my desk. (The cat is almost always Desti, who is also black, but naming a laptop after her would be confusing.)

Anyway.

One of the problems with getting a new computer is getting it configured the way I want it, which usually means "pretty much the same as the last one". Most people do this by copying as much as they can off the old one, (on Linux that's typically their entire home directory), and then installing the same collection of applications (packages, in Linux terminology). It's tedious, and when the architectures or operating system versions are different it leads to a wide range of random glitches and outright bugs that have to be tracked down individually over the course of the next week or so. Even if it doesn't, home directories tend to include a large amount of random stuff, like downloads and the contents of your browser cache, that you don't necessarily want.

And if you're trying to set up a home directory on your web host, or your work machine, or something tiny like a Raspberry Pi, well... What you really want to do is start afresh and just install what you really need.

That's where the turtles (because home is wherever you carry your shell, as it says in the song) come in. Specifically, Honu, which is a collection of makefiles and scripts that does almost all of the setup automagically.

Honu (Hawaiian for the green sea turtle) requires nothing more than a shell (the Linux/Unix command-line processor, and anything Posix-compatible will work), an SSH client, the git version-control system, and make. In fact, if you can install packages on your target system, the first thing Honu's bootstrap script will do is install the ones you don't have.

Make was one of the first programs for building software automatically, and I'm very fond of it. It lets you define "recipes" -- actually, short shell scripts -- for building files out of their "dependencies", and it's clever enough to only build the things that are out of date. It can also follow rules, like the built-in one that tells it how to use the C compiler to turn a .c file into a .o object file, and the linker to turn a .o file to an executable file. (On Windows the executable file would end in an extension of .exe, but Unix and its descendents don't need it.)

Make can also follow chains of rules, so if your source file changes it will rebuild the executable, and (unless you tell it not to) delete the object file after it's sure nothing else needs it. And rules don't have to result in actual files -- if you give it a recipe for a "phony" target it will simply notice that it isn't there, and run the recipe every time. This is good for things like "install-pkgs" and "install", which are Honu's main make targets.

Turn it loose with a make command, and Honu's makefiles happily go about installing packages, creating directories, and setting up configuration files ; the whole process takes well under an hour.

I wrote Honu to be pretty generic -- it knows a lot of my preferences, but it doesn't know my name, email address, current projects, or hosting service. I also have another package, Mathilda (our name for the particular happy honu who narrates "Windward"). Mathilda sets all of that up, pulling down the Git repositories for my current projects, blog archives, websites, songbooks, build systems, and so on; putting them in the right places so that I can sit down in front of Sable, open the lid, and be right at home.

...Except, as in most moving projects, for tracking down all the little pieces that got left behind, but that only took a couple of days.

...

...And in case you were wondering what happened to this week's Songs for Saturday, you can read more about "Windward" in Songs for Saturday: Travelers and The Bears, from 2015.

Where the wind takes us next year no turtle can tell, But we'll still be at home come high water or hell, Because home is wherever you carry your shell.

Or $(SHELL), as the case may be.

Another fine post from The Computer Curmudgeon (also at computer-curmudgeon.com).
Donation buttons in profile.

mdlbear: (technonerdmonster)
2019-03-01 04:50 pm

Writing Without Distractions

A few years ago I read an article about how to set up a Mac for distraction-free writing. I can't seem to find it anymore (okay, some rather large value of "a few"), but "there's an app for that" now. Many writers on my reading list are talking about distraction-free writing tools like iA Writer (seems to be the one people are most impressed by at the moment) and FocusWriter (free and cross-platform). There's even an Emacs mode.

These all work roughly the same way: run a text editor in full-screen mode, and write plain text with simplified markup in a fixed-width font. Worry about formatting later, if at all. Grey out everything but the sentence or paragraph you're working on. The article I can't find -- written before specialized writing programs and even before the web -- suggested getting the same effect by taking all of the icons off your screen and setting your default font to Courier.

If you're happily using one of these tools, you may want to skip ahead to the section on formatting, and maybe fill in the gaps later. If you're still using a word processor, or typing into a text field in a browser (even in "rich text" mode), you should probably stick with me.

What You See is All You Can Get

WYSIWYG (What You See Is What You Get) word processors are arguably the worst thing to have happened to writing in the last half-century. They have three huge problems:

The first is that they make a promise they can't deliver on. In fact, they should be called WYSIAYCG -- What You See Is All You Can Get. If your word processor doesn't support kerning, multiple fonts, paragraphs with hanging indents large initial capitals, mathematical notation, or internal cross-linking, you can't use them. If they make it difficult to use these features, you still won't use them unless you absolutely have to, and then you find yourself wasting time doing clumsy work-arounds. Think about how you'd go about formatting song lyrics with chords over them. Shudder. How about making the space between sentences equal to one-and-a-half times the space between words?

The second is related to the first: word processors target a specific page layout. If you want to make a printed book, a web page, and an eBook, you're going to have to do extra work to accommodate the differences, or settle for something that has about the same level of mediocrity in all of those environments.

At a lower level, word processors use proportional-spaced fonts. That means you have to peer over the tops of your glasses to see whether that character at the end of the sentence is a period or a comma, and if your hands are shaking from too much coffee you'll have trouble selecting it. Or putting the cursor in front of it without selecting it, if you want to add a few words.

The third is that they distract you from actually writing, tempting you to fiddle with fonts, reformat your footers, worry about word-wrapping and hyphenation, and place your page breaks to avoid widows and orphans, at a time when you should be concentrating on content.

There's a fourth, mostly unrelated, problem which is so pervasive these days that most people accept it as The Way Things Are: if you accidentally select something and then type, whatever you selected goes away. In almost all cases, even if your word processing has an "undo" feature, this can't be undone. So let's talk a little more about...

Editing

Anyone who's been hanging around me long enough is expecting me to mention GNU Emacs at some point, and I will. But there are plenty of other text editors, and most of them are perfectly usable. They're often called "programmers' editors".

I'm not going to tell you how to use a text editor here; I'm just going to tell you more about why, and point you at some resources. Michael Hartl's Learn Enough Text Editor to Be Dangerous is a pretty good introduction to most of them, though you may want to skip the chapter on Vim. It gives short shrift to Emacs, but fortunately the first thing on your screen after starting Emacs is the tutorial. Start there.

So, why would you, a writer, want to use a programmer's editor?

One reason is that programmers have been writing on computers for a quite a bit longer than writers have, so text editors have a considerable head start. More to the point, programmers use their own programs. This gives them a strong incentive to make their programs fast, efficient, and powerful. Not every programmer who has a problem with their text editor is going to fix it, but enough do to make them improve rapidly.

Word processors, on the other hand, are written by programmers, but they are usually written for ordinary users, not experts, and they're written to be products, not programming tools. As products, they have to appeal to their customers, which means that they have to be easy to learn and easy to use. They don't have to work well for people who spend their entire work day writing -- those are a tiny fraction of the customer base.

Another reason is that text editors use fixed-width fonts and encourage you to use comparatively short lines (typically 72 or 80 characters, for reasons that date back to the late 1880s). Paragraphs are separated by blank lines. Since line breaks inside of paragraphs are ignored by formatters, some authors like to start every sentence on a new line, which makes them particularly easy to move around, and makes it easier to spot differences between versions.

A text editor also makes you more efficient by giving you a wide range of keyboard commands -- you can write an entire book without ever taking your fingers off the keyboard. (This is, in part, due to their long history -- text editors predate graphical user interfaces by several decades.) And most modern text editors are extensible, so that if you want new commands or want them to behave differently for different kinds of markup, they're easy to add. (I have a set that I use for my band's lead sheets, for example, and another for my to-do files.)

Markup

Up until somewhere around 1990, everyone who did any serious writing knew how to edit a manuscript using proofreaders' marks. Manuscripts were typed double-spaced to leave room for insertions, corrections, and cryptic little marks between the lines and in the margins. This was, logically enough, called "marking up" the manuscript. You've probably heard of Markdown. You've certainly heard of HTML, which stands for "HyperText Markup Language". HTML, in turn, is a variant on SGML, "Standard General Markup Language". You may have heard of LaTeX, which is the standard for academic -- especially scientific -- writing.

Markup languages let you separate content writing from formatting. Semantic markup lets you add additional information about what the things you are marking up mean; it's up to a stylesheet to determine what they look like . In HTML, you don't have to <i>italicize</i> something, you can <em>emphasize</em> a talking point, or <cite>cite</cite> a book title. They usually look the same, so most people don't bother, until they decide to turn all the book titles in their two thousand blog posts into links.

You can see how using semantic markup can free you from having to think about formatting while you're writing. There's another, less obvious advantage: you aren't stuck with just one format. By applying different styles to your document you can make it a web page, a printed book, an eBook, a slide show, or an email.

Another advantage of markup languages is that all of the markup is visible. This week's xkcd: "Invisible Formatting", shows how you can accidentally make a boldface space in the middle of normal text, where it can distract you by making an insertion unexpecedly boldface. It may also make subtle changes in line and word spacing that are hard to track down down.

There are two main kinds of markup languages: ones like Markdown and Textile, that use simple conventions like **double asterisks** for strong emphasis, and the ones that use tags, like <cite>HTML</cite>. LaTeX and Restructured Text are somewhere in the middle, using both methods. You can be a lot more specific with HTML, but Markdown is far easier to type. Markdown and Textile let you mix in HTML for semantic tagging; Markdown, Textile, and Resturectured Text all use LaTeX for mathematical notation. Some formatters let you embed code with colored syntax highlighting.

These days, it looks as though Markdown is the most popular, in part thanks to GitHub; you can find it in static site generators like Hugo and Jekyll, and it's accepted by many blogging platforms (including Dreamwidth). Unfortunately they all accept different dialects of Markdown; there is an enormous number of Markdown-to-whatever converters. But the nice thing about markup languages is that you aren't stuck with just one. That brings us to...

Formatting

Once you have a file that says exactly what you want to say, the next thing you'll want to do is format it. Formatting programs (a category that includes LaTeX, web browsers, website generators like Jekyll and Hugo) all use some kind of style sheet that describes what each kind of markup is supposed to look like. You probably know about CSS, the "Cascading Style Sheets" that are used on the web. LaTeX has a different set, written in the typesetting language TeX.

If you wrote your file in HTML and you want to publish it on the web, you're done. You may want to make your own stylesheet or customize one of the thousands that are already out there, but you don't have to. Modern browsers do a perfectly reasonable job of formatting. CSS lets you specify a separate style for print, so when a reader wants a printed copy it actually looks like something you'd want to read on paper.

If you wrote your file in LaTeX and you want to publish it on paper, you're done -- it's safe to assume that LaTeX knows more about formatting and typesetting than you do, so you can just tell LaTeX what size your pages, pick one of the hundreds of available stylesheets (or write your own), and let it make you a PDF. You can change the page size or layout with just a few keystrokes.

If you wrote your file in Markdown or some other markup language, there are dozens of formatting programs that produces HTML, LaTeX, PDF, or some combination of those. (My favorite is Pandoc -- see below.) Markdown is also used by static website generators like Hugo or Jekyll, and accepted by everything from blogging sites to GitHub. If you're publishing on the web or in some other medium your formatter supports, you're done.

The advantage of separating content from format is that you're not stuck with one format. Web? Print? eBook? You don't have to pick one, you have all of them at your fingertips. There are hundreds of conversion programs around: html2latex, latex2html, kramdown (which GitHub uses),... For most purposes I recommend Pandoc. The subtitle of Pandoc's home page calls it "a universal document converter", and it is. It can convert between any of the the markup languages I've mentioned here, and more, in either direction. In addition it can output eBook, word processor, wiki, and documentation formats, not to mention PDF. As an example of what it can do, I write these posts in either HTML or Markdown as the mood takes me, and use Pandoc to convert them to HTML for Dreamwidth and plain text, stripping out the tags, so that I can get accurate word counts.

Version Control, etc.

Text files with short lines are ideal for other tools in the Linux (and Unix -- did you know that Unix was originally used by technical writers?) environment. When you compare two files, a line-by-line comparison (which is what diff gives you) is more useful than a paragraph-by-paragraph comparison (which is what diff gives you if you don't hard-wrap your text). Text editors can run formatters, spelling checkers, search tools, and others, and put the cursor on the exact line you're looking for. Want to search nearly 6500 blog posts for your favorite quote from G. K. Chesterton? Took me one line and a little over 4 seconds.

        time find . -type f -exec grep -nHi -e 'rules of architecture' {} +

Many formatting tools simply ignore single line breaks and use a blank line to separate paragraphs, examples include LaTeX and most (though not all) Markdown translators. HTML ignores line breaks altogether and relies on tags. I take advantage of that to make HTML more readable by indenting the text by four spaces, and using 80- or 90-character lines. If you want an example and you're reading this page in a browser, just hit Ctrl-U to look at the page source. Compare that to web pages made without hard-wrapped lines -- you may find yourself scrolling dozens, if not hundreds, of characters to the right because browsers don't do any wrapping when displaying source. Nor would you want them to.

The biggest advantage (in my not-so-humble opinion) is version control. (Those of you who've been around me were just waiting for me to mention git, weren't you?) Being able to find all the changes you made this week -- and why you made them -- can be incredibly useful. Being able to retrieve a file from three years ago that you accidentally deleted is priceless.

This post is already pretty long, so the next post in this series is going to be about version control (and the other things you can do with git and GitHub; it's not just version control) for writers. Stay tuned.

Resources

Another fine post from The Computer Curmudgeon (also at computer-curmudgeon.com).

mdlbear: blue fractal bear with text "since 2002" (Default)
2017-05-14 02:35 pm

Done last week (20170507Su - 13Sa)

It's been another rough week. This week it's been mostly health care -- I found out Tuesday that Amazon hadn't continued my health care as they said they were going to, so I was unable to order Colleen's humira. (Which, at $1800 for two doses, isn't something one wants to pay for out of pocket.) My HR contact is looking into it, but it took several days to get through; meanwhile I went online and signed up for Medicare Part D and identified a Medigap provider (ExpressScripts and Premera Blue Cross; both for continuity and because they seem to get top reviews. Who knows how long that will last under Trump(Doesn't)Care.)

I know there's something called compassion fatigue. Is despair fatigue a thing? Or is that just another phase of despair? I find myself incapable of being surprised at whatever outrageous thing Trump and the "Republicans" have done each day. (I put "Republicans" in quotes because they are rapidly turning this country into a right-wing dictatorship. I feel powerless to stop them.)

Onward. Had a really good trip with Colleen up to Whidbey Island; we went up the whole length of it and came back by way of Deception Pass. It's been a very long time since Colleen and I went out for a drive that long that was just a drive -- our occasional loop drives along the California coast were probably the last ones. It was a little too long, but it went ok.

I've been spending much of my spare time catching up on my reading. For some reason I'd stopped reading LWN (Linux Weekly News) sometime around the first of the year; in the last two weeks I've completely caught up. You can see the results in the links, most of which came from LWN, or indirectly by way of Sacha Chua's awesome Emacs News. I've also been finding Whidbey-related links. At some point I need to go back through my to.do archives, extract all the links, and aggregate them. They're kind of useless scattered across blog entries the way they are.

I've even done a little walking (not quite every day, and not much because I seem to be walking at about half my old 3mph pace), a little music, and a little hacking (almost entirely cleanup tasks). On the whole, I appear to have been keeping myself busy in a relaxed kind of way, though I haven't yet fallen into any kind of routine. Later, hopefully.

But.

My last few trips down to the house we used to call Rainbow's End (should we call it "Rainbow's Ended" now?) have been increasingly sad and discouraging. We put a lot of ourselves into that house; it was a large part of what we were as a family. Now we're scattered. We'll come back together, mostly, on Whidbey Island in a little over two months; it may very well be wonderful -- I hope it will -- but it won't be the same. I can't keep from thinking of what I might have done differently, over the last few decades(!), that might have made it possible to stay there. Hell, we all made decisions that seemed like the right thing at the time. Can't be fixed.

"I can't fix it!" is probably what I say most often when things are going badly. It always feels like my fault. I don't think I can fix that, either. I should shut up and go for a walk with Colleen.

Notes & links, as usual )

mdlbear: blue fractal bear with text "since 2002" (Default)
2016-06-28 09:10 pm

[I wrote a thing] Xmonad (part 2 of several)

You may want to start with Part 1

 

Xmonad is a tiling window manager. That means that, with very few exceptions, it lays out all of the windows in your workspace so that they completely fill the screen. You can have multiple layouts, and flip between them with a single keystroke. You can bring a workspace (there are 9 by default, but you can add more) to your screen with a single keystroke, or send a window to a workspace.

And the whole thing is configured using a text file that is actually a program, written in the functional language Haskell. I'll get to that later.

One of my main gripes about Gnome, etc., and one of the things I miss the most about CTWM, is that when you first start a program its window shows up at some random location on the screen, with whatever size the program thinks is appropriate. If you don't like those choices you have to move and resize the window yourself, and then do it all over the next time you log in. (There are some exceptions -- many newer programs remember where you put them last, and older programs, from the CTWM era, can be given a starting geometry.)

Xmonad's layouts are all deterministic, which is to say, predictable. When you start a program, you know exactly where it's going to be on the screen. When you change the layout, you know where everything is going to go. If you want to move a window into the main position (most layouts have one; e.g. the left-hand column) it's (as usual) just one keystroke to put it there.

But the best thing, and the reason I switched to xmonad in the first place, is the way it treats multiple monitors: it simply assigns one workspace to each monitor.

Undock your laptop, and its screen stays exactly the same. The workspaces that were shown on the other screens simply go back into hiding with all the others, and are still only a keystroke away. When you have multiple screens, you can move a window to another screen, or bring a workspace to a screen, or warp the pointer to another screen, all with single keystrokes.

When you go to a conference room and plug in a projector, a workspace immediately shows up there and its layout automatically adjusts to the projector's resolution and aspect ratio. When you get a new computer -- all the developers at work got new laptops just a month or two ago -- just copy your configuration files to it and everything will be exactly the same as it was on the old one. (Sometime later I'll write about my portable configuration, which makes it possible for me to set up my entire working environment in mere minutes.)

 

So let's go a little deeper into those magic keystrokes. First of all, you have to know that all of the commands (you can't really call them shortcuts) include a key that xmonad calls "Mod" (short for "modifier", of course). Mod is initially defined as Alt, but the first thing any Emacs user is going to do is redefine it as something else, usually the "logo" key. (That's the one on the left between Ctrl and Alt that usually has a Windows logo on it. If your keyboard has replaceable keys you may be able to get a penguin for it.) On old laptops that don't have a logo key I use Ctrl-Alt, but that's a matter of taste.

You also probably want to know that Mod-? gets you a list of all the commands. And that there's a fantastic collection of tutorials, documentation, and sample configuration files at xmonad.org.

When xmonad starts up, you see a totally empty, black screen. Most people, myself included, add a status/navigation bar at the top, but you don't have to. I'll get to that later. You can start a program by typing Mod-P, or open a terminal window with Mod-Shift-Enter. You will immediately notice that the first window you open fills the screen. If you open another, xmonad will tile the screen with them, showing them side by side.

If you start a third program, it will get added to the right-hand column. You can probably see where this is going. When you move the mouse pointer into a window, it gets a thin red border to show you that it has "focus".

If you decide that you started things in the wrong order, move the pointer into the window you want to put in the left-hand column (the "master" column) and hit Mod-Enter. You close a window you're done with using Mod-Shift-C.

Here's where it gets interesting: Mod-Space will switch you to a new layout, with the master column turning into a master row, and all the other windows across the bottom. Hit Mod-Space again, and the currently-focused window goes full-screen. (I reconfigure my full-screen layout to put a row of tabs across the top. Wondering how to see the hidden windows? Mod-Tab moves focus to the next window in the stack. It also works in other layouts, so you don't need the mouse to move focus around. If you spend most of your time in a terminal and an editor like vim or emacs, you can throw your mouse away and still be productive. Mod-Shift-Tab moves focus to the previous window.

Mod-2 puts you into a second workspace. There are nine of them. (I add two more -- 0 and -.) If you want to move a window, say from workspace 2 to workspace 1, use Mod-Shift-1. That's kind of a recurring theme in xmonad -- Mod-something does one thing, and Mod-Shift-something does something related.

You can see that in action if you add an(other) monitor. Now, workspace 1 is in the left-hand screen, and 2 is in the right-hand screen. Think of the two of them as West and East.

Now, Mod-w will move the focus (and the mouse pointer) into the West screen, and Mod-e will move the focus into the East screen. Mod-1 through Mod-9 will bring that workspace into whatever screen has the focus. If the other workspace was already visible, they trade places. (Some people don't like that, so you can change it so that it just moves focus into the other screen if you select a workspace that's already visible.)

Add a third screen to the right of East, and call it Right. Now, Mod-r and Mod-Shift-R do exactly what you would expect. (There are no bindings for T, so I suppose that if you have space for a fourth screen you could use it for that.)

There are more key bindings, to move focus (Mod-j and Mod-k focus the next and previous window, respectively; shifted, they swap the focused window with the next or previous window), to shrink and enlarge the master area (Mod-h and Mod-l respectively), or increase or decrease the number of windows in the master area (Mod-Comma and Mod-Period respectively).

mdlbear: blue fractal bear with text "since 2002" (Default)
2016-06-26 11:13 am
Entry tags:

Done last week (20160619Su - 25Sa)

Not all that good a week. Continued lack of productivity at work, mainly because of meetings this time, but still... I want to take a vacation after Westercon, but I have goals that I can't meet if I do. Bletch.

I haven't done much writing, either. A reasonable amount on Monday, but only a little after that. Grump. Did do more cooking than usual: chicken tikka masala on Monday, and beef Stroganoff yesterday. That was a real win. Lots of shrooms. I note in passing that while Cash and Carry has great prices, it doesn't have a very big selection, and few if any small packages.

On the plus side, I did a pretty good job of noticing and identifying my mood Friday. On the minus side, the mood in question was despair. Cat therapy helps, but not completely.

A fair amount of computer-related work -- got my raspberry pi up and running, with both Raspbian and OSMC (on different cards). OSMC (Open Source Media Center) looks like it would work well as a music and video player. Being one of the original cards, it doesn't have much in the way of RAM, so it wouldn't work as a desktop with my current workload. I also swapped my desktop machine for one of the two that have been sitting behind my desk ever since we moved in.

Moderate amount of house-project work.

Notes & links, as usual )
mdlbear: blue fractal bear with text "since 2002" (Default)
2016-06-21 09:04 pm

[I wrote a thing] xmonad (part 1 of several, incomplete)

As I mentioned about a week ago, I've been trying to write more. And since my current obsession is a program called xmonad, well, ...

This is incomplete: it's about the first day's worth (I've been trying to write about 500 words per day). Comments and suggestions are, of course, welcome.

 

My new 27" monitors arrived at work; I took advantage of the change to rearrange my work space. Before, it was the set-up I've had for most of the last three years -- monitor in front on a stand, second monitor on the right, and my laptop on the left. The new laptop, however, has a decent keyboard (with trackpoint and three buttons), and the monitors between them occupy about 2/3 of the desk.

The new arrangement has the laptop dock under the "middle" monitor; the laptop, being a business-class Dell, has both a pointing stick and a middle "mouse" button. The laptop's keyboard is decent enough that it can replace the thinkpad keyboard I've been using for the last couple of years -- it's a high-end Dell, and has both a pointing stick and a middle button. (The middle button has part of the Unix desktop environment since the mid 1980s; it means "paste", and I use it all the time.) The monitors are about 50% bigger, pixel-wise, than the laptop, and are arranged "traditionally" with the laptop on the left.

You can probably see the problem with this arrangement. The total workspace is about 7000 pixels wide, and it's not even arranged in a straight line -- to get from the laptop to the "middle" monitor you have to move the cursor to the right, but the natural direction would be straight up. What's more, when you undock the laptop the whole thing collapses down to a "mere" 1920x1080. It's no wonder that most of the programmers in my team have opted for a single 30" monitor, and keep their laptop (almost invariably a mac) closed while they're using it.

Fortunately, I anticipated this problem months ago, and started using a window manager called xmonad.

 

One of the things I love most about Linux is the fact that the program that manages the layout of the screen and the behavior and appearance of the windows on it is not part of the operating system. It's a separate program, sensibly called a "window manager", and it runs in user space as a perfectly ordinary application that just happens to have a couple of extra hooks into X, which is the (also ordinary) program that actually controls the display, the keyboard, and the mouse.

Being an ordinary program -- and not even a terribly complicated one -- anybody can write one, and many people have. For a long time I was using one called TWM (Tabbed Window Manager, but the T originally stood for Tom's). Later I started using CTWM (Claude's Tabbed Window Manager), because it introduced the then unfamiliar notion of multiple workspaces. (Before CTWM, these could only be found in an experimental system at Xerox where they were called "rooms". Apple introduced them decades later, as part of MacOS X.)

You've probably heard of Gnome, KDE, and Ubuntu's horrible Unity desktop environments. Down at the bottom, they're just window managers plus a couple of utilities for doing things like putting up the familiar bar (Gnome calls it a "panel") full of menus, launcher buttons, clocks and other widgets. You can, in fact, run gnome-panel under any window manager, and I did for a while. They also include a "session manager", which handles things like starting the panel and making sure that applications get notified when you log out, so that they can save their state and exit cleanly. I've been using Gnome for years, and loved it for its configurability.

But Gnome's configurability comes with a cost -- every time you move to a new computer, you have to spend an hour clicking around in control panels and property windows to get everything set up the way you like it. And every time there's a major upgrade, something is a little different. It's a cost I no longer have to pay.


Part 2

mdlbear: blue fractal bear with text "since 2002" (Default)
2016-06-19 01:53 pm
Entry tags:

Done last week (20160612Su - 18Sa)

Moderately productive week. Lots of computer configuration and upgrading work, which is always an easy way for me to feel like I've done something, even if it isn't all that useful. I have a new desktop computer, in a nice little Shuttle box, but haven't fully switched over to it yet. Because browser tabs, mostly. (I also got the raspberry pi booting, finally. Which mostly required looking at the installed card and noticing that, not only did it not have an OS installed, but it wasn't flagged as bootable. The Pi is one of the original 512Mb ones -- it's dog slow. Still, it has a lot of potential as either a media center or a special-purpose controller. I'm guessing that used, older pi's are dirt cheap on eBay.

My new monitors arrived at work; I took advantage of the opportunity to re-arrange my workspace (see notes for 0615We) -- and to get back into writing, with xmonad as my first topic. Xmonad really wins for this, because the physical arrangement of the monitors becomes almost irrelevant. By moving the laptop in front of me (because it has a usable keyboard for once) with the dock under the monitor, I not only freed up a sizeable amount of desk space but freed up my second thinkpad keyboard to come home with me. Win.

Last weekend also included a lot of cleanup work in the garage and the back yard -- the huge piles of junk and lumber have been hauled away. I really hated to lose the lumber, but it had been out in the rain for too long. I was, however, able to save most of the hardwood.

As indicated, I have been writing (see notes for 0614Tu). My goal is to write 500 words most days. (I missed yesterday because I was hacking on my journaling makefiles, which sort of counts in terms of time if not bytes.) This post is intended to hit today's word count, and, no, I'm not going to count the notes.

So that raises a question for you, my loyal readers. The article I'm writing on xmonad isn't done yet, but I do have two days worth of work on it. Should I post "episodes" as I go along? Maybe I should phrase that differently -- would anyone object if I did post what amount to partial rough drafts? Feedback would be useful. Because otherwise, that's what I'm going to do.

Some other ongoing projects will also be included in the word count, notably "Songs for Saturday" (or occasionally Sunday, if I'm being lazy) and the "River" posts. I will find or create a tag for the Linux-related stuff, like the aforementioned xmonad article, and probably "adventures in home computing" as well. Fiction is somewhat unlikely; I'm pretty bad at it, especially plotting. Metafiction and prose poems are a distinct possibility, though.

There. 500 words. Approximately, since wc doesn't distinguish between actual content and markup. At some point I need to do something about that, but I'm not going to worry about it right now.

Notes & links, as usual )
mdlbear: blue fractal bear with text "since 2002" (Default)
2015-05-10 09:50 am
Entry tags:

Done last week (20150503Su - 09Sa)

Hmm. Long week. The week included a lot of moving stuff around setting things back up after the wedding; that's probably what's behind my current back problems. (See QOTD from yesterday.)

My loaner project at work is winding down, though not as quickly as I'd like. Not feeling very good about work right now.

On the gripping hand, the Great Room looks fantastic, with much more room in its new configuration (blue couch in the SE corner). And Colleen's new baker's rack nightstand has been installed, and looks great. And I upgraded Nova to Debian Jesse, which rocks. (Not entirely clear what I'll do with the extra monitor space; possibly mostly devote it to the to.do file, which I usually edit on Nova anyway when I'm at home. x2x rocks, too.

I have to tell you about x2x(1). (For those of you still stuck on legacy operating systems, the equivalent is synergy or, if one of your machines runs linux, x2vnc.) It's the exact opposite of a remote desktop application (which you get for free in Linux) -- it lets you share a mouse and keyboard between multiple computers. You just sit their displays side by side, tell x2x which edges are next to one another, and your mouse slides smoothly between them, taking the keyboard with it. Cut and paste work perfectly. Indispensable. I also set it up at work, between my desktop and laptop.

Links in the notes, as usual.

raw notes, with links )
mdlbear: blue fractal bear with text "since 2002" (Default)
2012-06-15 07:53 pm

Adventures in Family Computing: Replacing the Router

As I mentioned downwhen Stargate, our gateway/router, had become basically unusable by Sunday morning. It's rather mysterious -- the CPU seems to be working fine, and it passed rootkit, memory and filesystem checks just fine. But there you have it: it would slow down rapidly after each reboot.

The next problem was finding a replacement. I tried the machine that had been our router. It wouldn't boot. Even after I noticed that the power connector on the disk had been disconnected, and fixed that. I tried several different ways of replacing it with the fileserver, and succeeded only in disabling its networking altogether with an ill-advised firewall install.

At that point I had two choices: add an extra ethernet card to one of the laptops, or reconfigure our wireless access point as a router instead of a bridge. Fortunately I did the latter. Which was something I'd been toying with for quite a while anyway. Did I mention that I'm somewhat obsessed with saving power?

At this point I have to mention that it wasn't quite that simple. I had to do quite a lot of reconfiguring, and got some of it wrong. For example, forgetting to test incoming ssh. I never did get that to work; it's something of a security hole, so it's not surprising that the router's ssh daemon doesn't listen to the WAN port. When I got back I did what I should have done in the first place, and forwarded the fileserver's ssh port to an alternate on the router.

Also forwarded the fileserver's web server; I still need to set up the appropriate virtual hosting. The other thing that needed attention was that the router was hosting my external git repositories. I moved them to my external host, at savitzky.net. No problem.

DHCP and DNS were a bit of a problem -- the DD-WRT distribution on the router doesn't seem to support multi-homed interfaces or my usual config files. I'll deal. I'll probably have to abandon my hare-brained idea of keeping WiFi and wired interfaces on separate subnets, but that wasn't working too well anyway. And I lose an instance of apcupsd, unless I can get that going on the router.

But the net gain is huge -- I've eliminated a box and about 12W of power-sucking from my rack, improved my security, and gotten a major project out of my "to.do" file. I win.

mdlbear: blue fractal bear with text "since 2002" (Default)
2011-11-05 10:52 am

Done yesterday (20111104 Fr)

Hmm. Not as good a day as its two predecessors, though the morning included a really good, useful meeting on the web-services side of $PROJECT. But that and the switch to cold weather made for too many excuses not to go out for a walk.

And I made progress toward setting up a transfer from my bank to my credit union, but didn't get started soon enough for it to count toward Bank Transfer Day (which is today). I tend to get down on myself about the obvious negative effects of procrastination, but of course by then it's too late to fix them.

One of the good parts was figuring out -- remembering, really -- one of the last bits of magic required to make ssh port tunneling work. Still having trouble with X forwarding, though; it worked fine with Lenny.

As for links, I was pleased to note that Occupy rigs up human-power after generators are confiscated

raw notes )
mdlbear: (hacker glider)
2009-11-24 09:55 am
Entry tags:

Chrome

Today's feeds included this post on ChromeOS by Cringely.

Last week Google made a preemptive strike against Microsoft, revealing details of its Chrome OS months before that product reaches its near-infinite beta release. The idea is simple: who needs a big OS if you are doing everything in a browser? It’s a huge threat to Microsoft and Apple. But then it struck me I’ve heard this all before, so I went back and found this video clip from my show Triumph of the Nerds, circa 1996, where Larry Ellison predicts the future, not knowing he was actually describing 2010.

It struck me that I've seen it before, too: Sun's Display Postscript. The difference is that Javascript is a far friendlier language to program in than Postscript, and that Chrome has some solid security behind it. We've learned a lot in the last two decades: Javascript was designed from the ground up for implementing the programming side of a user interface, and HTML 5 plus SVG on the front end are more than good enough to replace a 2-d graphics toolkit like GTK. So there's that.

Sun also invented the catch-phrase "the network is the computer", and NFS (which stands for Network File System, in case you've forgotten).

Cringe ends with:

We know that under the Chrome OS Google Apps will be very secure. Any tampering will trigger the download of a new and pure OS image. But will the Chrome OS have enough performance to compete with Microsoft Office? I think it eventually will, based, for example, on extensions like Google’s recently announced O3D API, which will allow Google Apps and approved third-party apps to grab spare GPU cycles to improve performance.

What’s left to be seen here is whether these improvements will be enough to beat Office or if Google will have to make a standalone (local PC-based) version of these apps. Only time will tell.

The most interesting part for me will be Microsoft’s response. This strikes at the very heart of Redmond’s business success and Microsoft will not take it lying down. Expect thermonuclear warfare.

What he seems to be forgetting is that it's going to be a three-front war. Down underneath ChromeOS, Android, Maemo, Moblin, and the Ubuntu Netbook Remix -- all of which are designed for mobile devices and thin clients -- is a perfectly functional Linux kernel. Mass storage is still dirt-cheap, and even after we get fiber to the home a suitcase full of hard drives will have more bandwidth than a pipeline to the cloud.

And a net app doesn't much care whether the back-end server it's talking to is in the next room or the next state, but you'll notice the performance difference. Heck, I notice the performance difference in my favorite audio editor between a local SATA drive and the same drive over gigabit ethernet.

Yeah, you'll back up to the cloud, use it for communication and sharing, and use it for deploying massive multi-user web applications. But all your applications will be running their front ends locally on Linux, so they can sneak behind the web to the local filesystem, and sneak behind the browser to X and the GPU, when you need performance. Your photos and music and video may be synchronized to a big server in the sky, but they'll all be in the fileserver in the closet, too. And some things won't get synced; the reasons are left as an exercise for the reader.

No matter what the (other) pundits are trying to claim, a URL is still a (virtual) pathname, a website is still a hierarchical filesystem (which you can of course mount with WebDAV), and the hierarchy of INTERconnected NETworks doesn't stop at your DSL modem or even at the ethernet port on the back of your PC. PCI is a network, too.

ChromeOS may take down Microsoft, and the Google Store may become a strong competitor for Apple. But is it the end of operating systems as we know them? I doubt it. Will you get all your applications from the Google Store? Probably not, any more than you'll get all your music from iTunes and all your books from Amazon. You'll hit some indy website, download to your local server, and away you go.

mdlbear: (ubuntu-hello-cthulhu)
2009-11-21 04:32 pm
Entry tags:

Query: best mail reader for Linux netbooks

I'm an old bear, and rather set in my ways. But now that Colleen has an Ubuntu-based netbook, we're looking for a good mail reader.

Requirements:

  • Gnome or, preferably, desktop-independent. She doesn't use KDE.
  • Must be able to handle multiple POP and IMAP accounts.
  • Not too complex.

Another possibility would be to suck everything down using fetchmail, but she would still need a good mail reader. Feel free to discuss the advantages and disadvantages of fetchmail you have an opinion on it.

mdlbear: (tux)
2009-11-06 08:30 am
Entry tags:

Gizmodo on Android

Here's a good article on Gizmodo about Android. Things could get interesting.

mdlbear: blue fractal bear with text "since 2002" (Default)
2009-10-08 08:42 am
Entry tags:

Done yesterday (20091007)

raw notes )

A good day. I felt very dragged out in the morning, and didn't do much in the way of journaling. It may have been mostly blood sugar, and I was ok by the time I got to work, A little while after that I got a happy, almost bubbly call from [livejournal.com profile] cflute that got the rest of the day off to a great start. We agreed that it was wonderful to have good things to talk about. The last year has been horrific for both our families; we're ready for Samhain to bring us a bright, shiny new one with good jobs for those who need them, good health for all of us, and homes filled with music, love and contentment.

I followed this with a walk around the pond; I took 10 minutes out for meditation, and another five or so to simply sit and watch the beautiful koi. I could feel my mood lighten. I returned to work and was contentedly productive for the rest of the afternoon, turning an ancient EeePC into an Unbuntu server that can be taken to Japan next week for a portable version of $DEMO.

There were too many conversations going on for me to sing, but I came out of my hole for some up-tempo noodling a couple of times.

Yeah; a good day. Let's have some more of them.

mdlbear: (hacker glider)
2009-09-28 09:43 am
Entry tags:

Upgrade update

So... here's an update on this post about cleaning the office, upgrading the fileserver, and fixing the Starport's email.

One out of three is,... um,... pretty bad. I'm probably going to have to go to Plan B or Plan C on the email; I simply can't make it work at Dreamhost. Worth an email to their tech support, though.

As for the fileserver, the problem is that I really "need" to have my home directory up and running for at least most of the day. And I need to have mail working, and the YD needs to have the laser printer working.

After toying with and rejecting the idea of swapping Nova's hard drive into temporary hardware temporarily (which would involve a fair amount of work), it became clear that the right thing to do would be to pull the drive, plop it into an external box, and just do the upgrade (setting up the three SATA drives in a mixed RAID configuration). If it goes quickly and smoothly, mount the old drive and start copying /home. Whee!

If it doesn't go smoothly, mount the old drive on Dorsai, the desktop. This is almost but not quite as much work as a temporary Nova, and is only possible because Dorsai is currently the only machine mounting filesystems over NFS from Nova.

Even if I'm able to bring up Nova quickly and restore /home onto it (it's "only" 15GB, which won't take long), the next thing will be to move the external box over to Dorsai, where I can mount the big partition that has all the media files and website working directories, and still use it while rsync rumbles along doing its thing.

The nice thing about that is that if NFS or NIS gives me trouble -- and those are the two most likely trouble spots, for certain -- I can mount /home on Dorsai and go my merry way while trying to fix them.

11:35 On second thought, the best thing is clearly to start by moving the old drive to Dorsai. That will (presumably) be fairly quick, and will take all the time pressure off of the upgrade.

mdlbear: blue fractal bear with text "since 2002" (Default)
2009-09-25 10:05 am

Muckin' the Byres

It just occurred to me that I can overlap three rather disagreeable major projects this weekend: moving thestarport.org's DNS and email, upgrading the fileserver, and cleaning the office.

I just realized that I have to do the first two in that order, or a lot of email will end up dropped on the floor. Most of that will be spam, of course, but the sheer volume of it means that if I don't move it, the tiny mailbox at my ISP will fill up and things will start bouncing.

But I also realized that having my fileserver out of service for a while will remove a major distraction that would normally keep me from cleaning out the office. Which direly needs it. Because I have to do a lot of that before I have the space to do the taxes. AAARGH!

I don't think I need help with this, just some good excuses to stop making excuses, if that makes any kind of sense. This post is a step in that direction.

mdlbear: blue fractal bear with text "since 2002" (Default)
2009-09-24 09:33 am
Entry tags:

Done yesterday (20090923)

raw notes )

Hmm. After taking out the summaries of a couple of long but private conversations, there isn't a whole lot left. I spent almost all of the evening out in the living room, mostly geeking about Linux and programming languages with various people. A lot of the regulars weren't there, but [livejournal.com profile] andyheninger showed up, which is rare. We go way back; he was a coworker at both AMI and Zilog.

The other conversations were mostly about the problems that Colleen was having over the weekend around feeling excluded, and more generally the way she falls apart when things aren't going her way. It's taken me a long time and a lot of help to both understand a little about what her problem is, and to understand that it's her problem, not mine. That was the hardest part -- my natural tendency is to blame myself for anything that goes wrong.

Many thanks to [livejournal.com profile] pocketnaomi for finding the perfect word for "the way she falls apart". Once Colleen heard it she understood much more clearly what was going on and what she needs to do about it. I've seen that same look of determination quite recently, when she's been stretching her physical limits. She said something to the effect of: "I have 35 years of bad behavior to unlearn... You'll have to kick me in the ass when I need it. And I'll kick you in the ass about your problems."

So it's a deal. And I have to credit Colleen not only for her understanding and willingness to change, but for giving me the perfect straight line I needed to drive the point home: "You never have that kind of conversation with me." "I'd love to, but I can't -- you keep falling apart."

During the afternoon Colleen and Marty made huge progress re-arranging the sewing corner based on my realization in the morning that it would work better if the sewing machine got moved from the North wall (the window facing the driveway) to the East along the large window that faces the porch and the street. The front window is enough wider that it actually fits, and the rolling storage units that were crowded into the space in front of the built-in shelves are now neatly arranged along the corner wall. Impressive.

Along the way Marty also completely re-arranged the front closet, making it an actual walk-in, with all the contents accessible. And Colleen went through four boxes and sorted the contents. Wow!!

A somewhat tiring day and a little rough in places, but any day when you get a breakthrough on a major problem is a good one. Add the sewing corner and the closet, and it was a very good day indeed.

mdlbear: (ubuntu-hello-cthulhu)
2009-09-19 07:16 pm
Entry tags:

Geekishly gloating

There are actually three things I can burble about right now. The main one is that my coworker presented a paper this week on the project that our group has been working on. So there are things I can talk about! (And some that I still can't.) I can at least point to the abstract, which is here, though you probably have to be an ACM member in order to download the paper.

Basically the thing is an e-writer -- an e-reader with pen input that lets you write on things like forms and book pages. The next prototype version, due soon, is about the same form factor as the Kindle DX only with WiFi instead of cell, and (because it's a research prototype) Debian Linux.

The other two are the fact that I'm pretty much off the hook for the demo next week -- I've already mentioned that one -- and that the Dell Mini-10 that I won at OpenSourceWorld arrived yesterday.

The Dell came already defenestrated, with Ubuntu 8.04LTS installed. Plusses include the almost-full-size keyboard, scroll gestures on the trackpad, a gig of RAM, and 16 GB of solid-state disk. Minuses include the trackpad, the fact that one does not put swap on a flash drive, and the fact that it's just a little too big for the cases that used to hold my Magio laptop. Still, it's a sweet, shiny little thing. It hasn't been named yet.

mdlbear: blue fractal bear with text "since 2002" (Default)
2009-09-19 01:06 pm
Entry tags:

Done yesterday (2009098)

raw notes )

A very good day. By the time my walk came around almost all the shoulder pain and tension were gone, and a lot of pressure was off. This was mostly because of hearing $boss explaining to his boss why the demo wasn't going to work. So I'm off the hook. Also, the Dell netbook that I won in the drawing at OpenSourceWorld finally arrived (more on that separately), and the friends who'd been visiting Wednesday and Thursday left in the morning. I wish we'd had a lot more time to talk, but the house was pretty crowded and noisy. We'll try not to do that too much; one can't pay adequate attention to two sets of guests at the same time.

It was hot and noisy on my walk, but I wasn't as out-of-shape as I'd been earlier in the week, and all the tension was gone.

Colleen, Naomi, and I had dinner at Spicy Leaves -- excellent as usual. It counted as our date night, since we'd had too many guests Thursday and I got home so late. Great food, and two of my favorite women in all the world; it was wonderful.

The day ended with singing and snuggle, and sleep courtesy of cyclobenzaprine.

mdlbear: (debian)
2009-02-15 09:06 am
Entry tags: