Archive for November, 2007

removing old “preferred” wireless networks

Friday, November 30th, 2007

In Ubuntu I accidentally tried connecting to a wireless network. After that every time go near it now the Gnome network manager would connect to it. There is no handy way that the manager lists of “allowed” networks can be managed. After some digging I found the solution - removing a directory that made it “preferred” and restarting networking. After that the manager no longer did an auto connect.

cd .gconf/system/networking/wireless/networks/
ls
rm -rf <essid>

to_proc for evdo auto dialing

Friday, November 30th, 2007

I was reading John Hume’s to_proc blog entry. Much like he said I hadn’t seen the extension and immediately liked it’s readability.

On my ubuntu machine I use scripts to dial into verizon evdo. Lately I haven’t been connecting as reliably as I had been and I was spending a lot of time dialing, looking at the system log.

Interested in trying out the extension and also more interested in setting up an autodialer I started working on an intelligent verizon pppd script. It’s not done yet (I’ll post more when it is fully flushed) but I did use the to_proc.

def call_evdo
  IO.popen("pppd call 1xevdo")
  sleep 10
end

10.times &:call_evdo

I like the readability thanks to the to_proc extension. Right now I am working on monitoring /var/system/log for the IP address / error and redialing / binding the default gateway. I’ll keep this blog updated with progress and eventually an autodialer script.

exif date shifting for photos

Monday, November 26th, 2007

I recently pulled about 6 months of photos from my camera. To my aghast I realized that I had mistakenly set the clock a year early so all of the photos had the correct date on them except for the year which was 2006 instead of 2007. This was really annoying in Picasa which uses the date of the photo in the exif header to order photo albums.

In order to fix this I need to update the EXIF file for each JPEG. What I really needed was a date shift since most of the dates I was using were fine. I did some digging around and found ExifTool by Phil Harvey that will let me modify an EXIF file, in particular ExifTool will perform a date shift on a group of photos - probably for morons like me who can’t properly set their camera date or accidentally check in a hard coded test URL.

ANYWAY I had quite a few photos to process and some of the photos (first half of 2007) that were correct. So I wrote a script that did the following:

1) Check the EXIF create_date for 2006.
2) If 2006 shift the date forward one year
3) confirm and delete the backup “original”

Here is the subsequent ruby script. It isn’t very pretty as this was a one off operation.

shift_year_forward_to_2007_if_2006.rb

#!/usr/bin/env ruby
require 'date'

def create_year(photo)
  command = "exiftool -CreateDate #{photo}"
  read_process = IO.popen(command)
  output = read_process.readline
  read_process.close
  Date.parse(output.split[3].gsub!(":","-")).year
end

photos = Dir[File.join('**/*')].select do |path| path.upcase.include?("JPG") end
photos.each do |photo|
    if create_year(photo).eql?(2006)
      puts "Attempting to Shift #{photo}..."
      modify_process = IO.popen("exiftool \"-AllDates+=1:0:0 0\" #{photo}")
      modify_process.close
      File.delete("#{photo}_original")
      if create_year(photo).eql?(2007)
        puts "Verified!"
      else
        puts "Error on #{photo}"
      end
    else
      puts "Ignoring #{photo}"
    end
  end

compiz fusion instability - going back to kwin

Monday, November 19th, 2007

After a few weeks of trying Compiz Fusion on my Kubuntu Gutsy laptop I have returned to using the standard KWin window manager. My reasons for this were:

  • Buggy decorators. After running for a short period of time with compiz the windows decorators (maximum, minimize, close, resize, etc) stopped appearing.
  • Tray icons not loading correctly. When I booted my laptop and immediately logged in a few of the system tray icons (PowerManager for one) would not load in the tray but instead be running on the top left of the screen. Restoring to kwin would cause this issue to go away.
  • Occasionally on login the keyboard would not be functional. This was resolvable by logging out with the mouse and logging back in.

Overall I liked the effects but couldn’t handle the issues and not being a kde developer didn’t feel like sifting through bug reports and trying to tinker with the window manager. I setup my compiz fusion configuration according to the help.ubuntu.com’s instructions.

Odd Behavior with Compiz Fusion Advanced Desktop Effects

Tuesday, November 6th, 2007

Today I was experimenting with Advanced Desktop Effects for Kubuntu Gutsy. I set them up easily enough. I first removed everything I had installed before (legacy beryl) and reinstalled CompizFusion according to the ubuntu help documentation.

Everything installed fine but I ran into a troubling issue. I was looking at the list of activated plugins and trying to get a handle on everything (including what the super key is…I still have no idea but I’ll figure it out soon enough) and after playing with the “Move window plugin” which was tied to ALT-F7 I said “that is cool but I’ll never use it…I’ll just drag the window around with my mouse” and disabled it.

Anyway that behavior was opposite of what I was expecting. The compiz desktop effect was also the base move window action so disabling it made it impossible to move any windows at all. I re-enabled it and moving windows (with the mouse) once again worked as expected.

I suspect that other effect “plugins” behave similarly so when playing with desktop effects be careful what you disable! IMHO a window manager’s core functionality includes things like “move window” “resize window” and treating them like plugins as opposed to core elements is an extreme that could lead an unaware user down a road that disables features that one might view as critical. That said there are things like “Application Switcher”, “Ring Switcher”, and “Shift Swticher” all of which are different ways to switch between windows. So I guess one could deliver an alternate “Move Window plugin.”

Perl Locale is Corrupted after Gutsy Upgrade

Monday, November 5th, 2007

At some point after I completed my Feisty to Gutsy upgrade I discovered that whenever I ran a perl module (whether it was when I was reinstalling vmware or running aptitude) I received the following warning:


perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

I ran across the following ubuntu forum thread and executed the following two commands to clean up the broken locale:


sudo locale-gen
sudo dpkg-reconfigure locales

That resolved the issue and the perl warnings disappeared when I ran aptitude again as a smoke test. I am not sure what could have caused this corruption as the thread is dated. The issue might not be gutsy upgrade related but it is likely the culprit as I have done little on my machine in terms of config changes beyond it.

BBQ Fried Chicken Wings

Monday, November 5th, 2007

I was getting ready to watch the Patriots / Colts game yesterday. I was planning on watching the game at home and felt like some chicken wings. If I had been out at a bar I would have had no issues ordering some from the friendly wait staff. In years past if I was home and felt like wings I would order 10 or so medium wings from Yakzies. I was always a fan of that place unfortunately the original location (near me) went out of business and I was out of options at home.

Anyway I was in the grocery story (Whole Foods as it were) earlier that day picking up a few things for dinner when I felt inspired to do it myself. At the Whole Foods counter they already had drumettes (already split and tipped) for sale. I thought to myself “how hard could it be” and after deciding to go BBQ at home (as I didn’t feel like experimenting with hot sauces) I ordered 8 wings and went home for the game.

I made the wings before the game started - it was a 3:15 start so it would be a late lunch anyway and I didn’t want to get hung up in the kitchen during the game. Truthfully I think I paused the beginning of the game as I was wrapping up and probably started watching the game 5-10 minutes after kickoff. It was a bit confusing as the local Chicago CBS clipped the first two minutes of the game and came in on the Colts with the ball with 13:57 left in the first quarter. Annoying.

Anyway the wings I made were fantastic. They were easy to make and I would definitely do it again!

Ingredients

  • Chicken wings. If you get whole wings split them and cut the tips of the wings off.
  • Vegetable oil (enough to fill whatever pan you are going to use 3-4 inches deep).
  • Flour
  • BBQ Sauce. I used about 3-4 tbsp to mix the wings with.

Recipe

In a medium saucepan pour vegetable oil until 3-4 inches of depth. You want enough to submerge the wings but you also want to avoid using too much as it is just wasteful. Heat to 360 to 400 degrees.

While heating the oil spread flour in a baking sheet and coat each wing lightly.

Once the oil is ready drop in the wings, I did 4 wings at a time but you could scale to whatever makes sense for your saucepan. I wanted to avoid using a lot of oil as I was limited in my quantity at home. I also didn’t want a spatterfest in case things got out of hand. I did 4 minutes for each batch of wings.

When the wings have turned a slight golden brown remove and drain on paper towels.

In a mixing bowl (I used a medium sized stainless steel bowl) place 4 tbsp (or whatever you feel like) of BBQ sauce. Drop the wings in as a group and mix them with the sauce. Each wing should be covered lightly.

Serve immediately!

All in all this was one of the easiest things I have done. Next time I would look to improve with the following:

  • Have a better thermometer. All I had was a meat thermometer which didn’t do the best job as it couldn’t read temps above 400 degrees and I didn’t feel comfortable leaving it in the saucepan. Have a thermometer meant for measuring the temperature of hot oil would have made it easier to control the temperature of the oil.
  • Get more creative with the batter and sauce. I just coated the wings in flour - which worked really well as a base for the BBQ sauce I added in the mixing bowl. However I could have gotten a lot more creative both with the batter around the fried chicken as well as the sauce I coated the chicken with. This was a “out of the blue” recipe and I was very pleased with the results but even still I could see a few small easy things I could do that would makethis recipe even better.

On top of that the game couldn’t have been more enjoyable. A great close contest with the Patriots coming from behind and outlasting the beleaguered Colts in the 4th quarter!

Automatix Thunderbird 2 Restoring to Official Gutsy Package

Friday, November 2nd, 2007

After I completed the upgrade to Kubuntu 7.10 Gutsy Gibbon I realized my Automatix installation was broken. Since I had installed Automatix to get an easy Thunderbird 2 upgrade I said to myself “no big deal” and removed it from my system. This didn’t cause me too much of a worry until I ran an aptitude show thunderbird to see what happened to the automatix package.

I wasn’t comfortable returning to Automatix - I have gotten to the point where I am trying to keep my sources.lst as clean as possible to make upgrades simpler. However without Automatix, I discovered that the package was for all intensive purposes lost. I could run thunderbird but aptitude had no idea it was there and I figured at that point my upgrade path was not so clear. I set about to uninstall it manually and after reading a couple posts on how best to accomplish this I did the following:

sudo rm /usr/bin/thunderbird
This removes the link to /usr/bin.
sudo rm -rf /opt/thunderbird
Automatix Thunderbird 2 was installed in this directory. A nice way to perform an install since files are not trickled all over the place.
sudo rm -rf /etc/thunderbird
There was nothing really in this directory but I noticed it and I deleted it.
sudo rm /usr/share/applications/thunderbird.desktop
Remove the Icon from my KDE Menu

At this point as far as I could tell Thunderbird was uninstalled. Performing an aptitude search thunderbird revealed no installed thunderbird packages. I completed my migration back to a proper ubuntu package by installing the default thunderbird package (which in Gutsy is Thunderbird 2).

sudo aptitude install thunderbird

This restored Thunderbird and my Thunderbird 2 was now back to an official Ubuntu package.