Skip to content

Instantly share code, notes, and snippets.

View Erliz's full-sized avatar
🎮

Stanislav Vetlovskiy Erliz

🎮
View GitHub Profile
@Erliz
Erliz / .bash_profile
Last active March 4, 2017 23:32
Add bash autocomplete for hashicorp vault application
# Path function, write override exist values in path
_vault-patch() {
path=""
if tty -s; then
if [ $# -le 2 ]; then
echo "No arguments specified. Usage:";
echo "vault-patch secret/path field value";
return 1;
fi
text="\"${@:3}\""
@Erliz
Erliz / score.html
Last active December 21, 2016 23:29
Hockey score for #mycom
<html>
<head>
<style>
@import url(https://fonts.googleapis.com/css?family=Iceland);
html, body {
height: 100%;
margin: 0;
}
@Erliz
Erliz / online
Last active August 18, 2016 16:00
ESP
0
@Erliz
Erliz / gist:3dc196632e6e141c172e
Last active March 10, 2016 23:12
Creating search collection for subs
db.Anime.aggregate([{$project:{_id: true, title: true, "externalDbs.titles": true, startDate: true, endDate: true}}, {$unwind: "$externalDbs"}, {$unwind: "$externalDbs.titles"}, {$group: {_id: "$_id", titles: {$addToSet: "$title"}, titles: {$addToSet: "$externalDbs.titles"}}}, {$out: "Search"}])
db.Search.find({$text: {$search: 'ajin'}})
// multiple fields https://docs.mongodb.org/manual/tutorial/create-text-index-on-multiple-fields/
@Erliz
Erliz / Part I
Last active October 2, 2023 10:09
Sample Questions for MongoDB Certified DBA (C100DBA)
http://blog.cloudthat.com/sample-questions-for-mongodb-certified-dba-c100dba-exam/
1. b
2. с
3. a, c
4. a, c // b
5. c, d
6. b // | c
7. d // | b
8. d // | b, c
9. a
@Erliz
Erliz / init.sh
Created February 16, 2016 12:10
m101-hw6.5
mkdir -p data/rs1 data/rs2 data/rs3
mongod --replSet m101 --logpath "1.log" --dbpath data/rs1 --port 27017 --smallfiles --oplogSize 64 --fork
mongod --replSet m101 --logpath "2.log" --dbpath data/rs2 --port 27018 --smallfiles --oplogSize 64 --fork
mongod --replSet m101 --logpath "3.log" --dbpath data/rs3 --port 27019 --smallfiles --oplogSize 64 --fork
mongo --port 27017 << 'EOF'
config = { _id: "m101", members:[
{ _id : 0, host : "localhost:27017"},
{ _id : 1, host : "localhost:27018"},
@Erliz
Erliz / startXDebug.js
Last active January 24, 2016 15:56
startXDebug
function setCookie(name, value, options) {
options = options || {};
var expires = options.expires;
if (typeof expires == "number" && expires) {
var d = new Date();
d.setTime(d.getTime() + expires * 1000);
expires = options.expires = d;
}
@Erliz
Erliz / gist:2eb2a67cd55e0321bc64
Created December 24, 2015 11:41
Curl TTFB Detector
curl -w "Connect time: %{time_connect}\nTime to first byte: %{time_starttransfer}\nTotal time: %{time_total} \n\n" -o /dev/null http://st.torg.imgsmail.ru/freeze/new/js/glued/4a1189cb3ffc6d87d7f8cd1e4cee8161/libs.js
@Erliz
Erliz / Dockerfile
Last active December 11, 2015 20:08
gemini
FROM node
RUN npm install -g gemini
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
chrpath \
libssl-dev \
libxft-dev \
@Erliz
Erliz / btdigg.py
Created November 27, 2015 10:35
Script for btdigg search
#VERSION: 1.30
#AUTHORS: BTDigg team (research@btdigg.org)
# GNU GENERAL PUBLIC LICENSE
# Version 3, 29 June 2007
#
# <http://www.gnu.org/licenses/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by