Thursday, June 16, 2005

USBStorage and Linux 2.6

I've got a dual athlon with SUSE 9.2 installed, and I just bought a nifty external USB2.0 enclosure for my DVD+/-RW drive so I could move it from machine to machine. Well, initially, plugging it in to the USB2.0 port on my system gave me:

usb 4-2: new full speed USB device using address 2
usb 4-2: device not accepting address 2, error -71
usb 4-2: new full speed USB device using address 3
usb 4-2: device not accepting address 3, error -71

and so on, as long and as hard as I wanted to try. After puzzling over it for some time, I started checking out drivers and reading kernel source comments... lo and behold, I got an idea...

oldegeek# rmmod ehci_hcd
oldegeek# modprobe uhci_hcd

Then unplug the device, and plug it back in. Viola!

usb 3-1: new full speed USB device using address 2
usb 3-1: Product: USB 2.0 Storage Device
usb 3-1: SerialNumber: 00042222200000253123
scsi0 : SCSI emulation for USB Mass Storage devices
Vendor: Revoltec Model: USB/IDE Bridge ( Rev: 0103
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0, type 0

A few seconds later I mounted /dev/sda and was off and running. I haven't tested the burning capabilities with it yet, however.

Wednesday, June 15, 2005

The Console Adventures of Midnight Commander!


Midnight Commander (mc on your local, friendly linux console) is another good case study for console mode applications. The GUI is not bad for manipulating filesystems in certain ways, but a competent mc jockey will smoke a gui-driver for almost any set of complex file manager tasks. If you add to that the fact that it supports mouse-interaction on an xterm, you have 'the best of both worlds'.



Just a bit to get you started... type "mc [enter]", and you'll find yourself in a twin-paned console based world of blue screens hearkening back to Norton's System Commander. If you just logged in, it will show you your home directory in two panels. Check and see if your [F1] key brings up help. If it doesn't, you'll need a bit of ancient Unix lore, which is this: Most console/terminal based application understand escape sequences for keystrokes. [esc]-1=[F1], [esc-2]=[F2]... [esc-0]=[F10]. mc has a 'menu bar' at the top, that you can access with [F9] or [esc-9] and use the arrow keys to negotiate. It also has a 'command bar' at the bottom, listing the direct functions of the function keys. Both of these 'bars' respond to mouse commands if you have gpm ( GNU console mouse API ) or an XTERM with your TERM variable set properly (xterm, generically, eterm, aterm, rxvt, etc). [tab] will switch between screens for you, [ctrl-t] will mark and unmark files or directories to which you can apply the commands in the menus or on the command bar.



If you want to do something interesting to a file, like, say, grep it for something, you can position the cursor on the desired file and type "grep 'some stuff' [alt-enter]; this will copy the highlighted filename to the command line. [alt-h] will bring up a menu of command history. [alt-?] (or in my case, with rxvt and a TERM declared as xterm-color, [alt- shift-?]) brings up a 'find' dialog for finding files. [ctrl-\] brings up the 'directory hotlist' (think favorites in IE... nice tool. [alt-tab] (well, if you're connected via Windows, you'll have to use [esc-tab] does completion on the command line; hit it twice you get a menu of possible commands.



On top of all of that nifty stuff, it does 'macro substitution'; this provides variables that you can use in command lines. For instance, 'file %f [return]' will run the command 'file' on the highlighted item in the panel. %x gets you the extension of the currently highlighted item, %b will give you the name of the current highlighted item without the extension, %d will give you the currently selected directory name, %t will give you the currently tagged files in a list... the list goes on. Great stuff for quickly doing lots of interesting stuff to collections of files.



There is also a user-editable popup menu under [F2]. You can hit [F2][@] and 'do something with the current file' - you'll get a dialog asking for the command and parameters.



In the end, you can make mc an extremely productive file manager environment. Leave the image browsing to a graphical browser like Konqueror or Nautilus, but when you need to get some stuff done, mc may become your best friend!

Tuesday, June 14, 2005

Console Adventures


Some things are just right for a GUI - think Gimp, or Firebird, or other similar applications; but others are amenable to the console environment. One that I find constantly irritating is the overwhelming dearth of console-mode word processors. It's so hard to find a text-mode word processor for linux that I see article after article discussing how to get WordPerfect 5.1 for DOS running in DOSEMU. Now THAT is CRAZY.


Don't get me wrong; I'm a senior Unix admin, and I can use vi with the best of 'em (and no, it's not "six", or "vie", it's "vee eye"), but I'm looking for something more transparent, for writing stuff for people to read. ( Ironically, I'm writing this in vi ) I'm looking for something that will hide the markup from me (unless I want to see it) and let me do [ctrl-i]to turn on italics, and [ctrl-i] again to turn 'em off. You get the idea. But there's nothing out there that produces a useful document. We have emacs with it's 'enriched text' mode, which is some odd kind of markup that's fairly lame, and destined for the scrapheap of textual history. We've got html, which I can write with my eyes closed, in my sleep, but is not very versatile, nor very precise. Then there's latex, tex, et al, that are cryptic and complex in nature, and still don't hide the markup.


I did, however, find 'aft' (almost free text) here; it's a fairly nice 'almost markup' that converts to a lot of formats and works very well for small projects - anything up to an article or so. I don't see it as ready for book creation, however. You can convert to html, latex, rtf, etc. Once you get to latex, you can make a pdf, and it's fairly nice by default. You can customize it for output, too.


AFT is fairly easy to learn, and nearly transparent - it's easy to read and understand AFT documents prior to translation. It's full of beauties like:



*Title: Welcome To My Nighmare
*Author: Y. Olde Geeke
*TOC
* First Level Section
** Subsection
_Bold Text_


That little snippet of code will populate your html meta tags, create an automatic TOC (Table of Contents) based on your section and subsection headers, and make your text bold. Like I said, it's easy to use and see through. I like it for anything under 50 printed pages, I think.


So, go get it and play with it. Let me know what you think - or if you have any reasonable alternatives that don't require me writing a new editor from scratch. (I'm thinking about hacking on lyx until I can get the code to use a console as a rendering engine. No, seriously!)

Disappointment

So I saw the excitement about go.blogger.com, and
thought I might jump on the bandwagon with an idea
I had. For some time I've been using my Sprint PCS
phone as a voice recorder via email. It does this
wonderful little trick called VoiceSMS, where you
get to record two minutes of speech, it encodes it
as a wma, and emails the resulting file. I use it
during drivetime to record my rants about stuff I
hear on NPR, and mail it to my yahoo account so I
can refer to the audio later.

So I thought to myself, self(because
that's what I call myself)You have GOT to try
this!

Imagine my disappointment when I got back a
message telling me that my carrier was not yet
supported by go.blogger.com. *sigh*

OpenSlowLaris

So I noticed that Solaris released their sourcecode today. I think it's probably truly a watershed day in IT history; Solaris is fairly stable, albeit (in the past) hobbled by the sparc processor architecture, and now free to roll up on your X86 machine of choice. The rumormill says that Opterons are the new sparcs, and all I can say is "It's About Time!"

I ran some informal, poorly-controlled benchmarks between sparcs and x86/linux boxen and the only scientific finding I can share with you is this: Slowlaris is not just a catchy name. I'll be interested to see how the OpenSolaris thing shakes out. I spent about five minutes looking for the license - It's not easy to find; but it allays my fears to some extent. I was concerned that OpenSolaris would have some kind of hidden bomb that would 'contaminate' developers so that they couldn't work on linux anymore without raising questions of intellectual properties. Well, it appears that Sun is playing nice this time 'round; they're using the "CDDL", and OSI approved license.

Well, kiddies, if you want to get your hands dirty on some 'real unix', you know where to go.

I almost didn't make this entry, because the very first paragraph on the OpenSolaris site is a blatant request for bloggers to disseminate their thoughts about the release and basically do their marketing for them. But what the hell; it is important.

Friday, June 10, 2005

Apple and the Evil Empire

After years of assuring us that the Power PC was the One True Chip and that the Wintel Empire could never strike back, Apple has jumped ship. Next year you'll be able to purchase Macintosh machines with Intel Inside. The corrollary, of course, is that soon there will be a version of Max OSX that runs on Intel Machines.

The would-be technopunditry have been discussing the 'extreme difficulty' that Apple and Co will have in the conversion of OSx to the Intel platform - but they've missed the point. Darwin is OSx on X86, minus a buncha add-on code and that cool GUI, Aqua. I'll be interested to see how Apple approaches this strategic partnership - will they ask Pappy Intel to build 'em some very specific motherboards, or will they go a la carte? That question is significant to those who like OSX but don't want to buy PPC hardware, or for that matter, Apple hardware... Will they be able to, say, run YellowDog on their g4 powerbook, and use that OSX license on their hot-shit hyperthreading 10 ghz P4.5? Curiouser and curiouser.

This also could have significant impact on the future of linux on the desktop. If Apple goes generic - ie, offers OSX for purchase by the General Public for operation on their own X86 systems, we could see linux on the desktop become the impossible dream outside of universities and really serious *nix shops that want an X11-based desktop and the Linux kernel rather than the Mach microkernel and the Aqua interface. I'm terribly torn - I've been with linux since 1996 or so, via slackware, redhat, mandrake - you name it. I've nursed it along on crippled hardware and fought through old-school kernel patch and recompile to get my cheap ass hardware recognized and functional. I've spent days building X11 so that I could have AA fonts and lots of other eye candy and dancing bologna; but, Oh My Heart, the thought of Lightwave and Poser native in *nix makes my pulse race.

If Apple can actually produce an OSX that is viable on X86, and vendor supported, and the switch to PC hardware can bring their prices down within shouting distance of Dell, this could also have a significant impact on Windows. I can only hope.


All I can say, folks, is "Hang tight - this is gonna be a bumpy ride!"