Wednesday, June 18, 2008

Smart Search

By far the most useful plugin I've added to Firefox in the past half-year or so:

https://addons.mozilla.org/en-US/firefox/addon/188

SmartSearch adds a context menu item that allows you to send selected text (or whatever word you right-clicked on) to any one of the links in the Bookmarks 'Quick Searches' folder (Bookmarks->Organize Bookmarks->Bookmarks Menu->Quick Searches). I had to create this folder myself, because at some point I short-sightedly deleted it as being useless.

The SmartSearch page on quicksearches has a number of handy links such as a dictionary, thesaurus, IMDB, amazon, netcraft, whois, wayback archive, and google maps. I added a few more for google images and some source code pages:

Google Images Quicksearch
Google Code Quicksearch
Koders Quicksearch
Krugle Code Quicksearch (requires JS)
Codease SmartQuery
Codease FullText Query

Obviously many more can come in handy, and the code search engines can be trimmed down to just one or two (probably Koders and Codease).

The good news is that new Quicksearches are simple to create: navigate to the search page, right-click on the search form, select 'Add a keyword for this search', invent some useful keyword, and use the Quick Searches folder for the 'Create in' location.

Tuesday, May 27, 2008

Nightly Tester Tools

Got sick of the Intel driver crashing X11, and Ubuntu releasing their upgraded packages only on the recent version (Horny Heron or something). Bit the bullet, did the upgrade, and...

...Firefox 3beta got installed! What the hell?!? Poof go all (well, most) of my extensions, you know those handy things I use for, oh, locking down Firefox, anonymous browsing, other small conveniences that make using such a poorly-performing browser worthwhile.

Included in these was Zotero, in which I have quite a number of documents stored for offline viewing, and which *still* has no independent UI for accessing them (even the Open Office plugin requires a running instance of Firefox). Suckfest à la mode, just what I ordered!

A search of the Zotero forums, though, turns up a link to the Nightly Tester Tools plugin, which can be used to run an extension for a previous version of Firefox. Zotero is now up and running on Firefox 3beta.

Version 3 does seem to be a bit faster than 2, and hasn't been too crashy. The theme/extension writers should really get their act together and update/port their stuff before this puppy hits the street.

Wednesday, May 7, 2008

Pulseaudio, Firefox, Flash 9

Upgrading to the latest flash plugin (9) kills audio in Firefox. Awesome!

Based on the PulseAudio information on http://www.pulseaudio.org/wiki/PerfectSetup
and the library provided by revolutionlinux, it took only a couple of steps to get things working:

cd /usr/src
git-clone http://git.0pointer.de/repos/libflashsupport.git
cd libflashsupport
sudo ./bootstrap.sh
sudo ./configure --prefix=/usr
sudo make
sudo make install

Then restart firefox.

It probably helps to have /etc/firefox/firefoxrc contain the line

FIREFOX_DSP="padsp"

...and to have /etc/asound.conf contain the lines

pcm.!default {
type pulse
}

ctl.!default {
type pulse
}

pcm.pulse {
type pulse
}

ctl.pulse {
type pulse
}


...but libflashsupport is the magic bit.

Monday, May 5, 2008

VimMate

Yet another Textmate-style extension to Vim:

http://vimmate.rubyforge.org/

This one integrates a project manager with Vim. Jury is still out on whether it will prove useful, but coupled with the Vim Debugger plugin it could prove quite useful for the dynamic languages.

Git as a backup tool

Recently migrated from CVS to GIT at work, and started to look at other uses of local GIT repositories. Backing up config files in home directories seemed a natural application, and as usual someone else has thought of it, implemented it, and abandoned it:

git-home-history

Getting this built is pretty straightforward:
cd /usr/src
git clone http://jean-francois.richard.name/ghh.git
cd ghh
./autogen.sh
make
make install
cd ~
git-home-history init
vi .gitignore
git commit -a
crontab -e
* */4 * * * /usr/local/bin/git-home-history commit >/dev/null 2>&1


The last line is what should be added to crontab to run this every 4 hours.

There are similar projects for /etc and for general backup:
etckeeper
gibak

Other useful GITisms:
* install tgit
* install qgit
* get vim syntax and filetype plugins from vim-mode-for-git-commits; also check out the GitDiff plugin
* add the following to ~/.bashrc or equivalent:
GIT_PAGER=`which tig`
export GIT_PAGER
* add the following to ~/.vimrc or equivalent:
let git_diff_spawn_mode=1
autocmd BufNewFile,BufRead COMMIT_EDITMSG set filetype=git

Wednesday, April 23, 2008

e17 profile backup script


Given that E17 uses binary config files, and these may get hosed without warning, it is useful to back them up after making changes.

The following shell script will do just that, via tar:

#!/bin/sh

[ -d ~/.e/backup ] || mkdir -p ~/.e/backup

tar -zcf ~/.e/backup/e17-config-$(date +%F-%T).tgz ~/.e/e


Also worth noting is an improved way of using the E17 profile switching for extending battery life: put a shell script for switching to the battery profile in /etc/acpi/battery.d, and one for switching to the A/C profile in /etc/acpi/ac.d . Note that this occasionally causes E17 to crash (and take X with it), so be conservative.

Current configuration:
  • Smoke theme, Darkness startup, Slick icons
  • 10 1x1 virtual desktops
  • XRENDER engine with Composite disabled
  • 3 profiles (AC, battery, and default)
  • Run command: uxterm -bg black -fg orange -fa 'xft:Courier New' -fs 11 -hold -e
  • Shelf (invisible, below windows, shrink:48, all desktops) on upper right-top (Contents: cpufreq, mixer, winselector, battery, deskshow, tclock, temperature, exalt)
  • Shelf (invisible, below windows, shrink:60, all desktops) on lower left-left (Contents: Pager)
  • Shelf (default, below everything, shrink:40, all desktops, auto-hide) on upper left-top (Contents: Start, IBar, Taskbar)
  • Shelf (invisible, above everything, shrink:40, all desktops, auto-hide) on lower right-bottom (C0ntents: IBox)
  • Shelf( default, above everything, shrink:48, desktop 0:0, auto-hide) on lower-right-right (Contents: News, Forecasts)

I should note that Forecasts doesn't seem to work at all. I also disabled the screen savers, lock, and power management as they are all a bit crashy.

The screenshot isn't much to look at.

Friday, April 18, 2008

Powertop && Latencytop

Now that most everything is working (sans the crappy TI SD reader) on a good solid kernel, it's time to break stuff by adding powertop and latencytop. Laptop users should play with powertop a bit to find out how to lower their power consumption; latencytop can be useful in debugging lagged or unresponsive applications.

sudo apt-get install powertop

http://www.latencytop.org/

The latencytop patch applies cleanly to 2.6.24.2, and requires CONFIG_SCHEDSTATS be set. Powertop requires CONFIG_TIMER_STATS and suggests many more adjustments while it is running ( though apparently the usbcore.autosuspend advice is deprecated).

On an unrelated topic, now that inttab is gone the settings for terminals (you know, respawn getty and all that) is in tty-specific files in /etc/event.d . Why? Who knows! Maybe they're trying to reduce the AT&Tness of their *nix.