Archive

Archive for September, 2012

Android: Unable to install Titanium Backup

September 28, 2012 Leave a comment

You might get some weird errors when installing or upgrading Titanium Backup.

 

To fix this, delete the file data/app/com.keramidas.titaniumbackup-1.odex

Advertisements
Categories: Uncategorized

Enabling dual date format output for JSON.NET for .NET v 4.5

September 28, 2012 Leave a comment

Adding on to https://jefferytay.wordpress.com/2012/05/09/enabling-dual-date-format-output-for-json-net/ 

 

You will find that the code segment is no longer found in JSON.NET for .NET v4.5. This is because things have been changed between .NET 4 and .Net4.5

 

You now need to find the function called SerializeObject

image

private void SerializeObject(JsonWriter writer, object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
    {
      contract.InvokeOnSerializing(value, Serializer.Context);

      _serializeStack.Add(value);

      WriteObjectStart(writer, value, contract, member, collectionContract, containerProperty);

      int initialDepth = writer.Top;

      foreach (JsonProperty property in contract.Properties)
      {
        try
        {
          object memberValue;
          JsonContract memberContract;

          if (!CalculatePropertyValues(writer, value, contract, member, property, out memberContract, out memberValue))
            continue;

          writer.WritePropertyName(property.PropertyName);
          SerializeValue(writer, memberValue, memberContract, property, contract, member);
        }
        catch (Exception ex)
        {
          if (IsErrorHandled(value, contract, property.PropertyName, writer.ContainerPath, ex))
            HandleError(writer, initialDepth);
          else
            throw;
        }
      }

      writer.WriteEndObject();

      _serializeStack.RemoveAt(_serializeStack.Count – 1);

      contract.InvokeOnSerialized(value, Serializer.Context);
    }

Again we are looking at the code in bold, replace it with

if (memberValue != null && memberValue.GetType() == typeof(DateTime))
         {
             writer.DateFormatHandling = DateFormatHandling.MicrosoftDateFormat;
             writer.WritePropertyName(property.PropertyName);
             SerializeValue(writer, memberValue, memberContract, property, contract, member);

             writer.DateFormatHandling = DateFormatHandling.IsoDateFormat;
             writer.WritePropertyName(property.PropertyName+"_js");
             SerializeValue(writer, memberValue, memberContract, property, contract, member);
         }
         else
         {
             writer.WritePropertyName(property.PropertyName);
             SerializeValue(writer, memberValue, memberContract, property, contract, member);
         }

Categories: ASP.NET

You receive an “Unable to start program ‘http://localhost/. The system cannot find the file specified.” error when debugging

September 26, 2012 Leave a comment

If you are using Visual Studio 2012 and Windows 8, when trying to debug a website hosted on IIS, you may get the error listed above.

 

This is actually known issue and is listed in Microsoft Connect

https://connect.microsoft.com/VisualStudio/feedback/details/758876/visual-studio-2012-unable-to-start-program-error-when-debuging-website-on-win8-ie

 

To work around this, you will need to set your home drive to a local drive and then start Visual Studio

SET HOMEDRIVE=C:
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe"

Categories: Visual Studio

Outlook 2010–Storing all your emails in a local pst, and using exchange as your primary calendar

September 26, 2012 2 comments

Chances are you have a finite space for emails, whereas there is almost limitless space on your pc to store your emails.

It is actually possible to store all your emails in a local pst, and keep things like your calendar and tasks on exchange so that you can sync your events.

 

To do so, first ensure that you close outlook. Then goto Control Panel –> Mail. Open the default profile.

 

Click on the email tab, and then click on the Change Folder" button.

 

Which will give you the following prompt.

image

 

Click Ok and then choose a local file to store the emails. Which will give you a screen similar to what you see below

image

 

Then, goto data files, and select your exchange profile and click on Set as Default

image

 

Done!

Categories: Microsoft Office

Getting Cryptzone Appgate Security Server to work with HyperV 3.0

September 23, 2012 Leave a comment

Appgate is a fantastic product, giving you up to 10 VPN accounts for free.

 

In a VMware or VirtualBox environment, this works out of the box. However it does not work well with Windows HyperV. Primarily this is due to the different network adapter HyperV exposes.

 

Luckily it is still possible to make this work with HyperV!

 

First download the ovf version from CryptZone. You can request for the free edition at http://www.cryptzone.com/products/appgate/security-server/

 

Then download the Microsoft Virtual Disk Converter at http://technet.microsoft.com/en-us/library/hh967435.aspx

 

Next, unzip the ovf files to a folder and use mvdc to convert it to a vhd file

image

 

Now goto HyperV and create a new Virtual Machine with the following specs

  • 1 CPU
  • 768MB Ram
  • Mount the VHD created in the previous step as IDE 0 Port 0
  • Add a legacy network adapter

image

 

Start up the VM and then goto Factory default failsafe

image

 

Let it load and you will end up with the following prompt. Enter y

image

 

Enable super user by typing su. then type dladm show-link.

Make sure you see dnet0 listed

image

 

To play safe, type ifconfig dnet0 plumb up followed by ifconfig –a. Make sure you see the same thing as the image below. For now its ok to not have any ip address

image

Type reboot to reboot the machine and boot normally (i.e 10.0.2)

Run ls host* and ensure that you see hostname.e1000g0 appear

then run mv hostname.e100g0 hostname.dnet0. This will switch the hostname mapping to the hyperv NIC.

Run ls host* again to ensure that this is correctly done

image

 

Now try out the ag_ipconfig command and make sure that it changes dnet0

image

You can now follow the steps in Appgate configuration guide and proceed to setup the vpn

Categories: HyperV, Windows Server

Storage Spaces Speed Test

September 18, 2012 Leave a comment

Over the weekend, several of my hard disks crashed so I replaced them with 3x Seagate 2TB 7200K RPM hard disks.

 

Since I’ve upgraded to Windows Server 2012, I decided to give it a go and see if using storage spaces is the way to go.

 

Setting up was easy, just start Server Manager –> File And Storage Spaces –> Storage Pools and pool the 3x 2TB hard disks together into a pool.

 

Then create a virtual disk and volume and you are good to go.

image

 

I also had a M4 128GB SSD as well as a 500GB 7200K RPM Seagate HDD.

 

Do note that my motherboard does not support SATA6, just SATA3

 

Using CrystalMark, I had the following result for the SSD. Pretty decent speeds

image

 

Next I tried the 500GB SATA

image

 

And for storage spaces (Mirrored)

image

 

Overall for sequential reads, the performance of mirrored disks is pretty decent. It fails at the small sector reads which is pretty much a limitation of the physical disks itself.

 

However storage spaces does give additional benefits

  1. Ease of Recovery. Using previous software raid technologies, if a disk failed, it is not so straightforward for you to restore back the data. With storage spaces you can easily add in a disk and it will do the rest
  2. Storage spaces allows you to add disks to the pool. In theory this should improve performance, but I cannot verify this as I have insufficient disks to try this one out
  3. Disk Reordering: With software raid, the disks needs to be presented in a fixed order. No such issues with storage spaces
  4. Auto recovery: I used to have an additional disk serving as a backup disk. With storage spaces I no longer need to care since it will automagically restore the data to another available disk (think hot spare)

Verdict: There may be some teething issues during the Preview and RC, but RTM definitely fixes these issues and makes storage spaces good for production use!

Categories: Windows Server