Friday, August 31, 2012

Dimitri's baptism

Today we went to a couple of pharmacies and a grocery store looking for Gerbers baby food.  None of them had any.

For lunch we had kefetedes and French fries.

Dimitrios's baptism was at 7pm followed by dinner.  A lot of George's relatives and friends attended. Dimitri was exorcised at the beginning of the 30 minute ceremony. His clothes was removed before he was thrown up and down in the holy water and anointed with olive oil. In the beginning Dimitri was sleeping, but he was screaming and crying when he was dunked in the water.  Supposedly Kristen had a shocked expression on her face.

Amongst the dishes at dinner was kokoresti, pork, and lamb.

Thursday, August 30, 2012

Trip to the center of Athens

We went to a Carrefour grocery store in the afternoon. They didn't have any Gerber's baby food for Dimitri but at least I was able to get some Euros from the ATM.

After dropping off Kristen and Dimitri, George and I heading to the metro station and traveled into Athens to go to the New Acropolis Museum. Afterwards, we walked through Plaka and Monastiraki. There was an icon vendor who said they could make a Ladder of Divine Ascent icon in about a week for 250 euros. I declined.

When we arrived back at George's mother's house, George's cousin Maria and his aunt were visiting. George and I snacked on some moussaka, phyllo cheese triangles, and little Greek meatballs.

Later we went to a cafe next to the church where Dimitri will be baptized. I had a Greek frappe with Baileys. Almost everyone else had beers.

Wednesday, August 29, 2012

Arrived in Greece

Today I arrived in Athens, Greece, via Atlanta and JFK.  On my flight from JFK to Athens, I sat in the row behind Kristen, George, and Dimitri.  Everyone on the plane thought that he was a very good baby.  And then he chocked will drinking from his sippy cup and vomited on George.

George's mother picked us up at the airport.  Everyone was tired and took naps.  George's mother made moussaka.  Leonidas, Antonis, and their girlfriends stopped by later in the evening to see Dimitri.

Wednesday, August 01, 2012

Resuminator

It looks like something changed as far as how application resume works with either Safari 6 or Mountain Lion.  Before, applications like TextEdit and Preview would resume their previous application state when launching but Safari would start fresh.  Now, Safari re-opens the windows that were opened when it was closed when launched.

To fix this (i.e. have Safari no reopen windows that were opened when it was last closed), either run this in a Terminal window:

defaults write com.apple.Safari NSQuitAlwaysKeepsWindows -bool false

Or, download Resuminator from here.  Another option is TinkerTool.

Monday, July 30, 2012

Strange iCloud issues with Mountain Lion on my laptop

A couple of strange things occured when I installed Mountain Lion on my work laptop.  For some reason, there seemed to be a phantom iCloud account which I couldn't initially get rid of.  In Notes, I could see the second account which caused all notes to duplicate, but I couldn't remove it.  When I removed the account from the "Mail, Contacts, and Calendar" preference pane, it would reappear.  Eventually I was able to get things working by some combination of removing the iCloud related keychain entries using Keychain Access, and manually deleting the data files which Notes uses (which I found via the lsof command).

I also had some problems sending iCloud email.  Removing the old Mobile Me smtp setup and removing and re-adding iCloud email seemed to fix it.

I didn't encounter any of these problems in my Mac Pro.  One thing that was different during the install was I didn't get prompted to login into iCloud on the MacBook Pro while I did on the Mac Pro.

Friday, July 27, 2012

Intitial OS X 10.8 Mountain Lion Notes


The installation was uneventful.  One nice touch during the installation is that you setup different accounts for iCloud and the iTunes store.

A couple of things that I have noticed so far:
The location of the Notifications menu bar icon annoys me.  I would prefer that the Spotlight icon be in the top right corner of the screen.

Monday, June 11, 2012

Terminal bell in Ubuntu 12.04

I got a new HP PC at work to replace my approximately 5 year old Dell that is running Red Hat Enterprise 5.x.  Since I no longer support any servers running Red Hat and the stuff I work on is deployed on Solaris boxes, I decided to switch to Ubuntu.

One of the problems I discovered is that the terminal bell doesn't work.  It appears that when they decided to disable the PC speaker beep (which I actually sort of prefer in some cases), they also disabled the terminal bell without providing an easy way to re-enable it.  I was able to get it to work again by running the following:

pactl upload-sample /usr/share/sounds/ubuntu/stereo/bell.ogg bell.ogg
pactl load-module module-x11-bell display=:0.0 sample=bell.ogg
xset b 100 

After doing this, I could hear the bell when doing "echo -e '\a'", when doing tab completion, or hitting Control-g in a non-windowed Emacs session.  Unfortunately, there is no bell sound in windowed Emacs sessions, though.


Saturday, February 18, 2012

Open Blu-ray discs with VLC 2.0

The Open BDMV folder doesn't work for me.  The only way I could get a Blu-ray to open is via Open Network and using an MRL like "bluray:///Volumes/Greece 2008".  The Open BDMV folder UI adds the BDMV subdirectory to the MRL which seems to cause the playback failure.

Thursday, February 09, 2012

innerHTML and IE

I needed to insert a large chunk of html returned from an Ajax call to a pre-existing CGI script.  Everything seemed to work fine under Chrome, but under IE I was getting an Unknown Runtime Error.  I was able to get things to work by using a regex to grab only the table element that I was interested in and inserting that to my document via my div's innerHTML.  This seemed somewhat fragile.  I found a better solution in the comments to this blog post.

This is what I ended up doing (where data contains the html returned by the Ajax call and flowDiv is the id of the div I am inserting into):
  
var oldDiv = doc.getElementById('flowDiv'); 
var newDiv = doc.createElement(oldDiv.tagName); 
newDiv.id = oldDiv.id; 
newDiv.className = oldDiv.className; 
newDiv.innerHTML = data; 
oldDiv.parentNode.replaceChild(newDiv,oldDiv);



Saturday, October 22, 2011

Arch Linux on a Pogoplug

The hard drive that I was using for Time Machine died (I/O errors), so I went to Best Buy to get a new one.  While I was there, I noticed that they had a Pogoplug which I also purchased. 

Although the box said the model number was a POGO-P21 (which is the model number for the Pogoplug v3), the sticker on the Pogoplug itself said that it was a POGO-E02 (Pogoplug v2). While the v3 has a faster processor, the v2 has more memory (256 MB vs 128 MB).  I didn't notice until just now that I could have installed Optware on it and kept access to my.pogoplug.com.  Instead, I installed Arch Linux ARM on it (on a 2 GB flash drive).  In retrospect, I probably could have done what I wanted with Optware, but since I already have Arch Linux working, I'll probably leave it as is.

I used pacman to install ffmpeg on the Pogoplug and configured my netcams to upload to it instead of my Western Digital MyBook Live since the ffmpeg binary on Arch Linux includes the mpeg4 and H.264 codecs where as the MyBook does not.  Encoding to H.264 is too slow, so I'm encoding to mpeg4 (I was encoding to motion jpeg on the MyBook).  Although I am storing the images and videos on a 16 GB flash drive (formatted ext2 to reduce flash wear), I'm uploading the compressed files once a night to the MyBook for easier remote access and more permanent storage.

Friday, October 21, 2011

More efficient NAS backups using Carbon Copy Cloner

By default, when backing up to a sparse bundle disk image, Carbon Copy Cloner uses a band size of 8MB. This might be already for use on a local disk, but seems to cause a slow down when reading from a mounted drive on a NAS such as the Western Digital MyBook Live.  This is probably due to have so many files in the band directory of the bundle.  To rectify this, one can create the sparse bundle ahead of time by doing something like this:

hdiutil create -verbose -type SPARSEBUNDLE -size 1T -imagekey sparse-band-size=262144 -fs HFS+J -volname myVolume myVolume
 This will increase the band size to 128 MB which should improve performance.

Point Carbon Copy Cloner to this pre-created disk image when doing the backup.

Friday, September 23, 2011

DD-WRT VPN client with MacOS X and iOS

With build build 14896, the VPN client doesn't seem to work by default with MacOX X 10.7 or iOS 4.3.  To get it working, go to Administrations->Commands, and add the following to what runs on Startup (Save Startup) and then restart the router:

echo 'noaccomp' >> /tmp/pptpd/options.pptpd

Note:  if you make any changes in DD-WRT's web interface that may a cause the options.pptpd file to be rewritten, you might have to restart the router.

Monday, September 19, 2011

Blocking WD MyBook Live incoming connections


The MyBook Live allows remote access the the hard drive via the WD 2go iOS app.  One thing I don't like about it is that it pokes a whole via UPnP on my firewall for ports 80 and 443.  And unfortunately on dd-wrt, UPnP port forwarding takes precedence over any other rules on the FORWARD chain.

So, I manually added a rule via Administration->Commands (Save Firewall) in dd-wrt:

iptables -t nat -I PREROUTING -p tcp -i `get_wanface` -m multiport --dport 80,443 -j DROP

"iptables -L" doesn't show prerouting rules.  Instead, do: "iptables -L -t nat".

Since the MyBook Live runs Linux internally, there might be a way to change the ports through some manual unsupported mechanism, but haven't had a chance to check.  Hopefully Western Digital creates a firmware update that allows the port to be changed via a supported mechanism in the web UI.

Saturday, September 10, 2011

Dripping shower

My upstairs shower was occasionally dripping a little.  A while back, I had fixed a similar problem with my downstairs shower by replacing the Price Pfister valve assembly and cartridge/pressure balance with a combo unit (part number 974-042).  This was evidently the wrong part.  Although it worked alright, it caused the handle and wall flange to stick out a bit.  I think this was due to the fact that the shower is a pre-1997 unit (either model 08, 808, 0X8 or R89).  According to this FAQ, the correct part numbers are actually 971-250 for the valve assembly and 974-291 for the cartridge/pressure balance.

So, I ordered the parts and replaced them.  The shower appears to be working ok.

Monday, September 05, 2011

Compressing network camera images on a WD My Book Live

I have two Panasonic Network Cameras that are setup to ftp images via timed and motion sensor triggers to a Western Digital My Book Live NAS.  This device runs Linux. Information to gain ssh access can be found here.  The device has perl and a stripped down version of ffmpeg pre-installed.

Below is a quick and dirty perl script that will take the images uploaded from the network cameras and generate QuickTime files from them.  Unfortunately the ffmpeg binary that is pre-installed has limited codec support, so the QuickTime file is just using the mjpeg codec.

UPDATE (9/5/2011 1:00pm): Modified framerate of QuickTime file and changed the threshold for including motion image files.


#!/usr/bin/perl -w

use strict;
use Time::Local;
use POSIX;
use File::Copy;

# crontab:
# 5 0 * * * cd /DataVolume/shares/Netcam; perl -w compress_to_mp4.pl >>compress_to_mp4.log 2>&1

my $root = '/DataVolume/shares/Netcam';
my @dirs = ("$root/pancam1/motion",
            "$root/pancam1/timer",
            "$root/pancam2/motion",
            "$root/pancam2/timer");

foreach my $dir (@dirs) {
  my $stoptime;
  $stoptime = time();
  $stoptime = timelocal(0, 0, 0, (localtime($stoptime))[3], (localtime($stoptime))[4], (localtime($stoptime))[5]);
  my $threshold = 60*60*24;
  my ($type) = ($dir =~ m!/([^/]+)$!o);
  if ($type eq 'motion') {
    $threshold = 60*10;
    $stoptime = 0;
  }
  if (opendir (DIR, $dir)) {
    my @filenames;
    while (my $filename = readdir(DIR)) {
      push @filenames, $filename if $filename =~ /\.jpg$/o;
    }
    closedir (DIR);
    @filenames = sort @filenames;
    my %batches;
    my $laststart = 0;
    my $lastts = 0;
    foreach my $filename (@filenames) {
      my ($year,$mon,$mday,$hour,$min,$sec,$msec) = ($filename =~ /(\d{4})(\d{2})(\d{2})s(\d{2})(\d{2})(\d{2})(\d+)\.jpg/o);
      my $ts = timelocal($sec, $min, $hour, $mday, $mon-1, $year);
      next if $stoptime && $ts>$stoptime;
      if ($ts - $lastts > $threshold) {
        $laststart = $ts;
      }
      $lastts = $ts;
      push @{$batches{$laststart}}, $filename;
    }
    foreach my $ts (sort keys %batches) {
      if (! -d "$dir/tmp") {
        mkdir("$dir/tmp");
      }
      my $count = 1;
      my @tmpfiles;
      foreach my $filename (@{$batches{$ts}}) {
        my $tfilename = sprintf("tmp%08d.jpg", $count);
        my $tpath = "$dir/tmp/$tfilename";
        push @tmpfiles, $tpath;
        copy("$dir/$filename",$tpath) or die "copy failed $!";
        $count++;
      }
      next unless scalar(@tmpfiles) > 1;
      my $outdir = "$dir/../$type" . "_video";
      if (! -d $outdir) {
        mkdir($outdir);
      }
      $outdir .= strftime("/%Y%m%d", localtime($ts));
      if (! -d $outdir) {
        mkdir($outdir);
      }
      my $ofilename = strftime("%Y%m%d-%H%M%S.mov", localtime($ts));
      my $out = `ffmpeg -y -r 3 -vcodec copy -i $dir/tmp/tmp%08d.jpg $outdir/$ofilename 2>&1`;
      if ($out =~ /error/om) {
        print "$out\n";
        die;
      }
      foreach my $filename (@tmpfiles) {
        unlink($filename);
      }
      foreach my $filename (@{$batches{$ts}}) {
        unlink("$dir/$filename");
      }
    }
  }
}

Dynamic widths for blog template

Add the following CSS to the template for dynamic widths:


html body .content-outer {
max-width: 90%;
}

Thursday, August 11, 2011

MailRaider

I needed to read an Outlook .msg file that was attached to a Help Desk ticket.  Using MailRaider, I was able to see the message and retreive the attachments inside.

Wednesday, July 20, 2011

Initial MacOS X 10.7 Lion Notes

In System Preferences:
  • To change the mouse scrolling behavior to how it use to behave in prior versions, uncheck "Move content in the direction of finger movement..." in the Mouse panel.  It might be worth leaving it checked if using a track pad or Magic Mouse.
  • To always show scroll bars, change the "Show scroll bars" options in the General panel.  Unfortunately, there isn't a way to add scroll arrows.
In order to show harddrive/directory information (number of items and free disk space) in the Finder, toggle on "Show Status Bar" under the View menu.

The default location which Finder windows opens is now "All My Files".  To change it, look under the Finder preferences, and change the location listed under "New Finder windows show" in the General tab.  I have mine set to Applications, although I used to have it set to my home directory.

To install Java, launch any Java application from the Finder.  For example, Java Preferences under Applications/Utilities.

There are a bunch of new high quality voices in multiple languages when customizing the System Voice in the Speech System Preference panel.  They will auto download if selected and are quite large.  The foreign languages seem to be all high quality.  For U.S. English, Jill and Tom are the high quality ones.

After installing, it takes a long time (and lots of churning of the hard drive) to rebuild the Spotlight database.

Sunday, May 22, 2011

Strange audio problem with Denon AVR-790 Receiver

I was watching a Blu-ray on my PS3 when my Denon AVR-790 receiver started making clicking noises and the audio stopped.  I tried switching to different input sources on the receiver (including the radio tuner) and still no audio output.  I went into the menu, and the option to generate test tones was missing.

After doing some research, I tried blowing into the headphone jack and audio started outputting from the speakers.  Evidently the receiver must have a very sensitive headphone jack and some dust must have caused it to think that headphones were plugged in.  Seems ok now.

Monday, May 09, 2011

The Invasion Begins

Today, the cicadas of Brood XIX started re-emerging in Nashville.  This is the brood that last emerged in 1998.