CPU Fan – CNPS10X Optima

Was having some trouble with my new i5 processor, it was getting upwards of 215 degrees when ripping a DVD. In addition the computer would on occasion simply turn off cause the processor was to hot. For around $32 (Purchase on Newegg) I purchased the Zalman CNPS10X Optima, which fixed the problem entirely. Highly recommend the product. Easy to install and dramatic results.

Photo :

35-118-099-TS_thumb[2]

New temp readings :

Temp_thumb[1]

Full usage of CPU :

Speed_thumb[1]

Prime Rib

Broke out the chef jacket and had my first real meal of 2012.  A coffee infused dry rubbed prime rib with asparagus & baked potatoes.   I used the following recipe http://www.bhg.com/recipe/beef/herbed-prime-rib-with-two-sauces/.  Here are some photos of the event.

Apply dry rub :

IMG_2929

45 minutes into cooking.

IMG_2968

Cooking complete!

IMG_3068

Deglaze pan for au jus

IMG_3025

Let it rest for 20 minutes and cut.

IMG_3116

Side of asparagus and baked potatoes.

IMG_2992

Tags :

Install MongoDB as a Windows Service

Installing MongoDB as a service on my Windows 7 turned out to be pretty simple. 

Download Mongo – http://www.mongodb.org/downloads

Follow Instructions – http://www.mongodb.org/display/DOCS/Windows+Service

There was one gotcha I ran into as I did the install.  If you specify an invalid data path the service will be stuck in an infinite loop of restarts, and have to be removed (or create the missing directory).

My install command :

   1: D:\Tools\MongoDB\mongodb-win32-x86_64-2.0.2\bin\mongod --logpath C:\Data\Development\logs\MongoDB.log --logappend --dbpath C:\Data\Development\MongoDB_Data --install --serviceName MongoDB

 

Here is the exception I was getting in my log file:

   1: ***** SERVER RESTARTED *****

   2:  

   3:  

   4: Sun Mar 04 10:20:08 [initandlisten] MongoDB starting : pid=6652 port=27017 dbpath=C:\Data\Development\OneBrownMule\OneBrownMule.Web\App_Data\AppDB 64-bit host=mueller-laptop2

   5: Sun Mar 04 10:20:08 [initandlisten] db version v2.0.2, pdfile version 4.5

   6: Sun Mar 04 10:20:08 [initandlisten] git version: 514b122d308928517f5841888ceaa4246a7f18e3

   7: Sun Mar 04 10:20:08 [initandlisten] build info: windows (6, 1, 7601, 2, 'Service Pack 1') BOOST_LIB_VERSION=1_42

   8: Sun Mar 04 10:20:08 [initandlisten] options: { dbpath: "C:\Data\Development\MongoDB_Data", logappend: true, logpath: "C:\Data\Development\logs\MongoDB.log", service: true }

   9: Sun Mar 04 10:20:08 [initandlisten] exception in initAndListen: 10296 dbpath (C:\Data\Development\MongoDB_Data) does not exist, terminating

  10: Sun Mar 04 10:20:08 dbexit: 

  11: Sun Mar 04 10:20:08 [initandlisten] shutdown: going to close listening sockets...

  12: Sun Mar 04 10:20:08 [initandlisten] shutdown: going to flush diaglog...

  13: Sun Mar 04 10:20:08 [initandlisten] shutdown: going to close sockets...

  14: Sun Mar 04 10:20:08 [initandlisten] shutdown: waiting for fs preallocator...

  15: Sun Mar 04 10:20:08 [initandlisten] shutdown: lock for final commit...

  16: Sun Mar 04 10:20:08 [initandlisten] shutdown: final commit...

  17: Sun Mar 04 10:20:08 [initandlisten] shutdown: closing all files...

  18: Sun Mar 04 10:20:08 [initandlisten] closeAllFiles() finished

  19: Sun Mar 04 10:20:08 dbexit: really exiting now

Tags :

Remove by Id–MongoDB C#

When removing a document by the identifier using the C# 10gen driver for MongDB you need to specify the internally used id column, “_id”, not the property name from the DTO that you’re storing.

The Driver can be found on NuGet by search for MongoDB or the official project github page can be found here.

   1: public class DataProvider 

   2: { 

   3:     private MongoDatabase _db;

   4:     public DataProvider() 

   5:     { 

   6:         var server = MongoServer.Create("mongodb://127.0.0.1"); 

   7:         _db = server.GetDatabase("MyDB"); 

   8:     }

   9:     public void Delete(string id) 

  10:     { 

  11:         var collection = _db.GetCollection("MyDocumentCollection");

  12:         //Does not work 

  13:         //collection.Remove(new QueryDocument("Id", new BsonObjectId(id)));

  14:         //Works 

  15:         collection.Remove(new QueryDocument("_id", new BsonObjectId(id))); 

  16:     } 

  17: }

  18: public class MyDocument 

  19: { 

  20:     [BsonId] 

  21:     public ObjectId Id { get; set; } 

  22:     public string Name { get; set; } 

  23:     public string Description { get; set; } 

  24: }

 

I’ve submitted a pull request to have RemoveById added to the MongoCollection.

https://github.com/mongodb/mongo-csharp-driver/pull/87

Tags : ,

Organize Camera Photos and Videos Using PowerShell

I was searching for a quick and easy way to organize the contents of my cameras SD card when I transfer the files off to my computer.  It would be great to have the time to organize all the photos per event (Grandpa’s Birthday, Birth of Child Number 2, etc), but this never works.  I always put off that task and I end up with a monster SD card with an unmanageable amount of photos and videos.  The problem is compounded by the additional directories that the camera uses for its organization.

Well I found a simple PowerShell script that did this online (see here, a blog post from Kim Oppalfens), but there were some problems.

  1. The directories were too granular (one directory for each day of photos).
  2. It only handled photos.
  3. My camera doesn’t embed the date in the jpg the way that this script was expecting, resulting in some null ref errors when running the script.

So I wrote my own which I’ll share with you here, you can also download a text version here.

$PhotosDirectory="d:\Photos & Movies"

Function CopyFiles([System.IO.FileInfo[]]$Files)
{
    $currentCount = 0
    $percent = 0;

    Write-Host "  0% Complete"
    foreach ($file in $Files)
    {
        $currentCount++
        if ($currentCount -gt ($Files.Length / 10))
        {
            $percent += 10
            $percentString = $percent.ToString().PadLeft(3, ' ')
            Write-Host "$percentString% Complete"
            $currentCount = 0
        }

        $year = $file.CreationTime.Year.ToString()
        $month = $file.CreationTime.Month.ToString().PadLeft(2, '0')
        $monthName = $file.CreationTime.ToString("MMMM") # <-- Month Name

        $TargetDirectory = "$year\$month - $monthName"
        $TargetPath = "$PhotosDirectory\$TargetDirectory"

        if (!(test-path $targetpath))
        {
            new-item $targetpath -type directory >> log.txt
        }
        xcopy /y $file.fullname "$targetpath" >> log.txt
    }
    Write-Host "100% Complete"
}

Write-Host "Copying JPG's"
$files = Get-ChildItem -recurse -filter *.jpg
CopyFiles($files)
Write-Host "Copying MOV's"
$files = Get-ChildItem -recurse -filter *.mov
CopyFiles($files)

Couple key points

  1. Copy contents of above script and past into a new file.  I named mine Photos.ps1 and put in my C:\Users\<user name>\Documents\WindowsPowerShell directory.  The name doesn’t matter, but the extension of ps1 does.
  2. Launch PowerShell.
  3. Insert you SD card, and navigate to the directory where your photos or stored.  I did this by inserting the SD card into my reader, but the usb cord worked as well.
  4. Run your ps1 file by typing the full path and file name.

The result is a well organized directory of your digital photos and videos.