Skip to content

Instantly share code, notes, and snippets.

View Tirael's full-sized avatar
🏠
Working from home

Georgiy Zhuykov Tirael

🏠
Working from home
  • Moscow, Moscow City, Russian Federation
View GitHub Profile
namespace Sagas
{
using System;
using System.Collections.Generic;
class Program
{
static ActivityHost[] processes;
@Tirael
Tirael / default-gelf-tcp-udp-inputs.json
Created October 14, 2020 23:30
Graylog3 - default GELF TCP/UDP inputs
{
"v": 1,
"id": "65fc58bb-1758-4f3e-b9a3-e89b24d04443",
"rev": 1,
"name": "Default GELF TCP/UDP inputs",
"summary": "A Content Pack for Graylog3 with two GELF TCP/UDP inputs",
"description": "",
"vendor": "noname",
"url": "",
"parameters": [],
@Tirael
Tirael / gist:6fce2f75ac01e4a84da31fdd59220f76
Last active August 30, 2020 20:22
Kafka + strimzi (Windows)
choco install sed
kubectl create ns kafka
# curl -L http://strimzi.io/install/latest | sed "s/namespace: .*/namespace: kafka/" | kubectl apply -f - -n kafka
using Jaeger.Reporters;
using Jaeger.Samplers;
using Jaeger.Senders;
using Jaeger.Senders.Thrift;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using OpenTracing;
@Tirael
Tirael / ForEachAsync.cs
Created June 5, 2020 11:41 — forked from 0xced/ForEachAsync.cs
Parallel foreach async enumeration with maximum degree of parallelism
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Parallel
{
public static class EnumerableExtensions
{
@Tirael
Tirael / LetsEncrypt_HTTPS_plex.MD
Created June 3, 2020 18:13 — forked from churro-s/LetsEncrypt_HTTPS_plex.MD
Setup Let's Encrypt certificate for use with Plex Media Server on Ubuntu
@Tirael
Tirael / RestSharpExecuteAsyncMoq.cs
Created May 12, 2020 21:36 — forked from mrstebo/RestSharpExecuteAsyncMoq.cs
Example for mocking RestSharps IRestClient ExecuteAsync method using Moq
using Moq;
using NUnit.Framework;
using RestSharp;
using System;
using System.Net;
namespace RestsharpTests
{
[TestFixture]
public class RestsharpExecuteAsyncMoq
Backup:
docker exec -t -u postgres your-db-container pg_dumpall -c > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql
Restore:
cat your_dump.sql | docker exec -i your-db-container psql -Upostgres
@Tirael
Tirael / shrug.ahk
Created June 7, 2019 14:36 — forked from dieseltravis/shrug.ahk
autohotkey script to replace 🤷 with ¯\_(ツ)_/¯ (and a few other common unicode art emoji)
; :shrug: ¯\_(ツ)_/¯
:B0:`:shrug::
if (A_EndChar == ":") {
SendInput, {BS 7}¯\_(ツ)_/¯
}
return
; :whatever: ◔_◔
:B0:`:whatever::
@Tirael
Tirael / LTTBD.cs
Created June 7, 2019 12:31 — forked from adrianseeley/LTTBD.cs
Largest-Triangle-Three Bucket Downsampling Graphs in C# (For an Array of Floats) http://i.imgur.com/UwhvV45.png
public float[] Downsample(float[] array, int Length)
{
int insert = 0;
float[] window = new float[Length];
float[] window_x = new float[Length];
int bucket_size_less_start_and_end = Length - 2;
float bucket_size = (float)(array.Length - 2) / bucket_size_less_start_and_end;
int a = 0;
int next_a = 0;