Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#
# group_by_owner script reads directory (passed as a first agrument),
# finds any Git-repositories in subdirectories,
# parses first the line from `git remote -v` for each repositry,
# moves repository to ~/Projects/<owner>/<repo>
#
# ⚠️ Can work incorrectly for repositories with many "remotes"
# (or without any "remotes").
#
#!/bin/bash
#
# gclone is a wrapper on top of the `git clone` command, it:
# 1. parses the URL
# 2. creates "owner" directory in ~/Projects/
# 3. clones repository into ~/Projects/<owner>/<repo>
#
# Usage:
# gclone git@github.com:chuhlomin/terraform.git
# gclone https://github.com/chuhlomin/terraform.git
@chuhlomin
chuhlomin / nginx-and-certbot-config.md
Created April 18, 2019 13:04 — forked from rkaramandi/nginx-and-certbot-config.md
Running NGINX and CertBot Containers on the Same Host

Running NGINX and CertBot Containers on the Same Host

The Problem

A lot of people run into the problem of running Let's Encrypt's CertBot Tool and an NGINX on the same container host. A big part of this has to do with CertBot needing either port 80 or 443 open for the tool to work as intended. This tends to conflict with NGINX as most people usually use port 80 (HTTP) or 443 (HTTPS) for their reverse proxy. Section 1 outlines how to configure NGINX to get this to work, and Section 2 is the Docker command to run CertBot.

1. NGINX Configuration

I use Docker Compose (docker-compose) for my NGINX server. My docker-compose.yml file looks something like this:

curl --request POST \
--url http://localhost:8080/helloworld.Greeter/SayHello \
--header 'content-type: application/json' \
--data '{"name":"John"}'
envoy_1 | [2018-06-12 18:41:24.490][12][debug][main] source/server/connection_handler_impl.cc:196] [C8] new connection
envoy_1 | [2018-06-12 18:41:24.492][12][debug][http] source/common/http/conn_manager_impl.cc:186] [C8] new stream
envoy_1 | [2018-06-12 18:41:24.493][12][debug][http] source/common/http/conn_manager_impl.cc:452] [C8][S6165410297060250325] request headers complete (end_stream=false):
envoy_1 | [2018-06-12 18:41:24.493][12][debug][http] source/common/http/conn_manager_impl.cc:457] [C8][S6165410297060250325] ':authority':'localhost:8080'
envoy_1 | [2018-06-12 18:41:24.493][12][debug][http] source/common/http/conn_manager_impl.cc:457] [C8][S6165410297060250325] 'user-agent':'curl/7.54.0'
@chuhlomin
chuhlomin / message.txt
Last active December 11, 2017 20:20
Kafka Message Binary Format (Proposed)
XXXX XXXX = 8 bits
1. XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX - baseOffset
XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX
2. XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX - batchLength
3. XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX - partitionLeaderEpoch
4. XXXX XXXX - magic (current magic value is 2)
5. XXXX XXXX XXXX XXXX - attributes
Compression
@chuhlomin
chuhlomin / message.txt
Last active December 11, 2017 20:06
Kafka Message Binary Format
XXXX XXXX = 8 bits
1. XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX - baseOffset
XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX
2. XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX - batchLength
3. XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX - partitionLeaderEpoch
4. XXXX XXXX - magic (current magic value is 2)
5. XXXX XXXX XXXX XXXX - attributes
Compression

Keybase proof

I hereby claim:

  • I am chuhlomin on github.
  • I am chuhlomin (https://keybase.io/chuhlomin) on keybase.
  • I have a public key ASA3cogGNMPLFViVHZbT_uhTtQmtFjcSQvw5DdUk3X5GIAo

To claim this, I am signing this object:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.0.4/redux.js"></script>
<script src="https://fb.me/react-0.14.0.js"></script>
<script src="https://fb.me/react-dom-0.14.0.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-redux/4.0.0/react-redux.js"></script>
<style id="jsbin-css">
приходит ко мне стартап
и говорит что у них есть новый алгоритм, который позволяет "переводить с одного языка на другой без практической потери смысла"
запросил подробностей
команда состоит из одного человека (это нормально)
но в документах написано, цитирую по памяти "разработали новый гематрический алгоритм, усиленный цепями Маркова"
я дернул глазом еще на слове "гематрия"
знаете что это?
гематрия это способ изучения Торы через цифры