- Neon's Glow – The Blog of John DeArmond - https://www.johndearmond.com -

The Linux Chronicles – Day 3a

Whew, what a day.  This will be a two part post because I have so much ground to cover.  What an eventful day.  I had my first “guru moments” (roadblocks that require guru knowledge) and I spent a LOT of time, almost 8 hours, getting my Palm Pilot (Actually Handspring Visor – still superior) to work.  The Palm saga will get a second post.

The day did not start well.  I sat down to this laptop, raised the cover and….. Nothing.  It would not come out of screen save or power save or whatever state that it was in.  I putzed around a bit, forgetting about the virtual terminals (more on that later) and finally gave it the 1-finger salute (power switch).

Now if you do that to windoze, it’ll come back up but like a guy coming off a week long drunk, it’ll be dazed and confused for awhile.  Not Ubuntu.  Not only did it reboot in under 2 minutes but it also restored everything to the state it was in the night before, including applications!  How ’bout that.

I chatted with my guru and he told me that many laptops have issues with power saving and even screen savers under Linux.  Too much hardware variety compared to desktop machines.  It does NOT crash Linux, it just makes the screen freeze which, unlike windoze, is not the same thing.  Here’s a note that I sent a friend earlier today that explains it all:

I still have a ton of work to do.  Here’s some critical info that you might need one day.

Linux has 8 virtual terminals.  You access then with <ctrl><alt> and a function key.  Xwindows, the GUI that you see, runs on virtual terminal 7 by default.  That’s <ctrl><alt><F7>.  The other screens are character mode terminals.  one could fire off the GNOME desktop on more than one terminal if he desired.  One is generally enough :-)

I’ve confirmed with my guru that my experience is typical – that laptops have a hard time coming out of screen saver and that sleep and hibernate under Linux is generally broken.  I had to turn power management off in the BIOS.  No matter.  My machine is as cool as it’s ever been when turned on even without that.

When Xwindows (“X”) won’t come out of screen save, it is usually that the graphics chip has crashed.  In windoze that would be fatal.  Here, it’s an annoyance.  Simply C-A to another terminal which resets the video controller and then C-A-F7 to get back to your session.  It comes up really slow like a waking giant but once it does, things are normal.

The other thing that happens is that X crashes.  Hey, it’s a GUI.  that’s what they do.  Theoretically X can be restarted with a long command at the shell prompt but in my experience, things are generally hosed up enough that rebooting is a good idea.  Too many daemons in unknown states.  The machine appears to be locked up but it isn’t.  Just that terminal.

C-A to another terminal, log in with your user ID and password and then execute this command line

$sudo shutdown -r 0

Type in your password again and in 3 seconds, the machine is rebooting!

sudo does the task as superuser.  shutdown does what it says.  -r is reboot and 0 is the number of minutes of warning given.  If this were a big multi-user system then you might want to give people 5 minutes or so to save their work.  Here, shut da f**ker down NOW.

My creaky old 5 year old machine takes 40 seconds to load the kernel and dial out, 1 minute to the login prompt and 1:50 to complete the reboot.  Winders is still beating its meat trying to figure out what to do in that time interval.

Ok So there you have it, how to get out of what looks to a windoze user like a crash.

After that was resolved, I let the automatic updates finally finish.  Here is where I had my first “Guru Moment”.  During the update, it popped up a screen and asked me what I wanted to do with “menu.lst” No indication what menu.lst is or what I might want to do with it.  Options included keeping the file, overwriting it with the developer’s version and a couple of others.  That could be a show stopper for the casual user, as this is a critical file.  It controls what grub, the boot loader does.

Fortunately, the night before I had gone into /boot/grub and edited that very file to fix a FUBAR that the installer did (a Guru Moment in itself).  The installer had pointed it at the wrong disk as previously noted.  Because of that I knew that I HAD to keep the existing file so that’s the option that I chose.  If I had over-written that file then my machine might not have booted!

My next step was to work with Firefox some more.  It still wasn’t complete.  My stored password file did not port over.  I looked at the menus in edit->preferences and noticed an import/export facility.  That means that I have to export the file from my windoze drive and import it in Linux.  Though there is probably a way to make the copy operation work, I’m just going to boot windoze and get the file.  Let’s put that off until tomorrow!  Going back to windoze is like going to the dentist – I put it off as long as possible.

Blog Editor

My next task was to get a blog editor up so that I could continue this illustrious blog :-)  The editor built into WordPress sucks.  I’d been using a program called BlogDesk.  It was OK and let me get articles up to the blog host but I still had to touch them up before publishing.  Before I brought it over and ran it under WINE, I decided to look at a native Linux option.

Awhile back I had installed the ScribeFire extension in Firefox but had not tested it.  It represents itself as a complete blog editor.  I fired it off and you know what?  It almost is.  It’s better than BlogDesk and is what I’m writing in right now.  I say “Almost” because it is missing a few things that require one to know HTML.  No in-depth knowledge, just a few things.

For example, in the above note, I indented it with a <blockquote> tag.  There’s a button to insert that tag but not one to un-do it.  I had to go into the HTML view mode and type some text outside the </blockquote> tag to get the text to flow back over to the left margin.  No biggie and I can handle it but it would confuse a neophyte.  All part of learning, I suppose.  Still I give ScribeFire a thumb’s up.

Import Email Address Book Into Evolution

My next hat trick was to work on Evolution.  Some of the following troubles stem from my not knowing that Evolution is supposed to be a clone of Outlook (or Outlook express – I don’t know the difference because I’ve never executed either one).  I thought that it was just a fancy mail program with a calender.  I certanly did not want to use it as my PIM (personal information manager) Live’n’learn.

My first operation was to import my address book from Agent.  Getting my content out of agent was enough of an adventure that I’ll blog about it separately.  Agent will only export to XML!  Worthless for an application looking for a comma separated values or CSV file.  Let’s start with my having my Agent address book in CSV format as follows

“neonjohn”,”jgd@noen-john.com”,”great guy” (yeah I misspelled neon for the spam harvesters)
“bbq John”,”jgd@johngbbq.com”,”great BBQ”
“John DeArmond”,”jgd@johndearmond1.com”  (remove the “1” for my address)

Now any other application that I’ve ever worked with uses the top row to know what the field names are and imports the rest of the file accordingly.  Does Evolution?  Nooooooo.  It expects a specific format.  The Mozilla export format, for one.  It is as follows:

“First Name”,”Last Name”,”Display Name”,”Nickname”,”Primary Email”,”Secondary Email”,”Work Phone”,”Home Phone”,”Fax Number”,”Pager Number”,”Mobile Number”,”Home Address”,”Home Address 2″,”Home City”,”Home State”,”Home ZipCode”,”Home Country”,”Work Address”,”Work Address 2″,”Work City”,”Work State”,”Work ZipCode”,”Work Country”,”Job Title”,”Department”,”Organization”,”Web Page 1″,”Web Page 2″,”Birth Year”,”Birth Month”,”Birth Day”,”Custom 1″,”Custom 2″,”Custom 3″,”Custom 4″,”Notes”

All that on one line.  Can you believe that?  I searched the net for hours trying to find that format and finally got a friend who uses SeaMonkey to export his address book and send it to me (thanks Cliff!)

I saw immediately that I was going to have to reformat my data.  The easiest way to deal with a CSV list is to call it up in a spreadsheet.  Open Office’s spreadsheet does this well.  I simply clicked on “agent.csv” and after asking me a couple of questions about the file, OO brought it up as a series of columns.

Through hours of experimenting (and hundreds of file imports into Evolution) I figured out that I could have the name in the first column, email address in the 5th column (Column E in the spreadsheet) and the notes all the way over in column AJ!

What I did was to first import a file containing the above header info.  Each field went into a column.  Then I imported agent.csv and cut and pasted the data into the right columns.  When OO saved the “spreadsheet”, this is the result:

“First Name”,”Last Name”,”Display Name”,”Nickname”,”Primary Email”,”Secondary Email”,”Work Phone”,”Home Phone”,”Fax Number”,”Pager Number”,”Mobile Number”,”Home Address”,”Home Address 2″,”Home City”,”Home State”,”Home ZipCode”,”Home Country”,”Work Address”,”Work Address 2″,”Work City”,”Work State”,”Work ZipCode”,”Work Country”,”Job Title”,”Department”,”Organization”,”Web Page 1″,”Web Page 2″,”Birth Year”,”Birth Month”,”Birth Day”,”Custom 1″,”Custom 2″,”Custom 3″,”Custom 4″,”Note”
“9c1″,,,,”9c1@yahoogroups.com”,,,,,,,,,,,,,,,,,,,,,,”foo.com”,,,,,,,,,”9c1 mailing list”
“9c1 hub covers”,,,,”petreephar@aol.com”,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,”Has 9c1 hub covers Dave Petree”

Through further experimenting I learned that Evolution treats the header row as data so I deleted it using a text editor to result in

“9c1″,,,,”9c1@yahoogroups.com”,,,,,,,,,,,,,,,,,,,,,,”foo.com”,,,,,,,,,”9c1 mailing list”
“9c1 hub covers”,,,,”petree2phar@aol.com”,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,”Has 9c1 hub covers Dave Petree”

(If you need Caprice 9C1 hub covers, remove the “2” from his address.)

Once I had the data in that format, it imported nicely.  With one bug.  in every entry, the “Notes” data was preceded with the word “Notes:”.  A bug, for sure.  At that point I had several hours in the project and was tired so I just edited each entry in Evolution and got rid of the “Notes:” garbage.


If you’re coming from a microsloth product or from Mozilla stuff (Thunderbird, SeaMonkey, etc) then the process should be straightforward.  Export as a Mozilla CSV file and import using the same format.  I’ll deal with what it took to get Agent data into CSV format later.

As it turns out, I wasn’t finished but that’s another story

Another Guru Moment – sort of

I call this a “sort of” because it involves the “vi” editor, something most non-unix folks don’t know about.  It is probably the worlds most powerful text and programming editor (shut up EMACS guys!) but learning it is a career in and of itself.  The guru moment has more to do with lock files and hidden files than it does vi, which is why I’m posting about it.

If I’m editing a file in a multi-tasking, multi-user system, I want to have exclusive access to this file so that nobody or nothing else can modify it.  A practically universal method of doing that is to write a “lock file” in a known place.  This file is generally empty, though I usually write the date it was created in the file so that stale ones can be detected.  If any other application (such as another instance of vi) tries to edit that file, it sees the lock file and either refuses or throws up a warning.

There are a few conventions in *nix (that means Unix, Linux, xenix and all the other ‘nix-like OSes) and one is to simply precede the file name with a dot.  If I were editing a file named foo.txt, then the lock file would simply be .foo.txt.

*nix’s treat “dotted files” as hidden files.  That is, they don’t show up in the standard view of File Manger (ctrl-h makes them visible) and from the shell, “ls” doesn’t show them.  “ls -a” does.

I keep my linux log as a text file called “LinuxLog.txt”.  It sits on my desktop and I edit it with vi.  It is open all the time so that I can jot notes in it when things happen.  When my computer appeared to lock up by not coming out of screen save this morning and I gave it the 1 finger salute, vi was killed without removing the .LinuxLog.txt lock file.

When everything came back up and I attempted to open LinuxLog.txt in vi, vi complained about there being a lock file and asked me if I wanted to quit, open the file read-only or edit anyway.  I chose “edit anyway” because I knew what had happened (and you need to also.)  The version of vi that I use, GVim, has a small bug.  When I tell it to edit anyway, it should erase the stale lock file and then lock the file itself, erasing it when the text file is closed.  It doesn’t.  That means that until I go in and remove .LinuxLog.txt manually, GVim will bitch at me every time.

To remove it, I went to “places” in the top tray and clicked on “desktop”.  That opened an instance of file manager on the desktop.  I pressed ctrl-h to show me the hidden files and deleted .LinuxLog.txt.  Problem solved.

See? Becoming a guru involves simply learning one little tid-bit after another.  Too bad there are millions of ’em :-)

Well, that’s it for this part.  Stay tuned for the Palm Pilot adventure.  Below is the log file for the day.


01/17/09  0645

Woke up to find that the screen would not recover from the laptop being closed.  I’ll change the bios on that.  Meanwhile I had to give it a 1 finger salute.  Amazingly Ubuntu started right back up where it was, opening all windows except Agent.  Amazing.  In the future I can press power, and then “alt-S”.  A few <return>s might be necessary, depending on what was open on the desktop.


Let the automatic updates that I’d downloaded last night install.

Machine is effectively paralyzed when updates are installing.  They’re about finished now.

Had the first “Guru moment”.  A screen popped up asking me what I wanted to do with menu.lst.  Had I not fooled around with grub the night before, I’d not have a clue.  Screenshot taken.

Working with Firefox to see if the built in blog editor will work.  REalized that I need to bring my password file over.

When the update finished, it presented an error message that said that a package could not be fetched.  I knew that the cause was from terminating the download but would everyone?

Another “Guru Moment”.  The machine had to be rebooted to install the updates.  When it came back up, this logfile attempted to reopen in Vim just like it was when I exited.  This time it bitched about a lock file being in place and warned me that another instance of Vim was probably editing the file.  This lock file was left over from before.  It is of the same name with a dot (.) in front of it. The problem is that Vim didn’t renew the lock after I told it to “edit anyway”.  I had to know to open a file browser on the desktop, tell it to show hidden files and then delete the lock.

I’ll give this one a partial pass since few people will be using Vim (a shame).


I see that a 15mb Evolution update is coming in so maybe it will be better.

I just posted a blog entry using ScribeFire plugin in Firefox.  Vastly better than BlogDesk (windows).  Will be going forward with ScribeFire.


I’ve learned several things after all the updates that downloaded overnight installed.  The main lesson is, run the updater the first thing out of the box after installing a new system.  So many things are broken on the distro that I lost count.  Firefox being the beta release was probably the worst one but there were many others.  Evolution is broken fairly badly on the distro.  The Update fixed it.  Etc.

After the updates installed, everything that I’d ported over for Firefox worked.  I copied the files bookmarks.html, places.sqlight (fixed fastdial), the directory adblockplus, signons2.txt and signons3.txt (saves passwords).  The latter two didn’t take but the saved password feature has an import/export feature.  I’ll have to start windows to export from that side.

All preferences are stored in pref.js.  If you don’t want to move those over, don’t copy that file.  I kinda had my winders version of FF hosed up, particularly regarding popups, so I didn’t copy it.  Lots of extensions write stuff to that file too, so copying over it would undoubtedly have hosed those up too.

— Next Task

Import contacts into Evolution.  I have a CSV file but as usual, Evolution doesn’t like it.  I’m now searching the web for what format this thing wants.  I’m also downloading the Evolution manual.

17:15 –

Two things happened.  The initial automatic update finally finished and I figured out – sort of – how to import my address book into Evolution.  It’s been a wild about 4 hour trip!

Cliff sent me a Mozilla export file.  I had no idea so much crap was stored in the thing.  I guessed everything except the Notes field.  Even with the proper layout, there appears to be a bug in Evolution because it puts the word “Notes” in front of every note entry.  Very strange.  I culled my notes and then manually corrected them after import.  enough time wasted on this one.

Here is the layout:

“First Name”,”Last Name”,”Display Name”,”Nickname”,”Primary Email”,”Secondary Email”,”Work Phone”,”Home Phone”,”Fax Number”,”Pager Number”,”Mobile Number”,”Home Address”,”Home Address 2″,”Home City”,”Home State”,”Home ZipCode”,”Home Country”,”Work Address”,”Work Address 2″,”Work City”,”Work State”,”Work ZipCode”,”Work Country”,”Job Title”,”Department”,”Organization”,”Web Page 1″,”Web Page 2″,”Birth Year”,”Birth Month”,”Birth Day”,”Custom 1″,”Custom 2″,”Custom 3″,”Custom 4″,”Notes”