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.

 

Firefox hides tabs and fails

I while ago I introduced a friend to Firefox. I didn’t want to push it but just show it and I hoped it would stick. After some weeks I asked if she liked it and she said it was nice but that she missed the tabs that IE had. I was amazed… Firefox were years before IE with tabs but still it fails… Look at the screen shot from Firefox 3. Nothing tells you the interface is tabbed.

Firefox fails to show how to open new tabs. Internet Explorer leads the way!
Firefox fails to show how to open new tabs. Internet Explorer leads the way!

Luckily Firefox 3.5 seems to address the issue. Firefox 3.5 also makes it even clearer than Internet Explorer with a + in the new tab button. Way to go Firefox!

Firefox 3.5 introduces new tab button!
Firefox 3.5 introduces new tab button!

Easy way to convert videos using FFmpeg!

Update: I used FFmpeg for some conversions but I just found out Avidemux and it seems promising! Trying it right away!

Every once in a while I get my hands on a video file that I can’t play. Today when I wanted to watch a bouldering movie it failed. Not sure why. Maybe becuase my WLAN wasn’t fast enough to stream the huge HD file?

I looked around and found no nice tools to convert the movies. Either it was some shareware, adware or I just couldn’t find the download link on the ugly web site… I reverted and decided to try to use the command line tool FFmpeg to encode my videos to mpeg and be able to play them. It worked so good I’m amazed!

In Ubuntu FFmpeg is included in the distribution and is easy to install via Synaptic or Apt (sudo apt-get install ffmpeg). In Windows you can use these builds.

To make the conversion I used the following: ffmpeg -i OriginalVideo.mp4 -ab 128k -b 2000k EncodedVideo.mpg

Tip: If you are testing different settings for FFmpeg add -t 60 to encode only the first minute of the video.

FFmpeg is capable of creating videos with different codecs as well, but I didn’t need that currently so that will be a later exercise!

Portable backup solution for Windows

I have been thinking about creating an easy solution to backup some files from different computers to thumb drives. I wanted a solution that was portable (so I could run it from the thumb drive) and easy to configure (maximum update one path to copy from and one to copy to).

I decided to give Robocopy (that I use for complete backups) a try. The portable requirement was solved by copying the file Robocopy.exe from the folder C:WindowsSystem32 (in Windows Vista) to my thumb drive. And the easy to configure requirement was solved by creating a Backup.bat file on the thumb drive with the following content:

SET source="D:Code"
SET destination="./CodeBackup"
SET logfile="./Backuplog.log"

SET copyMode=/MIR /XF desktop.ini
SET options=/R:0 /W:0 /LOG+:%logfile% /NFL /NDL

Robocopy.exe %source% %destination% %copyMode% %options%
pause

It copies the folder Code from my D: drive to the folder CodeBackup in the root folder on the thumb drive.

I popped out the thumb drive and stuck it in a Windows XP computer that didn’t have Robocopy installed. I ran the bat file and it didn’t work. It seems like you need to have different versions of Robocopy for it to run in Vista and XP so I downloaded the Windows Server 2003 Resource Kit which includes a Robocopy version that workes in XP. To be able to run robocopy on both Vista and XP I renamed the files to RobocopyXP32.exe and RobocopyVista32.exe. Then I updated the Backup.bat file to point to the XP version when I’m doing the backups from XP and the Vista version when doing backups from Vista. It seems to work fine and is an easy enough solution!

Write Your Own WXR File to Migrate Custom CMS to WordPress

I have been using a custom build CMS that’s really basic for a tiny site for some years. It has around 200 posts so it’s not a huge site but too much too migrate to a new host by hand. I have been using WordPress for some other sites and I really like it so I decided to look into migrating the data from my current custom CMS to WordPress (and host it on wordpress.com). I also wanted to replace some low resolution images with the same images but in higher quality (if possible automatically).

I decided to try to export all posts on my old site to a RSS file that I then convert to a WordPress WXR file (which is a RSS file with some extra tags). I couldn’t find any specification for the WXR file but it’s really simple so I’ll just write down some notes.

The first part is the XML specification and blog description. It should look something like this

  
http://localhost/~ola/wp
	The Car Numberplate Game
Sat, 27 Sep 2008 16:08:57 +0000
	WordpressImportFileGenerator 0.1
	en
	1.0
	http://platespotting.wordpress.com
	http://platespotting.wordpress.com
	photo< ![CDATA[photo]]>
	plate< ![CDATA[plate]]>
	uncategorized< ![CDATA[Uncategorized]]>
	photo< ![CDATA[photo]]>
	plate< ![CDATA[plate]]>

Then each blog post, page or attachment is wrapped in tags



Screenshot: Softa.nu sand pit
Sat, 16 Aug 2008 21:19:15 +0000 < ![CDATA[admin]]> < ![CDATA[photo]]> < ![CDATA[plate]]> < ![CDATA[photo]]> < ![CDATA[photo]]> < ![CDATA[plate]]> < ![CDATA[plate]]>
Screenshot: Softa.nu sand pit
< ![CDATA[ A house in our neighbourhood caught fire so we went to look and on our way I found 181. Enjoy!]]> 190 2008-08-16 23:19:15 2008-08-16 21:19:15 open open 181 publish 0 0 post location nacka, stockholm googlemapurl http://googlemapuprl.com/testurl
Tody we found a sand-pit
Sun, 21 Sep 2008 16:28:12 +0000 < ![CDATA[admin]]> < ![CDATA[Uncategorized]]> http://localhost/~ola/wp/wp-content/uploads/2008/09/181_080816.jpg < ![CDATA[]]> 191 2008-09-21 18:28:12 2008-09-21 16:28:12 open open 181_080816 inherit 190 0 attachment http://localhost/~ola/wp/wp-content/uploads/2008/09/181_080816.jpg _wp_attached_file /home/ola/public_html/wp/wp-content/uploads/2008/09/181_080816.jpg _wp_attachment_metadata a:6:{s:5:"width";i:2816;s:6:"height";i:2112;s:14:"hwstring_small";s:23:"height='96' width='128'";s:4:"file";s:66:"/home/ola/public_html/wp/wp-content/uploads/2008/09/181_080816.jpg";s:5:"sizes";a:2:{s:9:"thumbnail";a:3:{s:4:"file";s:22:"181_080816-150x150.jpg";s:5:"width";i:150;s:6:"height";i:150;}s:6:"medium";a:3:{s:4:"file";s:22:"181_080816-300x225.jpg";s:5:"width";i:300;s:6:"height";i:225;}}s:10:"image_meta";a:10:{s:8:"aperture";d:2.600000000000000088817841970012523233890533447265625;s:6:"credit";s:0:"";s:6:"camera";s:20:"Canon PowerShot A540";s:7:"caption";s:0:"";s:17:"created_timestamp";i:1218917746;s:9:"copyright";s:0:"";s:12:"focal_length";d:5.79999999999999982236431605997495353221893310546875;s:3:"iso";i:0;s:13:"shutter_speed";d:0.0166666666666666664353702032030923874117434024810791015625;s:5:"title";s:0:"";}}

Along with all item tags comes the the history for each post but since I didn’t have any history in my old CMS so I exclude it.

To create WXR XML from my standard RSS XML I decided to build a quick .NET program (download the source code) that just reads all fields from the RSS file and then converts them to their corresponding fields in WXR. You’ll need to customize the tool but the class WordPressWxrItem.cs might be a good start…

Registration and Mailinator

I usually use web based disposable e-mail addresses from Mailinator to avoid giving away my address. I have noticed that some companies don’t let you register using a Mailinator address. Today when I registered to download TimeSnapper (classic) I got this funny note.

TimeSnapper funny note when register with a Mailinator adress
TimeSnapper funny note when register with a Mailinator address

That made my day ^_^ Easy amused I guess.

Thanks to Coffe Driven Development for TimeSnapper idea!

Picasa Microsoft ICE Button

I have been playing around with Microsoft ICE (Image Composite Editor) some days and it’s really great for stitching several images to a panorama! The only thing missing is a way to open images in ICE from Picasa without needing to locate them in Explorer.

I created a button that you can add to Picasa that opens the selected images in ICE. It’s available for automatic installation or manual installation. If you choose manual installation copy the file to <your user folder>AppDataLocalGooglePicasa2buttons. If you want to remove it from Picasa you can delete the file from that directory. The pbz file contains two zipped files; one XML-file and one icon file. See Picasa Button API for more information about Picasa Buttons.

Prerequisites:

  • Picasa Installed. I used the version 3 beta.
  • Microsoft ICE installed. Note! It must be installed to the following folder: C:Program FilesMicrosoft ResearchImage Composite Editor

Issues / TODOs:

  • There are a hard coded path for the ICE executable. I tried to find a registry key for ICE but I found none so you must install Microsoft ICE to the following folder: C:Program FilesMicrosoft ResearchImage Composite Editor
  • The icon and text on the button doesn’t look quite alright. It works but looks a bit lame.
  • Try to send a path where ICE should save the stitched image so it defaults to the same location as the unstitched.

I’ll try to fix the above issues. See my post in ICEs forum.

If you are using Flickr you might also want to check out picasa2flickr and if your are using Gimp the Gimp Picasa Button!

Move Your Operating System to a New Hard Disk

Some years ago I wrote about how to create a Windows Rescue CD. Today I was stuck with a similar problem. I wanted to merge all data from one disk to another without needing to re-install my computer.

My first thought was to create a new rescue CD that I could restore to my new drive. But that didn’t seem like the easiest solution so I looked up a tool called Clonezilla. I started out by setting up similar partitions using GParted and boy am I glad I did? It turned out that you can use GParted to copy one partition to another. It took some minutes, I rebooted and it didn’t work.

I was a bit clueless until I remembered that you need to write a Master Boot Record (MBR) to the disk before it’s possible to boot from it. I booted up from an old DOS cd and wrote fdisk /mbr. Rebooted and still no luck so I fired up GParted again and saw that I had forgotten to set the bootable flag on the drive. I rebooted and everything went fine.

When knowing about MBR and the boot flag it’s a no-brainer and I can’t recommend it enough! At least if you aren’t on a mac where Carbon Copy Cloner is available!