Archive for the 'Linux' Category

Worst command line option ever.

"Hey, I just tried to pkill a service and I got disconnected from the machine and now I can't reconnect." a co-worker just said.

"What'd you kill?" Jim asked.

"Um... oh, I used -v instead of -f. What does -v do?"

PGREP(1)                      Linux User’s Manual                     PGREP(1)

NAME
       pgrep,  pkill  -  look  up  or signal processes based on name and other
       attributes

...

DESCRIPTION

...

       pkill  will send the specified signal (by default SIGTERM) to each 
       process instead of listing them on stdout.

OPTIONS

...

       -v     Negates the matching.

OH. Worst, option, ever. To be fair, I suspect that that option exists because pkill is probably just a thin wrapper on pgrep. But still.

It probably didn't help matters that he ran pkill via sudo.

Saving the Net / Who Owns What?

Saving the Net / Who Owns What?

Admittedly, this link has been all over today, but it was a really good editorial, and it even referenced Lakoff / Moral Politics. Actually, some of what was in this article reminded me of what my Lakoff term paper was supposed to be about, but this article had a much better execution than my term paper. And the brief mention of Howard Dean at the end of the article finally got me to go check him out, which I'm really glad I did.

My Five Favorite UNIX Commands

Basically, I'm completely useless without UNIX. Back in the day when I was interviewed for the Sysadmin position here where I work, one of the questions was "What's your favorite UNIX command and what's an example of something clever you've done with that command?" Back then, I answered grep, but my clever answer was pretty lackluster, and more programmery than sysadminy. Which probably partially accounts for why I was hired as a programmer and not a Sysadmin, but at least I didn't answer finger... Which one of my fellow rejected-for-sysadmin hired-for-programmers answered. ;-)

So without further ado, here are my five favorite unix commands, why, and maybe something clever I've done with each one.

  1. perl - Claiming perl as my favorite command isn't really fair, since it slices and dices and is the ginsu of UNIX commands. Really, I don't use `perl -e` all that often... But I use scripts starting with #!/usr/bin/perl every day, so that's why this is number one. And being the shotgun it is, I'm not even going to try to give an example.
  2. wget - The very first problem I had with Mac OS X 10.1 was that they replaced wget with curl. I assume that curl is equally capable, but I happen to know all of wget's switches back and forth, and I can recursively download a web tree or grab an mp3 in my sleep. I just prefer wget to download files to a web browser, because it's easier to pick where I want the file to go, it's more stable than a web browser, and the output is more useful. Any which way, a quick `wget url` is definitely my favorite method of downloading something.
  3. grep - I use grep any time I'm looking through huge hunks of text. From `tail logfile | grep -v "stuff I don't want to see"` to `grep "email@address.com" ~/mail/*`, I basically use it as my first line search tool. My favorite use of grep was probably the time I was writing that paper on Dorian Grey, and I had a text file of the book. I was searching for references to opium, I needed context, so a simple `grep -A 5 -B 5 -i -E 'opium|opiate' doriangrey/* | enscript | lpr` gave me my pages of quotes just in time for my class.
  4. dict - There really aren't any *clever* uses of dict, but I use it all the freaking time. For me, it doubles as both a spell checker and a dicitonary. Though now that I've been using Mac OS X a lot more, it's just my dictionary, thanks to OS X's integrated spell checking prowess.
  5. (gnu) tar - (gnu)tar is really the lynchpin of the Makefile for my sites. Mind you, it's very important that that's gnutar, because other tar's just pale in comparisson. It's mainly the --exclude filename (which excludes every file in the given file name) and --after-date date (which only includes files who were modified after the given date that make it so insanely powerful for me, and allows me to only upload things which have been changed since I started working with a simple `make` call to make.

Other top contenders included:

  • make - I use make a lot, but really it's just a way of making batch commands, and so for that reason it was dropped down.
  • tail - In my line of work, I have to watch the log files from a lot of web servers, among other things, so I tail a lot of logs. But it's really grep that makes tail so useful, because those are really verbose logs, and I know I don't want to see everything in there.
  • scp - This is what I use for 80% of my file transfers between servers (I use http for the rest), but it's kind of boring.
  • ssh - I have tendrils all over the place with ssh, but it, too, is pretty mundane. I still couldn't get by without it.
  • emacs/vi - I use both of these editors every day, and I really like both of them, but um, they're kind of mundane.

What're your favorite UNIX commands, and why?

GNOME Usability Study

This was posted right on slashdot, but I found it an interesting read: GNOME Desktop Usability Study. It did a good job of highlighting a lot of GNOME's problems, but I also found it unsatisfying, because it only addressed the symptoms of GNOME's deeper interface issues, rather than delving into what GNOME's real problems are.

An Apology to Mozilla

A month ago I bitched about Mozilla switching from using Alt to Control for command keys in Linux. Well, I was talking to one of the SysAdmins at work the other day about phasing out Netscape 4.77 in favor of Mozilla, and I told him I wouldn't use it, because of their choice of command key. And he pointed me at this page about customizing Mozilla, which tells you exactly how to change the command key. I almost hugged him. Now I'm going to switch very soon, I believe. Well, as soon as I figure out how to change the highlight color from white...

Multiple Desktops for the Masses?

Fans of Linux have long touted the multiple-desktop capabilities of the innumerable X11 Windows Managers as one of the most important interface elements since the window. In fact, it seems as though an X11 window manager isn't even considered for prime-time until multiple-desktop support is complete. In fact, when Be came out with their alternative to the Mac OS so many years ago, one of advantages that was frequently cited was the multiple-desktop support that it came with.

In effect, multiple -- or "virtual", as they're sometimes called -- desktops, create multiple groups in which to place windows, so that users can, in theory, group their windows by task, or by application, or by whatever they want. In addition, most multiple-desktop environments include a tool called a "pager", which gives users a miniature view of each of their desktops, so that they can access their other desktops, and drag windows between each desktop.

Now multiple desktops may sound great in theory, and everyone I know seems to love it in practice. Everyone, that is, except for me. All of my co-workers use nine desktops, with one desktop bound to each number on their numeric keypad. But me, I have blackbox configured with two desktops -- one of them for all my stuff, and the other to quickly switch to when I don't want someone looking over my shoulder, or when I need to let someone borrow my terminal.

The problem I have with multiple desktops are the same problems I have Microsoft's stupid MDI "innovation". You see, I want all of my information in front of me if I so choose, and I frequently want to look at information in several applications at once. Both MDI and multiple desktops require much more window management for me to quickly get at my information than a single desktop approach, and both keep me from my information.

So there are four conventional approaches to windowing/desktoping:

  • Single desktop, Single window: such as Mac OS X (once they fix the problems with documencentricity). With methods like minimize or windowshade, it's possible to get windows out of the way to view information in the background when so desired. Best current compromise in my mind.
  • Single desktop, multiple document interface: such as many windows applications. Limits user to a single application of information. Impossible to view information from any other application in parallel with the current application.
  • Multiple desktops, single window: such as most X11 window managers. With features such as "stick window" to make a window appear on all desktops, it's possible to view information from multiple windows simultaneously, but it requires more work, in my opinion. A pretty good alternative, but less convenient for the forgetful, and harder to initially understand for the new user.
  • Multiple desktops, multiple document interface: This is the absolute worst possible combination possible, because the parent window has to be moved to move any of the child windows. Unfortunately, the MDI choice is left up to the application writer (except on the Mac, where it's thankfully impossible), and writers of Linux software, in their complete failure to understand interfaces, are tending towards MDI, "because Microsoft did it". (Despite the fact that even Microsoft has stopped doing it, for good or bad.)

Speaking of Mac OS X and broken window behavior, I recently submitted feedback to Apple that there should be more options for managing windows now that they aren't managed at an application level (as they were in OS 9). Notably, I suggested a "send to back" feature, to balance out the very annoying "bring to front" behavior that an accidental click on my bottom-most window has.

Today I was playing with the new office scanner and using Photoshop, when it occurred to me what the logical conclusion of a "send window to back" feature was. Window Layers. First, a run down of the features:

  • The ability to create an arbitrary number of layers, and any given window can be assigned to any given layer.
  • The layers can be arbitrarily ordered, with "send backwards" and "send to back" menu commands, while "bring to front" and "bring forward" are handled by a single click and a control-click (of shift-click or whatever) respectively.
  • Layers can be hidden.
  • Arbitrary colors could be associated with layers, with the title bar of a window in a layer being tinted to that color.
  • It'd be possible to specify that every application automatically gets it's own layer.
  • Apple has to fix their windowing implementation anyway, so while they're doing it, they might as well give us more than we've ever had.
  • And with these features, all the hooks would be in place for an enterprising software developer to develop fancy little layer controls, and even fully emulate the behavior of classic multiple-desktops.
Now the merits of this idea:
  • All of a users data is visible on one screen, unless they've hidden it.
  • Mac users are already familiar with window layers. They're just used to them being grouped by application, rather than arbitrarily.
  • Mac users are already familiar with layers. I got the idea for layers from Photoshop, and more than a few Mac users are familiar with Photoshop, thanks to the huge popularity of Macs in graphics works.
  • Layers can emulate the old Mac OS application-centric windowing style, or multiple-desktop windowing style, or a number of other windowing styles, while providing new features which have never been available in any windowing system I've ever used.
  • Layers don't require users trying to figure out what multiple-desktops do to their actual desktop. You see, to a Mac user (and to a lot of Windows users, too), their Desktop is their castle. They put their files on their desktop, and they set a desktop image, and they expect things to stay that way. Trying to implement traditional unix multiple desktops on either of these systems would be problematic because of this issue: When they change desktops, would all their files and desktop image stay there? If so, then wouldn't it look like all their windows had vanished instead? And if they get a whole new desktop to mess up, then that just gives them a ton of room to lose files in.
And then there are flaws with the idea:
  • The biggest that I can think of is that visual cues of which windows belong to which layers would be hard to distinguish. Color is nice, but it doesn't work for everyone. OS X could emboss some sort of name over each window, but that might obscure information, which is the whole point of this idea.
  • It's probably more power than your average web browsing, e-mail writing home user has anything to do with.

Do I think this will ever happen? No. But a guy can dream, can't he? And if you think something like this is a good idea, then you should send some feedback to Apple saying so, like I just did again (though they're probably tired of hearing from me by now, and are automatically deleting my feedback =).

I Fink It’s a Great Idea!

Are you a UNIX geek working in a Mac OS X world? Do you want to install and uninstall all those unix progams with ease? Dream of apt for Darwin? Then Fink is probably just the thing for you. It's still in development, so it lacks polish, but it does it's job very well. Most importantly, it makes it easy to uninstall things you've installed with Fink.

Basically, for those who don't know what apt is, Fink gives you an easy front end to installing and uninstalling all kinds of unix programs -- some graphical, some command line.

Linux Empowers One Badass Online Demo

I was trying to get Nautilus running on my Debian Potato box, but that turned out to be nigh impossible without potentially upsetting my system. So I resorted to looking at screenshots, when I noticed their blurb about a demo. Now normally, thanks to commercial software practices, when I think of a demo, I either think of some interlinked images, some silly flash animation, or a limited version of the program. Since I was already looking at images, and since it's free software, options 1 and 3 didn't make much sense. Option 2 didn't make very much sense either, because a flash demo would be used to sell something, and it wouldn't make sense for eazel to spend time making a demo of something they're giving away.

So when I saw a java applet loading, I became a little alarmed. But when I saw that the java applet looked to be a version of VNC, a huge smile spread across my face. Their demo let a user, in real time, interact with their product across the internet on one of their computers. Wow. So uhh... If you're a windows user wondering what a linux desktop is like, go check this out. I recommend the 800x600 version, because the 1024x768 was a little sluggish on my cable modem.

After using the demo, I think I still like KDE's Konquerer better, but Nautilus is definately looks to be a good system as well.

How Many Times Have I Said Linux In Three Years?

There's getting to be quite a lot of entries on this site, and sorting them by date and by category didn't go very far towards helping a reader find interesting things to read on the site.

So, to fix that, I've added a search feature. You can find a search box at the bottom of every page on Linkstew. Enter what you want to search for, hit the button, and you get a list. The search functionality is still very limited, and things like and and or and grouping don't work. But don't worry, those are on my list of things to add to the feature.

Also tonight, I added more old content into the site. A lot of it is in the new category "Writing," but there's also a lot of old content now in Music, Books, Movies, Games, and Software.

Let me know if you have any ideas for how I could improve things around here. Some day I'm going to have to overhaul the whole site again, because years of retrofitting has really left a mess in it's wake.

Broken Backup Computers

I have more than two desktop computers, but there are two I use regularly. They look a lot alike, and they're a lot alike on the inside, too. The big difference is one runs Windows and the other Linux. The linux computer is hooked up to my big monitor, so I use it most of the time (and it's hooked up to the big monitor because I use it most of the time). When I want to use Windows, I boot the computer, wait awhile, then use this magical little tool called VNC to display my Windows screen in a Linux window, and so I don't have to move or use another keyboard or anything to use Windows while I'm using Linux.

Since everything I used to use Windows for I can now do with my PowerBook, I wanted to consolodate my two desktop computers into one. And since the newer parts were in the Windows computer, and since I use it less often, I was going to install Linux on it and set things up and then move the data off of my current Linux computer to the new one. Only, when I started the Windows computer, I found that the keyboard didn't seem to be working. And when it booted to Windows, the mouse wasn't working either, but the keyboard had started working. In other words, it smells like the PS2 controller on the motherboard is partially toast, so Linux is probably a no go on that thing. It might make a decent server for something, but I don't think it'll do as my new desktop machine, meaning that if I want a machine beefy enough to vmware Windows, I'll have to buy new parts, which will have to wait awhile. It's also a problem because the motherboard in my current Linux machine doesn't have as much room for hard drives and cd burners, and because the fan in the power supply is going bad. Flan!

Unproductive EMACS use, etc.

I was sitting in MCB, and in front of me someone pulled out a laptop. I didn't pay too much attention, until I noticed that the machine was booting linux. Cool, I thought. Then I noticed that the machine was running woody, which is the very unstable branch of Debian. I thought to myself that this guy either has much clue, or zero clue. When he started X, then opened EMACS, and then opened a terminal to use vi to edit a file, my estimate of his amount of clue went down. Then he started taking notes in emacs, and he didn't even know control-k to cut a line, or how to set a mark without using the mouse, etc. In other words, he was using the bleeding edge of Debian, which probably bites his ass daily and he doesn't know how to fix any of it, "because it's bleeding edge".

Catproof Computer Keyboard

Well... I think this is actually legit. PawSense is apparently a bit of software which is supposed to detect when a cat is walking on the keyboard, lock the screen, and then make cat annoying noises... Seems like a waste of time to me. Just use xlock, no worries.