Skip to content

Instantly share code, notes, and snippets.

@vn971
vn971 / coursier-tree-example
Last active January 19, 2018 15:08
ttl=never
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 January 5, 2018 15:15 — forked from rantav/README.md
Find slow queries in mongo DB

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 December 22, 2015 12:27
hedgewars-chat-notify.sh (notifies on new CHAT messages in multiplayer mode)
#!/bin/bash -eu
hedgewars 2>&1 | (
while read -r LINE; do
if [[ "$LINE" == *CHAT* ]]; then
notify-send "$LINE";
echo "$LINE";
fi;
done;
)
@vn971
vn971 / onchange.sh
Last active March 29, 2016 13:56 — forked from evgenius/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