Windows 7 MBR

If you happen to have Windows 7, and it craps out on you like mine did (Power outage, when it attempted to boot it would simply say Disk read error, Press Ctrl+Alt+Del to restart) then in order to fix it, you just need to run the following command from the Windows 7 DVD (or USB disk if you happen to have it written to a USB key)

bootsect /nt60 c: /mbr

Once I did this, that machine was back in action. And it only took me two weeks or so in order to get around to it.

DBus Tutorial (from Dan Williams)

In a thread on the NetworkManager mailing list explaining why a dbus-python script wasn’t working, Dan posted this tutorial, and I thought it was a good one, and should go out to a bit of a broader audience. (This is copied verbatim from the email, no spell checking or such – again, I did not write this, I am merely posting it here for others to consume)
Read More…

Speaking of wireless…

Thanks to Jeremy Olexa (aka darkside) I now have 2 new Atheros based cards.

One is a Belkin N1 Wireless Notebook card, Part #F5D8011 – ath9k based, although I’ve gotten it recognized by the kernel and I can get an IP address via dhcp, as well as connected via WPA2, I can’t seem to pass traffic.
Two is a Buffalo AG54 WLI-CB-AG54L, this one seems to be ath5k based, although I haven’t attempted to use this one at all yet.

Currently towards the bottom of the todo list, is to get these both working, preferably using the N1 as an access point, so I can test out the speeds of the Efika MX’s wireless. This has a secondary goal of seeing if the wireless issue that I have (currently I cannot seem to ssh into any wireless clients) is the AP I am using (pfSense based) or if it is something more; I’m guessing the former.


While working on the Gnome overlay with the Gnome team, I decided to give Empathy a go.  I talk to maybe 3 total people on AIM, and no one on Yahoo, which just leaves me with Jabber (Gmail) contacts that I actually talk to.  So I installed it, I even enabled webkit so that I could use Adium themes with it (I personally prefer Stockholm, just be sure to look inside the folder and only move the style into the right place.)

It was kind of a disaster.  I’m running on a Quad Core, 2.4ghz machine, and double clicking on a contact would take up to 25 seconds for the window to show up.  I was not a happy camper.  Watching htop, I could see that my DBus session bus was working hardcore.  100% cpu usage on 1 core.

No problem, I thought to myself, whipped open my handy terminal, ran “dbus-monitor –session” to watch the traffic that was causing it to use so much cpu and…. nothing.  Zilch.  There was no (apparent) traffic going on but the session bus was still using 100% cpu.

I popped over to the Gnome bugzilla, and started reading through bugs, but none were coming close to what I was seeing.  In desperation, I turned to the faithful Google.    And I searched… and came up empty – not so much empty as simply results that weren’t helpful at all.

I let it go for a few days, asked a couple people if they were having any issues, and most don’t use Empathy, so that was a bust.  Then I was looking around while I was “at work” which really meant I was sitting in the office as opposed to my room using the computer, and I came across Bustle;

Bustle is very nice, in that it can show you timings.  Once I had that compiled, I used Recordmydesktop to take a video of me using Empathy, with Bustle running, logging everything that went on with Empathy.  Then I popped in to the Empathy IRC channel (#empathy on and mentioned in the channel that it was taking a long time for my IM windows to open, and pointed them at the video ( (21MB)) and then at the two screenshots of Bustle ( and ), and Danni replied to me, asking why I was using the logger, when it shouldn’t be enabled.  So I disabled it, and removed telepathy-logger from my system, re-compiled Empathy, and sure enough, the IM window pops up instantly.  I’ve removed the dependency as well as got rid of the useflag (with a note in the ebuild about why) and committed it to the Gnome overlay.  Due to Danni saying that no one should be using telepathy-logger, I’ve also package.masked it in the Gnome overlay.  I must say, using Bustle is *very* nice, and I’d like to thank Will Thompson for writing it.

I also smiled at the “How?” section of the Bustle website, considering that was the exact purpose for me downloading it.

I’m hoping to write an ebuild for Bustle, and apparently it is really easy to do with Haskell as the Gentoo Haskell team has a script that you run that will write the ebuild for you.  I haven’t started working with it yet, but I definitely plan to, as Bustle is now definitely on my radar for usage in debugging what is going on with apps and their DBus usage.

Deauthentication Reason Codes

Client Reason Code…Description…Meaning
0…noReasonCode…Normal operation.
1…unspecifiedReason…Client associated but no longer authorized.
2…previousAuthNotValid…Client associated but not authorized.
3…deauthenticationLeaving…The access point went offline, deauthenticating the client.
4…disassociationDueToInactivity…Client session timeout exceeded.
5…disassociationAPBusy…The access point is busy, performing load balancing, for example.
6…class2FrameFromNonAuthStation…Client attempted to transfer data before it was authenticated.
7…class2FrameFromNonAssStation…Client attempted to transfer data before it was associated.
8…disassociationStaHasLeft…Operating System moved the client to another access point using non-aggressive load balancing.
9…staReqAssociationWithoutAuth…Client not authorized yet, still attempting to associate with an access point.
99…missingReasonCode…Client momentarily in an unknown state.

Just posting it here for future reference

Useful Documents and Bookmarking

I get asked a lot of times when I am doing things, how I did it – a lot of times they are Google searches with very specific keywords, however there are a few documents I always keep around in my bookmarks…
Writing udev Rules from dsd – this I would say is pretty much the definitive guide for writing udev rules – while it isn’t exhaustive, it does cover everything you would need to write your own. This isn’t Gentoo specific either – any distro that uses udev can follow these instructions!

I have a few machines, once in a while, I will do a clean install, and when I do, I always read the Gentoo Linux x86 with Software Raid and LVM2 Quick Install Guide – While I have been using Gentoo for the better part of 5 years, I am getting… uhh, older… and sometimes those little things slip through – so even though I don’t need to constantly read it – I always double check after I’ve done everything just to be sure I’ve gotten all the bases covered – nothing more annoying than rebooting into your amazing new clean install and having forgotten to emerge grub so it doesn’t boot! Yes, I will admit that I’ve done it (more than once!) but that is neither here nor there.
Gentoo Security Handbook – I don’t think I really need to explain why I keep this one bookmarked – always a good thing to have. While I won’t link them, the Infra documentation on hardened servers is also very good and easy to follow and understand what/why things are done the way they are.
Gentoo Linux Cron Guide – The question often comes up – which cron should I use? This guide is very good at explaining some of the differences between a few of the implementations available in Portage, and guides the user through the various installations and how to use cron as well.
GCC Upgrading Guide – This is pretty much a must-read as a Gentoo user/system administrator/developer – there are times where an upgrade is non-trivial, and this documentation is always good to follow when there is an upgrade available.
How to get meaningful backtraces in Gentoo – Another essential guide – if you are having an application crash on you, it is likely a developer will want to see a backtrace – this guide walks you through getting something that is actually meaningful.

While these documents may be talking about Gentoo for the most part, they are easily converted to another distro – definitely recommend checking them out at your convenience, and bookmark them, as they may be called up multiple times. If you don’t want to keep them bookmarked on your machine (since you are always out and about…. right? right!?) you can always use a service like diigo which is what I use personally (and any time I add a bookmark, they get posted here to my blog as well so I can find them without surfing over there), which is also a great site, however I no longer use it because I used to use an irssi script that posted all urls posted on IRC to it…. okay if you are in a few channels… not so good when you are in 20+ ;)
And a newcomer of sorts – Mozilla Weave – which requires Mozilla Firefox 3.0 (which is currently in beta or nightlies only) any basically allows you to sync all your settings to their servers, and when you login to another machine with Firefox 3.0, you can sync your settings down from there and have them. There are other things planned for it – and there are already addons for doing the same thing for Firefox already.