2011
12.08

While debugging a grossly complicated Excel 2010 workbook my Immediate window disappeared completely. If it ever happens to you, here’s an easy way to get it back:

  • Open the VBE and select Tools, Options
  • Select the Docking tab and make sure the window in question has no checkmark in that tab
  • Close the options window. If you don’t see it yet, select Window, Cascade.
  • Now open the Options dialog again and check the docking property of the window you just (hopefully) got back.
  • Drag it to where you want it docked.

Done!  Now get back to work!

2011
11.17

Running through the Zend Framework quickstart on Ubuntu 11.10, I ran into a few issues. Granted they’re not huge issues, but they slowed me down nonetheless.

1) Make sure that the php.ini for the cli is updated to include the zend framework. See the /etc/apache2/php.ini for the changes required.

2) When creating the /data and /scripts folders, they need to be in the root of your quickstart app, beside your “public” folder.

3) I didn’t have the Sqlite driver installed on my machine so that had to be installed before I could create the database.

AN ERROR HAS OCCURED: The sqlite driver is not currently installed

To fix this, I installed the “php-mdb2-driver-sqlite” package from Synaptic.

After fixing these 3 problems, the data loading script worked like a charm!

There was one more glitch getting the Quickstart app completed. Apparently in Ubuntu 11.10, Sqlite has been upgraded to Sqlite3 where Zend is still using the older version. Here’s a workaround to add the prior version to get through: https://bugs.launchpad.net/ubuntu/+source/php5/+bug/875262/comments/10

2011
11.14

Gimp Plug-ins

I stumbled across this set of plugin’s today. It’s got a million ways to slice photos and it’s in the Debian repositories. Sweet!

sudo apt-get install gimp-plugin-registry

See the details.

2011
10.27

Easy Monitor calibration

I spend a lot of time in front of my monitor and if it’s too bright my eyes get tired quickly. As a result, I keep my brightness down so low that people have thought I had a broken monitor. However, when viewing pictures I need it to look as accurate as possible. Here’s a quick and dirty way to be sure that my Contrast and Brightness are set to reasonable values.

http://www.photofriday.com/calibrate.php

It won’t be perfect, but the price is right and you have nothing to lose but a few minutes of fiddling.

2011
10.06

Handy PL/SQL

Every now and then I need to write a block of PL/SQL that’s a little more involved. I’ve had this block of script put aside as an example of how to include functions and procedures in an anonymous block.

BEGIN
   DECLARE
       -- Equivalent of a package level variable
       i   INTEGER := 0;

      PROCEDURE doStuff (description IN VARCHAR2)
      IS
         i   INTEGER;
      BEGIN
         DBMS_OUTPUT.put_line ('description is ' || description);

         i := i + 1;
      END;

      FUNCTION calcStuff (i_value IN INTEGER)
      return integer
      iS
         i_dummy   INTEGER;
      BEGIN
         i := i + 1;
         DBMS_OUTPUT.put_line ('Function called ' || i || ' time(s)' );

         return i_value + i;
      END;

   BEGIN
      -- Call our shiny new procedure
      doStuff ('one');
      doStuff ('two');
      doStuff ('three');

      -- Call our new function
      DBMS_OUTPUT.put_line ('Function returned: ' || calcStuff(100));
      DBMS_OUTPUT.put_line ('Function returned: ' || calcStuff(150));
      DBMS_OUTPUT.put_line ('Function returned: ' || calcStuff(200));

   END;
END;
2011
10.03

When sharing digital images online, I often find myself looking for an easy way to copy and paste the EXIF data. This little script when put into my ~/.gnome2/nautilus-scripts folder will create a text file of the most commonly used EXIF information.

#!/bin/bash
files=$#
count=1
message=`echo "Dumping EXIF from $files files"`

(while [ $# -gt 0 ]; do

	# Strip off the file extension, including the "."
	upperExt=`echo $1 | sed 's/.*\(\..*\)/\1/' | tr '[a-z]' '[A-Z]'`

	if [ -f "$1" ]
	then
		# Get the file name without the extension
		# trimmed=`echo $1 | sed 's/\(.*\)\..*/\1/'`

		if [ $upperExt = ".JPG" -o  $upperExt = ".JPEG" -o  $upperExt = ".PPM" -o $upperExt = ".CR2" -o $upperExt = ".NEF" -o $upperExt = ".OTHER_RAW_EXTENSION" ]
		then
			# Output EXIF data to a new text file named the same as the original image.
			exiftool -canon -S "$1" > "$1.txt"
		fi
	fi
	# Output the zenity progress bar
	sav=`echo "(($count / $files) * 100)" | bc -l`
	echo $sav
	count=`expr $count + 1`
shift
done) | zenity --progress --auto-close --auto-kill --text "$message"
2011
09.22

Recently my webhost installed mod_security on my webserver. It seemed like a non-event until I started getting calls from a few clients who had been merrily working for a long time. When they tried to update content in either Open-cart or WordPress, they were getting strange errors such as “501 Not Implemented” or “406 Not acceptable”.

The fix is to sidestep mod_security for those requests. Ideally it should be limited to the offending request, but in the interest of getting people running, I simply added a .htaccess file in the /admin folder of the broken sites with the following contents.

<IfModule mod_security.c>
    SecFilterEngine Off
    SecFilterScanPOST Off
</IfModule>
2011
09.02

Ok, I saw the warning but didn’t think it applied to me. Don’t assume it doesn’t apply to you!

Remove any proprietary ATI/AMD drivers from your Natty installation. You can put them back on after we install the new kernel.

Now that you’ve checked for anf removed any ATI proprietary drivers, visit this URL and pick out the kernel that you want to try. http://kernel.ubuntu.com/~kernel-ppa/mainline/

In my case, I was running the latest natty kernel on a new (but low-end) Toshiba C650D laptop. It was crashing constantly, never running for more than an hour. As there weren’t any clear indicators in the logs, and the hardware worked fine on Windows, I wanted to try a different kernel. I wanted to the newest kernel possible in the hopes that whatever issue had been resolved.

I opened the above Url and scrolled way down to the bottom of the page. All the way to “v3.0.4-oneiric”. It was dated four days ago – that ought to be new enough! As I’m running 64 bit 11.04, I need the “amd64″ binaries. Download the appropriate ones, “headers…all” and the “headers” and “image” file for my architecture.

 linux-headers-3.0.4-030004_3.0.4-030004.201108301138_all.deb linux-headers-3.0.4-030004-generic_3.0.4-030004.201108301138_amd64.deb linux-image-3.0.4-030004-generic_3.0.4-030004.201108301138_amd64.deb 

Next, open a terminal window and cd to the folder where your binaries are located. Run the following command to install the new kernel:

 /sudo dpkg -i /linux-headers-3.0.4-030004_3.0.4-030004.201108301138_all.deb linux-headers-3.0.4-030004-generic_3.0.4-030004.201108301138_amd64.deb linux-image-3.0.4-030004-generic_3.0.4-030004.201108301138_amd64.deb 

Let it run for a minute or two and if there are no errors reboot. If you have errors, fix them, try the install command again and reboot. If Grub doesn’t prompt you to choose a kernel, check it from terminal once you’re logged in. with the following:

 /uname -r /

There you have it! Running a 3.0 kernel on Ubuntu 11.04, Natty.

2011
08.18

Working as a freelance web developer means that I work really strange hours. I may not get to a project until my kids are in bed and keep working late into the evening. When there’s something that needs to be done, nothing ticks me off quite like a broken website that requires a phone call to customer support. Once or twice I’ll let someone get away with it, after-all sometimes stuff breaks. That’s just the way it is. But when it came time to renew my website domain – the face of my freelancing business, and I discovered yet again that the domain renewal pages of my registrar *still* would not allow me to renew online I nearly lost it. I called up their customer support where the person on the other end asked me for my username and password so that they could enter the transaction for me. Yeah right. It was time to find myself a new registrar. After the usual poking around the Internet and some discussion among my associates, I settled on http://www.namespro.ca/. They’ve been in the business since 2003 and are a Canadian business so I feel like I can trust them to manage my domains properly. I signed up and was able to quickly and easily move over my domain. The website is easy to follow and the domain management pages are clean and easy to use. I sent a couple questions out to their tech support and received prompt replies that made me very happy with my choice. I’ve since moved a couple more domains to them and will continue to chance my domains over to namespro as they come due. Managing my domains from a proper web interface on my own schedule has never been simpler!

2011
08.16

Resize and Rotate

Last week my laptop died so when the new one arrived I started re-installing all those apps that make it work the way I want. This post is about one of those *must-have* applications. I manage all may camera images on my laptop so being able to quickly resize or rotate images is pretty important to me. Luckily a friend showed me an easy way to do bulk rename and resize with a simple right-click.

Installation

To add the new options to the Nautilus context menu we’ll first need to install the package:

 sudo apt-get install nautilus-image-converter 

You’ll need to restart Nautilus or simply logout and log back in before you get the new right-click menu options. After you’ve done that you will be able to right-click on any image file and you’ll see the two new menu items: “Resize Images” and “Rotate Images”.

When you choose one of the menu items you will be presented with a simple interface to provide the relevant input parameters. What could be easier?!