New depths of laziness
September 18th, 2006 by Jerry
I was pondering the abilities of my new phone, and I realized I could make it a remote for a couple things on my computer – mainly, music and TV. Since I’m too lazy to fix my computer’s infrared receiver box (and then too cheap to buy a shareware remote control program for my phone), I wrote a couple web pages to do the switching from the webserver. It works great now, and since I can connect to the wireless network in my apartment, it should respond pretty fast. All this so I don’t have to sit at my computer or lug around the wireless keyboard to control music/TV. Call it an exercise in system control via PHP.
However, in the process of writing these pages, I had to reconfigure sudo (non-linux-geeks: it’s a way to do admin-level stuff without having to enter the admin password; read this to get a better idea of what sudo does). In the process of letting the webserver run commands as me, I corrupted the sudo config. No problem – I’ll just log in directly to root (admin account) and fix it. This was when I realized the admin password wasn’t working right. I had just been using sudo to do all the admin stuff for a while, and now I had neither that nor the admin password.
Techno-babble Warning. Normally, fixing this would be a long scary process of booting from a recovery linux CD and manually mounting the root partition and fixing the problem directly. This probably would have required admin access to create the recovery CD, and besides, I was tired of restarting my computer, especially since earlier this weekend I had to do a panic-restart after mounting an NFS share directly on top of the home partition. But, since I’ve had problems with my 64-bit processor and some programs, I had a separate 32-bit system (dchroot) running, and sudo still worked in that setup. The only problem was that the main config files weren’t accessible from inside the 32-bit system. In a flash of brilliance, I remounted the root partition from within the 32-bit subsystem, fixed the sudo config file, and unmounted the partition (not sure if double-mounting a partition can cause problems). Saved from a huge headache! Although I may have just inflicted one upon my non-geek friends reading this! Sorry, but I did put a big warning up there…