Skip to content

Instantly share code, notes, and snippets.

View ezhov-da's full-sized avatar
🙈
Work

Denis ezhov-da

🙈
Work
View GitHub Profile
@ezhov-da
ezhov-da / ParseRSAKeys.java
Created February 27, 2022 11:07 — forked from destan/ParseRSAKeys.java
Parse RSA public and private key pair from string in Java
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.PKCS8EncodedKeySpec;
@ezhov-da
ezhov-da / Dockerfile
Created October 13, 2021 08:12 — forked from rosskevin/Dockerfile
nginx envsubst escape $
FROM nginx:alpine
# https://thepracticalsysadmin.com/templated-nginx-configuration-with-bash-and-docker/
ENV LISTEN_PORT=80 \
NGINX_ENV=production \
SERVER_NAME=_ \
RESOLVER=8.8.8.8 \
UPSTREAM_API=api:3000 \
UPSTREAM_API_PROTO=http \
WORKDIR=/www \
@ezhov-da
ezhov-da / gist:396bc36d0860bc18ec2d68cd9a4344ff
Created October 9, 2021 20:53 — forked from cjaoude/gist:fd9910626629b53c4d25
Test list of Valid and Invalid Email addresses
Use: for testing against email regex
ref: http://codefool.tumblr.com/post/15288874550/list-of-valid-and-invalid-email-addresses
List of Valid Email Addresses
[email protected]
[email protected]
[email protected]
[email protected]
@ezhov-da
ezhov-da / actor.kt
Created July 26, 2020 20:41 — forked from xsaamiir/actor.kt
KotlinConf 2018 - Kotlin Coroutines in Practice by Roman Elizarov code Code https://youtu.be/a3agLJQ6vt8
const N_WORKERS = 5
class Content
class Location
class Reference {
fun resolveLocation(): Location = TODO()
}
data class LocContent(val location: Location, val content: Content)
@ezhov-da
ezhov-da / Docker connect to remote server.md
Created March 19, 2020 07:55 — forked from kekru/Docker connect to remote server.md
Connect to another host with your docker client, without modifying your local Docker installation

Run commands on remote Docker host

This is how to connect to another host with your docker client, without modifying your local Docker installation or when you don't have a local Docker installation.

Enable Docker Remote API

First be sure to enable the Docker Remote API on the remote host.

This can easily be done with a container.
For HTTP connection use jarkt/docker-remote-api.

@ezhov-da
ezhov-da / pulp_upload.py
Created March 4, 2020 12:26 — forked from nextrevision/pulp_upload.py
Upload RPM to Pulp Repository and Publish
#!/usr/bin/env python
import os
import sys
import requests
import argparse
import json
import time
pulp_user = 'admin'
@ezhov-da
ezhov-da / curl.md
Created November 6, 2019 13:43 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@ezhov-da
ezhov-da / Spring Chained Tx Management.md
Created October 11, 2019 10:57 — forked from anair-it/Spring Chained Tx Management.md
Best efforts 1Phase Commit using Spring chained transaction managemer and Apache Camel

Best efforts 1 Phase commit

This is a non-XA pattern that involves a synchronized single-phase commit of a number of resources. Because the 2PC is not used, it can never be as safe as an XA transaction, but is often good enough if the participants are aware of the compromises. The basic idea is to delay the commit of all resources as late as possible in a transaction so that the only thing that can go wrong is an infrastructure failure (not a business-processing error). Systems that rely on Best Efforts 1PC reason that infrastructure failures are rare enough that they can afford to take the risk in return for higher throughput. If business-processing services are also designed to be idempotent, then little can go wrong in practice.

Scenarios

Consider a jms based service, where there is an inbound Queue manager (QM1), an outbound queue manager (QM2) and a database (DB). Here are the scenarios that I would like to cover using Best efforts 1 PC commit process:

Happy path

  1. Start MQ transaction on QM1 2
@ezhov-da
ezhov-da / GitConfigHttpProxy.md
Created September 18, 2019 05:16 — forked from evantoli/GitConfigHttpProxy.md
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@ezhov-da
ezhov-da / README.md
Created August 6, 2019 05:41 — forked from Beastrock/README.md
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation