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.
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
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.
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:
Record a 1280 x 720 section from my screen to a high quality format
Open and edit the recorded file in Sony Vegas Platinum 8
Render it from Vegas to a lossless format
Re-render it using HandBrake
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.
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.
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.
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!
I’m using Sony Vegas Platinum 8 to make my video editing. It’s some years old but I like it a lot. I just updated my camera from standard definition to high definition (one Canon HV20-PAL and one Canon 550D). It gave me some problems. But I think I’ve found a decent workflow. There is a never version available that might work better with HDV but I’m sticking with my 8. For now at least.
To capture from the HV20 I use HDVSplit. It captures to M2t files. And with the 550d it’s just to copy the MOV files from the memory card. To get Sony Vegas to accept the MOVs you must install QuickTime. I used the free version and that worked fine. The video I have been working on doesn’t have that many files from the 550D so I cannot tell how good it performs yet.
Project settings and editing
Start Sony Vegas and let it automatically detect the project settings by opening one of your M2t files. It should then detect the format automatically. Open the project properties. It should look something like this.
I use Deinterlace method – Interpolate fields. I tried all the different options in Vegas. I tried to deinterlace in Handbrake but this way seemed to give the best results.
The Platinum version of Sony Vegas only allows 1440 x 1080 which is the maximum resolution from the HV20. The 550D does 1920 x 1080. Vegas automatically converts the clips so they work together. I’m not really sure what happens with the 480 pixels but the video looks good so.
When that’s set up you can start editing. If you get performance problems Eugenia has some tips you can try.
When you are done it’s time to render your video. I started out by following Eugenia’s guide but Sony Vegas kept crashing on me. I tried some different methods and I ended up with the following.
Start out by following step 2 & 3 in another of Eugenia’s guides. The only thing I changed was that I’m using Pixel aspect ratio: 1.0000 here instead of 1.3333 as before. I’m not sure why but the videos turned up wrong otherwise.
This will export a HUGE file in a lossless format.
Once that was done I had to convert the file to some other format. I tried with some different tools but I found Handbrake to be the easiest to use. All you do is to open the file in Handbrake and select a preset profile and render the video.
Viola! That’s all. Maybe not optimal but it works.
At work we always have a pretty hefty development environment. At home I’ve never had any dedicated environment for my web development. It’s both a relief and something I miss.
Today I’ll try to set up a WordPress development environment that’s a bit more robust than my old setup where I download the file I need to change from my website to my desktop, change it, upload it and refresh the browser.
I download the theme I want to use from WordPress Themes. I add -ol to the end of the theme folder to not confuse the themes with the original folder names. Then I check it in. This is done to easily be able to track my changes compared to the version I started out from later. Both to be able to see what I have done but also to easily be able to merge updated theme versions further down the road.
I change the styles.css file and add some information. Here is an example from the Simplr-ol style.css file.
THEME NAME: Simplr-ol
THEME URI: http://code.google.com/p/mypersonalblog/ (Simplr http://www.plaintxt.org/themes/simplr/)
DESCRIPTION: My customizations to Simplr; "The original minimalist one-column, content-centered theme for WordPress. A different type of theme. For WordPress 2.6.x."
AUTHOR: Ola Lindberg (Simplr by Scott Allan Wallick)
AUTHOR URI: /wp/ (Simplr http://scottwallick.com/)
TAGS: variable width, fixed width, one column, widgets, theme options, options page, white, orange, blue, microformats, hatom, hcard
If any theme diverges a lot from the original theme I’ll maybe come up with a new name and upload it to WordPress Themes. For now I think it’s good enough to have them all in one Google Code repository.
Setup VirtualBox, Ubuntu, Apache and WordPress
I installed VirtualBox, created an Ubuntu appliance and installed Ubuntu 9.10 desktop. I installed the guest add-ons and Apache. I changed the VirtualBox network to Bridge mode so it get’s its own IP address.
Update 101118: I recently wanted to make this setup on another computer (using a wireless network card) where I couldn’t get the Bridged Adapter to work. I searched around a bit and it and it seemed like some people had similar issues. Instead I configured VirtualBox to use two network cards. One using NAT (giving internet access) and one using Host-only Adapter.
With this setup you should access you guest os from your host os with the IP address your 2nd network card gets (in Windows).
I created an Apache Virtual Host and installed WordPress to that folder. The production URL is /wp/ and for the local URL I use http://o/blog. I added the IP for my virtual Ubuntu to the name o i my hosts file. Now I can surf to http://o/blog.
My virtual host is configured like this
#Only put the log file like this in the web root on a local server
CustomLog /home/ola/shared/web/ola/ola-access.log combined
Share files between my workstation and the virtual Ubuntu server
To share files in VirtualBox I use SharedFolders. The folder on my Windows workstation where I checked out the repository is D:CodingMyPersonalBlog and it’s mapped to the name MyPersonalBlog in Ubuntu.
To mount the folder MyPersonalBlog to /home/ola/MyPersonalBlog in Ubuntu you run the following from an Ubuntu terminal
sudo mount -t vboxsf mypersonalblog /home/ola/MyPersonalBlog
Make sure that the files are visible in you Ubuntu server by running ls -la in the folder.
Note! You need to run this every time you login or you can create a script and make it auto run.
Now I can enable the themes in the WordPress admin panel.
Note! If WordPress can’t see the themes look at the permissions for the shared folder. I set mine to 0777 since it’s a local setup.
Import all posts from the production setup
I use the build in WordPress feature to export all posts and pages to an XML-file. I import that file to my local setup. I include all attachments. Some minutes later I have all my posts in my local development environment.
If I need to re-import all posts I use the plugin Bulk Delete to empty my current local database. Then I empty the Media Library in the WordPress admin panel. One tip is to increase the number Media items per page via the Screen Options.
I installed Aptana, created a project file and added all my theme files to it. I have never used Aptana before so it’s a test. We’ll see how it goes.
Recently the batteries in my shaver (an old, but working, Philishave 5890) and hair trimmer (an old, but working, Philips HQ-C280) died. I looked around online for replacement batteries but didn’t find any specifications. I opened the devices but they didn’t tell what to use for replacements.
The 5890 uses two serial connected batteries. I measured the original size for each battery to: 42.5 x 14 mm. A little bit too long for being an AA. But I took a chance and replaced it with two NiHM AAs (47 x 14 mm). You’ll have to shoe horn them in to fit but it does.
The HQ-C280 uses one battery. I measured the size to match an AA battery exact so I just replaced it.
All the replacement batteries are standard AAs (for mounting) 1,2 V and 1500 mAh. I charged them for 20 hours and it worked fine!
On a Swedish version of the Advantage, use the following shortcuts instead
Turn on and off audible tones (sounds for Caps Lock / Num Lock)
Program + (?+)
Turn on and off key clicks
Program + (*’)
(´`) + (w) for ”Windows mode”
(´`) + (p) for ”non Windows mode” (use this for international Windows layout and in Linux)
(´`) + (m) for ”Macintosh mode”
Reset (there are several different resets, see the manual for more info) the keyboard:
Program + Shift + F10
Kinesis On-Board Dvorak Layout (on a Swedish computer)
Program + Shift + F5
If you are using a Swedish layout and switch to the on-board Dvorak layout your layout will look a bit different than the layout presented in the manual. The attached image shows how my layout works or download the SVG of the layout.
Update: Thanks to Alind for providing a good remapping method. Here is how I switch CapsLock and Shift:
In my previous post I requested you to help and seed the new Ubuntu Gutsy release. After having my torrent client seeding for some hours I realized that my DSL connection (8Mbit/1Mbit) wasn’t as keen as I was on the high network load it created. It made my computer almost unusable.
Luckily my router running the Tomato firmware had great support for Quality Of Service. I set it up according to the screen shots below and the network problems went away. It might be worth looking into!
Tomato: QoS – Basic Settings
Tomato: QoS – Classifications
Tomato: QoS – Graphs
I’m not sure if I managed to set it up properly so all comments are appreciated!
Some weeks ago I got my hands on an old PowerMac G4 (Mirror Drive Door). It’s no speed monster but two 1.25 GHz CUPs and 1 GB RAM it’s more than enough for my usage. There’s only one catch – The MDDs are really noisy. For a while I kept it on my balcony but that will only work when it’s not raining (and it rains a lot in Sweden) so I decided to make some modifications to get it quiet.
Power Macintosh G4 (Mirrored Drive Doors) – model number: M8570
2 x 1.25 GHz G4 PowerPC (7455) CPUs (with ALU sink)
4 x 256 MB (PC2700) RAM (max 2 GB)
ATI Radeon 9000 Pro (64 MB)
1 x 120 GB HDD
DVD Reader / CD-burner (combo drive)
USB 1.1 (I must get hold of an USB2 PCI card)
I started out with some research to find out if there were any existing modifications and found the following great articles:
This was a good starting point. Both for inspiration and information.
I tore apart the mac to find specifications for all my fans. I didn’t search for any disassembly instructions which I recommend you doing. The computer is a pain to work with. I put together data (airflow, noise levels, RPM, etc) for all original fans by reading data sheets from the manufacturers web sites and tried to find replacement fans with similar air flow capacity but with lower noise levels. The specifications for both the original and new fans are put together in this Google Docs spread sheet.
Time for Modding!
When the fans were ordered I started to gather some temperature data with the original configuration (except for the speaker which was removed). I used the program Temperature Monitor to get the CPU and HDD. Since the MDD can’t measure other temperatures I used a standard indoor/outdoor thermometer to measure PSU, room, DVD and PCI temperatures. Just attach the fan with tape where you want to measure. Having some different data was really valuable (as comparison) to find out which fans that are necessary and not. I also measured the energy (Watts) the computer used for normal desktop use to about 120 W and 130 W when burning CDs using a (UPM PM300) power meter. I compared this data to a friend’s new computer (that was quite even though it consumed 200-250 W). I thought that if that computer is quiet mine can be as well.
I’ll describe the different configurations I tried below. All data is available in the following Google Docs spread sheet.
Test 1 – Original configuration apart from removing the speaker to let air flow through that.
Test 2 – I removed the two 60 mm Nidec fans from the PSU and replaced that with one 92 mm Zahlman fan running at 7 V that I attached (temporarily) using tape. The temperatures rose a bit, but not too much whilst the noise level was lower but still too disturbing.
Test 3 – I kept the 92 mm fan attached to the PSU (from test 2) and connected the DVD fan at 5 V (instead of original 12 V). To be able to attach the DVD fan to 5 V I built a connector cable using a standard connector socket. You can cut the cables to the fan and solder these on a standard 3 pin fan connector (or 4 pin Molex connector) if you want but I thought it was better to build the custom connector. I noticed a tiny temperature drop but no real drop in noise.
Test 4 – I put the DVD fan back to 12 V and attached a 92 mm fan running at 5 V in the bottom front blowing air in to the computer. I hoped that this could help the CPU fan getting some cold air from outside the chassis and thereby letting it run at as low RPMs as possible (and thereby being quiet). This mod didn’t do any difference in noise or temperature.
Test 5 – When the 92 mm fan (from test 4) didn’t do any difference I wanted to try to put a fan between the CPU sink and the chassis. The idea was that this fan should draw hot air out from the box. I had ordered a slim (15 mm instead of standard 25 mm) 80 mm fan that I hoped to fit perfect. It didn’t. The RAM was in its way. I decided to try to use a Dremel and remove as much plastic as possible from the new fan. After a whole lot of cutting (in the fan) I could attach it (using stripes). I noticed a drop in temperature but no drop in noise. The CPU fan had to be removed.
Test 6 – The final mod! I kept the 80 mm fan (as in test 5). I replaced the 120 mm CPU fan with the PrimeCooler fan. And put back the original two 60 mm fans in the PSU. Since I had ordered a quiet 60 mm fan I replaced the original chassis door fan with that as well (even though it didn’t do any difference). I ran the computer for a while and found out that both noise and temperature was ok so I put back the speaker and crossed my fingers. After some hours I realized that this configuration was more than good enough! The noise level is ok. The computer is not quiet but it doesn’t disturb me anymore and that’s good enough. The temperatures are almost normal so I decided to stop here. For now at least.
It was a fun project to get this computer quiet even though it required about 10 h of work. I can’t really understand why Apple decided to make the computer so loud when it’s possible to make the “windtunnel” macs quiet. It’s like they wanted it to be noisy to make people feel that it was a really powerful computer or something.
If you aren’t into modding I would recommend you just changing the 120 mm Delta CPU fan with a new one and keep an eye on the temperatures. I think that would be enough. If it isn’t try to find a slim 80 mm fan that you attach between the CPU sink and the chassis as well.
Happy modding! Comments and questions are more than welcome.
Update 071026: I think my problems are solved in Gimp 2.4 (as well as the latest Inkscape). Have been running it for 1 day now without my problem. I can’t get the pressure sensibility to work though but at least it’s way better than before.
Update 071215: Well it broke again… The new workaround is to disable pressure sensitivity in Gimp by adding the –no-wintab command line option to the Windows short cut (right click, edit and just add the option). I have tried to find a solution to add the –no-wintab options to have Gimp always use it but I can’t find it so if you have any idea on how to do that please tell me!
A year ago I replaced my old Wacom Intous 1 for a Wacom Graphire 4 and to my great frustration neither Inkscape nor Gimp could handle the new pad. I researched it and found out something about a GTK/Wacom-driver error… This was sad since I really liked both of the applications.
But today I downloaded the newest versions of both Inkscape and Gimp and it works like a charm! So welcome back in my life, I have missed you both!
Unfortunately the new version of GTK seems to break Workrave.
The Tango Icons are so nice! I cant stop playing with them ^_^
Update: After reinstalling all my GTK+ applications it doesn’t work again. I’ll try to find a solution for this and update this post once I know why.
Update 071215: Well it broke again… The new workaround is to disable pressure sensitivity in Gimp by adding the –no-wintab command line option to the Windows short cut (rightclick, edit and just add the option). I have tried to find a solution to add the –no-wintab options to have Gimp always use it but I can’t find it so if you have any idea on how to do that please tell me!