Skip to content

Instantly share code, notes, and snippets.

View itn3000's full-sized avatar
🤔
🤔🤔🤔🤔🤔🤔

Yusuke Ito itn3000

🤔
🤔🤔🤔🤔🤔🤔
View GitHub Profile
@itn3000
itn3000 / ConcurrentDicitionaryKeyTypeBench.cs
Created June 2, 2022 02:44
ConcurrentDictionary.TryGetValue comparison by key types.
// This benchmark use one record and TryGetValue returns true.
// Results will be affected by record num and whether match any record or not.
using System.Collections.Concurrent;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
BenchmarkRunner.Run<ConcurrentDictionaryBench>();
record C1(string a, int b, string c);
@itn3000
itn3000 / cmake-memo-ja.md
Last active April 19, 2022 00:09
cmake memo in Japanese
  • 静的リンクしたい場合は-DCMAKE_DEFAULT_CMP0091=NEW "-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded$<$<CONFIG:Debug>:Debug>"とする
    • cmake-3.15以降
  • ビルド出力先の指定は-B、ソース指定は-S
  • VSの場合、ターゲットアーキテクチャを-Aオプションで指定する(x64,Win32)
  • VSの場合、リリースビルドしたいときは--config Release
@itn3000
itn3000 / how-to-create-server-client-cert.md
Last active April 13, 2023 02:52
how to create root,server,client certificate by openssl
@itn3000
itn3000 / FasterLogWithFastCommitMode.cs
Last active April 14, 2022 02:20
Exception in iterating FasterLog with FastCommitMode=true
using FASTER.core;
// ensure log directory is empty.
if (Directory.Exists("abc"))
{
Directory.Delete("abc", true);
}
using var fl = new FasterLog(new FasterLogSettings("abc")
{
@itn3000
itn3000 / ReturnClientCertificateThumbprint-description.md
Last active April 17, 2022 18:52
investigation of discarding client certificate problem on IIS

Steps to reproduce

Environment

  • Windows Server 2022 for server
  • ubuntu-20.04 with curl for HTTP client

setup

  1. creating self signed CA certificate using openssl and import to server root CA
@itn3000
itn3000 / github-actions-release.yml
Last active April 6, 2022 07:00
github actions release event type sandbox
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
release:
types:
- published
@itn3000
itn3000 / NuGetVersionParseTest.cs
Last active April 1, 2022 15:02
nuget semver2 parse test
// dotnet add package NuGet.Versioning --version 6.1.0
using System;
using System.Reflection;
using NuGet.Versioning;
namespace nugetclienttest
{
class Program
{
static void OutputVersion(NuGetVersion v)
@itn3000
itn3000 / GetConfigurationChangedNotification.cs
Last active March 29, 2022 16:41
sandbox for getting notification of IConfiguration changes
// dotnet add package Microsoft.Extensions.Hosting;
// dotnet add package System.Reactive;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Configuration;
using System.Reactive.Concurrency;
using System.Reactive.Subjects;
using System.Reactive.Linq;
using System.CommandLine;
using System.CommandLine.Binding;
var opt1 = new Option<string>(new string[]{ "--opt1", "-o1" }, "this is option1");
var opt2 = new Option<int>(new string[]{ "--opt2", "-o2" }, "this is option2");
var rootcmd = new RootCommand("this is root");
rootcmd.Add(opt1);
rootcmd.Add(opt2);
rootcmd.AddCommand(CreateCommand1());
@itn3000
itn3000 / versionreadfrompe.rs
Last active March 24, 2022 02:32
read exe version by rust with pelite( https://github.com/CasualX/pelite )
// this works with linux
use std::fs;
use pelite::pe64::Pe;
use pelite::pe32::Pe as Pe32;
use pelite::Error as PeErrors;
use memmap2::Mmap;
fn output_ver_info(p: &std::path::Path) -> Result<(), anyhow::Error> {
{
// let f = std::fs::File::open(p)?;