Archive for the ‘Linux’ Category

Linux in the 21st Century

October 3rd, 2007 by daryl

For years now, I’ve been an avid Linux user. I (half) joke about how crummy Windows is, and I hate when I have to support Windows, though I’m really not as much of a Linux zealot as you might think. I have to confess that there’s a part of me that likes knowing how to do arcane things that lots of other people don’t know how to do. See all that text scrolling by in my simple terminal window? That’s me installing software, bucko. No graphical installers with smiling paperclips for me. I really do like understanding how my system works (more or less), being able to look under the hood to troubleshoot things. I like not having to understand how a registry works in order to tweak software (though I do have to know how to edit a text configuration file, which might be as scary to others as a registry is to me). But some of my old school willingness to dispense usability in favor of a dumb sense of pride and configuration simplicity is wearing off. More and more, I’m finding that there are tools it’d be nice to have that aren’t best implemented in a terminal application. Sure, I could write a program to read a text file I store meeting requests in and send me an email when I’m about to have a meeting, but that takes work and seems not terribly reliable. More and more, I’m looking for tools to handle these sorts of tasks for me, and I’m finding that I like them. I’m emerging from my self-imposed prison of command line solutions and testing out tools that just might help me work like a normal human being, and with some surprisingly good results.

One such tool is Korganizer, the KDE desktop manager’s calendar and organizer tool. In recent months, I’ve been required to attend many more meetings than in the past, and trying to keep them all straight has been a pain. I had tried using Mozilla’s Sunbird calendar program at various times in the past, and it’s a fine piece of software, but it clutters up my workspace. In addition to my mail window, my browser, my irc client, and my tabbed terminal window, I also had to have Sunbird running, and it just irritated me. So I recently tried Korganizer, which it turns out will hide in your system tray and pop up alerts reliably. I’ve been using it for a couple of months now and really have no complaints. It’s a little sluggish on my system, but not so bad that it keeps me from using it. I can tolerate a little UI lag when adding events if the trade-off is reliable notification of upcoming events, the ability to suspend or dismiss events, reasonable handling of recurrence, and a view of my day or week (or month) that lets me see at a glance what’s on my schedule. And Korganizer has all of these things. It also handles todo lists and journals, which I guess are like meeting minutes. I started using todo lists but found that having to open the app to see them made them less useful. I haven’t played with journaling. There are a bunch of buttons at the top that I haven’t done much with, though I’m sure they’re useful. The system tray utility seems to use up no appreciable resources, and that’s a big win on a system that runs dev mysql and apache servers in addition to all my desktop software. I’m sure there are things that Korganizer could do a lot better (I wish I could see our executive calendars, kept on a remote groupware server; as it is, I’m an island), but it beats holy hell out of hacking together something using text files and output from the “cal” command, and it has become a must-have tool for me.

Next up is Komodo Edit. I’ve taken comfort in the simplicity of the command line and the non-GUI text editor since I became used to editing files in pico and reading mail using pine back in college. When I began doing a lot of programming and learned a lot of the cool things you can do using the vi editor, I couldn’t imagine I’d ever go back to an IDE that would require mouse moves and menu navigation. My fingers are hard-wired to do vi commands now. I can do text replacement in my sleep (want to add a tab to the beginning of lines 23 - 47? type: “<ESC> :23,47s/^/\t/”; oops, wanna undo it? just type “u”; then “:wq” to save and close), and I have trouble editing in any other way. One of my few beefs with vi has always been that it’s hard to do operations that span more than one vertical span of screen real estate. To delete a line range, you have to count lines or look for line numbers and then delete or cut. If you’re trying to move a hundred lines around, this can be a minor pain. A few years ago, I tried out ActiveState’s Komodo IDE. It’s built on top of Mozilla’s code and so is a cross-platform solution. At the time, it was very sluggish and didn’t offer much that interested me. Sure, there was code completion and syntax highlighting, but I can get the latter in vi, and the former almost always winds up irritating me more than it helps me. Plus it cost money to use the non-evaluation version. Recently, ActiveState and Komodo have been in Mozilla news. They’re starting a project to open up parts of their source, it turns out. In reading about this, I learned about Komodo Edit, which is the light-weight version of their pay-to-play editor. It’s free and pretty responsive (probably because it’s doing a lot less junk behind the scenes). Most importantly for my use, it has vi key-bindings. So I can fire up Komodo Edit, avail myself of what scrolly and selection capabilities are useful to me, and still do the weird “:23,47s/^/\t/” sort of commands that my fingers are so used to. What’s more, I can define projects and view select files in a sidebar, so I do a lot less typing to navigate my file system when working on projects that require me to edit a number of files. I’ve also discovered that the find and replace helps out sometimes when there’s some regex that I can’t quite work out by hand (e.g. when I want to replace with newlines). I probably use a tiny subset of Komodo Edit’s feature set, but they’re pretty useful. I find that if I’m doing one-off edits or will be staying in one file and toggling to the command line to test (e.g. when working on a perl script to parse a log and display summary info), I do better to stay at the command line, but Komodo Edit is fast becoming not a “must have” but a solid “nice to have when I want it” tool.

My latest interest is in launchers. I never really caught on to Mac OSX’s Quicksilver launcher. Or it’s not that I didn’t get it at some level as that I didn’t see that it was a killer feature for most Mac users, who I think of as people who like to draw pretty pictures more than as people who tend to want to remember abstruse key combinations needed to make a launcher behave in useful ways. But as I find myself more and more trying to get back to documents or applications that are buried in the file system or in menus, I find myself wishing I could just type a couple of keys to pull up the apps or docs. KDE’s Katapult looks very slick and promising, but it’s geared toward KDE applications and interactions, and I can’t seem to pull myself away from the Gnome desktop manager. Although I’ve read that Katapult is easy to extend, documentation seems poor at best, and I suspect you have to drink the KDE Koolaid and know a bit about working with KDE frameworks in order to make much headway. Gnome has an app named gnome-launch-box that is sort of like Katapult, but it’s very ugly. Although you can run it without the window initially on top of other apps, I can’t figure out how to then provoke it (in Katapult, you press CTRL-space and the slick interface appears instantly). It’s pretty responsive in terms of finding and launching folders and applications, and it handles multiple matches (e.g. a list pops up displaying both Korganizer and Komodo Edit if you type “ko”) and seems to be wired for extensibility, but by the developers’ own admission, it’s just not ready for prime time yet. Ubuntu ships with a tool called Deskbar that is a sort of launcher, but it hasn’t worked very well for me so far. It’s hard to predict what results it’ll return and in what order, and though it appears to be fairly extensible, a plugin I wrote for it (actually, I just modified the bugzilla plugin to point to my bugzilla install) is quirky at best. So while I’m on the hunt for a good launcher, none of the options I’ve found to date quite cut the mustard yet.

Of course I use Flock and Thunderbird. In the next few weeks, Flock will be making a big step toward its original vision for the browser as a social tool. Thunderbird is pretty low-frills but has served my email needs very well for roughly five years now. But these apps are old news for me, so they don’t really fit into this post, which outlines a recent foray into a broader set of GUI apps. In the same category are xchat and OpenOffice.org.

So, there you have it. Back into my dork cave I go. All this time out in the land of the first-class user has instilled in me a craving for a darkened room and the glow of a terminal window flickering up at me in a chunky Courier font.

:wq

New Laptop (and Ubuntu)

May 18th, 2007 by daryl

I’ve got a training session coming up in a couple of weeks for which I’m required to have a Windows laptop. Of the three laptops I owned at the time of my learning this, one is broken, one is 4 years old and just doesn’t have the power to run the software I’ll need to run, and my main one runs Linux. Sounded to me like it was time to get a new laptop. Doing so would afford me the opportunity to take both a Windows laptop and my Linux box to the training (where I’ll be doing a full day’s training and then, if possible, also a full day’s regular work each day, which necessitates that I have handy the box I can actually be productive on). It would also afford Mleeka an upgraded system after I got back from training. So I went to amazon and dropped a grand on another SONY Vaio and an extra GB of RAM. This is a significant upgrade for me, as I’m currently running half a GB and will be running 2GB when the new RAM arrives.

The new computer got here yesterday, and of course I love it. My inclination was to wipe Vista from it first thing, but then I googled around about dual-booting with Vista, and it turns out to be really easy. Vista lets you partition the disk without even so much as a reboot, which for Windows is shocking. So I shrunk the Windows partition and booted from the disk for Ubuntu Feisty. I had to mess around with gparted for a while to get the partitioning just right, but then I installed Ubuntu, and now I have a dual-boot system. So Mleeka gets her upgrade a little early. I started moving files from the old laptop to the new yesterday afternoon, and by now, I’m completely migrated.

I can’t say enough about how smoothly the Ubuntu install went. I’ve posted a number of times in the past about all the hoops I’ve had to jump through to get various Linuxes (Linuces?) installed on various laptops, but this time, it just plain worked. No wrangling with xorg.conf to get the widescreen or touchpad to work. No more special network card drivers.

The only rough patches I’ve hit so far are that networking does seem a touch flakey. I can get to other boxes on my network without issue, but I’ve had to restart my wireless interface a number of times this morning because I couldn’t hit things outside the network. So I’ll need to work that out. And when I opened up my laptop this morning, I was surprised to see that it had shut down. Turns out that the power management settings default to hibernating when the laptop is closed, and hibernate, intentionally or not, equals hard shutdown on this hardware. That’s easily enough resolved with a change to power management settings.

So in two weeks, I’ll be off to my training with just one laptop that happens to be blazing fast. My next step is to make a virtual machine of another Windows install so that I can run it in vmware during the training and never have to leave the comfort of a bootup into Linux.

Ubuntu notes

December 21st, 2006 by daryl

I’ve been running Fedora Core 4 on my laptop for a year and a half now, and I figured it was about time to update to something newer. I had tried Ubuntu briefly on the laptop at the very beginning but wasn’t impressed. I’ve also had Ubuntu running as the OS on my backup machine for a while, but I never use that machine manually, so I haven’t done much testing. Here go some miscellaneous notes after a couple of days of using Ubuntu (Edgy Eft). This is on my Sony Vaio VGN-FS550, which I absolutely love.

The install was fairly easy, and for the first time in the history of linux on laptops for me, the wireless just worked out of the box with no poking around to find drivers and just the right config. Setting up the widescreen was also pretty easy, if a little different from on FC4. On the latter, I had to google around until I learned about a tool called 915resolution that helps you set up widescreen displays, and then I added some config mumbo jumbo to my /etc/rc.local file to adjust the screen resolution on startup. Ubuntu, it turns out, has a nifty package for 915resolution (so no more hunting around — just do “apt-get install 915resolution”), but it doesn’t have /etc/rc.local, so I had to find out how to make it run on startup. Ubuntu does this through /etc/default. When you install a package that may run at startup, it gets a file added in here by the package installer, and you add config to that file. So voila, within a matter of minutes, I had my widescreen set up (compare to hours of clueless googling and trial and error to get it set up originally in FC4).

The Alps mouse was a little more difficult. To fix this, you have to google around and find an xorg.conf config that’s close to what you need and then tweak it until it works. To find out what device to use, you can cat /proc/bus/input/devices and look for the mouse. In my case, it looks like this:

I: Bus=0011 Vendor=0002 Product=0008 Version=7321
N: Name=”AlpsPS/2 ALPS GlidePoint”
P: Phys=isa0060/serio4/input0
S: Sysfs=/class/input/input6
H: Handlers=mouse1 event5 ts1
B: EV=f
B: KEY=420 0 70000 0 0 0 0 0 0 0 0
B: REL=3
B: ABS=1000003

The “Handlers” line in theory tells you what to plug into the InputDevice section in xorg.conf (which in my case looks like this):

Section “InputDevice”
Identifier “ALPS”
Driver “synaptics”
Option “CorePointer”
Option “SendCoreEvents” “true”
Option “Device” “/dev/psaux”
Option “Protocol” “auto-dev”
Option “Protocol” “auto-dev”
Option “LeftEdge” “120″
Option “RightEdge” “830″
Option “TopEdge” “120″
Option “BottomEdge” “650″
Option “FingerLow” “14″
Option “FingerHigh” “15″
Option “MaxTapTime” “180″
Option “MaxTapMove” “110″
Option “ClickTime” “0″
Option “EmulateMidButtonTime” “75″
Option “VertScrollDelta” “10″
Option “HorizScrollDelta” “10″
Option “MinSpeed” “0.45″
Option “MaxSpeed” “0.75″
Option “AccelFactor” “0.020″
Option “EdgeMotionMinSpeed” “200″
Option “EdgeMotionMaxSpeed” “200″
Option “UpDownScrolling” “1″
Option “CircularScrolling” “0″
Option “CircScrollDelta” “0.1″
Option “CircScrollTrigger” “2″
Option “SHMConfig” “true”
EndSection

Googling around revealed to me that the “Device” line should use something like “/dev/input/event5″ where the event number matches what you found in /proc/bus/input/devices. The problem I encountered was that the event number varied from bootup to bootup. So one time, the hard-coded xorg.conf would work, and another it wouldn’t. I finally settled on using /dev/psaux, and it seems to work, though I haven’t rebooted since the last time it worked, and I’m not convinced that it’s not still a little flakey. The last time I started up, it wasn’t working, and then I did ctrl-alt-f1 to get to a different screen and then ctrl-alt-f7 to get back to the main screen, and I wonder if that isn’t what made it start working. It was after that switch that the touchpad started functioning fully. Who knows what’ll happen the next time I reboot?

I should note that most of the touchpad functionality was fine out of the box. It was simply the bit that lets you slide your finger down the right-hand side to scroll a window that was busted. I use that a whole lot, so it was pretty high priority to get it fixed. This did eat up a couple of hours of time over a couple of days, but it was the only frustrating part of the install.

The mouse is still a little flakey. Sometimes when I click something (a link or a taskbar item, for example), it just waits until there’s another click or a mouse movement to register the click. I suspect this is something I can tune in xorg.conf, but for the moment, it’s only a minor annoyance that hasn’t justified the further research yet.

Ubuntu comes with a nifty little program called Tomboy that lets you take notes easily. It’s basically a local wiki. If you want to add a note, you just hit alt-f12, and a little menu pops up from nowhere out of the task bar showing recent notes and letting you add one. You can easily link notes together, do some basic text formatting, etc. I’m not sure it’s something I’ll use a lot, but it does strike me as potentially useful.

I’ve had cause this morning to try to write an apache module in perl, and that meant compiling Apache::Constants against apache, which I had installed using apt-get. Which meant that there were no source files lying around that I could find. After some fruitless googling, I eventually checked the man page for apt-get and saw that you can get sources using “apt-get source [package]“. I did this but had troubles with the configure command (”error 77: C compiler cannot create executable”), which I resolved by doing “apt-get install g++”. So now I had apache sources ready to compile the perl module against, but it turned out that the module wants apache 1.3. Which meant that my labors were more or less a dead end, save that I learned how to get package sources in ubuntu. Someone in the ubuntu irc channel suggested as an alternative to downloading sources that I could just install the -dev package, though frankly, I’m not sure where ubuntu would put the sources for that either, so it may not be a valid alternative for my purposes. (While writing this paragraph, I learned that — duh — there’s Apache2::Const, which was already installed and does for apache2 what Apache::Constants does for apache.)

Bootup for this machine now takes about 14 years, and I read somewhere that they actually sped things up significantly in this release. Those who installed the previous releases I gather are still waiting for their systems to be ready for use. It also bugs me that I can’t see the status of the system as it boots up. I’ve always found it comforting to see what part of the bootup process the system was in. I suspect there’s a way to get to this view. Luckily for me on all counts, I shut down rarely.

The battery life is crappy now. Under FC4, I could get a solid hour or hour-and-a-half out of a fully charged battery. The other day, plugged in downstairs, I ran the computer upstairs on battery for a minute, and it almost immediately told me I had only 18 minutes of battery left. On the plus side, Ubuntu’s battery indicator seems to work at least marginally with this system, telling me at minimum whether I’m on AC power or battery. This feature alone would have saved me a number of accidental shutdowns in the past due to inadvertent lack of AC power.

Ubuntu’s UI in general feels just a little more sluggish and less polished than that of FC4, but in general, I’m satisfied with it so far.

The ubuntu online presence and community seem outstanding.

Limiting ssh access with the command option in authorized_keys

December 6th, 2006 by daryl

Using public keys to log in via ssh to servers is a wonderful thing if only because it prevents you from having to type your password each time you want to log in. I’ve been using this method happily for years. Today, I learned something new (to me) about using public keys to log in. In the authorized_keys file that lists accepted keys for a user, you can specify the “command” option along with some other things that allow you to limit what people can do when logging in.

Say for example you wanted to grant someone access to an svn repository with a real user account (because you have other privileged users already hitting the repository with user accounts and so can’t use svn’s authentication). But you don’t want this person to have a full shell or in fact to be able to do anything but use svn. The command option lets you dictate what operation is performed upon login. You prepend the default key output with the command information, as follows:

command=”program” ssh-dsa AAAABtce9euch… user@example.com

So in my example, I add the following:

command=”svnserve -t –tunnel-user=svn_username”

This makes it so that as soon as svn_username logs in, he gets a tunnel to the svnserve command. If he’s issuing svn commands at his command line and sending the appropriate output, this is great. If he’s trying to ssh directly, he gets some server status gobbledegook and is effectively locked out from actually logging into the server. Just what I needed.

To prevent further interactivity during the session, you can pass some other options, as follows:

command=”svnserve -t –tunnel-user=svn_username”,no-port-forwarding,no-agent-forwarding,no-X11-forwarding,no-pty

You can also have some other fun with the command, though. For example, just to play around, I created a user and added the command “ls /tmp”. Sure enough, when I ssh’d in as that user, I got the output from an ls command. I could see more practical applications, however. For example, you might add “ps -eaf” as a command and have a script try to log a user in periodically and parse the output to see if a given program is running. There are no doubt much better ways of handling this particular case, but you see my point.

powered by performancing firefox

When did I change my mysql database structure?

November 30th, 2006 by daryl

A stats tracking application I’ve slowly built over the last six months or so recently started showing some potentially anomalous data for one of its views. A number that has trended upward steadily for all time suddenly dipped substantially (5%) and wallowed about at the low number for a week before beginning to trend upward again. During the low period, I looked into the matter to try to determine whether there was a problem with the stats or whether the numbers were legitimately low.

My first step was to identify any changes that had been made to the stats program immediately prior to the dip. There were a couple of changes that couldn’t possibly have related to the issue and one that seemed unlikely to have caused a problem but that merited investigation. So in a copy of the code and on a copy of the production database, I rolled back the possible culprit and re-crunched the stats. The numbers came back the same, so the possible culprit I had identified was in fact not the culprit.

Next, I wanted to determine whether or not I had made any recent changes to the database structure that could possibly have skewed my calculations (I do all sorts of calculations and caching on raw data). This wasn’t as straightforward as just viewing an svn log to determine when any relevant files were changed. But there is a way to tell when (if not how) a database was last changed. You need only look at the timestamps on the files that contain information about your database structure. This works for mysql, in any case. Here are the steps I took:

  1. Figure out where your data files are stored. If you don’t know, try typing “ps -eaf |grep mysql” (or the equivalent on your linux distro) and looking for the “datadir” parameter in the command line string. Change into that directory.
  2. There, you should see a directory whose name corresponds to the database you want to check for changes. Change into that directory.
  3. Next, do something like “ls -la *.frm” or, if there are many tables, “ls -la <tablename>.frm”. This lists timestamps for the files that store table structure, which tells you when the tables were changed.

In my case, I have a production database and a staging database that stay pretty close to in sync. Luckily, I had synced data between the two but hadn’t synced a change I had made to a production table’s structure. So the timestamp for my production table corresponded to the date on which our stats dip appeared. I could then get a mysql prompt and type “show create table <tablename>” for both my production and my staging databases to see what the difference between them was.

It turned out to be that I had simply dropped an extraneous index in production, something that shouldn’t have affected my stats. That crunching stats in both the staging and the production environments had the same end result corroborates my conclusion that the index change didn’t matter.

As my stats had begun trending upward again and we had just come off the Thanksgiving holiday break, I felt pretty confident after doing this little diligence pronouncing the dip a product of holiday lag. In any case, now you know, if you didn’t already, how you can check to see when you last changed a mysql table’s structure.

powered by performancing firefox

Quick and dirty apache logfile analysis

June 28th, 2006 by daryl

Dilemma: I had a bunch of rotated apache log files that I wanted to check traffic patterns in to see if some link changes I had made to a site were affecting traffic. Specifically, for the domain in question, I had tried to route requests to certain urls over to another domain by changing links in the html, and I wanted to see if it was actually impacting traffic. So I wrote the following little bash script to iterate over a set of log files and print the date and the line count for specified search strings.

#!/bin/bash

if [ -z "$1" ]
then
echo “Usage: $0 search_string [log_file_prefix] [log_directory]”
echo “log_file_prefix defaults to ‘access_log.’”
echo “log_directory defaults to ‘.’”
exit
fi

if [ -z "$2" ]
then
2=”access_log.”
fi

if [ -z "$3" ]
then
3=”.”
fi

FILES=$(ls $3)

for FILE in $FILES
do
EPOCH=${FILE##*$2}
DATE=$(echo $EPOCH|awk ‘{print strftime(”%c”,$1)}’)
COUNT=$(cat $3/$FILE | grep “GET $1″ |wc -l)
echo “Looking for $1 in log for $DATE: $COUNT”
echo “”
done

So say I execute the command as follows: “./log_parse /about access_log_www. www”. It would scan for requests beginning with “/about” in all log files whose names begin with “access_log_www.” in the directory “www”. The script assumes that rotated log files are suffixed with a timestamp, and it writes the time based on that timestamp. Output looks something like this:

[root@www logs]# ./log_parse /about access_log_www. www
Looking for /about in log for Thu 08 Jun 2006 07:00:00 PM CDT: 726

Looking for /about in log for Fri 09 Jun 2006 07:00:00 PM CDT: 681

Looking for /about in log for Sat 10 Jun 2006 07:00:00 PM CDT: 28

It’s certainly not a full-service solution for log analysis, but it makes a quick check of one-off traffic patterns over time pretty easy to spot.

Flock

June 23rd, 2006 by daryl

So, people who know me know I work for Flock, which has something to do with computers. We actually produce a web browser built on the platform that Firefox is built on. When we first started talking big a little less than a year ago, we sang out about how we were going to revolutionize browsing. Talking big got us in a little trouble because we were over-hyped too early. We’ve since changed our message a bit. Rather than being the saviors of the internets, we’re just trying to make the web a little easier to use for some people. If you like to blog, share your bookmarks, and use photo services like flickr and photobucket, maybe Flock is something you’d be interested in. Otherwise, it’s probably not. Here’s some of what I personally like about our product; these things are what would make me think about using Flock if I didn’t feel bound to because I’m an employee.

Built-in news/feeds integration. Most blogs and many news sites you see nowadays display little orange radio-wave icons and advertise things like “RSS2.0″ and “Atom.” These are just techie ways of saying “here’s a list of recent articles that your software may be able to keep track of.” The idea is that you can plug these feeds into your feed reading software, which will notify you of updates so that you don’t have to go out each day and click through to the dozen sites you like to keep up with. There have long been Firefox extensions and standalone applications that would consume these feeds, but I’ve never liked any of them. In the case of the extensions, the interface has always bugged me. In the case of applications, well, I really don’t need another application open on my desktop. Flock has feed-reading built in. I subscribe to the feeds for the blogs I like to read. When one of them has new content, a button in my browser lights up to let me know. So no more going out and visiting the site to see what’s new. When I click the news button, a sidebar opens up that gives me a tree view of my feeds (sort of like an email view, with folders and items on the side), which I can scan easily for updated content. This feature really makes my life easier and is probably my favorite thing in the browser.

Next, there’s the star button. It’s a little button connected to the urlbar. If you’re at a site that you like and would like to save for later, just click the star button. It’ll turn orange, and when you later visit sites you’ve starred, it’ll turn orange to let you know you’ve already starred them. If you’re adventurous, you can make an advanced options box appear that’ll let you apply tags (just think of them as ad hoc labels that are easier to use than nested folders) to the things you star. We call the things you star “favorites.” And there’s a favorites manager that lets you see a list view of the things you’ve starred. You can search through them by tag, sort by recent, organize them into collections (which you can make appear in your toolbar), and go back to their advanced options to change settings. What’s more, if you’re so inclined, you can set your favorites to be synced up with an online bookmarks service like delicious or Shadows so that your favorites are available to you anywhere, any time. I like our favorites system because it lets me do some level of organization of my links without making me manipulate a bunch of nested folders; I can quickly apply multiple labels that let me get to my links later in several ways without having to file them redundantly in multiple folders.

Favorites interact with the search box, which widget can be very useful but is something I often overlook. If you’ve used Firefox before, you’re already familiar with the search box embedded in the browser interface. You can select from among several search engines to direct your searches to, and you can easily perform searches without first having to navigate to the search page itself. I have muscle memory that makes me hit my home button and search straight from Google, so the search box hasn’t historically been something I’ve used (hence my often overlooking it now). But there’s one thing that makes it very handy in Flock: As you type search strings, it searches through your browser history and your favorites and populates a flyout with relevant searches. In other words, it’s a quick interface to search for relevance among things you’ve already flagged as relevant by visiting or starring. And when I say it searches through your browser history, I don’t mean it looks for strings in the url. It does a full text search on pages you’ve visited. So even if you didn’t star that page about platypuses that you found so interesting, if you want to get back to it without combing through thousands of results from Google, you can just start typing “platypus” in the search box, and sites you’ve visited that contained the word will magically appear in the flyout.

Next, there’s photo integration. We have this thing called a topbar that’s a little slice of screen that pops open between the browser buttons and the content window. It’s a pretty good size for displaying thumbnails of photos, and it’s got a neat little slidey interaction that makes it easy to zoom through photos it contains. The photos currently can be set up to pull from accounts at flickr and photobucket, and you can use the topbar to view your own photos or those of other users. The topbar will also notify you by lighting up a browser button when your contacts post new photos, so there’s no more running out to click through your contacts’ pages to see what’s new — Flock just brings it all to you with no effort on your part. This functionality is of pretty limited use to me because I don’t follow photos very closely, and the ones I tend to care about usually get posted to kodakgallery, which Flock doesn’t yet support and which sends me email invitations to see photos anyway. What is useful to me to the extent that I use it is the fact that Flock comes with a photo uploader that makes it pretty easy for me to send photos to flickr. As a Linux user, I’ve always had to do it the painful way, using file upload widgets and navigating through files by name to upload. This is definitely not a good way to batch upload photos. Now I can just open the uploader, browse files or drag files to the window, rotate and crop, and upload. If I were inclined to use photo services very frequently, this would be a great tool for me, especially since most of the tools out there that simplify photo uploading don’t work in Linux. Rumor has it that you can also now drag photos into textareas in the browser and they’ll get uploaded and posted automatically, but I haven’t tested that functionality out yet and so can’t verify that it works.

The last two features that stand out to me are things that used to excite me but that now completely underwhelm me. The first is the blog editor. It’s built right into Flock and lets you edit and save posts locally before pushing to your blog service. One nice thing is that it’s got drag and drop goodness, and I’ll bet that by this time, if you drag photos into it, they get pushed to your photo hosting service. Generally, I’m about as happy editing blog posts in my blog’s user interface, and as far as blog editing usability goes, I prefer the extension produced by Performancing to our blog editor. This is really sort of a shame, as blog integration was one of the things we wanted to address best and first, and in my opinion, we’ve regressed a bit on that front. The other feature I used to like that I now find almost useless is what we’re calling web snippets. This used to be a little sidebar or floaty window that you could drag photos and text snippets to for later use in blog posts. We later added the ability to add notes to the web snippets, and I found this useful as sort of a blogging to-do list. But we crammed the tool down into a little area at the bottom of the screen and made it pretty much unusable because of the way it uses its real estate. In theory, it helps you assemble things to put into blog posts, but in reality, for me, at least, it sits down in the status bar unused. These two features were very appealing to me when we started working on them around a year ago, but they’re now the least useful things we’ve added to the browser.

Which is ok, because, as I think I’ve indicated, we’ve added other useful things. The news functionality alone makes me want to use Flock. I think we’ve also produced a beautiful browser. As much credit as Firefox is due for helping to bring choice back to the web browser industry, the browser’s default theme is heinous. Any time I run Firefox now to test something, I’m shocked at how clunky the buttons and toolbars look, and I find it a little oppressive. Using Flock just feels smoother to me because our interface looks smoother. This is of course purely a matter of taste, and it should be noted that both Flock and Firefox can be re-skinned to look entirely different and better (or worse). I think that for the time being, Flock provides a better experience out of the box, though.
So, that’s what I’ve been doing for the last 18 months. I do primarily web programming and system administration these days, though I’ve been involved at some point in pretty much every part of the business. Last week, we released our first public beta (we’ve been in developer alpha for months), and feedback so far is pretty good. We’re still recommending that people try Flock out but not be disappointed if we’re not quite ready for prime time or if the browser’s a little buggy. If any of the features I’ve described sound useful to you, I invite you to try the browser out. You can download it here. If you’re not game, no hard feelings; as I said at the beginning of this post, Flock isn’t for everybody.

Backing up Windows Documents on Ubuntu Linux

May 3rd, 2006 by daryl

I wrote earlier about getting a hard drive added to one of my Linux boxes so that I could do backups. I’ve been meaning to get backups in order for many years, but it’s been more urgent since about 10 months ago (yeah yeah, must not’ve been too urgent if it waited that long), when I lost all the data on my laptop and had to recover what I could from a backup I had manually made some months before. More precious than most of the data I might have lost in that case are the photos and videos we’ve accumulated of Lennie over the past two years. When I had to send Mleeka’s laptop in to the shop a few months ago, I made an effort at dumping her files onto a Linux fileshare, but it wasn’t terribly successful, it wasn’t easy, and it wasn’t a long-term, self-sustaining solution. My project tonight was to put such a solution in place.

Backing up from Linux to Linux is simple, and I’ve had that going for several days. You just run rsync as a daemon on the fileshare, create a module, put the client’s public ssh key on the server, and run a cron job on the client that pushes to the module. All I had to to today to make this work on the new disk was move the files from one disk on the server to the other, edit the module in /etc/rsyncd.conf to reflect the new path, and restart rsync. Nothing to it.

Backing up the Windows box has been somewhat more challenging. I spent a few hours wrangling with a couple of different options for running rsync clients and daemons on the Windows laptop. I kept running into problems with weird Windows path issues, Windows firewall issues, other connection issues, permissions issues, and so on. It was very frustrating. Finally, I read a suggestion that one just mount the Windows directory on the Linux fileshare and then rsync locally. Simple and brilliant!

Ubuntu Linux appears not to ship with smbfs enabled, so after getting errors with the mount, I issued “apt-get install smbfs” to get that module. Then I did the following to create a mountpoint and a share:

mkdir /mnt/laptop_mleeka
mount -t smbfs //server/sharename /mnt/laptop_mleeka

This is of course after right-clicking properties on the My Documents folder on the Windows laptop and sharing the folder as “sharename.”

Once that was mounted, I issued the following:

rsync -a /mnt/laptop_mleeka/* houston@localhost::mleeka_bak

In this case, “mleeka_bak” at the end of the command is an rsync module I set up that manages permissions and file locations for the sync. The initial backup is running as I type. I understand that samba mounts are pretty slow, so it’s taking a while to haul the 9 GB of data across even my local network. Luckily, rsync is incremental, so in the future, it’ll sync only differences between the file systems.

All that remains is to add the mount command to /etc/fstab so that the server tries to remount the drive in the unlikely event of a reboot and to toss the rsync command itself into a cron job so that the backup takes place nightly.

Adding a hard drive to a Ubuntu Linux box

May 3rd, 2006 by daryl

Dilemma: I’ve got an old desktop system with less than 20 GB of disk space. On that system, I wanted to store backups of my laptop and our photos of Lennie. I also wanted to use it as a machine that will allow me to build software from time to time (which can take up a few GB of disk space). Without even starting backing up the many GBs of photos yet, I’ve nearly filled up the 20GB, and that’s after deleting a bunch of stuff. I happen to have another desktop system that has been on its last legs for a while, but it’s got a 65 GB hard drive.

Objective: Put the 65 GB hard drive in the working desktop system and make it operational.

Dilemma 2: I don’t really know anything about hardware. I forged ahead anyway, though, and I got it working. Here’s how.

Disclaimer: I did this on a Ubuntu Linux box. I have no idea how it’d go on any non-Linux box (so don’t ask). If you try these steps and you or your computer blow up or become otherwise harmed or incapacitated, note well that by reading further, you’re asserting that you’ve proceeded at your own risk. :)

  1. Remove hard drive from dying computer. (This is pretty straightforward and doesn’t merit more detailed instructions.)
  2. Read the back edge of the hard drive (the part with the pins) to figure out how to make it a slave so that the computer doesn’t get confused when it tries to boot up with two drives, This usually involves pulling a little plastic tab that slips over two pins off and sliding it back down onto two other prongs. I learned this the hard way by installing the drive, having the computer fail to boot, and remembering that something like this had to be done, whereupon I consulted the back edge of the hard drive.
  3. Install the hard drive in a free bay in the working computer. This is pretty straighforward and, like initial removal, will require a screwdriver.
  4. Cross your fingers that you’ve got the necessary cables available in your working computer’s case. If you don’t, you should probably consult some other guide. I was lucky. One cable is a ribbon cable with a plastic component that will receive the long array of pins on the back edge of the disk drive. The other is a little bundle of colored cables capped by a white plastic piece. It’s got four or five holds in the back for receiving pins. These plug into the obvious spots on the back edge of the disk drive.
  5. Now boot up. The computer should boot as it did previously.
  6. Get a terminal window open. If you don’t know how to do this, you probably shouldn’t go any further.
  7. Find out what the disk is named. The following command will give you some output about your disks and partitions. You should look for one that’s the same size as the disk you installed and one that’s not listed in the output of the command “df”. If you don’t see one, something went wrong with the hardware install and I probably can’t help you.sudo fdisk -l
  8. Make a directory to mount the drive on. I used /bak: Sosudo mkdir /bak
  9. Now give your user permission on that directory. You might have to do something more involved if you need to allow more than one user to access the disk. This works for me, though.sudo chown -R houston /bak
  10. Now partition the disk using fdisk. This is weird if you don’t know what you’re doing. I’ll walk you through my steps, which may or may not be the best to have taken.
    1. First do the following command, which takes you into a little interactive prompt (where /dev/hdb is the disk; note that it differs from /dev/hdb1, which I guess represents the partition on that disk; also note that you should substitute your disk identifier as above):sudo fdisk /dev/hdb
    2. At the command, enter “d” and then “1″ to delete the first partition on the disk. If there are other partitions, delete them as well.
    3. Then press “w” to write the changes to the disk and exit. This’ll probably take a few seconds or minutes.
    4. Next do sudo fdisk /dev/hdb again (substituting your disk identifier)
    5. Press “n” to add a partition. Chances are that you want just one, in which case you can just accept the defaults in the ensuing prompts.
    6. Then press “w” to write the changes to disk and exit.
  11. Now format the new disk as an ext3 disk. Note that the /dev/hdb1 below is the same as what I discovered in step 7 to be my new disk. Substitute your value there.sudo mkfs /dev/hdb1 -t ext3
  12. Ok, now you’ve got an ext3-formated disk with one partition. All that’s left is to mount it so that it can be used. To do this, edit /etc/fstab and add the following line to the end (again, substituting the drive identifier and directory the disk should be mounted on in columns one and two):/dev/hdb1 /bak ext3 defaults 0 0
  13. Finally, typing the following command should mount the drive so that you can begin writing to it (substitute your path if needed):sudo mount /bak
  14. Since we added the entry to /etc/fstab, the drive should come back mounted on reboot as well.

Laptop hosed

January 10th, 2006 by daryl

The other day, I was looking for some QuarkXpress-like publishing software for Linux after working with much frustration in Open Office to come up with a template for a publication I’m thinking about doing some work on. Open Office is great software, but it’s just not ideal for this kind of layout as far as I can tell. I found something called Scribus that seems a little rough around the edges but that I think’ll do the trick. Unfortunately, I had a lot of trouble getting it installed. It needed Qt, and that had some prerequisites that I had problems with. When I had trouble doing a manual install of this stuff, I decided to use yum to try to install qt, and at some point in the process, I used yum to uninstall it. And yum decided to uninstall a bunch of other stuff at the same time. Which didn’t really cause a problem until I had to reboot yesterday and gnome wouldn’t start. (Incidentally, I wound up finding an rpm for Scribus that installed with no problem and rendered all this pain really superfluous and thus doubly painful.)

So I decided to just reinstall my system. Since getting the widescreen and wireless working on this laptop was a pain originally, I made an effort to save all the info I recalled having needed to do so, figuring it’d be a pretty quick matter as a result. But I forgot to save my xorg.conf, and the wireless stuff didn’t work as seamlessly as one might have hoped. And though I thought I had blogged the steps when I originally set up this system just in case I needed to do it again, I hadn’t. Luckily, it didn’t take as long this time, though it still wasn’t exactly a walk in the park. So here’s a quick walkthrough for future reference.

For the widescreen, I need a tool called 915resolution. Once you get that installed, for this particular laptop, I add the following lines to /etc/rc.local:

/usr/sbin/915resolution 66 1280 800
/usr/sbin/915resolution 34 1280 800
/usr/sbin/915resolution 45 1280 800
/usr/sbin/915resolution 54 1280 800

Then, I edit /etc/X11/xorg.conf so that the screen, monitor, and video sections look like this:

Section "Monitor"
  Identifier   "Monitor0"
  VendorName   "--> LCD"
  ModelName    "1280X800@75HZ"
  Option       "CalcAlgorithm" "CheckDesktopGeometry"
  Option            "dpms"
  HorizSync    30.0 - 82.0
  VertRefresh  58.0 - 75.0
  UseModes     "Modes0"
EndSection

Section "Screen"
        Identifier "Screen0"
        Device     "Videocard0"
        Monitor    "Monitor0"
        DefaultDepth     24
        SubSection "Display"
                Viewport   0 0
                Depth     24
                Modes    "1280x800" "1920x1200" "1680x1050" "1440x900"
        EndSubSection
EndSection

Section "Modes"
  Identifier   "Modes0"
  # 1280x800 @ 75.00 Hz (GTF) hsync: 62.62 kHz; pclk: 107.21 MHz
  Modeline "1280x800_75.00"  107.21  1280 1360 1496 1712  800 801 804 835  -HSync +Vsync
EndSection

Some tutorials suggest that I need to get the ATI driver, but I’ve found that it’s not necessary. So, that takes care of the widescreen setup for this model (Sony VAIO VGN-FS550).

Next up, networking. I initially tried to cobble this together more or less piecemeal as I had done previously (thanks to the process of trial and error). But what ultimately worked was the directions that start here, which links to this site, which is the real jumping-off point. Essentially, here are the steps:

  1. Download and install the ieee80211 subsystem.
  2. Download a recent ipw2200 driver (which requires the ieee80211 subsystem).
  3. Download and install recent firmware.
  4. Copy the load, unload, and other similar scripts from the ipw2200 directory to, say, /usr/local/wireless
  5. Add the following to your /etc/rc.local:
    modprobe ipw2200
    cd /usr/local/wireless
    /usr/local/wireless/load #ipw2200 driver loader
    
  6. Reboot or execute those commands by hand.
  7. Then just bring your wireless interface up as you normally would.

The installs listed in the first two steps are pretty routine. Just do the standard make and make install. I don’t think I had to do any other steps to make those work. The firmware files have to be copied into the hotplug directory on your system, which you can find the location for by looking for the FIRMWARE_DIR line in /etc/hotplug/firmware.agent.

After getting the wireless working, I ran into a couple more problems. For both wired and wireless interfaces (though I initially thought it was just the wireless), I started getting random disconnects. When I looked at the output from dmesg, I kept getting the error “no IPv6 routers present.” After googling around, I checked /etc/modprobe.conf and made sure the line for eth1 specified ipw2200 as the module rather than eepro100, which was what was listed when I checked. So far, this has kept my link up for a few minutes. If this is the sort of thing that degrades over time, it might not appear just yet and I might not be out of the woods, but in the short term, that change (and a subsequent reboot) appears to have done the trick.