Skip to content

Instantly share code, notes, and snippets.

View shirmanov's full-sized avatar
💭
open to new opportunities

Leonid Shirmanov shirmanov

💭
open to new opportunities
  • RBI Group
  • SPb, Russia
  • 07:20 (UTC +03:00)
View GitHub Profile
@tsubik
tsubik / AddMigration.ps1
Created June 10, 2014 17:17
Powershell script to automate visual studio with creating migrations
#Author: Tomasz Subik http://tsubik.com
#Date: 2014-05-27
#License: MIT
Param(
[parameter(Mandatory=$false)]
[alias("n")]
$name = [System.Guid]::NewGuid().ToString(),
[parameter(Mandatory=$false)]
[alias("p")]
@sayedihashimi
sayedihashimi / _webjob-env-vars.txt
Last active April 11, 2025 06:44
Environment variables when your app is running as a Microsoft Azure Web Job
ALLUSERSPROFILE C:\DWASFiles\Sites\WebjobsEnvvars\ProgramData
APP_POOL_CONFIG C:\DWASFiles\Sites\WebjobsEnvvars\Config\applicationhost.config
APP_POOL_ID WebjobsEnvvars
APPDATA C:\DWASFiles\Sites\WebjobsEnvvars\AppData
APPSETTING_REMOTEDEBUGGINGVERSION 11.0.611103.400
APPSETTING_ScmType None
APPSETTING_WEBSITE_NODE_DEFAULT_VERSION 0.10.29
APPSETTING_WEBSITE_SITE_NAME WebjobsEnvvars
aspnet:DisableFcnDaclRead true
aspnet:PortableCompilationOutput true
@rushfrisby
rushfrisby / JsonSchemaToPocos.cs
Last active July 5, 2025 22:20
Converts a JSON schema to C# POCO classes
class Program
{
private const string Cyrillic = "Cyrillic";
private const string Nullable = "?";
static void Main()
{
string schemaText;
using (var r = new StreamReader("schema.txt"))
@sahilsk
sahilsk / ELK Procedure
Created August 26, 2014 04:53
nginx proxy configuration for elasticsearch
## Install Docker
```
# install the backported kernel
$ sudo apt-get update
$ sudo apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
$ sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@kurokikaze
kurokikaze / gist:350fe1713591641b3b42
Created October 3, 2014 11:40
install chrome from powershell
(new-object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome_installer.exe', 'c:/temp/chrome.exe');. c:/temp/chrome.exe /silent /install;rm c:/temp -rec
@rosskukulinski
rosskukulinski / Dockerfile
Created October 21, 2014 17:07
Docker etcd/confd configuration of nginx
FROM <private repo>
MAINTAINER Ross Kukulinski "[email protected]"
ADD nginx.toml /etc/confd/conf.d/nginx.toml
ADD templates/nginx.tmpl /etc/confd/templates/nginx.tmpl
ADD confd-watch /usr/local/bin/confd-watch
RUN chmod +x /usr/local/bin/confd-watch
@seibar
seibar / Web role perf counters
Created December 4, 2014 21:55
Azure Web role performance counters
\RAS\Bytes Transmitted By Disconnected Clients
\RAS\Bytes Received By Disconnected Clients
\RAS\Failed Authentications
\RAS\Max Clients
\RAS\Total Clients
\WSMan Quota Statistics(*)\Process ID
\WSMan Quota Statistics(*)\Active Users
\WSMan Quota Statistics(*)\Active Operations
\WSMan Quota Statistics(*)\Active Shells
\WSMan Quota Statistics(*)\System Quota Violations/Second
@jimmycuadra
jimmycuadra / cloud-config.yml
Last active April 19, 2021 03:04
CoreOS cloud-config for DigitalOcean with iptables firewall
#cloud-config
coreos:
etcd:
# generate a new token for each unique cluster from https://discovery.etcd.io/new
discovery: https://discovery.etcd.io/<token>
# multi-region deployments, multi-cloud deployments, and droplets without
# private networking need to use $public_ipv4
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
@janogarcia
janogarcia / email_coding_guidelines.md
Last active November 26, 2024 15:35
Email Coding Guidelines
@JonCole
JonCole / ThreadPool.md
Last active May 10, 2025 15:44
Intro to CLR ThreadPool Growth

ThreadPool Growth: Some Important Details

The CLR ThreadPool has two types of threads - "Worker" and "I/O Completion Port" (aka IOCP) threads.

  • Worker threads are used when for things like processing Task.Run(…) or ThreadPool.QueueUserWorkItem(…) methods. These threads are also used by various components in the CLR when work needs to happen on a background thread.
  • IOCP threads are used when asynchronous IO happens (e.g. reading from the network).

The thread pool provides new worker threads or I/O completion threads on demand (without any throttling) until it reaches the "Minimum" setting for each type of thread. By default, the minimum number of threads is set to the number of processors on a system.

Once the number of existing (busy) threads hits the "minimum" number of threads, the ThreadPool will throttle the rate at which is injects new threads to one thread per 500 milliseconds. This means that if your system gets a burst of work needing an IOCP thread, it will proces