Wednesday, September 24, 2008

Emacs eMail

Not too long ago I decided to get all my mail via Gmail, and ignore the account I have with my internet service provider (ISP). Partly this is for the sake of simplicity. I don't have to check both accounts any more.

Partly it's also for security. I'm careful, but started getting a small amount of spam at my ISP account, and every now and then one of them would leak through security and into my inbox.

I started by forwarding all my mail from the ISP account to Gmail, and then over time have changed the email address registered with external businesses, so any newsletters or promotional announcements would go straight to Gmail. Google is better at managing spam than the average ISP, so this is a good idea from that standpoint as well.

I also have two accounts at Yahoo!, one of which serves as a primary backup for Gmail (anything coming to Gmail gets copied to Yahoo!), and the other of which I give out when I don't want any stray messages coming to my main mail accounts. Kind of goofy, but it works for me.

For some reason or other...oh, yes, it's coming back now...I have Emacs set up so C-c m will take me to the buffer list...and sometimes I hit C-x m instead, and end up inside an Emacs *mail* buffer.

Ok, anyway, I started thinking about sending mail from Emacs.

I recently configured Mozilla Thunderbird to send mail via my Gmail account, and to automatically download any new messages from Gmail's inbox whenever I fire it up. Working with Thunderbird is a lot nicer than working through a browser, and it lets me have a local copy of everything, just in case Gmail isn't working some day. In that case I could always send mail through Yahoo! or my ISP, and if my Gmail account gets deleted or suspended for some reason known only to Google, which has basically no customer service, I will still have all my email, stored locally, on my own hard drive. And I can delete older messages and confidential ones from Gmail and not worry about privacy.

So last night I decided to see if I could set up Emacs to send mail (send only -- not read -- Thunderbird is for that).

I found a good blog post called "Configuring Emacs for Gmail's SMTP" at "This sentence is false", owned by Denis Bueno. But I couldn't get things working last night.

On another blog called "Arg and gah and ap and pa" I found "Sending mail through gmail Using Emacs", which I ignored until this morning. I tried it and it worked. I also used a tip from the first blog to fancy things up a bit.

The process, in brief:
  1. Install starttls
  2. Modify ~/.emacs
  3. Add ~/.authinfo

I installed starttls on my Kubuntu system via the Synaptic Package Manager. Use whatever is appropriate for you. I am new to Linux so I don't know the best way to do anything.

Here is what I ended up adding to my ~/.emacs file:
;; Sending email via Gmail. Info is from:
;; http://argandgahandapandpa.wordpress.com/2008/04/27/sending-mail-through-gmail-using-emacs/
;; supplemented by
;; http://obfuscatedcode.wordpress.com/2007/04/26/configuring-emacs-for-gmails-smtp/
;;
;; To see output in a buffer named "trace of SMTP...", uncomment the following two lines for debugging.
;;(setq smtpmail-debug-info t)
;;(setq smtpmail-debug-verb t)
;;
;; The following sends email via smtp. If problems, the smtp server may need restarting.
;; Email address and password are held in "~/.authinfo"
;;
(setq send-mail-function 'smtpmail-send-it)
(setq smtpmail-smtp-server "smtp.gmail.com")
(setq smtpmail-smtp-service 25)
(setq smtpmail-auth-credentials (expand-file-name "~/.authinfo"))
(setq smtpmail-starttls-credentials '(("smtp.gmail.com" 25 nil nil)))

Here is what I have in my ~/.authinfo file:
machine smtp.gmail.com login [my-id]@gmail.com password [my-password]

To use, replace "[my-id]" and "[my-password]" with your Gmail user id and password (no quotes or brackets of course).

See the "Configuring Emacs for Gmail's SMTP" post for security issues and why to use the .authinfo file.

I did have one problem when Emacs reported that the SMTP server was not running. I'm not sure about that. I used C-x m to open a new *mail* buffer, typed in a test message, and usec C-c C-c to send, and got the Linux version of the hourglass. After a long while I managed to abort the hung process somehow and got a message in the minibuffer at the bottom of the Emacs window about SMTP not being active.

I uncommented the two SMTP debugging lines in .emacs, opened a new Emacs session and tried again, successfully.

You can find more info by checking the Emacs manual (at the menu bar, go to Help -> Read the Emacs Manual (C-h r) ).

Now why in the hell would I do this? Nothing like getting to the point. The point is that I often want to remember something, to look up later or to add to a list of URLs or a list of interesting sites or programs, and sending a quick note to my Gmail account is a way of saving a thought for later. Saving in a way that I can get access from any of my three computers (Gmail functions as my network).

Might work.

References.

Configuring Emacs for Gmail's SMTP
gnutls (GNU TLS encryption library)
Sending mail through gmail Using Emacs
starttls (Simple wrapper program for STARTTLS protocol)

Wednesday, September 17, 2008

Who, Me?

There seems to be a lack of individual responsibility around these days. Maybe that's just me. Maybe it's always been this way. Probably. Some things I don't notice so good.

I've always been surprised by how lazy and opportunistic people are. Maybe that's just me. Maybe I'm not as bright as I've thought, or maybe I just haven't caught on yet to the true meaning of life. Something like that. I haven't caught on to massive sloth and grabbing what's easy.

I noticed during job interviews, or even worse, while on the job, that I scared people when I told them I stood 100% behind my work. Don't know why. That seems like a good characteristic to me, but it's never flown. People get spooked. Someone once asked me if I carry a gun.

Maybe a lot of them are scared to see someone care. Most of my working life has been in state government, where, when you swing through the trees, you see a lot of sleepy apes. The entire point of a bureaucrat's life is not to do anything. If you do anything you can be blamed, but you can never be blamed for doing nothing. Everyone in that kind of environment understands the idea of making decisions judiciously. Without question. I.e., doing nothing.

That's why it can take a year to get a stapler unless you steal one from a desk that's just been vacated.

That world works that way because there is never a positive incentive. There is no profit sharing. No bonuses. You don't get big stock options if you bet your job and a lot of company resources on a bold gamble. There is none of that, only the opposite.

Negative incentives.

What is, is. The status quo is the highest good. Muck up and the only option is punishment. Do well and you mess up the status quo. The only option is punishment. Keeping up appearances is the highest good.

I've worked with people who were demoted and moved across town into jobs they knew nothing about only because they happened to work for someone else who lost a turf war. I've seen a talented and experienced programmer given a desk and chair and nothing else, expected to sit there until he gave up and quit, only because he once spoke the truth. I know someone who, as a project manager whose project failed, was given a promotion.

No change, no gain. No gain, no pain. A small promotion is about the best you can get, and failure restores xquiet, enduring balance to a bureaucrat's life. A few dollars more a month from a promotion seems like a positive incentive but it's reall more of a threat. You have to work harder to keep up appearances, so maybe it's not a good thing to get. And you still have to show up every day for decades until they finally have to turn you loose. No matter who you are, how good you are, if you play in this system you weather down to the same level as everyone else. You want only to get through today, and live long enough to retire. Nothing more. Trying to actually do something only causes confusion and pain.

I've been a member of two Meetup groups based around web technology. I just learned today that the second one has now also failed. There are 71 members and only nine or 10 have shown up at meetings. The two organizers have been doing the presentations and the rest have been sitting there. People keep joining. And not showing up.

So easy. So clean.

I sort of know a web developer who lost his job when the big bust came a few years back. Henry Shires. In 1999 he hiked the Pacific Crest Trail, using a shelter he made himself. He did it because he wanted to. He didn't sit around waiting for someone to ask, or to give orders. He needed to do the hike for personal reasons, so he did. To help he designed a shelter that was sort of like a tent and sort of like a tarp.

Later he got into web development. I don't know much about this part of his story, but having talked to him a time or two I heard that he lost his job. It was bad all over then. Happened to lots.

Sometime later, after he'd posted his original tarptent plans, then updated them with a new model or two (all free information for the taking), I found that he was in business. Making and selling tarptents.

Now he's one of the big names in the ultralight cottage industry class. Sounds like damning with faint praise but it's really praising with no damns at all. This is tough work, in a small market, and now he has a worldwide clientele and a reputation to go with it.

This is what personal responsibility is about.

First he had a dream, to hike the Pacific Crest Trail. And he did it.

Then he had a job, and then didn't.

Then he created a business and made it work.

This is real web develpment. Henry Shires had a stake in it. He had something to gain. Web development now isn't something for his resume. It is a vehicle for his business. He had a reason to work with that, which was to develop his business, because he liked hiking and liked tarptents. So he took on the responsibility of it all. It gave him a payback. Not like what you get when you decide to become a member of an anonymous group.

Not a big story at all, but nice. Not like clicking a link on a web page and joining a group and never showing up. First Henry showed up at life and the group joined him.

Now if only I could be so smart.


References:

The Olympia Web Design Meetup Group

Tarptent.com

The original Tarptent plans


Wednesday, September 10, 2008

Camera Yeeg.

I'm falling behind. Falling off the wagon. Disappearing in the rear view mirror.

Sony has just announced its new flagship camera, the Sony Alpha DSLR-A900. A 24.6 megapixel 35mm format camera with a full-frame CMOS sensor. Just a few years back you could buy a one megapixel camera from Kodak for $10,000. The Sony will sell for only about $3000.

A few years farther back I was drooling over a new camera system. I liked the Canon EOS 1N. Too expensive though. About $1400. That was serious money. Insanely serious money.

However, things have changed.

My first digital camera was a Kodak point and shoot three megapixel pocket camera that still works fine and cost around $400. That was a stretch. Back then, around 2000, you could buy a perfectly good point and shoot for maybe $85. I didn't use cameras like that. I was into SLRs, but for $350 to $400 you could get a really solid and capable film SLR camera.

The whole scale of the market has changed. Now for anything like a usable camera you are going to pay $500 and up for a point and shoot, or $1000 and up for a good amateur level DSLR, or $5000 and up for a seriously good DSLR. The Sony seems cheap by comparison.

The other part of the equation beyond cost is complexity. Sadly for me I bought a $1500 4X5 view camera about the time I lost interest in film. For it I have three lenses which about double the cost. So be it. The real point is that a 4X5 has about one tenth the number of options and controls that even a point and shoot camera has, let alone a top tier DSLR.

The new Sony has a bunch of stuff, but it's a lot simpler than what it's competing with. For example: Intelligent preview function, 3 user programmable custom memory modes on mode dial, advanced dynamic range optimizer (5 step selectable), direct HDMI output, user interchangeable focusing screens (3 options), AF micro adjustment, auto program exposure mode, program exposure (with shift) mode, aperture priority mode, shutter priority mode, full manual exposure mode, single, auto, continuous and manual focus modes, white balance settings, LCD illumination settings. Drive modes: single frame advance, continuous advance (turn rear dial to swap between L and H modes), self-timer, continuous bracketing, single frame bracketing, white balance bracketing, mirror lockup, DRO bracketing, and remote control. Custom button control for: AF Lock, AF/MF control, D.O.F preview, ISO, white balance, exposure compensation, flash compensation, drive mode, AF Area, image size, quality, creative style (default), D-Range Optimizer (DRO), flash mode, memory. Got that?

I'm getting to like my obsolete Canon S50, other than the fact that the on/off switch is wearing out. It didn't have the best lens and has about half the resolution of new point and shoots, but it's pocketable and if handled right produces great images. I take it backpacking. I love it. It's simple and it works.

Today, right now, I miss the old days. Sort of.

I'm always wondering about what it would be like to shoot 4X10 or 7X11 and do contact prints. Maybe switch over to exclusively pinhole photography. Something timeless. Something dead simple. Just film and light and some surprises. No fuss. No buttons.

References:

Sony A900 Is Officially Announced
Several views of the Sony A900
Sony Alpha DSLR-A900 Preview