2008-10-27

Getting backlight to turn off on Dell Inspiron 8100 with Xubuntu 8.04 Hardy

All I wanted was to get the backlight to turn off when my laptop(Dell Inspiron 8100 laptop running Xubuntu 8.04 Hardy) was idle for a few minutes. Is that so wrong? Why did it take over 3 hours of googling and trying various things without really understanding what I was doing?

I did a whole lot of things, and I have no idea which ones were truly necessary or not, so I will start at the end, with the final change that actually got it to work, and work backwards from there.

I had everything configured properly but still the screensaver and turning off the monitor would not work. Then I found a Ubuntu Forums post that said that the gnome-screensaver module is turned off by default in Xubuntu 8.04 even though there is a place in the Settings Manager for configuring the screensaver! That would explain that all the changes I made to the screensaver configuration had no apparent effect! To make matters worse, apparently the gnome-power-manager settings for what to do when the computer is idle depend on the gnome-screensaver module to be activated, so power management is hobbled by default also. In any event, the fix is:

  • Settings -> Settings Manager -> Autostarted apps
  • Then click on Add to create a new entry
  • Then enter gnome-screensaver as the command (and any name and description you want)
  • Then exit out and restart the desktop (Ctrl-Alt-Backspace) to restart with the screensaver running.
So that was what finally got my gnome-power-manager settings to come to life.

Working backwards, here is how I configured the screensaver settings:
  • Settings -> Settings Manager -> Screensaver
  • Select a screensaver theme.
  • Set the slider for "Regard the computer as idle after"
  • Check the box for "Activate screensaver when idle."
  • Click on the Power Management button
  • On both the On AC Power and On Batter Power tabs set the slider for "Put display to sleep when inactive for:"
This will result in the screen saver kicking on after the time you set, and then the backlight turning off after the time you set Power Management screen. I couldn't find a way on these screens to go straight to turning off the backlight without going through the screensaver first.

However, after much fiddling around I was able to get the backlight to turn off without going through the screensaver first (at least not for long) by doing the following:
  • Set the screensaver to "Blank" on the screensaver settings page.
  • Start up gconf-editor from a terminal, then navigate to Apps -> Gnome-Power-Manager -> Timeout and set the values for sleep_display_ac and sleep_display_battery to both be 1.
This seemed to work to make the backlight turn off at the time set for the screensaver to turn on. Your mileage may vary.

Another thing I did was use gconf-editor to set the settings for Apps -> Gnome-Power-Manager -> Backlight -> dpms_method_ac and dpms_method_battery to "off". I think this may have been necessary to ensure that the backlight was told to turn off when the idle time setting was reached.

Other things I did earlier, but which I am not sure were necessary or not, were to install libsmbios-bin (sudo aptitude install libsmbios-bin) and then add dcdbas to /etc/modules (sudo nano etc/modules/ and then just put dcdbas on a line by itself). I read some posts that suggested these were necessary in order to allow Ubuntu to control the backlight on a Dell laptop, but who knows.

I learned that you can set more options of gnome-power-manager by installing gconf-editor (sudo aptitude install gconf-editor) then starting it by entering gconf-editor in a terminal, and then going

Changing wireless cards on Xubuntu 8.04

I have Xubuntu 8.04 running on an old Dell Inspiron 8100. I started out with a Netgear WG511 v2 wireless card, but it kept having trouble connecting to my router in spots where there should have been no problem connecting. So, I decided to "just" switch to another wireless card I had lying around, a Linksys WPC54g v2 which uses the ACX111 chipset. It was a long and painful process to get it to work, so I thought I would write down what I think I learned along the way.

First, remove the existing wireless card and reboot with a wired ethernet connection and make sure it works. This way you will be able to do research on the web and download files as needed.

Next make your computer forget it ever met your old wireless card, otherwise, like happened to me, it will assign the new card to wlan1 which could cause troubles. Linux keeps a list of every network device it ever met and what interface it assigned it to (i.e. wlan0, wlan1, etc). This list is at:

/etc/udev/rules.d/70-persistent-net.rules

Use sudo nano to edit this file and remove the entry for your old wireless card and then save the file. This will prevent Ubuntu from saving wlan0 for your old card and assigning your new card to wlan1. You could probably make everything work with your new card on wlan1, but you would have to find and change every configuration file that references wlan0 and to me it just seems easier to force your new card to be assigned to wlan0.

If your old card used ndiswrapper then you need to make your computer forget about the old card's drivers. To do this first find out the name of your old wireless card driver:

sudo ndiswapper -l

It should show you the name of the existing wireless driver. Then delete that driver from ndiswrapper like this:

sudo ndiswrapper -e

These steps should eliminate your old wireless card configuration so that you can proceed with installing your new card without creating any conflicts. I followed this guide for the WPC54g v2:

http://ubuntuforums.org/showthread.php?t=324148


If you have a different card just search for an guide on how to install it.

2008-10-08

The rewards of being disorganized

I often wonder why so many people make little or no effort to get their lives organized. Everyone agrees that getting your environment and affairs organized makes life easier, but so few seem to do it.

Then I had an idea. Maybe its psychologically more rewarding to be disorganized than it is to be organized, at least in the short term.

What gave me this idea is an New York Times opinion piece that described experiments regarding willpower:
http://www.nytimes.com/2008/04/02/opinion/02aamodt.html?partner=permalink&exprod=permalink
In this piece the authors assert that "the brain has a limited capacity for self-regulation, so exerting willpower in one area often leads to backsliding in others." They also said that modifying behavior in pursuit of goals uses up willpower: "The brain’s store of willpower is depleted when people control their thoughts, feelings or impulses, or when they modify their behavior in pursuit of goals." They discuss experiments showing that exercising willpower on one task results in reduced performance on a subsequent task requiring willpower.

So maybe getting organized, which naturally involves modifying behavior in pursuit of goals, is experienced by people as draining.

And maybe the surprises and emergencies that result from being disorganized are rewarding because they trigger an adrenaline rush (sorry no articles yet to cite for that proposition). There is something stimulating about quickly reacting to emergency after emergency, and that mode of living is so rewarding that we have movies and TV shows like Indian Jones and 24, that depict it.

The rewards of reacting to crisis, and the draining nature of proper preparation, could lead to a dynamic where a person would experience getting organized as unrewarding because (1) the exercise of willpower is draining, and (2) the reduction in emergencies leads to fewer rewarding spurts of adrenaline. Someone attempting to pull their lives together could simply find the experience to just feel wrong.

This could explain why the chronically disorganized tend to look down on the organized as living a dull and meaningless existence. In their experience attempts at organization left them feeling drained and unstimulated, and so they assume that the lives of organized people must be draining and unrewarding.

Well, are the disorganized people right? Are the organized not living life to the fullest? According to the New York Times piece people can grow their capacity for willpower by exercising it, just like you can make a muscle stronger with exercise. So maybe the organized people who have bulked up their willpower with regular exercises of willpower don't find being organized to be nearly as draining as the disorganized experience it to be.

2008-10-03

Why you need to over-save if your retirement funds are in the stock market

In recent decades the conventional wisdom has been that people should invest the majority of their retirement savings in the stock market. The conventional reasoning goes like this:


  • The stock market has a historic rate of return of 10% over the long term, which is much better than the other investment choices.

  • There is risk in stocks, and the stock market can drop in the short term, but it always comes back up in the long term.

  • Your retirement is off in the future, so you are investing for the long term and short term downturns don't matter.

  • Your retirement will last a long time so even in retirement you will be investing for the long term.

  • If you don't take risks your investments won't make enough money and you won't have enough money to retire when you want to, or to spend as much as you want to in your retirement years.

Do you find yourself nodding your head in sage agreement with this sound advice? Taking risks; getting high returns; thinking in the long term.

Now lets look at what the purveyors of the conventional wisdom have to say when there is big downturn in the stock market:

"Q. But what if I am about to retire? Then what?

A. Leaving the work force at a time like this creates big problems. Not only is your portfolio down, but you need to start withdrawing from it. So you are essentially locking in your losses.
If your portfolio has taken a big hit, it may be time to seriously consider delaying retirement. Working just a few years more can make a big difference. Or, a part-time job may keep you from having to dip into your portfolio before it recovers."


From "Is My Money Safe" New York Times, 29 Sept 2008

"Fortunately, you can soften the blows of retiring in a slumping market. Here are some ways to help make sure your savings last as long as you do:

WORK LONGER AND SPEND LESS. This may sound obvious, and somewhat depressing, but working just a few years longer can make a big difference.
"

From "Retire Now, and Risk Falling Short on Your Nest Egg" New York Times, 16 August 2008. See also "Retirees Filling the Front Line in Market Fears" New York Times, 22 September 2008.

Now wait a second. You were investing in the stock market so that you wouldn't have to work in your golden years, and so that you wouldn't have to pinch pennies. And now they are telling you that you need to delay retirement, and spend less in retirement exactly BECAUSE you were savvy and invested your retirement in the stock market? Our savvy strategy got us the the exact result we were trying to avoid?

The problem with the conventional wisdom is that it doesn't consider one of the most important realities of retirement: You will need to withdraw money from your retirement fund on a fixed schedule over a long period. There are invariably one or more substantial stock market downturns during any given 20 year period, and so invariably the person with all of their retirement savings in the stock market will have to sell some portion of their portfolio when the market is down at some point during their retirement. And once you sell when the market is down it is impossible to realize the long term average return on your portfolio because that long term average assumes you never sell.

Since you will need to be withdrawing your money on a fixed schedule the long term return of the stock market is irrelevant to you. You don't care if over time it will eventually return 10% for someone who never had to sell their stocks. What you care about is what the return will be if you have to start withdrawing a fixed amount every year starting at age 65. And guess what? No one can tell you what that rate of return will be because its impossible to calculate or predict. If you are really lucky the market will stay up for your entire retirement. But what is more likely is that there will be a substantial downturn sometime during your retirement, and you will need to sell stocks at a loss just to keep your up with your expenses, and then your retirement fund will be crippled for the rest of your retirement because you had to liquidate at a bad time, and you will be in the exact financial place you were trying to avoid.

Another reality that the conventional wisdom ignores is that things come up and you never know when you are going to need to suddenly make a larger than expected withdrawal from your retirement fund. People lose jobs. Family members get disabled. Your child gets mixed up with the law. The big house you bought with an adjustable rate mortgage loses value and you have to sell at a loss because you got transferred and in order to close the sale you have to pull money out of your retirement fund to make up the balance on your mortgage. Stuff happens, and if it happens during a market downturn you could be forced to sell stocks at bargain prices and be left in the exact situation you were trying to avoid.

At this point conventional wisdom follower is shaking her head and has a knowing little smile because she knows that even though stocks are risky people who invest in stocks are still going to be better off in the long run than people who invest their retirement in bonds or (horrors) CDs, because the stock market investors will still get a better rate of return on average and so no matter what the stock investors will probably have more money in retirement. Which will probably be true most of the time if you assume the same amount of money invested in stocks vs. CDs. However, what if the perceived high rate of return in the stock market causes someone to save less?

Imagine you are in your 20s and you are starting to make plans for retirement. You carefully calculate the annual income you want to have in retirement, and then you calculate how much you need to be saving now to reach that goal, assuming (of course) a 10% return since you are savvy and will invest in the stock market. Thanks to the high returns available to the savvy stock investor it turns out that you don't have to save that much of each paycheck, and so you can afford to spend lots of money on lattes and nice cars and big houses. Meanwhile your clueless neighbor invests everything in low yielding but safe investments, and since they need to save more of their paycheck they have a plainer car, make their own coffee, and spend less on their home. Fast forward 45 years. The stock market crashes just as you reach age 65 and suddenly your retirement fund shrinks to less than that of your clueless neighbor. You need to postpone your retirement, sell your nice car, drop the lattes, and pray the market recovers before you are 80. Your clueless neighbor's retirement starts right on schedule and she has exactly the amount of money for retirement that she was expecting.

Here are some illustrative numbers. I put together a spreadsheet using Robert Shiller's stock market data and compared two hypothetical people who steadily invested a fixed percentage of the US median household income every month from 1968 to 2008, the year they both plan to retire. One person put 10% of median household income in the S&P 500. The other invested 20% of median household income at long term interest rates. Here's how they compared last year:

October 2007
10% of income in S&P: $1.1 million
20% of income at long term rates: $762,000

The safe investor sure looks like a chump and the stock investor is looking forward to a relatively lavish retirement. But lets look again a year later:

23 October 2008
10% of income in S&P: $646,000
20% of income at long term rates: $802,000

The stock investor has seen her nest egg diminish to almost half its size a year ago and her life has been turned upside down. The safe investor has had no disruption. Note that the stock investor, even with the market downturn, got a higher rate of return than the safe investor. And the stock investor was able to spend more money during their working years. But that didn't protect the stock investor from having her her retirement plans thrown out the window. And if the stock investor retires on schedule, she will pull money out of the market when its down, which will reduce her overall rate of return in in coming years.

The moral of the story: if you save for retirement assuming a high rate of return from stock investments you need to be prepared to suddenly find yourself with much less money than you were expecting to have.

So whats the answer? The answer is that if you want to be sure of having a certain annual income in retirement then during your working years you have to save, and spend, at a rate that assumes a low rate of return. If you save like all your money was invested at 4%, and you spend in retirement like your money was invested at 4%, then you can probably afford to have some or all of your retirement fund in stocks since you will probably be able to sell stocks at a loss during a downturn and still have enough left over.

Another possibility is to start off investing all your retirement funds in the stock market when you are young, but then start moving money out of the stock market and into conservative investments starting 10-15 years before your planned retirement (when the market is up, of course) with the goal of having at least 5 years living expenses in very safe investments when you reach retirement.