Skip to content

Instantly share code, notes, and snippets.

View nikolaymatrosov's full-sized avatar

Nikolay Matrosov nikolaymatrosov

View GitHub Profile
@nikolaymatrosov
nikolaymatrosov / diagram.py
Created September 26, 2020 13:44
Yandex cloud diagram
from diagrams import Diagram
from diagrams import Group
from diagrams.yc.infrastructure import Compute
from diagrams.yc.serverless import ServerlessFunctions
from diagrams.yc.serverless import ServerlessTriggers
from diagrams.yc.serverless import YMQ
with Diagram("Create Snapshots", show=False, direction="LR", curvestyle="polyline"):
cron = ServerlessTriggers("Cron Trigger")
spawn = ServerlessFunctions("Spawn Function")
package main
import (
"context"
"fmt"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
"time"
)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nikolaymatrosov
nikolaymatrosov / sa.go
Created May 5, 2022 07:20
Yandex Cloud Service Account Go example
package main
import (
"context"
"fmt"
"github.com/yandex-cloud/go-genproto/yandex/cloud/resourcemanager/v1"
"github.com/yandex-cloud/go-sdk"
"github.com/yandex-cloud/go-sdk/iamkey"
)
@nikolaymatrosov
nikolaymatrosov / transfer.cs
Created May 12, 2022 05:52
Yandex Cloud Object Storage Transfer Example
using System;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
using Amazon.S3;
using Amazon.S3.Transfer;
namespace ConsoleApp1
{
static class Program
@nikolaymatrosov
nikolaymatrosov / fluent-bit-config.yaml
Created June 14, 2022 12:56
Fluentbit ConfigMap for Yandex Cloud Logging
apiVersion: v1
kind: ConfigMap
metadata:
name: fluent-bit-config
namespace: logging
labels:
k8s-app: fluent-bit
data:
# Configuration files: server, input, filters and output
# ======================================================
@nikolaymatrosov
nikolaymatrosov / fluent-bit-ds.yaml
Created June 14, 2022 13:42
Fluentbit Deamon Set yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: fluent-bit
namespace: logging
labels:
k8s-app: fluent-bit-logging
version: v1
kubernetes.io/cluster-service: "true"
spec:
@nikolaymatrosov
nikolaymatrosov / serverless.yml
Created June 30, 2022 12:37
API Gateway example
service: bot
frameworkVersion: "3"
provider:
name: yandex-cloud
runtime: golang117
environment:
FOLDER_ID: b1g***
httpApi:
payload: '1.0'