Edward Cooke

Edward Cooke

Something cool
ASP.Net

From Nuget.Server to NugetGallery

Well, we started running into an issue with Nuget.Server and it was time to migrate to NugetGallery. Mainly, it wouldn't clean itself up (after a few days, there were 10's of gigs of temp files in c:\windows\temp\nuget), and now that we have a couple thousand packages it started really slowing down. It was just time. So here goes what I did to make this work. Initial Steps: 1. Clone NugetGallery from github 2. Configure NugetGallery settings (database, etc) 3. Modify the web.config in the
3 min read
ASP.Net

ASP 5 vNext WebAPI Abstract/Inherited Classes

Good evening everyone, I've been fighting vNext, Web API and abstract classes. I just want to be able to pass an array into my API of a bunch of different types that all inherit a base class. Turns out it's a configuration option as vNext uses Newtonsoft.JSON to do the serialize/deserialize it was just a matter of finding it. Here's an example what I want passed into my API. public abstract class FilterBase { } public class Filter1 : FilterBase { public string FilterString { get; set; }
2 min read
Operations

Windows 10 going to sleep to quickly

Well, I've had a very annoying issue that I've been fighting. I enabled wake-on-lan on my desktop and had it start going to sleep. This was great. Saves power and I can still remote into it. I installed the wake on lan tools on a linux box so I can wake it up remotely. However, I noticed that after it would wake up, it went to sleep really quick. Within a couple of minutes. Sometimes as quick as 2 but usually around 4 or 5. After hunting around the interwebs for a while I ran across a post on mi
1 min read
Operations

Wake-on-lan, windows 10 and Linux

Well, after having wake-on-lan running and working great (other than the stupid sleeping after a couple minutes issue) I decided I would do a quick post on how I got it working and my setup, it was actually very easy once I found the right package. First, my overall setup. Linux/Ubuntu firewall, running iptables. 2 VLans, one for everything else. My desktop is on the client VLAN and the linux firewall acts as the gateway between both VLans and the internet. My solution, SSH into the firewall
1 min read
Windows 10

Windows 10 - .NET 3.5

Ok, so here's the overall situation 1. Fresh Windows 10 Install 2. Installed IIS attempting to include .net 3.5 in this install - it failed pulling the package from Windows Update due to my WSUS server. 1_ Skipped the .net 3.5 and installed everything. IIS, .net 4.5, Hyper-V etc. 3. After fixing my Group Policy to pull from Windows Update I attempted to install .net 3.5 at which point I started getting a 0x800F081F during the install(among others). The fix. Uninstall IIS. Restart
1 min read
TypeScript

Upgrading to the latest TypeScript from source

Hi, my little exercise was to update TypeScript in VS2015 to the latest from the master branch in git, I wanted abstract classes. It's really not that hard, just not very much documentation on it. In this guide, you will want to replace "c:\development\" with the path you clone the TypeScript git repository into. I'm showing how to do this on a 64-bit system, so if you are using a 32-bit system change Program Files (x86) to just Program Files. First step is compiling TypeScript, here's a quick
2 min read
Raspberry Pi

Raspberry Pi 2 Cross Compile kernel on Ubuntu

Since a step by step guide for cross compiling a kernel and installing it on the pi2 is pretty much non-existent, here is my guide. Ok, first step, install Ubuntu. You will need to be able to mount the SD card for the Pi, so doing it in HyperV isn't going to work, you can't mount SD Cards as block devices. I didn't try VMWare or VirtualBox, I just used an old laptop, worked great as it had an SD Card slot in it. Once you have Ubuntu installed and set up, update it to the latest and greatest, n
3 min read
Programming

Team City, MSBuild, MSDeploy, Web Deploy, NTLM and aspnet_client

Ok, more on Team City and build/deploy stuff. In my previous blog post, I showed how to run team city as a domain user account. One of the reasons was for web deploy to not store the username/password in the configuration. There's another gotcha with web deploy I'll help you fix as well, when deploying to the root of a site, there is a cool folder that the updates to .net framework insists on creating. And it doesn't inherit the permissions either. It's aspnet_client. It's a pain. Because it bre
4 min read
Java

Java bites again - Cisco ASDM

So, this was annoying. My Cisco ASDM is version 1.5(68). It works on my desktop, but not my brand new vm. I would continuously get the Unable to Launch Device Manager from <ip address or hostname> error. Very annoying. Both Java version 1.7.0. But! The desktop was update 45, the vm was update 51. So, my next quest, try and hunt down version 45. What a pain. Finally got though it. Here is the URL to the cab file http://java.sun.com/update/1.7.0/jinstall-7u51-windows-i586.cab. A cab file can easil
1 min read
C-Sharp

Certificate information and Fiddler

So, one of my biggest gripes with fiddler is not being able to see what the original ssl cert the server was spitting out was. If you decrypt the ssl traffic, fiddler acts like a man-in-the middle and replaces the server certificate with it's own so it can decrypt it. If you don't understand that very well, google will help alot more than I can. So. Long story short, I needed to know what ssl certificate the web servers were spitting up, even if Fiddler was running. Fiddler doesn't have this
1 min read
C-Sharp

Enhanced security in web sites (headers)

Hey all, so, just got back from a pretty good "Secure Coding" conference from SANS. Learned a lot of stuff. Including some simple countermeasure you can implement on you site. Not all browsers support them, but, with them, it helps prevent Cross Site Scripting. I have create a little .net library that will help with implementing them, along with a sample web app. I encourage you all to go look at it at: https://github.com/veccsolutions/Vecc.WebSecurity It's really easy to use. Hopefully you al
Mac

Armada 2 on VMWare Fusion

Good (whatever time of day it is where you are at), I just got a Mac Book Pro, and it was decided to use VMWare Fusion for the virtualization. Well, I wanted to be able to play armada2 on it, one of my favorite games. It requires Windows XP (unfortunately). And initially running it under XP proved to be challenging. It would flicker between a black screen and the actual game. The fix was to disable the asynchronous cursor in the "options->graphics settings" of the game. It took me a while to fi
1 min read
JavaScript

IE8 and checking to see if an element is being hovered

Hey there, last night I needed to figure out why a jquery selector wasn't working in IE8. :hover. Turns out IE8 doesn't support the hover css selector. Lame. Unfortunately I still have to support IE8, its a good portion of the users of my site. So, I came up with a quick workaround. It effectively just tracks whether the mouse is in the element or not. Now, this could be modified to be supported on multiple elements, but I only needed one so I hacked it together real quick. And it should get you
1 min read
Operations

Install MS-DOS 6.22 from upgrade disks

OK, this was really dumb, but I wanted to install DOS, and only had access to the upgrade disks. Lame. I got the MS-DOS 6.22 floppies from my MSDN (yes it's still there). But, MSDN only has the upgrade disks. No install disks. The 6.0 version of DOS is just the files, no disk images. So that's pretty close to useless for installing fresh as well. But, there is a workaround. Boot off of the 6.22 upgrade disk #1. Then on the first screen press F3. Then answer the prompts to exit the setup. It wi
1 min read
C-Sharp

Create content type in Umbraco

Hi, this is one of my first posts on programming in Umbraco. And it's about programatically creating a content type and assigning the available child content types. It's actually pretty easy once you spend a day digging through code, so I figured I would share my knowledge. To create the content type is pretty straight forward. First, all of the using statements needed for this exercise. using System.Collections.Generic; using System.Linq; using umbraco.interfaces; using Umbraco.Core.Models;
2 min read
Windows 8

Twain drivers and Windows 7/8 64-bit

Not sure if this applies to 32 bit versions of windows or not, as I only use 64-bit. I have tons of ram and 32-bit doesn't handle it (max of 4 gig and you will only be able to use 3 gig due to memory addressing issues). Anyways. I was running into an issue where I needed to scan some documents with an older scanner that didn't have drivers for Windows 8. So, I tried the Windows 7 64-bit drivers, after all you can get most Win7 drivers to work under Win 8 without any issues. Just an FYI, this sc
3 min read
C-Sharp

WCF and external .config file

Hi all, it's been awhile. I've been pretty busy. Anyways, I just had a requirement, due to limitations of the software I'm working with, to load WCF configuration I had to do it from a file other than the web.config. I started out thinking this was going to be an easy task, wrong! Took a day of plugging away, but I finally found it. My requirements were, load config from external file and be able to use the standard WCF config sections. There are 3 main steps to this. Load the external config
6 min read
Linux

ZFS, 3ware 9650 and performance

Hey everyone, here's the plan, migrate all of my VM's to a data store on my NFS server, I've been wanting to do this for a while, to get off of the dedicated local storage, and move to shared. Big benefits of doing so, one of which is multiple hosts can access the same VM's for redundancy. But, I initially set up using ZFS. I went with ZFS for compression and data deduping. Turns out, deduping is a huge memory hog. Compression is a huge CPU hog (not a shocker). So, when I first created them, doi
1 min read
Operations

WCF with HTTP and HTTPS

OK, this is really, really annoying. You should NOT have to do any config to support the 2 most widely used protocols on the internet, HTTP and HTTPS. Here's the simple, really simple, web.config to support both HTTP and HTTPS. You don't need all the attributes to do it, if you don't specify them, it will use the defaults. So, for simplicity sake, I didn't put them in. This is an example that I couldn't find on google....so here you all go. <system.serviceModel> <bindings> <basicHtt
1 min read
Operations

Multiple Config Transforms on Single Element

Hey everyone, so, I had a need to set some attributes and remove 2 of them in my web.config transform file. On my development system, I have my WCF services all pointing to my local fiddler, for debugging? Anyways, I needed to remove the proxyAddress attribute and also set the useDefaultWebProxy, and securityMode. You can't put in 2 different transforms in the same element doing something like xdt:Transform="SetAttributes(useDefaultWebProxy),RemoveAttributes(proxyAddress)". The msbuild app puk
1 min read
C-Sharp

EntityFramework, slow insert and SqlBulkCopy

Hey all, I finally got fed up with the ridiculously slow insert times of EntityFramework. So, I went with the SqlBulkCopy route, but that required a second connection to the database, and second connection string in the config file, you're not storing them in the code right...? Well, I created some extension methods to handle this all for me, this takes care of getting the SqlConnection out of the Entity Context. Below is the code to do it. public static class ObjectContextExtensions { ///
1 min read
C-Sharp

Converting non MVC3 projects to MVC3 projects

Well, I needed to do this because the project that the codgen tool in Orchard creates is not an MVC3 project. Call me picky, but I like the Add Control, Goto View, Create View, and all the other cool little things that come with an MVC project in Visual Studio. So, I set out to figure out how to do it. It's pretty easy, in the .csproj file, there is a project type GUIDs element. Starts out as something like this: <ProjectTypeGuids>{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids> just
C-Sharp

iTextSharp and Windows SSL Certificates

Well, it took a bit of work, but I figured out how to add certificates and intermediate certificates into a PDF document while signing it using iTextSharp. The examples they had were close, but not quite there. They had hard coded the buffer size to 4000. Seemed a bit small, it got real tight when I had 2 intermediate certificates, so I made a change to that to use a more dynamic approach. I did a 4000 + RawData.Length for each certificate. Definitely opened up some more room to fit everything i
3 min read
Windows XP

Unable to move/drag icons on desktop in Windows XP

I had a weird issue today where we could drag drop stuff from places like Outlook, Explorer, Internet Explorer, to other Explorer windows. But you could not drag them to the desktop. It would give you a circle with a line saying no, you can't do that. You couldn't even move the icons around on the desktop. The fix. 1. Start a command prompt 2. Start up regedit 3. Start up task manager 4. Kill all explorer.exe processes 5. In regedit, goto hkey_current_user\software\microsoft\internet explo
ESX

vSphere 4.1 / vpxd service not starting

Good day all, we upgraded our vCenter server from 2008 to 2008r2. Yay. (2008 bad, r2 good). Once we did this, we ran into a problem where the vCenter services weren't starting. Searching the net revealed nothing. Our guess was that the sql server was not all the way started when the services were started. Changing the services to automatic (delayed) still did not fix it. Adding the MSSQLSERVER service as a dependency did not work either. One way we found to get around it is really cheesy. Create
1 min read