tail -f findings.out

Migrating Firefox instances and saving issues

I recently performed a fresh install of Intrepid Ibex on one of my home PCs, and restored the files I cared about from backup. I decided to use a Firefox backup created by FEBE from a machine whose Firefox setup I preferred. For a while, all seemed to have worked just fine. Then I came across an image I wanted to save. I right-clicked it, select “Save image as”… nothing. Tried it again, still nothing. I went to File, Save Page As. Nothing! Now I am a little worried. Various forum posts suggested people that had this issue had to remove their profiles and have Firefox remake them. Forget that.

As it turns out, the problem was caused by both me and Firefox being a little dumb. In the PC where I made the FEBE backup, I had all downloads set to go to /home/MYUSER/Downloads. In the new PC, however, my username was different, so that location didn’t exist. Instead of politely informing me the specified location didn’t exist, Firefox just did nothing. Changing the download directory to something that existed fixed the issue immediately. Didn’t find any matches in the tracker, so I have added a ticket to Bugzilla.

Tags: , , ,
November 30, 2008 - 1:33 PM Comment (1)

Show the largest MySQL tables on a box

This post shows some handy things you can do with the information_schema database created by default in instances of MySQL 5. I especially liked the query to show the largest five tables in a given instance. I wrapped that query in a Python script, and after adding a bash alias to where that code lives, I can now do:

Most of the length is due to the addition of a function to handle pretty printing. Here is the script:

Continue Reading “Show the largest MySQL tables on a box”

Tags: ,
November 28, 2008 - 8:23 PM No Comments

The Snipping Tool and GScrot

One new tool I have come across in my foray into Windows Vista that I have found quite helpful is The Snipping Tool. The average Vista user I talk to has never come across this utility and, as mentioned here, it is annoyingly packaged with the Tablet-PC Optional Components, so you might remove it and never know. All this aside, it is definitely worth a try. If you ever perform the Print Screen/take entire window screenshot -> open file in editor -> crop/mark up before using an image pattern, then this tool is for you. Unless you remove it, it can be found in Accessories in the Start Menu.

I found it most handy to bind it to a keyboard shortcut, say ctrl + alt + s. You can assign a shortcut to any application by right clicking it in the Start Menu, selecting properties, select the shortcut tab, click the Shortcut key box, and press the combo you want to use. Then when you need to capture an image, just hit that combo, and your screen will turn slightly white, a window with controls will appear, and your cursor will change. Now you just drag select the area you want to capture, and the image comes up in a handy editor. It’s no Photoshop, but it covers what you will likely need. You can crop, mark things up with various colored lines, and a few other things, aside from Save and Print. This makes it very easy to grab a section of your screen, mark it up with an arrow or something similar, and include it in an email, webpage, etc. A very easily generated one thousand words.

Not to be left in the dark while on my Linux desktop, I went looking for similar apps. I quickly found GScrot. It covers the features of The Snipping Tool and a lot more. Once you bring it up, you can select to take a screenshot of a selected area, a fullscreen shot, a particular window, part of a window, or a webpage with one or two clicks. It handily keeps track of all the images you have taken per session, which is great if you are doing a series of similar ones. You can print, save, copy, etc, and send it right to a defined hosting site in one click! It also has a small editor brought up by hitting the Draw icon after an image is taken that lets you quickly add line markups.

In short: The Snipping Tool is a useful small app for Vista use, and does a commonly needed task well (and definitely better than PrintScrn). Meanwhile the Linux version does more, and does it better, and does it for free :-)

Tags: , , ,
November 22, 2008 - 9:56 PM No Comments

Finding missing modules and making them available

On a few occasions, I have needed to debug python code in some production application that I couldn’t easy get installed on my local box, either because it was old, or had a very custom setup, or I just didn’t have time and the problem needed to be fixed. I would copy over the python file I needed to mess with into my home folder, but it would almost definitely need to import modules that wouldn’t be found when I ran the script, as they too were in the original location. It wasn’t always clear exactly where, however.

I could run a recursive find command for the module(s) in a directory above where I grabbed the troubled file, but if there is a really large tree of directories in the application, that might take a while. Here’s an alternative. Open a python prompt in the directory where the problematic file was originally, try to import what it needs to import, and then run this for each imported module:

1
module.__file__

An example:

1
2
3
>>> import os
>>> os.__file__
'/usr/lib/python2.5/os.pyc'

Now you know exactly what you need to copy (note: grab the .py, not the .pyc, of course). Or if you don’t want to copy all the files, you can just add this to the file you are editing for debugging:

1
2
import sys
sys.path.append('/my/other/place')

And then the originals can be imported as desired. Except for really large projects, one or two appended paths will probably contain all you need.

Tags: , ,
November 22, 2008 - 9:29 PM No Comments

Web Productivity Winning Duo: Launchy + keyword bookmarks

This tweak is a little more involved than most I put up, but it is totally worth it. When done, you can fire off any custom web search from Launchy!

Here are the steps (I assume you have Launchy installed and know what a keyword bookmark is):

Continue Reading “Web Productivity Winning Duo: Launchy + keyword bookmarks”

Tags: , , , ,
November 15, 2008 - 5:12 PM No Comments

« Older Entries

Twitter links powered by Tweet This v1.6.1, a WordPress plugin for Twitter.