Overtherailing. RSS

I hope you find the answers faster than I did.

Archive

Dec
8th
Wed
permalink

Registry tweak to keep Internet Explorer’s download dialog boxes open

While you can just as easily accomplish this by downloading a large file, unchecking the “Close this dialog box when download completes” and cancelling the download, once in a blue moon it might be useful to accomplish it programmatically. Here’s a .reg to accomplish that.

(I’m unsure if this can be applied to HKLM or not.)

Info on the “reg.exe” command line utility here: http://technet.microsoft.com/en-us/library/cc732643(WS.10).aspx

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]
;
; Setting this value to "Yes" ensures that IE's download window remains open.
;
; This value is normally set by checking ("no") or unchecking ("yes") the
; "Close this dialog box when download completes" checkbox.
;
"NotifyDownloadComplete"="yes"
Nov
25th
Thu
permalink

Weird state-save (KVM/libvirtd) issue on Ubuntu 10.04.1 x64

As mentioned in my previous post, I’m enjoying getting to know KVM (http://www.linux-kvm.org) on an Ubuntu Server 10.04.1 64-bit install in my lab at home.

While things were going quite well (Linux, FreeBSD, OpenBSD, and WinXP VMs all ticking along nicely so far), I ran into a sizeable frustration: in virsh, I could not perform a “save” operation (e.g. commit a VM’s memory contents to disk to be restored later).

Here’s what would happen:

  1. In virsh, I would type “save vm-name-here /some/directory/vmname.save” and hit Enter.
  2. virsh would acknowledge the keypress (cursor moved to the next line) but would return no further output.
  3. The file “/some/directory/vmname.save” would indeed be created, but would never exceed a size of 1.5 kbytes or so.

I ran into this late in the evening and couldn’t attack it further (a quick strace operation wasn’t super informative); leaving the operation to run in a “screen” session overnight resulted in no additional progress. The VM would also stop responding, the virsh session in which the save-state operation failed would hang (until Ctrl-C was applied), and future “list” operations inside virsh would hang once reaching the problematic VM until I manually killed its KVM process.

I found this in the logs today:

[ /var/log/syslog ]

[...]
Nov 25 20:20:02 vmserver01 kernel: [343733.466671] type=1503 audit(1290745202.581:95):  operation="open" pid=3731 parent=26966 profile="libvirt-cb0b4b48-eb03-9284-34bf-15d0e84fb6a7" requested_mask="ac::" denied_mask="ac::" fsuid=0 ouid=0 name="/some/directory/ubuntu-vm1.save"

Turns out this is due to the default AppArmor profile wrapped around libvirtd in Ubuntu 10.04. After adding one line to the rules applied to libvirt and restarting apparmor and libvirtd (/etc/init.d/apparmor restart && /etc/init.d/libvirt-bin restart), I was able to save VM states to disk!

[ /etc/apparmor.d/abstractions/libvirt-qemu ]

[...]
/some/directory/* rw,
[...]

Note that the syntax “/some/directory/* rw,” specifically grants read-write access to files in that directory’s root, not directories or files further down the hierarchy. Relevant: http://manpages.ubuntu.com/manpages/hardy/man5/apparmor.d.5.html

(Disclaimer: I have no idea if this was the most appropriate location to tweak the ruleset.)

…Er.

Late breaking edit: I just discovered this is a known issue :p From the aforementioned AppArmor config:

[ /etc/apparmor.d/abstractions/libvirt-qemu ]

# workaround https://launchpad.net/bugs/457716. The svirt driver does not
# relabel the state file (https://bugzilla.redhat.com/show_bug.cgi?id=529363)
# resulting in denied messages. The below works around this somewhat by
# allowing users to save state files in their home directories. We use
# 'owner' to make sure we don't overwrite the user's files. This will be
# removed when the upstream bug is fixed.
#include 
owner @{HOME}/ r,
owner @{HOME}/** rw,

Looks like a cleaner fix is in place for the libvirt included in 10.10 (Maverick Meerkat).

Ah well. I wanted to save these state files elsewhere anyhow ;)

Nov
22nd
Mon
permalink

Networking in FreeBSD 8.1 x64 on KVM

Just a quick note on network functionality for a FreeBSD 8.1 64-bit guest on KVM (http://www.linux-kvm.org): type “virtio” was a no-go, but a network device of type “ne2k_pci” seems to work like a charm:

  

  <devices>
[...] <interface type='bridge'>
<mac address='52:54:00:53:65:83'/>
<source bridge='br0'/>
<model type='ne2k_pci'/>
</interface>
[...]
</devices>

Loving this KVM/virsh setup in my home lab so far.

Jun
12th
Sat
permalink

James Brown + Markov Chains = LOL

With the Markov Chain generator implemented in Ruby found here: 

http://blog.invisible.ch/2005/01/15/markov-chains-in-ruby/

…and a text file composed of James Brown lyrics from here:

http://www.lyricsmania.com/james_brown_lyrics.html

…We get the following:

Now darling you feel better! Get up offa that funky music white boy Play that thing, and movin` to release that thing, and movin` to get back I hold you later alligator.

OOdl-uh HYUH! HA! Gimme some! too fun-kay sound, now say it once (3xs) Hit ‘em hit’em!! Hey Hey!! WOOOOOOOOOOOO!

Is it now! Ow! Knock out by the wise old brother at the train To take us over the world But I need you got you

May
23rd
Sun
permalink

Sleep issues on Ubuntu 10.04 on Dell Inspiron 5150

After resurrecting and upgrading an old Dell Inspiron 5150 for a friend, I installed Ubuntu 10.04 Desktop and installed all available updates.

I don’t have a ton of experience with Linux as a desktop OS, but I gather sleep and hibernate functions can be problematic. Hibernate definitely doesn’t work out of the box on this Dell unit, but that’s not a big deal; my biggest concern was a functional sleep operation, which also wasn’t working out of the box.

After a little Googling on the issue, I changed the following line in /etc/default/acpi-support

ACPI_SLEEP_MODE=mem

…to:

ACPI_SLEEP_MODE=standby

…and ran:

sudo /etc/init.d/acpid restart

This apparently results in reduced power savings, but it at least grants some functional sleep functionality on this particular laptop.

(It’s worth mentioning that with 512MB of RAM, Ubuntu 10.04 totally screams on this unit. Very responsive, rapid startup, fabulous range of applications right out of the gate… I’m impressed. Beats the crap out of WinXP on the same machine.)

Apr
18th
Sun
permalink

Access SMS messages from an iPhone backup

An iPhone’s SMS history is stored in backups of the device as an sqlite database file which is readily accessible using the sqlite command line tools. The file in question is 3d0d7e5fb2ce288813306e4d4636395e047a3d28.mddata.

My iPhone’s SMS backup database is located in:

/Users/[username]/Library/Application Support/MobileSync/Backup/[uid]/

By cd’ing to the directory and typing:

sqlite3 3d0d7e5fb2ce288813306e4d4636395e047a3d28.mddata

…One can now start poking around:

sqlite> .tables
_SqliteDatabaseProperties  msg_group                
group_member               msg_pieces               
message                  
sqlite> select * from message limit 10;
[...]

Neat.

Thanks to http://insend.de for some useful hints on the location of this file!

Apr
12th
Mon
permalink

Fix that ?!@#*! Finder -10810 error

I’ve had intermittent issues with Finder hanging up on volume ejections; after killing it, it refuses to relaunch, displaying the error “The application Finder can’t be opened (-10810).”

Turns out you can pop into Terminal (I’m using Visor, so I always have one open; you could try opening it from Spotlight too) and type:

/System/Library/CoreServices/Finder.app/Contents/MacOS/Finder &

Thanks to the following site for the hint:

http://utvv.blogspot.com/2010/01/how-to-fix-application-finder-cant-be.html

Mar
25th
Thu
permalink
Mar
24th
Wed
permalink

UNetbootin: very cool bootable USB drive generator

http://unetbootin.sourceforge.net

UNetbootin allows you to create bootable Live USB drives for a variety of Linux distributions from Windows or Linux, without requiring you to burn a CD. You can either let it download one of the many distributions supported out-of-the-box for you, or supply your own Linux .iso file if you’ve already downloaded one or your preferred distribution isn’t on the list.

Pretty slick!

permalink

Fixing gem installation after Snow Leopard upgrade

If you’re trying to install Ruby gems after upgrading to MacOSX 10.6 and receive the following error:

computron:~ root# gem install json
Building native extensions.  This could take a while...
ERROR:  Error installing json:
	ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h

…just reinstall XCode off the 10.6 DVD (it’s under Optional Installs). Things should function fine afterwards.

Mar
22nd
Mon
permalink

Fugly bash script to monitor remote Web server

I bet this can be done better. If you feel the same way, please feel free to edit the following Gist:

http://gist.github.com/340464

#!/bin/bash
 
if test -z "$1"; then
        echo "Usage: curl.sh hostname"
        exit
fi
 
RESULT=`curl -sI ${1}|head -n 1|awk '{ print $2 }'`
 
if [ ${RESULT} -eq "200" ]; then
  # All is well 
  exit
else
  echo "OH NO SOMETHING IS BROKEN -- curl returned HTTP status ${RESULT} when fetching ${1}"
fi
permalink

Creating files of arbitrary size in Windows

When asked how to do this, my first reaction was to Google for a Windows port of dd. Turns out that since at least Windows XP, there’s been a built-in command line utility capable of this.

From Microsoft’s fsutil documentation:

Fsutil is a command-line utility that you can use to perform many FAT and NTFS file system related tasks, such as managing reparse points, managing sparse files, dismounting a volume, or extending a volume. Because fsutil is quite powerful, it should only be used by advanced users who have a thorough knowledge of Windows XP. In addition, you must be logged on as an administrator or a member of the Administrators group in order to use fsutil.

Usage is straightforward:

fsutil file createnew c:\test.out 1000000
Feb
18th
Thu
permalink
Science is the only news. When you scan a news portal or magazine, all the human interest stuff is the same old he-said-she-said, the politics and economics the same sorry cyclical dramas, the fashions a pathetic illustration of newness; even the technology is predictable is you know the science. Human nature doesn’t change much; science does, and the change accrues, altering the world irreversibly.
— Stewart Brand, “Whole Earth Discipline”
Feb
13th
Sat
permalink

No One Knows What the F*** They’re Doing (or “The 3 Types of Knowledge”)

alfajango:

Feeling Like a Fraud

Have you ever received praise, or even an award, for being great at something despite having no clue what you’re doing? Do you feel like a fraud, wondering what sort of voodoo you’ve unwittingly conjured up to make people think you know what what you’re doing, when the reality is quite the contrary?

I recently had a conversation with my girlfriend (going to school for her nursing degree) when she expressed her confusion with some praise she had received from her professor. Her professor had told her that she was the best nursing student she had had in years. “But how the hell could that be true?” she asked me. See, she sometimes struggles studying, is often worried about doing poorly on exams, and stresses about all of the things she doesn’t quite understand or can’t quite remember. At the same time,  she sees other people stroll into test-time confident and carefree. She sees others never asking questions and always seeming to just “get it”. By comparison, how could she possibly be any professor’s “best student in years?”

I could see she was distressed. Lucky for her, I could relate. In fact, one of many similar experiences I’ve encountered occurred just over a year ago. I had entered a competition called the Great Lakes Entrepreneur’s Quest (GLEQ), which is a business plan competition for new business ideas and up-and-coming companies. My company had not won any awards at the competition that year. There were over 100 companies that entered, with nearly 500 total participants. Then during the awards ceremony they announced a brand new award that they were going to start giving out, the Spirit of Entrepreneurship Award, which would go to one individual who they felt exhibited the qualities of a great entrepreneur outside of just being able to write a good business plan. And the winner of the inaugural award was me. I was startled, confused, and amazed. If they had said my name half a second earlier, the person in front of me would have had a mouthful of Coke in their hair.

How could I win such an award, being in a room with so many great entrepreneurs and so many exciting companies and business ideas? There were companies in the competition already making a million dollars in yearly revenue (eligibility for the competition required that your company be making less that $3 million annually). By comparison, I wasn’t even making enough to quit my day job yet. I had to fake a doctor’s appointment that day just to attend the awards ceremony. Don’t these other people know what they’re doing more than I?

The answer to that question is the title of this post. No one knows what the fuck they’re doing. Not me, not those guys making bank, not anyone.

The 3 Types of Knowledge

To really understand how it is that no one knows what they’re doing, we need to understand the three fundamental categories of information.

There’s the shit you know, the shit you know you don’t know, and the shit you don’t know you don’t know.

Imagine being lost in the woods.

An example of shit you know would be knowing that it’s okay to eat an apple should you come across an apple tree (however unlikely that may be).

An example of the shit you know you don’t know would be wondering if you can eat these berries. As a result, you may decide to play it safe and keep moving, or you may decide to eat one now, see if you get sick, and if not, eat some more.

For an example of shit you don’t know that you don’t know, imagine if you were raised in an extremely sheltered environment, and you were never taught that some plants are poisonous. Finding yourself suddenly stranded in the wild, you would probably just start eating plants at random as you become hungry, without thinking twice. Pretty soon you would likely fall sick and die from dysentery or mycetism.

As illustrated by this example, you can see that the only dangerous category is the shit you don’t know that you don’t know (excluding extreme situations of life and death, where only the first category [shit you know] could save you). The same goes for any profession.

If I’m an engineer designing a bridge, I know that I need to account for that location’s climate when choosing the materials for building the bridge… this is stuff I know. I may not know exactly which materials have stress limits within boundaries set by the climate, but I can look it up… this is stuff I know that I don’t know. However, if I were a Veterinarian, and someone asked me to design a bridge, I may not even realize that different materials are affected differently by environmental factors… this would be stuff I don’t know that I don’t know. And in this situation, someone would probably die.

In my girlfriend’s case, say she’s a nurse that needs to administer a drug to a patient. If she knows that the prescribed drug reacts negatively with another drug the patient is taking, she knows not to administer the drug. If she remembers that the drug has twenty side effects and tends to react with other drugs, she knows to either look it up or ask someone else who knows, perhaps a doctor, before administering it. The only dangerous scenario could be not realizing that there could be any side-effects or reactions, and thus administering the drug without any second thoughts. Again, the only dangerous category is the shit you don’t know that you don’t know.

Wisdom and the Art of Being Not Dangerous

Along these lines, “wisdom” may be defined as the ability to not be dangerous. So what then is the point of education and experience? Your professors and teachers (and typical exam structure) would lead you to believe that you must cram as much information as possible into the shit you know category.

I am going to be bold and suggest that this is wrong. The goal isn’t to put as much as possible into the first category, it’s to take as much as possible out of the third category.

Now whether this means putting it into the first or the second category isn’t as important, as long as it’s not in the third category. In other words, the goal is to be not dangerous.

Everyone is as Clueless as You, If Not More

This is where the disconnect is. This is why you, my girlfriend, and myself at times feel like a fraud amidst praise and recognition. We feel that we have no clue what we’re doing, yet we see others confident and able. Surely they’re the ones that deserve the praise and recognition.

Here’s the secret though. Those other people fall into one of two categories, and neither one of those categories is more knowledgeable or able than you are.

1) They have figured out everything written here, and thus, are on an even playing field as you. They deserve it no more (and no less) than you do. They (and you) have a very large shit you know you don’t know category. Not only that, but they (and you) can only imagine how immense the shit you don’t know you don’t know category is (since it’s impossible to know by virtue of being the stuff you don’t know about). It’s easy to see how small the shit you know category is by comparison. And it is this awareness that makes them (and you) feel so clueless at times.

2) They legitimately think they know everything. The thing is, they don’t. These people are usually very egotistical (not to be confused with simply having a healthy ego) and don’t realize how little they really know. In other words, they have far more in the third category (shit they don’t know they don’t know), and far less in the second category (shit they know they don’t know). The first category is probably more or less the same.

One thing to note about this second type of confident people is that they are dangerous in two ways. For one, they exhibit a much larger third category as discussed above. They can be likened to a stereotypical teenager in thinking they know everything and not realizing how much there really is to know. However, unlike teenagers, they have a tendency to make others think they know what they’re doing, which makes others tend to rely on them. It causes others to put them in charge of things it seems like they know how to handle. And of course, since these people legitimately think they know how to handle these things, they are likely not to look it up or defer to people who actually know. As you can imagine, this causes their potential to be dangerous much more real than that of teenagers.

The Reason You Feel Like a Fraud

The real reason you feel like a fraud is because you have been successful in taking a lot of information out of the third category and put it into the second category; you of a lot of stuff you don’t know. The good news is that this makes you very not dangerous. The bad news is that it also makes you feel dumb and helpless a lot of the time.

Relax, Be Realistic, You Can Do It

I hope that this helps if you find yourself sometimes feeling conflicted, recognizing the contradiction between your abilities and what other people say about your abilities. When you find yourself in a situation where you don’t know what you’re doing, don’t be afraid to ask for help. Don’t ever feel ashamed for not understanding something, even it seems like it should be obvious; if you don’t understand it, then it’s not obvious, plain and simple.

In fact, if you never feel clueless, and you always know better than everyone else, please let me know, so that I can be aware of how dangerous you are.

Update: Rumsfeld, Dunning-Kruger, and Hacker News

Since writing this, I’ve been pointed to Donald Rumsfeld’s poem, The Unknown, which quite concisely describes the 3 Types of Knowledge I’ve written of here.

The Unknown
As we know, 
There are known knowns. 
There are things we know we know. 
We also know 
There are known unknowns. 
That is to say 
We know there are some things 
We do not know. 
But there are also unknown unknowns, 
The ones we don’t know 
We don’t know.

—Feb. 12, 2002, Department of Defense news briefing

Reformatted by The Slate.

Another related idea that has since been pointed out to me is the Dunning-Kruger Effect, which describes a bias in people’s in which they reach erroneous conclusions and lack the ability to realize it.

And for some really good relavent discussion on this post, check out the thread on Hacker News.

Update: Sub-categories of Knowledge

As a few people have pointed out in the comments and on Hacker News, there are also a few sub-categories of knowledge that are worth mentioning.

Shit you don’t know you know:

This is most closely a sub-category of the shit you know you know (1st category), but for one detail… you don’t realize that you know it. This category delves into the Freudian theories of the subconscious.

Shit you know you don’t know *anymore*, a.k.a. the shit you know you forgot:

This is a sub-category of the shit you know you don’t know (2nd category). As has been humorously pointed out, this is one of the main ways your second category grows to its overwhelming size as you get older.

Shit you think you know, but don’t:

This is a sub-category of the shit you don’t know you don’t know (3rd category). This is the most dangerous of all knowledge. This is mis-knowledge.

Jan
30th
Sat
permalink

Cognitive dissonance in marketing

From a recent Blackberry Bold 9700 ad:

“Whether conducting business with partners or conducting imaginary trains with your 5 year old, give every moment your undivided love.”

I’m reminded of the Bill Hicks bit on marketing and advertising…

http://www.youtube.com/watch?v=gDW_Hj2K0wo