Skip to content

Instantly share code, notes, and snippets.

Avatar

Vasili Novikov vn971

View GitHub Profile
View coursier-tree-example
my-project
├─ com.typesafe.akka:akka-actor_2.11:2.4.17
├─ com.typesafe:config:1.3.0
| ├─ org.scala-lang:scala-library:2.11.8
| └─ org.scala-lang.modules:scala-java8-compat_2.11:0.7.0
| └─ org.scala-lang:scala-library:2.11.7 -> 2.11.8
├─ org.scala-lang:scala-library:2.11.8
└─ org.slf4j:slf4j-api:1.7.16 -> 1.7.21
As a colorized screenshot: https://pointsgame.net/vn971/temp/2017.04.19_13:52:13_42376a2.png
@vn971
vn971 / README.md
Last active Jan 5, 2018 — forked from rantav/README.md
Find slow queries in mongo DB
View README.md

A few show tricks to find slow queries in mongodb

Enable profiling

First, you have to enable profiling

db.setProfilingLevel(1)

Now let it run for a while. It collects the slow queries ( > 100ms) into a capped collections, so queries go in and if it's full, old queries go out, so don't be surprised that it's a moving target...

@vn971
vn971 / hedgewars-chat-notify.sh
Last active Dec 22, 2015
hedgewars-chat-notify.sh (notifies on new CHAT messages in multiplayer mode)
View hedgewars-chat-notify.sh
#!/bin/bash -eu
hedgewars 2>&1 | (
while read -r LINE; do
if [[ "$LINE" == *CHAT* ]]; then
notify-send "$LINE";
echo "$LINE";
fi;
done;
)
View onchange.sh
#!/bin/bash
#
# Watch current directory (recursively) for file changes, and execute
# a command when a file or directory is created, modified or deleted.
#
# Written by: Senko Rasic <senko.rasic@dobarkod.hr>
#
# Requires Linux, bash and inotifywait (from inotify-tools package).
#
# To avoid executing the command multiple times when a sequence of