Linux and Wireless Config
Configuring wireless on Linux is a pain. Gentoo doesn't make the situation any easier: there's a text file in /etc/conf.d that needs to be edited to include your SSID, keys, options, etc., and if you're using WPA/WPA2, you need to mess with /etc/wpa_supplicant/wpa_supplicant.conf as well. If I want to change networks (say, when I visit my dad's house), I have to edit these files and restart the interface.
There's NetworkManager. It looks really cool. Unfortunately, it doesn't work on my PowerBook. It never scans for wireless networks (though it appears to detect my wireless interface ok), and its logging output isn't too useful. To be fair, I haven't had the time to look into it too deeply (after spending hours and hours getting it to build properly, I didn't have much patience for runtime issues), and I'm aware that the Gentoo 'backend' isn't one of the more mature ones. Also: it's ridiculously over-engineered. I do understand all the various cool things you can do with it because of how it's designed and integrated into the desktop, but all of that stuff isn't useful for my general usage.
Oh, and I still can't get NetworkManager to compile without gnome-panel present, which really pisses me off. It doesn't even build a GNOME panel applet, as far as I can tell. Regardless, I use Xfce, as we all should know by now. I've tried to keep the number of extraneous useless libraries and apps installed on my laptop to a minimum, so I don't really want to install most of GNOME just for a network control applet in my systray.
(I'd just like to point out that I think NetworkManager is a great piece of software. It obviously does work very well for some people. Just because it doesn't work for me, or doesn't meet my needs quite as well as I'd like, that doesn't mean I think it's crap. It most definitely isn't.)
I was thinking about what I care about for a wireless network manager. I realised that I don't need/want it to manage my wired ethernet interface. (That's a separate project: just a simple daemon, probably written in bash or perl, that configures/un-configures the interface when a cable is plugged in or removed.) For wireless, I'm thinking about the MacOS X model here. You get a little menu in the menu bar that lets you turn wireless on and off, pick networks, enter security info, and (I think, don't have the Mac in front of me right now) open up the networking settings panel. That's really all I need as well. I don't need fancy system services (I'll count on Gentoo's startup script to try to connect to my default already-defined networks on startup), I don't need it to take care of my ethernet interface, I don't need it integrated into my desktop so all my apps can know whether or not I have a network connection, I don't need a D-Bus service, and I don't need some weirdo 'dhcdbd' thing (I still have no idea what this does or why NetworkManager needs it, and I don't particularly care).
So, I think I'm going to blatantly rip off the Mac and write a little system tray icon (yes, I know, abuse of the systray; sue me) to handle my wireless connections. I was looking at wpa_supplicant, and it appears that it's freakin' awesome. You can use it for connections to unsecured, WEPed, and WPAed networks (among a bunch of other things most people aren't likely to have in their home), and it has a command-line tool to control a running instance of it (wpa_cli), which can add/remove networks, set parameters, force it to reassociate, etc. So I'm thinking I'll just require wpa_supplicant, and do network management through that. There are two things that require root access: 1) bringing the interface up and down, and 2) writing out a new wpa_supplicant.conf file so the system boot scripts can take advantage of any changes (this is optional). We don't need root for wpa_supplicant control, because it can be configured to allow normal users to control it based on their group membership (though on my laptop, the permissions on the control socket were messed up when I first tried it).
Bringing the interface up and down is annoying, since it's a very tiny (yet critical) action, and I need to pay attention to a bunch of security-related issues. One option is to use gksu or some other GUI method of prompting for the password. I like this from a development perspective, as it requires very little work on my part. It's a pain from the user's perspective, though, as I don't feel that a logged-in user should have to enter his/her password every time they want to turn wireless on or off. A lazy option is just to require the user to set up 'sudo' to let them run ifconfig with root privs with no password, but I don't really like that either. I think I'll end up writing a setuid helper app that validates the logged-in user in some other way (perhaps using pam_console).
I'm going to attempt to do it without depending on any Xfce libraries (though I might pull in libexo for the session client and a couple other things). I'd like to create a general-purpose desktop-neutral app here. It's certainly not going to cater to everyone, and probably won't work on all distros without some manual fudging. I just don't have the time or desire to spend that much time on it (yet), and I'll have to rely on contributors to submit patches for their setup of choice, if they care to do so.
Otherwise, it's not that hard. I'll store wireless config in my own format in the user's homedir. There can be an option to write out a system-wide wpa_supplicant.conf file to sync changes with the system so the interface can come up on boot with some default setup. All that's left is a lot of text output parsing (from wpa_cli, which hopefully doesn't change output formats between versions), and good CLI/GUI integration when setting wireless parameters and presenting feedback to the user. Since I'll be in MD for 2.5 weeks, I'll give it a shot, as I don't really have all that much planned while I'm at home.
(I think I'm going to name it 'airconfig'; when I make a website for it, it'll likely be here. If anyone has any thoughts for a more creative name, feel free to leave a comment.)
Sleep, Or a Lack Thereof
I've been having trouble sleeping recently, more than usual. I hardly got any sleep Sunday night, which was probably more due to napping Sunday afternoon than anything else. But the end result was that I probably spent about 2 hours sleeping, but still got up at 8am to get ready for work.
So I figured Monday night I'd be exhausted and I'd sleep well. I went to bed around 10pm, and fell asleep very quickly. However, I woke up at 1am. I had a lot of trouble falling asleep after that, maybe getting another 2-3 hours of sleep in before finally getting up at 7:30am. I felt tired, and not really rested (and I still feel kinda tired).
I'm not really sure what it is. Is it physical or mental? Am I not comfortable in my bed anymore? Is it too noisy? Too warm/cold? Has there been a lot on my mind lately that's keeping me from sleeping?
I really don't know. There's been a decent amount on my mind lately, but it's mostly work stuff, and I tend to be pretty good about leaving work stuff at work. Life stuff... well, I guess there's been a bit on my mind there as well, but I don't think that's been keeping me awake.
I hope it's not my bed. A new mattress isn't cheap.
Temperature is a good question. My bedroom is a couple degrees hotter than my living room because of the computer equipment. Still, if anything I feel a little chilly in my bed (sans blankets). I think I feel relatively comfortable.
Noise is a possibility. A few months ago I added a small dedicated Linux box as my router. It has a single 80mm fan that's a bit noisy. I should replace that with a quieter fan. Also, the CPU fan in my desktop machine could stand to be replaced, as it's not the quietest thing in the world. THe other fans in my computer are all variable-speed and relatively quiet.
So I guess I'll try replacing some of my noisier computer fans and see if that helps. I also came upon these noise-absorbing blocks, though I'm a bit skeptical. They also carry noise-absorbing lining material, though that's a bit more pricey. Ideally, I'd like to just move my computer out of my bedroom, but I don't have another place for it. If I ever move into a larger apartment with a spare room, that would work, but until then I'm stuck. I've also thought about building a low-noise, low-power NAS box to move all my storage out of my desktop. With that, I could conceivably leave my desktop off a lot of the time, or maybe even think about moving to a laptop-only configuration. I think I'm a ways off from that, though (maybe after I buy an Intel-based Mac laptop in a couple years).
Finding a good heatsink/fan combo for an old Athlon Socket A/462 motherboard isn't as easy as I'd hoped. The board also has very little clearance around the sides of the CPU socket, so smaller is better. It would be nice to get away with just a tallish heatsink, but the older Athlons probably run too hot for that.
Following Directions
Sigh. I know people don’t read directions. I know that, when you want to get someone to read something, brevity is better: the less there is to read, the more likely the recipient is to read it.
But when the first line of a Bugzilla mail says “Do not reply to this email. To comment on this bug, please visit: (URL)”, you’d think that people would, you know, just click on the damned link. How is it easier to hit reply, delete “bugzilla-daemon@xfce.org” from the “to” line, and paste my email address in there?
(Ok, spambots, have at the bugzilla-daemon address. It goes directly to /dev/null anyway.)
So now, Xfce Bugzilla emails start with this: “DO NOT REPLY TO THIS EMAIL. Also, do not reply via email to the person whose email is mentioned below. To comment on this bug, please visit: (URL).”
Hopefully that’s clear enough, and not too long for the ridiculously lazy among us to read.
Following Directions
Sigh. I know people don't read directions. I know that, when you want to get someone to read something, brevity is better: the less there is to read, the more likely the recipient is to read it.
But when the first line of a Bugzilla mail says "Do not reply to this email. To comment on this bug, please visit: (URL)", you'd think that people would, you know, just click on the damned link. How is it easier to hit reply, delete "bugzilla-daemon@xfce.org" from the "to" line, and paste my email address in there?
(Ok, spambots, have at the bugzilla-daemon address. It goes directly to /dev/null anyway.)
So now, Xfce Bugzilla emails start with this: "DO NOT REPLY TO THIS EMAIL. Also, do not reply via email to the person whose email is mentioned below. To comment on this bug, please visit: (URL)."
Hopefully that's clear enough, and not too long for the ridiculously lazy among us to read.
Long Day
Today I was at work from 8:45am until 7pm. While that may not be particularly impressive in the long run, it's quite a bit for me. While I didn't particularly appreciate spending the majority of my waking hours there, it's nice that the work is starting to interest me again. I'm getting to do a bit of software work. Even if I'm not really writing new code yet, digging into the Linux kernel for debugging purposes is pretty fun.
Anyway, I want to get to bed. I've been getting up early so far this week, and I'd like to keep it up.
Bye-bye, Kitty, Again
I don't know what's going on, but the second of our three cats had to be put to sleep last night. She was diagnosed with kidney disease a few days ago, and wasn't given a lot of time. She did ok for the first couple days (albeit being tired and sluggish), but started getting sick yesterday. She seemed to be in a lot of pain, so Dad had her put down; really, the only merciful thing to do.
What to say about Gwynna... She was the youngest one, about 7 or 8 years old, I think. I didn't know her as well as the others, as she was taken in around when I left for college. She was a beautiful cat, mottled brown/orange and grey. She was very personable, and meowed all the time, sometimes seemingly for no reason. She always wanted attention, sometimes at the expense of the other two cats.
I'm not sure what else to say... I'm still a bit stunned that two of our cats have died in the past 2 months.
Xfmedia 0.9.2 Released
I was bored last night, and decided to try to fix a few xfmedia bugs. It was looking fairly decent, so I figured I'd put together a new release, since it's been over a year since the last one, and several fixes have accumulated since then. Anyway, feel free to go download it from the page above, and/or check out the summary of changes.
Drivel
For the hell of it, I installed Drivel. I'm not sure if I prefer blogging from a "normal" web client, or from a local client, outside the web browser.
One deficiency is that Drivel (2.0.3) seems to be unable to set more than one category for new posts. Unfortunate.
This might be out of scope for the app, but a more robust post manager might be nice. Currently you can see recent posts in a dropdown menu, but to do anything with them, you have to load the post. I'd like to have a window with a list of posts, sorted by date, category, whatever, and be able to do various things with that.
Maybe I'll play with it again some other time; it looks like a neat piece of software.
Themable App Icons
Gotta head to the airport soon, but a quick note: neat hack for installing app-specific themable icons.
New Hacking Project
Back in March, I bought a used 12" PowerBook G4 from James. I absolutely love it, but I've had one annoying problem. I have both Mac OS X and Linux on it, and I have three partitions on the 60GB drive: one for Mac, one for Linux, and one for my home directory, which is shared between both OSes. Of course, I needed something that both of them could read and write to, so I chose the Mac HFS+ format. At the time I installed it, the ext2/3 driver for OS X didn't have write support for 10.4. It does now, but it doesn't have ext3 journaling support.
Unfortunately, the Linux HFS+ driver lacks journaling support as well, so I was forced to use a non-journaled volume, as Linux refuses to mount a journaled HFS+ volume read/write.
Now, I don't know if it's a deficiency in the Linux HFS+ driver, but 90% of the time after a hard lock (which unfortunately happens somewhat often, as the OSS Broadcom wireless drivers aren't always so stable), the filesystem gets trashed, and even OS X's Disk Utility can't fix it; I have to bust out the big guns: Disk Warrior. And even sometimes that has trouble. So, needless to say, I don't put anything irreplaceable on that partition.
So, I've decided to add journaling support to the Linux HFS+ driver. I don't expect this to be remotely easy. The first step, which I have somewhat completed, is just to allow the driver to replay the journal if there's data in it on mount (i.e., if a crash under OS X left the filesystem in an inconsistent state). I've been running into a bunch of annoyances, many of which just stem from the fact that I've never done any kernel hacking before. It took forever just to figure out how to write to the disk. Figuring out how to read wasn't easy either. I thought that after I'd found the sb_bread() function, that would be it. But, of course, it's all a matter of units. sb_bread() seems to read in blocks of 4096 bytes (which might be device-dependent; it just happens to be 4096 for me). In the HFS+ volume header, the journal location is specified in filesystem blocks (512 bytes), which took me forever to realise. Then most other offsets are in bytes. To make matters worse, some of Apple's documentation doesn't quite make sense.
Writing was another matter. sb_bread() returns a "buffer head" structure, which contains all the data in that block from the disk. (That's another thing: you can't read a certain amount of bytes from the disk, from what I can tell. Each time you read, you get a block, no more, no less.) For writing, you have to read out the correct block, copy the new data to the correct point in that block's buffer, then call mark_buffer_dirty() on it. If you want to write it immediately (I think/hope), you then call sync_dirty_buffer() on it as well.
Anyway, I think I have most of that sorted out; I just need to figure out some things I'm doing wrong regarding interpreting the spec and where portions of the journal are, and it should be ok.
Then comes the hard part, which as far as I can tell isn't documented anywhere: actually implement the journaling support in the driver so as you write to the disk during normal daily activities, metadata gets journaled, then data is written, and then the metadata is flushed to disk (or whatever). I really have no idea how this even works, let alone the details of implementing it. If anyone has any info on this, please feel free to drop me a note...