Skip to content

Instantly share code, notes, and snippets.

View rkttu's full-sized avatar

Jung Hyun Nam rkttu

View GitHub Profile
@rkttu
rkttu / WhenUsingAppRepository.cs
Last active July 12, 2017 06:31
MSpec, EF Core 2.0 In-Memory Provider Sample
using TheCompany.Something.Api.Repositories;
using TheCompany.Something.Data;
using TheCompany.Something.Data.Models;
using Machine.Fakes;
using Machine.Specifications;
using Microsoft.EntityFrameworkCore;
using System;
using System.Threading;
using System.Threading.Tasks;
@rkttu
rkttu / iis.yaml
Created November 23, 2018 01:31
Windows IIS K8S Deploy YAML Sample
apiVersion: v1
kind: Pod
metadata:
labels:
name: iis
name: iis
namespace: default
spec:
containers:
- image: microsoft/iis:windowsservercore-1803
@rkttu
rkttu / azure-vote-hybrid.yaml
Created March 31, 2019 08:06
Hybrid Kubernetes Workload Example
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: azure-vote-back
spec:
replicas: 1
template:
metadata:
labels:
app: azure-vote-back
@rkttu
rkttu / azure-container-instance.yaml
Created March 31, 2019 13:25
Azure Container Instance Sample
apiVersion: v1
kind: Pod
metadata:
name: iis-winsvrcore
spec:
containers:
- image: mcr.microsoft.com/windows/servercore/iis:windowsservercore-ltsc2016
imagePullPolicy: Always
name: iis-winsvrcore
resources:
@rkttu
rkttu / device.js
Last active May 2, 2019 01:38
Azure IoT Hub Device & Service Sample Code
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
'use strict';
var Protocol = require('azure-iot-device-amqp').AmqpWs;
// Uncomment one of these transports and then change it in fromConnectionString to test other transports
// var Protocol = require('azure-iot-device-amqp').AmqpWs;
// var Protocol = require('azure-iot-device-http').Http;
// var Protocol = require('azure-iot-device-mqtt').Mqtt;
@rkttu
rkttu / win10_ocr_example.linq
Created October 3, 2019 15:59
Windows 10 OCR Example with LINQPad 6
<Query Kind="Statements">
<NuGetReference>Microsoft.Windows.SDK.Contracts</NuGetReference>
<Namespace>Windows.Globalization</Namespace>
<Namespace>Windows.Graphics.Imaging</Namespace>
<Namespace>Windows.Media.Ocr</Namespace>
<Namespace>Windows.Storage</Namespace>
<Namespace>Windows.Storage.Streams</Namespace>
<Namespace>System.Net.Http</Namespace>
</Query>

Keybase proof

I hereby claim:

  • I am rkttu on github.
  • I am rkttu (https://keybase.io/rkttu) on keybase.
  • I have a public key ASC4angFcEhW26hdDOcrHUYMQBHo5t_aGhg_p2hDEukQkQo

To claim this, I am signing this object:

@rkttu
rkttu / Dockerfile
Created December 4, 2019 22:26
IIS Windows Container with STDOUT Logging
FROM mcr.microsoft.com/windows/servercore/iis:windowsservercore-ltsc2019
RUN set COMPLUS_NGenProtectedProcess_FeatureEnabled=0 & \
\Windows\Microsoft.NET\Framework64\v4.0.30319\ngen update & \
\Windows\Microsoft.NET\Framework\v4.0.30319\ngen update
ADD https://github.com/microsoft/windows-container-tools/releases/download/v1.0/LogMonitor.exe /LogMonitor/
ADD https://dotnetbinaries.blob.core.windows.net/servicemonitor/2.0.1.3/ServiceMonitor.exe /
RUN powershell.exe -Command Set-WebConfigurationProperty -p 'MACHINE/WEBROOT/APPHOST' -fi 'system.applicationHost/log' -n 'centralLogFileMode' -v 'CentralW3C'; \
@rkttu
rkttu / tf.ps1
Created January 18, 2020 13:57
Terraform Alias Example
function global:Invoke-Terraform {
[CmdletBinding()]
[Alias('tf')]
param (
[parameter(Mandatory=$False,Position=0,ValueFromRemainingArguments=$True)]
[Object[]] $Arguments
)
begin {
$PrevAwsProfile = $env:AWS_PROFILE; $env:AWS_PROFILE='saml'
}
@rkttu
rkttu / kubectx.ps1
Created January 18, 2020 16:52
PowerShell version of kubectx and kubens
function global:Select-KubeContext {
[CmdletBinding()]
[Alias('kubectx')]
param (
[parameter(Mandatory=$False,Position=0,ValueFromRemainingArguments=$True)]
[Object[]] $Arguments
)
begin {
if ($Arguments.Length -gt 0) {
$ctx = & kubectl.exe config get-contexts -o=name | fzf.exe -q @Arguments