Skip to content

Instantly share code, notes, and snippets.

View yatskevich's full-sized avatar

Ivan Yatskevich yatskevich

  • VictoriaMetrics Inc.
  • Amsterdam, The Netherlands
  • LinkedIn in/yatskevich
View GitHub Profile
@yatskevich
yatskevich / vs-bash-console.bat
Last active February 1, 2023 03:58 — forked from timabell/vs-bash-console.bat
batch script for loading git-bash and the vs tools in the same window
@echo off
%HOMEDRIVE%
cd %HOMEPATH%
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
echo Use full exe names when running under bash, e.g. "msbuild.exe"
echo Loading bash, you may now use git and msbuild in the same console \o/.
"C:\Program Files\Git\bin\sh.exe" --login -i
@yatskevich
yatskevich / gist:bd00e9fcb70cd1e467ff
Last active August 3, 2016 16:23
Service Discovery resources
Theory:
- http://jasonwilder.com/blog/2014/02/04/service-discovery-in-the-cloud/
Practice:
- https://github.com/yatskevich/service-discovery-box
- https://github.com/yatskevich/pingpong
- https://medium.com/@yatskevich/trying-out-consul-with-docker-on-os-x-3193b7ef9f39
@yatskevich
yatskevich / consul-session.sh
Last active June 22, 2018 02:42
Trying out Consul
boot2docker ip
# 192.168.59.103
consul members -rpc-addr=192.168.59.103:8400
# Node Address Status Type Build Protocol
# node4 172.17.0.13:8301 alive client 0.4.1 2
# node2 172.17.0.11:8301 alive server 0.4.1 2
# node3 172.17.0.12:8301 alive server 0.4.1 2
# node1 172.17.0.10:8301 alive server 0.4.1 2
@yatskevich
yatskevich / start-consuls.sh
Created January 17, 2015 12:25
Start 4 instances of Consul with Docker
# run the first server node expecting at least two more nodes to form a Consul cluster
docker run -d --name node1 -h node1 progrium/consul -server -bootstrap-expect 3
# other two nodes will join the first one using its IP (in Docker network)
JOIN_IP="$(docker inspect -f '{{.NetworkSettings.IPAddress}}' node1)"
# run second server node
docker run -d --name node2 -h node2 progrium/consul -server -join $JOIN_IP
# run third server node
@yatskevich
yatskevich / proxy-http-version.conf
Created January 12, 2015 15:32
proxy_http_version set to 1.1
server {
listen 80 default;
server_name your_server.org;
location / {
proxy_http_version 1.1; # this is essential for chunked responses to work
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@yatskevich
yatskevich / basic.conf
Created January 12, 2015 15:29
Basic nginx proxy example
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://localhost:9000;
}
@yatskevich
yatskevich / sbt-logging.scala
Created January 4, 2015 20:26
Redirect legacy loggers to slf4j/logback
import sbt.Keys._
import sbt._
object ApplicationBuild extends Build {
val unifiedLogging = Seq(
"commons-logging" % "commons-logging" % "99-empty",
"log4j" % "log4j" % "99-empty",
"org.slf4j" % "log4j-over-slf4j" % "1.7.9",
// This is correct way to define a resolver for Maven style repository.
resolvers += "version99" at "http://version99.qos.ch/"
@yatskevich
yatskevich / idea-plugins.md
Last active August 29, 2015 14:11
IntelliJ IDEA Plugins

Languages

  • Scala
  • Ruby
  • Markdown
  • NodeJS

Utilities

  • String Manipulation
  • RegexPlugin
  • AceJump
@yatskevich
yatskevich / build.sbt
Created August 14, 2014 12:53
sbt-release zero exit code
import sbtrelease._
import ReleaseStateTransformations._
name := "exit-code"
scalaVersion := "2.10.4"
releaseSettings
ReleaseKeys.releaseProcess := Seq[ReleaseStep](