This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# search and replace in files | |
$ sed -i 's/old-word/new-word/g' *.txt | |
# зайти в каждую директорию и обновить ее до указанного бранча | |
$ for f in *; do hg up megaplan-release-101 --cwd $f; done | |
# Скопировать ssh ключ на сервер | |
function sshid() { cat ~/.ssh/id_rsa.pub | ssh $1 "cat - >> ~/.ssh/authorized_keys.test"; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[program:nsqlookupd] | |
command=/usr/local/nsq/bin/nsqlookupd --http-address="10.36.206.254:4161" --tcp-address="10.36.206.254:4160" | |
process_name=%(program_name)s | |
numprocs=1 | |
directory=/usr/local/nsq | |
user=ubuntu | |
stdout_logfile=/var/log/nsq/nsqlookupd.log | |
stdout_logfile_maxbytes=50MB | |
stdout_logfile_backups=5 | |
redirect_stderr=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
gocd-server: | |
image: unibet/gocd-server | |
ports: | |
- 8153:8153 | |
- 8154:8154 | |
volumes: | |
- ./go-data/etc:/etc/go | |
- ./go-data/lib:/var/lib/go-server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SHELL:=/bin/bash | |
vpn_address ?= $(shell ip route get 1 | awk '{print $$NF;exit}') | |
username ?= "vpn-user-$(shell hostname)" | |
default: | |
make install-docker | |
make init-config | |
make run-server | |
make new-client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object FutureHelpers { | |
def collectWhile[A, B](in: Seq[Future[A]])(pf: PartialFunction[A, B])(implicit ec: ExecutionContext): Future[Seq[B]] = | |
collectWhileImpl(in, pf, Seq.newBuilder[B]).map(_.result()) | |
private def collectWhileImpl[A, B](in: Seq[Future[A]], pf: PartialFunction[A, B], buffer: mutable.Builder[B, Seq[B]])(implicit ec: ExecutionContext): Future[mutable.Builder[B, Seq[B]]] = | |
if (in.isEmpty) { | |
Future.successful(buffer) | |
} else { | |
in.head flatMap { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
monitoring: | |
alerts: | |
RPS: | |
prometheus: sum(rate(ws_requests_latency_seconds_count{app="services/front-office-service"}[5m])) | |
warn if more: 200 | |
crit if more: 500 | |
Requests latency: | |
prometheus: histogram_quantile(0.95, sum(rate(ws_requests_latency_seconds_bucket[1m]{app="services/front-office-service"})) by (le, app)) | |
warn if more: 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.language.higherKinds | |
import akka.actor.ActorSystem | |
import scala.collection.generic.CanBuildFrom | |
import scala.collection.mutable | |
import scala.concurrent.duration._ | |
import scala.concurrent.{ExecutionContext, Future, Promise, TimeoutException} | |
import scala.util.{Failure, Success} | |
import eu.inn.util.ConfigComponent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Нахождение кратчайшего пути между двумя произвольными вершинами в графе | |
* http://ru.wikipedia.org/wiki/Алгоритм_Дейкстры | |
*/ | |
class Dijkstra | |
{ | |
private $_graph = array(); | |
private $_nodes = array(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ZSH=$HOME/.oh-my-zsh | |
ZSH_THEME="robbyrussell" | |
plugins=(osx brew git sbt bower) | |
source $ZSH/oh-my-zsh.sh | |
PROMPT='%{$fg[yellow]%}➤%{$fg_bold[green]%}%p %{$fg[cyan]%}%c $ % %{$reset_color%}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: install supervisord | |
apt: pkg=supervisor state=present | |
- name: add nsq group | |
group: name=nsq | |
- name: add nsq user | |
user: name=nsq group=nsq |
NewerOlder