Skip to content

Instantly share code, notes, and snippets.

Yuto Takei yutopio

  • Tokyo
Block or report user

Report or block yutopio

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
yutopio / monitor.yaml
Created Nov 23, 2019
Swarm visualizer + cAdvisor + InfluxDB + Grafana stack
View monitor.yaml
# docker stack deploy -c monitor.yaml monitor
# docker exec `docker ps | grep -i influx | awk '{print $1}'` influx -execute 'CREATE DATABASE cadvisor'
version: '3.7'
image: dockersamples/visualizer
- "9000:8080"
yutopio / Calc.csproj
Created Mar 6, 2018
Simple math calculator
View Calc.csproj
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="">
<Import Project="packages\Antlr4.CodeGenerator.4.6.4\build\Antlr4.CodeGenerator.props" Condition="Exists('packages\Antlr4.CodeGenerator.4.6.4\build\Antlr4.CodeGenerator.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
yutopio / http.cs
Created Mar 3, 2018
Example of simple HTTP client / server by using Socket
View http.cs
using System;
using System.Net;
using System.Net.Sockets;
class Program
static void Main(string[] args)
var s = new Socket(
yutopio / ProducerConsumer.cs
Created Mar 1, 2018
Producer-Consumer problem implementation
View ProducerConsumer.cs
using System;
using System.Threading;
class Program
static int prodIndex = 0;
static int consIndex = 0;
static Semaphore empty, filled;
static string[] buffer;
View rsa.cs
using System;
using System.Collections.Generic;
using System.Linq;
class Program
static readonly Random rnd = new Random();
static void Main(string[] args)
yutopio / cert.cs
Created Feb 20, 2017
Certificate generation with BouncyCastle C#
View cert.cs
using Org.BouncyCastle.Asn1.Pkcs;
using Org.BouncyCastle.Asn1.Sec;
using Org.BouncyCastle.Asn1.X509;
using Org.BouncyCastle.Asn1.X9;
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Crypto.Generators;
using Org.BouncyCastle.Crypto.Operators;
using Org.BouncyCastle.Crypto.Parameters;
using Org.BouncyCastle.Math;
using Org.BouncyCastle.Security;
View string.cs
using System;
using System.Runtime.CompilerServices;
using static System.Console;
// No effect...
class Program
const string kHello = "HelloWorld";
View Cer.cs
using System;
using System.Runtime.CompilerServices;
using System.Threading;
class Program
static readonly EventWaitHandle wh = new ManualResetEvent(false);
static volatile bool beforeSet = false;
static volatile bool afterSleep = false;
View Volatile.cs
using System;
using System.Threading;
class Program
class Flag
public bool done;
View StreamUtil.cs
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
public static class StreamUtil
public static async Task<byte[]> ReadAsync(this Stream stream,
int length, CancellationToken cancellationToken)
You can’t perform that action at this time.