Unable to configure device language!

Well this post will help you in getting Alexa app setup for iOS guys in India especially people who bought their echo in US. Amazon Echo got me excited as it had got some good reviews when it launched! But since i was in India when it did , I decided to get one from some folks in the US .But that turned out to be a bad idea as Amazon decided it shouldn’t be released in other countries yet and blocked out the Alexa app from the Apple Store in other regions other than US.So if you had to install one you would most likely have to install one using some hacks or would have to get a US payment card and register yourself in Apple store with that card info. Well for some reason I didn’t try the hacks and the workaround and waited patiently for a year!

Come next year in the fall of 2017 , Amazon decides to give Google Home a run for its money and launches Echo .But its on invitation basis only for now.And anyways i was only waiting for the Alexa to be installed. Once it did in last week of October in Apple Store, I installed it only to be frustrated again.This time “Unable to configure device language Error 15:1:26:0:2” during setup post installation of the app. Well I felt like hitting myself against the Echo device. But after a few days better sense prevailed as I got myself into experimental mood. I knew it had everything to do with the regional settings and so I changed the country settings in Amazon to US and then tried setting up the Alexa and it worked just fine. Now where do you find the country settings? Strangely i could only find it in amazon.com domain and not in Indian domain(ie .in) . It was under Manage your content and devices under settings tab. If you don’t know how to reach Manage your content and devices you will get it under you account page once you sign in.

Once you have changed the country to US and then sign into the Alexa app it will setup up perfectly! Once you have set it up , you can always go and change it back to your country in the website and within it app as well.But the initial setup is the only hiccup!

Advertisements

Swagger with ASP.NET WEB API !!

Have you ever wondered if there was an quick alternative to the Fiddler and the Advanced Rest Client /Postman for that matter.Something that would be pretty close to code that can be helpful in documentation and help you quickly get up to speed on testing your restful API’s? Well of late Swagger has been pretty popular because its open source and its ease of configuration.Well you can be up and running in 5 min.Swagger helps us to build pretty solid rest API documentation . Do you want to read on or do you want to get into the thick of it?

Step 1 :Let us just go ahead and select the most common ASP.Net MVC application and select WEB API as Project Template.Just hit F5 and you can see that by default the project has two Controllers Home and Values. We will concentrate on ValuesController as it seems to have some methods exposed.Well once you have the project up and running you will notice that the web project hosted via IISExpress on some port will have a API option on the top left hand on the home page.Clicking on it will lead to http://localhost:[portnumber]/Help which will provide some basic documentation on the webapi exposed.But you will soon see how much more convenient ,user friendly and testable Swagger is.

ASPHELP

Step 2 :Time to fire up Swagger from nuget packages.To help us set it up in ASP.NET there is a open source project called Swashbuckle .

Type in the following in Nuget Package Manager Console.

Install-Package swashbuckle

swashbuckle

Expanding the App_Start folder in your SolutionExplorer you can see the SwaggerConfig.cs magically inserted with some default options set.Basically ensure that you have at least the following configuration under SwaggerConfig.Register() method.

var thisAssembly = typeof(SwaggerConfig).Assembly;

GlobalConfiguration.Configuration
.EnableSwagger(c => c.SingleApiVersion(“v1”, “A title for your API”))
.EnableSwaggerUi();

Thats pretty much it .And you can run it and hit the below url to go to swagger url

http://localhost:%5Bportnumber%5D/swagger

swagger

Well you can now click on the Get url ,expand it and hit the try it button to see the request url,response body,response code as well as the response header.You can pass in the required parameters as you can discover using the second Get url.

You can also add xml documentation by linking the document to swagger in the SwaggerConfig.cs

First you will have to enable the xml documentation in Build tab under project properties .Next you will have to add the following line to EnableSwagger()

c.IncludeXmlComments(filePath:System.AppDomain.CurrentDomain.BaseDirectory + “[name of xml file mentioned under build tab]”);

And just restart the application.

swaggerxml

So you can see your xml comments reflected now.Cool isnt it?
You can even add Implementation Notes by adding remarks tag in your xml comments.You can also add HTML elements into the remarks tag if you are interested like adding a table inside the remarks tag.

To add response type schema you will have to decorate your web api action method with ResponseType tags as shown below.

responsetype

Just to add to the fun , you can add that extra user friendly documentation by adding a sample request json for your request uri.For example most of the POST action methods in an api, can be a little tricky if you dont set the mandatory properties properly.You will however need to implement a small interface called ISchemaFilter as follows.You will need to set your sample json to @default property.

public class CustomerDefault : ISchemaFilter
{
public void Apply(Schema schema, SchemaRegistry schemaRegistry, System.Type type)
{
schema.@default = new { Age = "34", Name = "John", Address = "PO Box 565,24th Down Street,Newcastle" };
}
}


Finally just decorate your class with the SwaggerSchemaFilter tag as shown below

[SwaggerSchemaFilter(typeof(AssignDPCIInfoDefault))]

Thats it you will get a sample json request under the webapi method, once you fire up your swagger ui.

There are loads of customization that you can do via swagger.I would encourage to visit the below url at your leisure

https://github.com/domaindrivendev/Swashbuckle

Top Apps for Apple Store

So here I come out of the dark ages of PC and Laptops and notebooks and here comes my first blog from a 4.7 inch smartphone . I wanted to share what apps I love most on iPhone and don’t worry all are free 😛.  So here are a few. Mind you these are my list ( from a Indian perspective)and you are free to have ur difference of opinion.

I am assuming most of us would have installed all the major social networking sites. You might also want to install about.Me for profiling and Flikr for cool snaps you have taken!!



They have a good interface and some great profiles to go through.

For taxi rides I use Uber and Olacabs (only in India)



The advantage with these mobile apps of regular taxis are they give you referrals and free rides which is not available when you their IVR or websites.merucabs are another local Indian fav.



Of news and feeds I rely on Flipboard and Instapaper and Digg.



( sorry but these are regular affair in India and I really wanted to support this brave lady)

Rely on Instapaper and Pocket for reading later when offline or while on travel where u don’t have internet.



Makemytrip ,Expedia , tripadvisor and cleartrip for travel bookings . Hotel right now from makemytrip gives good deals as well.



Coupondunia for deals and Zomato for review on places to have meals !



if you are a football fan like me you would like to install onefootball which gives you content of goal.com and you will get live ticker for games in progress as well from all the leagues in the globe. And if you love cricket then cricbuzz is the app to have.

I know for jobs most ppl use naukri and timesjobs, but glassdoor is invaluable to know the package and the culture of the company !



For rentals and searching houses you can use 99acres,common floor  , majicbricks



For pregnancy apps I can’t think of anything better than babycenter my pregnancy app.

And for reviews if most of  things I use mouthshut..

I use relax m for concentration and soothing sounds.

Ted for great talks and coursera for great computer talks . Meetups for scheduling and reaching out to like minded communities and groups mostly in the tech realm.



I use healthkart+ and webMD for meds and procedures and diagnosis.

Flipkart Ebooks gives you free Ebooks to read . Not just the romantic and the classics.

Justdial for any info on utility in neighborhood

Timeful for managing my time and yes finally WordPress and blogger apps for blogging 🙂

There are a few notable apps like memorado for brain games, busuu for learning foreign languages,topic to insert voice into snaps, awesome scanner for scanning docs and wireshare for sharing stuff . Try ipash tone kewl among geeks and I use procam for editing snaps when not using Instagram!!

There are a few other mentionable apps like my bsnl for paying your bsnl bills or mobile one for Bangalore utility bills and my Vodaphone for Vodaphone users finally 

Load Testing

I guarantee you this blog is going to be short and sweet but yeah it will add 2cents to your Info DB! So lets start ,how do you do load testing? Have used the load tests in Visual Studio? Its pretty much a breeze if you are familiar with the IDE.You can do a web performace test or a load test in Unit tests

Load1

And you can even step up the number of users(read traffic) or have a constant load.

load2

You can do web testing in the same manner as you normal methods in C#.

load3

In addition you can also try other tools like Fiddler.Simply pass the url that you wish to test in Composer section and repeat the call selecting the session and hitting Shift + R.You will get the results under statistics.Thats as simple as it can get.

load4

There is another amazing tool called stressstimulus which hooks with the fiddler and provides some cool features.
stresstimulus

You can see a quick demo here (http://forums.asp.net/t/1666267.aspx?Free+Load+Testing+Tool+Fiddler+add+on+StresStimulus)
Lastly there are now lots of free sites (http://loaduiweb.org/), where you can test your rest urls and load test them.But now sure if you are ready to test is on another box in case you are working for some corporate organisation.

Threats , Risks, Security – OWASP ?

For those who are newbie to security — and by security i dont mean authentication and authorization alone,this maybe an eye opener.Heard about CRSF and XSS- they are more in case you read on? Read this for an eye opener about some crazy stuff(http://www.troyhunt.com/2014/10/find-crazy-stuff-in-mobile-app.html).Troy has done some great stuff and sure you can check out his pluralsight video as well.But there is something that we all realise that we hardly give too much importance to security until the shit hits the fan.There have been more and more cases of hackers stealing credit cards from retail merchants and publishing them ,but we should all understand that he was able to do because “Developers were ignorant” .Not that i want to run away- I AM A DEV GUY too! But off late there is this new heat being generated that we are not giving adequate importance to these risks or vulnerabilities which can be exploited and these security threats can soon be a nightmare you dont want to take! Ok enuf said now what ? where do I start?
Simple — heard of OWASP ? You need to make sure that you pass these top 10 security risks. You can also go to owasp.org to learn more about it.Every year they publish the latest threats and for different platforms as well.The top 10 threats of mobility are
https://www.owasp.org/index.php/Mobile_Top_10_2014-M10

Ok now that i know what my vulnerabilities are ,how do i resolve it or how to i include it in SDL(software development lifecycle).First as a part of the process you can use Thread Modeling Tool from Microsoft(its free in case you thought $$$ just now 🙂 ) ,which is basically a modeling tool like visio but where you can see the vulnerable areas in design phase itself so that you are aware of your attack surface area and try eliminating vulnerable ones.You can download it from here .
http://www.microsoft.com/en-us/download/details.aspx?id=42518
Now to fix these issues in code you can either do google which by the way gives you lot more options or you can use a tool called Fortify from HP which plugs into you Visual Studio and gives you recommendations based on OWASP rules and severity and other filters as well.But sadly its paid and so are tools like Checkmarz and Klockwork. Ok so thats bad news, but sure enough i can guarantee you that if you have the patience google has the answers to most of the OWASP risks that your application has. So secure coding then 🙂

The terminal server has exceeded the maximum number of connections

Ever encountered this error and you have been frustrated that the last minute changes and hotfix is not going through.Well these things happen and more often than not we learn it at the wrong time 🙂 .There is an easy way to boot out unnecessary people from the server you are trying to login.Works wonders if you are a admin though.

To start off ,if you the nice guy and want people to be notified that you have a emergency and that you need to remotely login,then you need to know the users logged in .Some lousy admin or support guy may have forgotten to log off their sessions.Hence you need to find them and email them.Easier said than done.So sysInternals have for you a simple tool to help you find these guys.You can either download the entire suite from sysInternals website or they have a live version http://live.sysinternals.com/. Open PsLoggedon.exe and pass in your remote server name as shown below.

psloggedin

There you go,you now know who are the culprits.But still it might not resolve your problem and you might still not be able to login remotely.So when the push comes to shove,you have to bump someone out.Here are some commands to login forcefully .

To connect to a remote Windows Server 2003-based computer, go to Start and Run (Windows + R keyboard shortcut) and then type the following command:

mstsc -v:servername /F -console

NOTE: Newer versions of the RDP client require the following command instead.

mstsc /v:servername /F /admin

Happy Remoting!

Visual Studio Productivity Power Tools for VS 2012

Well for starters let me assume you are a poor dev like me and don’t have access to Resharper! Well in case you do they have a lot of these features that are now available free of cost in Productivity Tools in VisualStudioGallery.msdn.microsoft.com.

Let me quickly show you some of the features that stand out pretty instantaneously .

1.PresentOn/Off – type this into the quick launch and lo you get the power of zoomit 🙂

PresentOn

2.You can now edit a project file by right clicking on the project.

Edit Project

3.Browse to definition by pressing on control and left mouse click.

Definition

4.Email code snippets by using the same option in context menu.

Email

5.Now you can find duplicate code snippets by selecting the option “Find Matching clones in solution” in context menu.

Clones

Also there are other features like Auto Brace Completion,Open Command Prompt and HTML copy.
So go ahead and give it a download!!