WordPress on OSX (10.6.8), Apache, PHP & htaccess

I’ve just managed to get OSX 10.6.8 to work with mod_rewrite and .htaccess to be able to let WordPress rewrite it’s URLs. Here is what I did.

I installed WordPress to my homefolder so I’ll access it using http://localhost/~ola/wordpress. Apache is configured to use a split config in OSX so to change the directives for the home folder you change the file /private/etc/apache2/users/Ola.conf. I changed AllowOverride None to AllowOverride All and restarted Apache.

I got a 403 Permission denied message. I checked the Apache error log /var/log/apache2/error_log. It said: [Mon Nov 28 16:30:47 2011] [error] [client 127.0.0.1] Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: /Users/Ola/Sites/slipstream/wp-admin/options-permalink.php, referer: http://localhost/~ola/slipstream/wp-admin/options-permalink.php

I added the Options directive FollowSymLinks to /private/etc/apache2/users/Ola.conf, restarted Apache and it worked fine.

I’m only using this config as a development box so I’m not sure if it has any security implications. If you have any knowledge about this just let me know.

Using Motion webcam software to capture an image every 30 seconds

Sometimes I use a webcam to capture images that I then use for time lapse videos. Other times I use my old Canon camera with CHDK and an interalometer script.

I have been trying to find a simple and robust webcam tool for this for years but all packages are too complicated and anoying. I just want to take an image every 30 seconds and be done with it. No HTTP server. No fancy scheduling. Nothing more than getting my images from the camera.

In Windows I have tried webcamXP and that’s pretty good. In Linux I have been running Motion. It’s a full featured motion detection package. Capable of much more than I want.

I adjusted the config file for Motion to only save one image every 30 seconds. Just as I want it.

My Motion config file (~/.motion/motion.conf)

# Motion is a webcam software that is designed for doing motion detection.
# I made the most simple config I could to disabled all motion detection
# features. Instead I just use it to take one picuture every 30 seconds.
# It's configured for giving the hightest quality possible with a
#   046d:0992 Logitech, Inc. QuickCam Communicate Deluxe
#
# Visit the web site for more information about Motion
#   http://www.lavrsen.dk/foswiki/bin/view/Main/WebHome

snapshot_interval 30
width 1280
height 960
quality 95
text_right ""
target_dir /home/ola/webcam/capture
snapshot_filename %Y-%m-%d/%Y%m%d-%H%M%S

process_id_file /var/run/motion/motion.pid
output_normal off
v4l2_palette 1
framerate 2

Multiple user profiles for Google Chrome

Recently I wanted to set up multiple profiles in Google Chrome. One for my personal browsing and one for my work. This way I don’t need to sign in and out from my different google, twitter, flickr and facebook accounts.

There is no GUI for this and it involves running some command line but it’s not too hard.

You should run all commands on one line and make sure to change the paths to your user name and profile.

Windows 7 / Vista

First you make a copy of your current default profile. You can do it either in Windows Explorer on on the command line.

xcopy "C:UsersOlaAppDataLocalGoogleChromeUser DataDefault" "C:UsersOlaAppDataLocalGoogleChromeUser DataOla" /e /i /h

Then you reset your new profile

C:UsersOlaAppDataLocalGoogleChromeApplicationchrome.exe --user-data-dir="C:UsersOlaAppDataLocalGoogleChromeUser DataOla" -first-run

Then you create a new shortcut on your desktop to launch your new profile

C:UsersOlaAppDataLocalGoogleChromeApplicationchrome.exe --user-data-dir="C:UsersOlaAppDataLocalGoogleChromeUser DataOla"

Ubuntu 10.10 (Linux)

Copy default profile

cp -r /home/ola/.config/google-chrome/Default/ /home/ola/.config/google-chrome/Ola

Reset your new profile

/opt/google/chrome/google-chrome --user-data-dir="/home/ola/.config/google-chrome/Ola" -first-run

And add a new Launcher (shortcut)

/opt/google/chrome/google-chrome --user-data-dir="/home/ola/.config/google-chrome/Ola" -first-run

That’s all there is to it.

 

Making screencasts for Youtube with CamStudio

Yesterday I needed to find a simple and robust solutions for recording a screencast. It turned out to be not as easy as I thought.

To get a similar workflow as with my other video editing I wanted it to work like this:

  1. Record a 1280 x 720 section from my screen to a high quality format
  2. Open and edit the recorded file in Sony Vegas Platinum 8
  3. Render it from Vegas to a lossless format
  4. Re-render it using HandBrake
  5. Upload the file to Youtube

Record with CamStudio

I started out with the latest beta of CamStudio. It a nice, simple and easy tool that does what I need.

My first attempt was to save an AVI file with the included Microsoft Video 1 codec. The quality was pretty low so I tried to use the CamStudioCodec (from their web site). I got a nice looking AVI. However Vegas didn’t really like this file. It worked, but it was very slow.

Then I tried to use the Huffyuv codec that I had installed recently when I optimized my HDV workflow. It created a BEAUTIFUL HUGE file that I could work with in Vegas. I edited the file, normalized the audio and rendered the video almost exactly the same way as I render all my other videos (described in my HDV workflow). I just lowered the resolution from 1440 x 1080 to 1280 x 720.

Re-render and upload to Youtube

I opened the file in HandBrake and selected the High Profile. I exported the file the same way as in my normal HDV workflow. It created a good looking file. I uploaded it to Youtube. Everything went smooth. Until I looked at the video on Youtube. It came out gray. No video at all. I made a test upload to Vimeo. No problems. I tried with different codecs and settings. Both in Handbrake, Vegas and CamStudio. All came out gray on Youtube.

I tried really hard to understand why this didn’t work but I couldn’t get it to work so I resorted to Avidemux. I opened the file in Avidemux. Selected the MPEG-4 ASP (Xvid) codec for video and MP3 for audio (I increased the quality on both). I exported the file and boom. It worked fine on Youtube.

I’m not sure what went wrong. Or why. And I ended up yet another tool in my belt. But I almost reached my goal of having similar workflows so I’m pleased.

Upload your old photos to Flickr

I use Flickr for all photos I would like to share with everyone and (a locked down) Picasa album for family events and other more personal things.

I have been using different online photo tools the last couple of years. Everything form building my own, to Gallery, WordPress, Picasa and Flickr. But the last year I have been using Flickr more and more. Instead of having all my favorite photos scattered around the web I wanted to upload them to Flickr. It was a pretty massive job. Here are the steps I took.

Update EXIF data on my oldest photos

I had about 100 (of my oldest) photo folders without EXIF-data. The most important missing fields are the fields that tells when the photo is taken. Without this Flickr would show it as it has been taken the same day as it was uploaded. I didn’t want that.

I looked around a bit for tools that could write EXIF-data and lastly I decided that the command line tool ExifTool would be the easiest to use.

My photos are sorted in folders like 2001/010101_A-beautiful-winter-day-in-the-snow. I opened a command line window and added the ExifTool binary to the path. Then I went through the 100 folders and executed the following command (should be all on one row) for every folder. Don’t forget to change the three date fields.

exiftool -Make="FUJIFILM" -Model="MX-2700"
-ModifyDate="2001:01:01 12:00:00"
-DateTimeOriginal="2001:01:01 12:00:00"
-CreateDate="2001:01:01 12:00:00"
-FocalLength="7,6mm"
-FocalLengthIn35mmFormat="35mm" 
-Artist="Ola Lindberg" 
-copyright="Ola Lindberg" *.jpg

The day is the most important. I didn’t care so much about the time. I added some extra camera information since I knew what camera I had used for the different shots. An hour later I had my first years properly EXIF-tagged.

Export the photos from Picasa

I’m using the Picasa program for my photo management. So I started from 1998 and took one year at the time. I starred, adjusted and exported the photos I wanted. Then I sorted them to folders by years when they were taken. I ended up with folders from 1999 to 2009 with between 5 & 50 images in each.

To be sure that I wasn’t missing any EXIF-data I looked through all exported photos in Windows Explorer where you can see the Date taken property. If it says Specify date taken you have no EXIF-data. By now most of my photos had the date in that field. I completed those that didn’t (both on the original file and the exported file).

Uploading to Flickr

I used the Flickr Uploadr tool to upload all photos. I tagged, added to sets, added titles and descriptions to all photos. Then I uploaded it one year at the time. I put them in one set for every year.

I ended up with sets from 1999 – 2009 with my old / new photos.

Re-sort the Flickr stream

Flickr sorts all photos by date uploaded. While it’s ok I didn’t want all my old photos to be on the first page in my Flickr stream. I could just have waited a while and it wouldn’t be a problem but I wanted to have them in an order more like date taken than date uploaded.

It’s strange that Flickr doesn’t support any way to re-sort you photo stream. But I found one third party tool (Flickr photostream update) that changes the upload date to the same as date taken. I ran it one set at the time and it worked fine.

There are one limitation though. You can never set the date taken to an earlier date than when you joined Flickr. I joined Flickr 2005-05-17 so my photos from 1999-2005 could never get the right upload date. Instead I changed the date for all photos from 1999 to 2005-05-20. All from 2000 to 2005-05-21. All from 2001 to 2005-05-22. And so on.

I looked for tools edit date uploaded in a batch for all photos in one set. I found one tool that I tried but it didn’t work. I didn’t have that many photos in these old sets so I just edited them one at the time in Flickr. It didn’t take more than 20 minutes so I was pretty happy. You could probably find a tool for this. Or even write your own.

Result

I uploaded about 400 of my old photos to Flickr. All in all it took two days. I ended up with a collection of my best of shots with sets for each year. And I’m very satisfied with it!