Installing Ubuntu on Windows 10

It’s really nice that I can use linux shell on windows. One of big part of me using MacBook was to have linux / unix-like shell and development environment.

Unit Testing With ASP.NET Core

It’s important that your unit test run against public interface of module. Otherwise, you do not test behaviour but your implementation of the behaviour. In case of APIs, it’ll be API interface via HTTP.

Get last item from List in F#

In C#, you use bang (!) to negate a boolean expression. Unfortunately, not in F#. it’s “not”

Fix ASP.NET Core port number on Service Fabric

If you create a stateless asp.net core api as service fabric service, the port number changes each time you restart the service fabric service. It’s quite annoying that your postman requests start failing because the port number has changed. To fix it, you have to override the resource, specifying the port number.

Configuration in ASP.NET Core

When you create stateless service fabric asp.net core api, the template doesn’t add configuration builder by default. I’ve spent about an hour pulling my hair why it doesn’t load appsettings.json on start up. So, Add it first.

A journey into ASP.NET Core CORS (Cross Origin Resource Sharing)

A quick note. I may turn this into a proper blog post.

Nginx as Reverse proxy for ASP.NET Core on Local Windows machine

NginX is a basket full of interesting features, but here, I’ll focus on using it as reverse proxy.

양치기들에게 나타나신 하나님

Luke 2:8-9 “And there were shepherds living out in the fields nearby, keeping watch over their flocks at night. 9 An angel of the Lord appeared to them, and the glory of the Lord shone around them, and they were terrified.”

False alarm from bots

I'm on call this week, and whenever there's alert, it comes to my mobile. I've had Error rate > 5% alert from PagerDuty the other day. I've acknowledged the alert, (otherwise it keeps sending me the alerts) and investigated it.

A public action method 'Login' was not found on controller 'xxxxWeb.Controllers.HomeController'

It was interesting. The action method definitely exists there, but we had 5 errors instantly. After investigation and some googling, it turned out that excel spreadsheet and some crawling bot were hitting the endpoint with HEAD and OPTIONS verb.

Why? I don't know, but the fix was simple. Currently, Login was constrained to GET. Simply take off the constraint and the page will serve HEAD and OPTIONS very well.

It's fun to be a on-call engineer. You can see loads of things you haven't expected to see, in real world, on production server.

Dictionary.Insert Null reference error

최근에 OAuth를 이용한 로그인 시스템을 구현하면서 login client를 NuGet Package로 만들었었다. 다른 개발자들이 쉽게 로그인 기능을 이용할 수 있도록. 그런데 자꾸만 acquired token을 저장하는 static Dicionary에서 Null Reference error가 나는게 아닌가. Dictionary.Insert에서...
Dictionary.Get에서 나면 몰라도 Insert에서 Null error가 나서 쫌 구글해보니, StackOverflow의 어느 고수께서 이미 답변. Threading 이슈라고.
http://stackoverflow.com/…/how-did-i-get-this-nullreference…

그 아래 다른분은 ConcurrentDictionary를 쓰라고 친절하고 부연 설명까지.