Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Jung Hyun Nam rkttu

🎯
Focusing
View GitHub Profile
@rkttu
rkttu / CTest.cpp
Last active Mar 22, 2021
C++/CLI and C# Interop Sample - For Complete Source Code, Go to https://github.com/level120/CsharpCppSample
View CTest.cpp
#include "pch.h"
#include "CTest.h"
using System::Runtime::InteropServices::Marshal;
CTest::CTest()
{
this->pVaListener = new CVaListenerUnmanaged();
this->pVaListenerManaged = gcnew CVaListenerManaged();
}
@rkttu
rkttu / CSharp Sample.ipynb
Created Nov 21, 2020
닷넷 인터랙티브 기반 C# 기초 강좌 샘플
View CSharp Sample.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rkttu
rkttu / docker2wsl.cmd
Created Oct 25, 2020
Docker container to WSL convert
View docker2wsl.cmd
@echo off
pushd "%~dp0"
rem Example: docker2wsl ubuntu:latest myubuntu
docker pull %1
docker run -d --name %2 %1 /bin/sh > %TEMP%\ctrid.txt
set /p CTRID= < %TEMP%\ctrid.txt
if exist %TEMP%\ctrid.txt del /f /q %TEMP%\ctrid.txt
@rkttu
rkttu / README.md
Last active Nov 7, 2020
KCD 2020 Online Code Sample {WSLHUB]
View README.md

프로그래밍 방식으로 WSL 배포판 안의 사용자를 조회하는 방법

이 코드 샘플은 프로그래밍 방식으로 WSL 배포판 안의 사용자를 조회할 수 있는 방법을 설명합니다. Win32 API를 주로 사용하였고, 일부 편의를 위하여 C# 코드를 이용했지만, C++ 코드에서도 같은 기능을 구현할 수 있습니다.

프로그램 코드를 테스트해보기 위해서는 .NET 5 이상의 SDK를 설치해야 합니다. 그 다음, 이 Gist 리포지터리를 Git으로 체크아웃하고 dotnet run 명령으로 실행해봅니다.

@rkttu
rkttu / main.cpp
Created Sep 29, 2020
Jagged String Array (VC++) Sample
View main.cpp
#include <tchar.h>
#include <stdio.h>
#include <combaseapi.h>
int __stdcall GetStringArrayDataW(OUT LPWSTR** lpArrayDest, OUT SIZE_T* pArrayLength);
void __stdcall FreeStringArrayW(OUT LPWSTR** lpArrayDest, IN SIZE_T nArrayLength);
int __stdcall GetStringArrayDataA(OUT LPSTR** lpArrayDest, OUT SIZE_T* pArrayLength);
void __stdcall FreeStringArrayA(OUT LPSTR** lpArrayDest, IN SIZE_T nArrayLength);
@rkttu
rkttu / wslhub-cla.md
Last active Sep 1, 2020
WslHub Contributor License Agreement
View wslhub-cla.md

Contributor License Agreement

The following terms are used throughout this agreement:

  • You - the person or legal entity including its affiliates asked to accept this agreement. An affiliate is any entity that controls or is controlled by the legal entity, or is under common control with it.
  • Project - is an umbrella term that refers to any and all IOMED Medical Solution S.L. open source projects.
  • Contribution - any type of work that is submitted to a Project, including any modifications or additions to existing work.
  • Submitted - conveyed to a Project via a pull request, commit, issue, or any form of electronic, written, or verbal communication with IOMED Medical Solution S.L., contributors or maintainers.

1. Grant of Copyright License.

@rkttu
rkttu / readme.txt
Created Jul 8, 2020
Ubuntu 20.04 + WSL 2 + XRDP PulseAudio
View readme.txt
# Credits
# https://c-nergy.be/blog/?p=13655
# https://askubuntu.com/questions/844245/how-to-compile-latest-pulseaudio-with-webrtc-in-ubuntu-16-04
# https://askubuntu.com/questions/496549/error-you-must-put-some-source-uris-in-your-sources-list
# https://unix.stackexchange.com/questions/65167/enable-udev-and-speex-support-for-pulseaudio
# https://rudd-o.com/linux-and-free-software/how-to-make-pulseaudio-run-once-at-boot-for-all-your-users
# First, you should install XRDP and X11 Desktop Environment first.
# Step 1 - Install Some PreReqs
@rkttu
rkttu / avgload.ps1
Last active Apr 20, 2020
Average Load (1m, 5m, 15m) Display for Windows
View avgload.ps1
# https://github.com/giampaolo/psutil/blob/master/psutil/arch/windows/wmi.c
$LOADAVG_FACTOR_1F = 0.9200444146293232478931553241
$LOADAVG_FACTOR_5F = 0.9834714538216174894737477501
$LOADAVG_FACTOR_15F = 0.9944598480048967508795473394
$SAMPLING_INTERVAL = 5
$load_avg_1m = 0.0;
$load_avg_5m = 0.0;
@rkttu
rkttu / kubectx.ps1
Created Jan 18, 2020
PowerShell version of kubectx and kubens
View kubectx.ps1
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
@rkttu
rkttu / tf.ps1
Created Jan 18, 2020
Terraform Alias Example
View tf.ps1
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'
}