Best Way to Store a Yakima Cargo Box in Your Garage

The Yakima Cargo Box I own is a RocketBox Pro 14. I used cables, pulleys, and a winch to hang it right on top of where I park my car. When I winch it down, it lands right on my car’s cross bars.


The box fits well on top of the opened garage door. You can see that and the winch on this pic:


On this pic you can see the pulleys and cables:


This final pic has the car right under the box:


This project was a lot of fun; it involved pulleys and a winch! I thought I’d share this in case someone’s looking for ideas.

TVP Helper for Dapper ORM

I’ve used this TVP (Table Valued Parameter) helper for Dapper for quite some time now and I thought I’d share it here in case someone also thinks it is super cool.

It’s really just a wrapper around the existing AsTableValuedParameter method that comes with Dapper. The wrapper helps you quickly build a DataTable from any type of collection.

With this small helper method:

public SqlMapper.ICustomQueryParameter ToTvp<T>(
    IEnumerable<T> enumerable,
    params Func<T, object>[] columnSelectors)
    if (columnSelectors.Length == 0)
        Func<T, object> getSelf = x => x;
        columnSelectors = new[] { getSelf };
    var result = new DataTable();
    foreach (var selector in columnSelectors)
    foreach (var item in enumerable)
        var colValues = columnSelectors.Select(selector => selector(item)).ToArray();
    return result.AsTableValuedParameter();

You can now create TVP parameters super easy and feed them to Dapper like this:

string[] names = GenerateNames(generatedNamesCount);
var namesTvp = ToTvp(names);
    new {Names = namesTvp},
    commandType: CommandType.StoredProcedure);


string[] names = GenerateNames(generatedNamesCount);
User[] users = names.Select(x => new User {Name = x, Email = x + ""}).ToArray();
var usersTvp = ToTvp(users, x => x.Name, x => x.Email);
    new {Users = usersTvp},
    commandType: CommandType.StoredProcedure);

EMF Meter Comparison (ED88T, ED78S, Trifield 100XE)

After searching for the right EMF meter for my home, I decided to buy the Cornet ED88T. On this post you will find why.

These are four types of EMFs that you want to measure in areas where you spend a significant amount of time:

  1. Microwave Radiation
    • Sources: wireless technology like Wi-Fi routers, cell towers, cordless phones and “smart” meters
  2. Magnetic Fields
    • Sources: power lines, improper home wiring and appliances
    • Health: They decrease the immune system and are known to be carcinogenic3
  3. Electric Fields
    • Sources: unshielded electrical wiring
    • Health: They rob you of a good night’s sleep3
  4. Dirty Electricity
    • DE are the frequencies that travel on your home wiring from things like solar power inverters, florescent lighting, dimmer switches and wireless “smart” meters)
EMF type Cornet ED88T Cornet ED78S Trifield 100XE
Microwave Radiation  Yes  Yes  Yes, but not accurate2
Magnetic Fields  Yes  Yes  Yes
Electric Fields   Yes, but the scale is not ideal1  No Yes, but the scale is not ideal2
Dirty Electricity  No  No  No

Once you have the ED88T, you can watch this video to learn how to use it and you’ll probably wonder what the safe maximums are for all the readings:

EMF type Safe Max3 Safe Max in Cornet ED88T screen readings
Microwave Radiation  100 (day) 10 (sleep) microWatts/squared meters (uW/m2)  0.1000(day), 0.0100 (sleep) miliWatts/squared meters (mW/m2)
Magnetic Fields 1.0 milliGauss (mG)  00.10 microTesla (uT)
Electric Fields  Less than 10 V/m  0010. V/M
Dirty Electricity 25-50 Graham-Stetzer Units

Here are some of the readings I’ve collected.

Building your own Annoy-a-tron with an ATtiny85

The annoy-a-tron is a little device that makes a small beep every X minutes. If you hide it well enough in a co-worker’s cube, it will drive him/her insane and will do almost anything to find it.

The annoy-a-tron is currently out of stock at ThinkGeek and I really wanted to prank someone at the office with it. So I did some research and decided to build one.

I decided to go with the ATtiny85 because I enjoy coding more than I do soldering. Instead of buying a 555 timer chip with resistors, capacitors, etc. like they are doing here, I just need to program the chip, wire up a battery and a speaker. I chose the ATtiny85 over the Arduino hardware because the ATtiny is cheaper and draws less power.

The final product looks like this:


And the software I put together makes a beep of customizeable tone frequency and length at random time intervals.

These are the parts you need to build the circuit:

The ATtiny85 is cheaper if you buy it in bigger quantities, I regret not buying more just so I can have different programs (different random intervals, tone, and tone length) loaded on the chips ready to go. SparkFun doesn’t have the best prices so look around if you will buy in bulk. I trust SparkFun and that’s why I bought most things there though.

You need a programming board to program the ATtiny85. I chose the Tiny AVS Programmer instead of the official one because I wanted to try out the Arduino IDE. To set up the IDE with the programmer, just follow the programmer’s hookup guide.

The Circuit:

The circuit is very straight forward. You just wire:

  • The positive end of the battery holder to the positive pin on the ATtiny85 (the solder tail).
  • The negative end of the battery holder to:
    • The negative pin on the ATtiny85
    • The negative pin on the piezo speaker
  • The chosen out pin (I chose pin 1) of the ATtiny85 to the positive end of the piezo speaker.


The Program:

I used the Arduino IDE (set up with the Tiny AVR Programmer Hookup guide) to program the ATtiny85.

Click this link to get the source code of program I loaded on the ATtiny85.

The program was deeply inspired by TinyTone to generate the tones and millionOhms to preserve power by getting the ATtiny85 to go to sleep.

I found that testing the program out takes a long time since you have to actually wait and see how the chip behaves. The program works like I want it to but I still have some questions that I’d like to ask an Arduino IDE (c++) expert or need a good amount of time to test out:

  • are the #include statements optional?
  • are the #define statements actually setting a variable or are they optional?

Testing those things would take time since removing them might not make compilation break but it might make the ATtiny85 not go to sleep properly and use more battery than expected. So I would have to see how long the battery lasts to really know if it is sleeping properly or measure the current being used by the ATtiny85 with an ampmeter.

Well, I hope you have fun with the ATtiny85! I’ve tried it with a couple of beta victims and I’m ready for a real one tomorrow.

git push hangs when windows git client pushes to TeamFoundation Git Server

Look at the bottom of this blog post for the solution to this issue.

I’m using the regular Windows git client (1.9.5.msysgit.1 downloaded from to push a repository with a 46KB file to a remote repository that is a Team Foundation Server Git repository.

When I do “git push” the console hangs for about 5 minutes (sometimes more) and then gives me a 401 error:

$ ls -la
total 29
drwxr-xr-x 4 pliska Administ 4096 Jun 22 14:02 .
drwxr-xr-x 13 pliska Administ 4096 Jun 19 11:40 ..
drwxr-xr-x 12 pliska Administ 4096 Jun 22 14:03 .git
-rw-r--r-- 1 pliska Administ 46157 Nov 19 2014 46KB.vsix

$ git push origin master -f
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 45.01 KiB | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)

The console hangs here for at least 5 minutes, after which I get these new lines:

error: RPC failed; result=7, HTTP code = 401
fatal: The remote end hung up unexpectedly
Everything up-to-date

I know my credentials are correct. When I enter wrong credentials I get an immediate error and don’t even see the first line from git push (the “Counting Objects” line).

I have been able to get this to work when

  1. (smaller file) The only file in the repo is 20KB in size, OR
  2. (use MS client and server) Instead of using the regular git client (1.9.5.msysgit.1), I use Visual Studio 2013, OR
  3. (use non-MS client and server) I push to a github remote (like this one).

From the three facts above. I’m thinking some of these things might be the cause of the issue:

  1. The TFS server does not like how the msysgit client sends the credentials. (But then why does it work fine for smaller files?)
  2. TFS does an extra credentials check for large files
  3. The TFS server has a setting that is not allowing large pushes into it. (But then why does it return a 401 error?)

After I commented on this Microsoft blog, Saeed from Microsoft suggested I use fiddler to see what is going on at the network level. I’m seeing the following:


We’re still not sure what this means, I need to research further. Saeed mentioned he has seen this when there is a misconfigured load balancer or proxy in the network, but my TFS server is not behind any of those. I’ll see if I can remote into the box and push directly to the local server just to see what happens.

I’ve googled this issue quite a bit and from this post’s suggestion, I ran the following command: git config http.postBuffer 524288000. Did this not fix it.

This page suggested this command: git config –global sendpack.sideband false . It also had a hex editor hack, I tried both with no success.


The latest stable git client that you currently get from is version 1.9.5 and is three months old. If you use the current release candidate version (you can download it here), things work fine.

I didn’t know this build existed, I don’t think a link exists to it from . Saeed pointed me in the right direction. Thank you very much Saeed! You were incredibly helpful!

Setting up ninject 3.2 on a WCF service

This is a step by step guide on how to create a WCF Service using Ninject to resolve (inject) its dependencies.

We start from scratch by creating a New C# WCF Service Project and end with an example of the service being instantiated with its dependencies resolved by Ninject. The code that resulted from this guide can be found here.

1. Create the WCF service project


2. Run Install-Package Ninject.Web.Common.WebHost from the package manager console.

  1. Make sure that you are using NuGet 1.6 or higher. Using an older version will result in missing references.
  2. Figured out this step after reading this.

3. Run Install-Package Ninject.Extensions.Wcf

  1. Figured this step out by looking at the Ninject examples on github

4. Teak your svc’s markup so the ServiceHost element has this attribute: Factory=”Ninject.Extensions.Wcf.NinjectServiceHostFactory”

&lt;%@ ServiceHost
     Factory=&quot;Ninject.Extensions.Wcf.NinjectServiceHostFactory&quot; %&gt;

You’re all done!

To see it in action, let’s create something to inject:

public class Repository : IRepository
    public IEnumerable&lt;Widget&gt; GetWidgets()
        return new [] {
            new Widget {Name = &quot;Widget1&quot;, Price=11},
            new Widget {Name = &quot;Widget2&quot;, Price=22}
public interface IRepository
    IEnumerable&lt;Widget&gt; GetWidgets();
public class Widget
    public string Name { get; set; }
    public decimal Price { get; set; }

We now need to add the Ninject binding in App_Start\NinjectWebCommon.cs. This file was generated when you installed the Ninject.Web.Common.WebHost NuGet package. At the bottom of the file you’ll find the RegisterServices method, add the binding there:

private static void RegisterServices(IKernel kernel)

Let’s make Service1 (automatically generated when you created the new WCF Service project) use the Repository:

public class Service1 : IService1
    private IRepository _repo;
    public Service1(IRepository repo)
        _repo = repo;
    public string TellMeHowManyWidgets()
        return string.Format(
            &quot;We have {0} widgets.&quot;, _repo.GetWidgets().Count());

Remember to add the new method to the service interface as well:

public interface IService1
    string TellMeHowManyWidgets();

We’re finally ready to see this working. Select the Service1.svc file on the Solution Explorer and hit F5, this will make the WCF Test Client appear. Double click the TellMeHowManyWidgets method and hit the Invoke button.


There it is! Our service replied with “We have 2 widgets”. This proves that the IRepository dependency was fulfilled by Ninject with a Repository object.

“Highlight all occurrences of selected word” extension on Visual Studio 2013

I love the Highlight all occurrences of selected word Visual Sutdio 2012 extension. But yeah, it does not run on Visual Studio 2013… unless you tweak it.

Download the tweaked version here.

Or if you want to tweak it yourself, follow these instructions:

  1. Download the extension from the official site. You will get a SelectionHighlight.vsix file.
  2. Rename SelectionHighlight.vsix to
  3. Extract the zip file
  4. Open the extension.vsixmanifest file in a text editor
  5. Edit <VisualStudio Version=”11.0″> to <VisualStudio Version=”12.0″>. Save the file.
  6. Select all the extracted files including your edited one (they are around 6). Zip the files.
  7. Rename the resulting *.zip file to *.vsix.
  8. Double click the .vsix file to install the tweaked extension.