Recent Posts

Azure - Consuming Blob storage from .Net

July 07, 2015

Azure Blob storage is a service for storing large amounts of unstructured data, such as text or binary data, that can be accessed from anywhere in the world via HTTP or HTTPS. You can use Blob storage to expose data publicly to the world, or to store application data privately.

Common uses of Blob storage include:

  • Serving images or documents directly to a browser

  • Storing files for distributed access

  • Streaming video and audio

  • Performing secure backup and disaster recovery

  • Storing data for analysis by an on-premises or Azure-hosted service

I have unit test driven repository on Github to show common uses of Blob storage.

https://github.com/sanjaysingh/azure-samples/tree/master/BlobStorageTest

Azure - Consuming Queue storage from .Net

June 14, 2015

Azure Queue storage is a service for storing large numbers of messages that can be accessed from anywhere in the world via authenticated calls using HTTP or HTTPS. A single queue message can be up to 64 KB in size, and a queue can contain millions of messages, up to the total capacity limit of a storage account.

Common uses of Queue storage include:

  • Creating a backlog of work to process asynchronously

  • Passing messages from an Azure Web role to an Azure Worker role

I have unit test driven repository on Github to show common uses of queue storage.

https://github.com/sanjaysingh/azure-samples/tree/master/QueueStorageTest

IoT Hello World - Control LED using Raspberry Pi

June 13, 2015

I used my Raspberry Pi B+ model to control a Led just to quickly see how easy or difficult it was. It turned out to be pretty straightforward once you have the hardware thins required.

  1. A two pin Led
  2. Two wires

After i installed Raspebian on the Pi using the standard guide that i have got. I installed WiringPi from https://projects.drogon.net/raspberry-pi/wiringpi/download-and-install/

For reference to GPIO pin layout, i referred http://pi4j.com/pins/model-b-plus.html. Connect long leg (+ve) of the LED to pin 11 (GPIO 0) and connect short leg (-ve) to any Ground (I connected to pin 6).

Note that you should also use a resistor on the ground wire to limit the amount of current being passed to the LED otherwise it might damage your LED or even the board. I learnt that usually that happens if you are going to use it for prolonged time but for my 2 sec demo it did not cause any issue without resistor. So do at your own risk.

*

GPIO pins can be programmatically controlled to be in either input or output mode. I saw that most of them are IN by default. I ran following to see pins status.

gpio readall*

* *

See that pin Gpio 0 is in IN mode. Change its mode to OUT as follows-

gpio mode 0 out

* *

Now you are ready to turn on/off the light. Use the following two commands.

For turning on the light - 

gpio write 0 1

* *

*

*

* *

For turning off the light

gpio write 0 0

Save nuget feed credentials

June 02, 2015

When working we custom Nuget feeds that require authentication, Visual Studio keeps prompting for user name and passwords and you are not able to save the password. This is really frustrating. You can run following command to save your credentials to the nuget.config file.

nuget sources update -name “My Feed Name” -source “https://nuget.sanjaysingh.net/PackageFeeds/Stable/nuget” -UserName “dev\sanjay” -Password “password”

Ensure that you have nuget.exe downloaded and your PATH variable is updated with its directory. You can download nuget.exe from following location.

https://www.nuget.org/nuget.exe

This command updated the machine wide config which is located at %APPDATA%\NuGet\NuGet.Config