Monday, December 26, 2011

TED Stuff to Remember

I've been a big fan of TED for several years, because it offers insight into what "the intellectual elite" consider important. Most of these people wouldn't give me the time of day, but occasionally, a few of them make some good points. I had some notes written on the back of an envelope that I wanted to throw away... ah... I meant recycle... so I figured I better blog them so I could find them later.

On Being Wrong
This presentation has a cute graphic of what it looks like to "realize you are wrong". I didn't care for the speaker, but the take away was what she called the "Unfortunate Assumptions of Wrongness":
There are three reasons someone might think you are wrong:
1. Ignorance- They don't understand the facts, so perhaps you can educate them.
2. Idiocy- You've explained it to them, so they must be too stupid to be to understand.
3. Evil- Maybe they do understand, but are trying to undermine your brilliant plan.
In my case, its always number three.

The Moral Mind
Very politically slanted, but not wrong. The speaker states that there five moral values, of which "Conservatives" acknowledge the importance of all five, but "Liberals" acknowledge only two.
1. Harm/Care - protection
2. Fairness/Reciprocity - don't lie, cheat, steal
3. Ingroup/Loyalty - community, tribalism
4. Authority/Respect - patriotism
5. Purity/Sactity - sexuality
The research seems to indicate that everyone agrees on 1 & 2, but that the divide is the "Conservative" insistence on the importance of 3, 4, and 5.


Self Deception

This presentation has a good explanation of the difference between a false positive and false negative, and how it relates to decision models.
Finding order in chaos which does not exist, is patternicity.
* More patterns are percieved by the left eye.
If the pattern (or model) is wrong, we have made either:
  Type I Error (false positive): believing something that is not real.
  Type II Error (false negative): not believing what is real.
When evaluating the outcome of a decision where the threat could be inanimate versus a predator, we naturally err on the side of the entity. This is called agenticity.
Agenticity is a difficult concept, especially since the speaker wraps it around religion, but the base of it is the belief that others can control chaos that we can't. If you're walking through the jungle and there is a rustle in the grass, it could be the wind or a lioness. If you assume it is the wind, and it is a predator, you get eaten. If you assume it is a predator, and that the predator has heightened senses, is faster and stronger, than you become over-cautious. If it is not a lioness ready to attack, its a "false positive", because you attributed agenticity to a sound without investigation. But you survive! Thus, we are wired for false positives.

Tuesday, December 06, 2011

Merrill *not* Lynch Retirement Calculator

For those of you from outer space, the American economy has been having a hard time recently. One shining example is the paragon of Wall Street, Merrill Lynch, which imploded nicely several years ago, but was too big to fail, so it was "bailed out". It now survives as a subsidiary of Bank of America, who was also too big to fail.

We'll I stumbled upon web based retirement calculator (click the Find Out button to the right) and decided to have some fun. I learned something interesting.

First the rules of the game: The calculator asks questions and determines a magic dollar value that you have to achieve. Four factors drive the calculator:
Current age
Current retirement contributions
Current income
Projected retirement age
Obviously the last variable is stupid, since everyone knows that retirement age is 65.

Given my actual age, a reasonable estimate of the value of my retirement accounts, and a reasonable estimate of my current salary, the calculator yielded a pass/fail rating. Pass was defined as having enough money to maintain my current lifestyle, and fail was defined as running out of money before I died... Which is apparently at age 91.

I had control over two factors, which determined if I passed or failed: First, the amount of money I contribute each month for retirement. Second, my investment style, defined by my degree of risk exposure. What I did not have control over was market performance, so I was presented output based on average market performance and below average market performance, which I guess means Merrill and Bank of America do not expect above average market performance over the next 45 years.

And what I learned was I get a passing grade if I save X dollars a month, using Y investment strategy:
$10,000 Conservative
$9,200  Moderately Conservative
$8,700  Moderate Risk
$8,500  Moderately Aggressive
$8,200  Aggressive

Needless to say, my New Year's resolution will not be to save $10,000 a month. So, I guess I "lose". But here's what I see as the moral of the story: The difference between playing it safe and taking the biggest gambles is less than 20%. If I put in a more realistic monthly contribution of $1,500 per month and act conservatively, I retire at 65 and run out of money at 67. If I'm aggressive, I run out of money at 68.

So, I guess I'll go aggressive. Let's be optimistic! What's the worse thing that could happen. After all, what's the likelihood that Wall Street will screw up again in the next 20 years?

Tuesday, November 08, 2011

Creating a New Project in SVN

It had been over a year since I'd created a new SVN project, so of course I forgot how and had to waste an hour trying to figure it out. Assuming a remote SVN server with SSH and working keys...

On the server:
cd /svnrepos
svnadmin create newproject
The project should now be visible in WebSVN.

On the client:
mkdir -p /tmp/newproject/{branches,tags,trunk}
cd /tmp/newproject
svn import -m "New Project" . \
    svn+ssh://websvn/svnrepos/newproject
Refresh WebSVN, and the three sub directories should be displayed, but we need to "prime the pump" by uploading an active item.
cd trunk;
svn co svn+ssh://websvn/svnrepos/newproject/trunk .
touch dummy.txt; svn add *
A         dummy.txt
svn ci . -m "First"
Click the trunk link in WebSVN, and the new file should be visible and the project should be active. Unfortunately, its in the wrong place... this is in /tmp.

Wipe out the "prime" directory:
rm -rf /tmp/newproject
Move to the "real" location and checkout the new project:
cd /some/path
svn co svn+ssh://websvn/svnrepos/newproject/trunk .
svn del dummy.txt; svn add *; svn status
Populate the directory with the project files. The next check-in should remove the dummy.txt file and sync with the server.

Sunday, October 16, 2011

Potty Humor

In a gents, somewhere in the UK, a sink manufactured by Thomas Crapper & Company.
Uh huh huh huh-- He said crapper.

Recyclable Turkey Gravy

..and its delicious and wholesome, too.

Tuesday, September 27, 2011

Good-bye Gnome

In the latest machine re-org, I reloaded my workstation with Fedora 15. I don't like it. I think they've made several wrong turns, the single biggest being their implementation of Gnome 3.

With Gnome 3, they have set a minimum acceptable video hardware platform. That's fine, because they provided a fallback mode in case the machine does not support 3D rendering. Accept for one minor problem... most of the desktop's features do not work in fallback mode.

For instance... The ability to exit the GUI. Yes: there is no logout, quit, exit, stop, leave, or otherwise feature. The only way out is to open a terminal and init 3. If they missed something as important as an exit function, just image what else they missed. (Hint: allot!)

So, I'm trying to switch to KDE and it looks promising. As a matter of fact, I have found a fix for my single biggest complaint with KDE. I am so use to highlighting text in a terminal window and pressing "Shift-Insert", that for five years, I have refused to use KDE because it required the extra step of "Ctrl-Insert".

On the taskbar, near the clock is a scissors icon. Left click, select Configure Klipper, and click "Synchronize contents of the clipboard and the selection". Now it works the way I want!

Monday, September 12, 2011

VM Autostart on XenServer

Its a good thing I don't need to run VMware, because they are so dependent on a pre-existing Microsoft infrastructure, that I couldn't run it, even if I tried. And I've tried. Of course, I should just go ahead and invest the $3,000 in Microsoft software... just so I can invest a $1,000 in VMware software. Or, I could use Citrix XenServer.

Unfortunately, Citrix is doing everything in their power to ruin their entry level product, based on the philosophy that if they strip enough useful features from their product, eventually people will have no choice but to buy it. I don't know... If I'm going to throw two grand at them, I might as well up the ante and buy VMware.

Or just hack their product. I mean, come on guys... are you even trying?

So, I've got a cluster of XenServers, and I want to start a VM with the host boots. Ah! Upgrade XenServer to enable! Or add the following to the /etc/rc.d/rc.local for all hosts:
xe vm-start name-lable=YourVmName
If the host is the first to boot, it starts the VM. If the host is not the first, it attempts the command, gets a failure message (becuase the VM is in the wrong power state... on), and boots as normal.

And now we give thanks to the command line Gods.

Wednesday, September 07, 2011

Linux Rescue for VM on XenServer

I finally figured out how to rescue a Linux VM running on a Citrix XenServer host, an believe it or not, it is completely unintuitive! First, power off the VM, though if you're going to rescue mode... you're probably "down" already. Second, mount the rescue media (CD/DVD). Third, make sure the VM is highlighted on the left pane of XenCenter.

Here's the trick: Across the top of the XenCenter menu, select VM, and Start/Shut down, and Start in Recovery Mode. The machine should boot from the rescue media. Proceed per rescue SOP.

Be forewarned... For some reason, booting is incredibly slow.

Monday, September 05, 2011

SSH Tunneliung of X11 Apps

I had occasion to finally test something I've been wondering for a while: What is the minimal configuration to allow and X11 application to tunnel through SSH? First, this procedure assumes you have a workstation that can display X11 applications. This can either be a Linux desktop or a Windows machine running Xming or another lesser X client.

Second, install a system with only the core or base packages, possibly by building the system through kickstart. Third, edit the /etc/ssh/sshd_config and make sure X11Forwarding is set to yes. Reload if needed.

Next install a simple graphical application; for my test I used xclock:
yum install -y xorg-x11-apps
Attempt to run:
ssh 192.168.1.1 -X xclock
Error: Can't open display
In this case a failure is what we expect.

Conventional wisdom says we need to install the entire "X11 Window System" group, which will grab almost 100 packages. Instead install one RPM:
yum install -y xorg-x11-xauth
ssh 192.168.1.1 -X xclock

Warning: <snip> (repeated several times)
...but behold! A glorious xclock. The errors are from not loading fonts on the remote machine. Oddly, if we install xterm, it also complains, yet it works just fine.

A side note on this procedure: To prevent from issuing the -X (or -Y) with the SSH command line, change /etc/ssh/ssh_config, adding:
ForwardX11 yes

Adding gedit will require 57 more packages.
Adding kedit will require 68 more packages.
Best choice: gvim, requiring three packages.
yum install -y xorg-x11-fonts-Type1 xorg-x11-fonts-misc
yum install -y gvim

Sunday, August 28, 2011

Unlocking Citrix Xensever Memory

Wow... Has it been that long since I posted? Yeah, its been a wild few weeks, what with hurricanes, earthquakes, hail storms, trying to sell a piece of underwater real-estate at a 30% loss. Whew! But hey, here's a Xenserver hack for you:

I loaded Xenserver 6 Beta on a cluster of servers, and was disappointed to find that they had moved memory management out of the "free" product and into one of the "pay" tiers. This means that if you want to change an VMs memory reallocation, you have to pay an extra licensing fee. Silly. Especially since it was so easy to bypass.

Create a template from a VM. Log into the Xenserver console via SSH as root. Using the template name that appears in XenCenter:
# xe template-list name-label=a-Windows_Vista_x86-x2
uuid ( RO) : 4c<snip>28
name-label ( RW): a-Windows_Vista_x86-x2
name-description ( RW): SP2, Registered
What we need is the UID. View the template parameters:
# xe template-param-list uuid=4c<snip>28
Here, look for the min/max lines:
memory-static-max ( RW): 1073741824
memory-dynamic-max ( RW): 1073741824
memory-dynamic-min ( RW): 1073741824
memory-static-min ( RW): 1073741824
I this case, the template will create a VM can only be 1G... never more... never less.

Lets change the bottom value:
# xe template-param-set uuid=4c<snip>28 memory-static-min=1
# xe template-param-list uuid=4c<snip>28 | grep " mem.*-m"
memory-static-max ( RW): 1073741824
memory-dynamic-max ( RW): 1073741824
memory-dynamic-min ( RW): 1073741824
memory-static-min ( RW): 1
I haven't figured out the other three values, as any attempt to change them throws an error saying they must all be equal. They do form the top limit, but once you strip out all that Aeroglass crap and disable half the services, Vista runs just fine at less than 512Mb. But just for the record, I wouldn't suggest you try to run Vista on 1 byte of memory.