Recent Posts

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

Weekly digest #11

August 25, 2012

Using JSHint inside Visual Studio – the basics, Steven Sanderson: JSHint is great. It’s a linting tool for JavaScript: a simple tool that can very often spot your mistakes before you do. It can save you from a lot of tedious debugging, lets you refactor JavaScript code with greater confidence, and reduces the chances of you deploying broken code to your production server.

What’s really new in ASP.NET MVC 4 (not much), Max Toro: Max Toro summarizes what has really changed in MVC 4. A very concise and to the point explanation.

Entities, Models, and Architecture, Chris Eargle: I read several programming articles a day to expose myself to other’s ideas and maybe find a gem or two. I share the articles I find interesting, but I don’t always agree with everything the author has written. One of these articles caused quite a bit of controversy when I posted it to my Facebook, probably because I have a lot of DBA friends and the title was Why I Avoid Stored Procedures (And You Should Too).

How integrate Facebook, Twitter, LinkedIn, Yahoo, Google and Microsoft Account with your ASP.NET MVC application, Ugo Lattanzi: In the past week, 15 august, Microsoft released an incredible number of cool stuff, starting from Windows 8 and ending to Visual Studio 2012 including the new ASP.NET Stack.

Inside the DLR - Invoking methods, Simon Cooper: So, we’ve looked at how a dynamic call is represented in a compiled assembly, and how the dynamic lookup is performed at runtime. The last piece of the puzzle is how the resolved method gets invoked, and that is the subject of this post.

An Introduction to ASP.NET Web API, Rick Strahl: Microsoft recently released ASP.NET MVC 4.0 and .NET 4.5 and along with it, the brand spanking new ASP.NET Web API. Web API is an exciting new addition to the ASP.NET stack that provides a new, well-designed HTTP framework for creating REST and AJAX APIs (API is Microsoft’s new jargon for a service, in case you’re wondering). Although Web API ships and installs with ASP.NET MVC 4, you can use Web API functionality in any ASP.NET project, including WebForms, WebPages and MVC or just a Web API by itself. And you can also self-host Web API in your own applications from Console, Desktop or Service applications.

About signing assemblies, GAC and friends, Ran Wahle: Recently I was asked by one of my colleagues to explain to a customer of his about signing assemblies, putting them into GAC etc. So I’ve decided to put some terms in order, for you to understand what it’s all about.

Extra Information from OAuth/OpenId Provider, pranav rastogi: When you authenticate a user using the OAuth/OpenId providers, you can request for some extra information about the user if you have granted access for these providers to send this information.