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 / Gruntfile.js
Last active December 22, 2015 01:59
grunt-bower-task issue #66
module.exports = function(grunt) {
grunt.initConfig({
dosmth: {
before: 'logging',
after: 'exiting'
},
bower: {
install: { }
}
@yatskevich
yatskevich / Helpers.scala
Created September 5, 2013 15:42
Normalize GET URLs in Play Framework 2.x
package controllers
import play.api.mvc._
import play.api.mvc.Results._
object Application extends Controller {
def untrail(path: String) = Action {
MovedPermanently("/" + path)
}
@yatskevich
yatskevich / chef.md
Last active December 22, 2015 20:39
Chef + Berkshelf + Vagrant

Install Chef (chef-client, chef-solo, knife)

curl -L https://www.opscode.com/chef/install.sh | sudo bash

Use knife-solo

Use Berkshelf

  • generate application cookbook using Berkshelf
@yatskevich
yatskevich / commands
Last active December 25, 2015 17:39
Configure EC2 instance - ubuntu-precise-12.04-amd64-server-20130411.1 (ami-d0f89fb9)
sudo apt-get update && time sudo apt-get dist-upgrade # http://askubuntu.com/questions/194651/why-use-apt-get-upgrade-instead-of-apt-get-dist-upgrade
# fix locale issues
# http://codetheory.in/fixing-locale-warnings-notices-issues-on-linux-server-or-desktop/
# http://askubuntu.com/questions/162391/how-do-i-fix-my-locale-issue
sudo vim /etc/environment
# and put the following variables into it
> LC_ALL=en_US.UTF-8
> LANG=en_US.UTF-8
@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](
@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
// This is correct way to define a resolver for Maven style repository.
resolvers += "version99" at "http://version99.qos.ch/"
@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",
@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 / 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;