Skip to content

Instantly share code, notes, and snippets.

View ciudilo's full-sized avatar
☺️

Kiril Piskunov ciudilo

☺️
View GitHub Profile
@ciudilo
ciudilo / kafka-service-script
Created June 18, 2019 17:10 — forked from mottyc/kafka-service-script
Kafka service script (copy to file: /etc/init.d/kafka)
#! /bin/sh
# /etc/init.d/kafka: start the kafka daemon.
# chkconfig: - 80 20
# description: kafka
KAFKA_HOME=/usr/share/kafka
KAFKA_USER=root
KAFKA_SCRIPT=$KAFKA_HOME/bin/kafka-server-start.sh
KAFKA_CONFIG=$KAFKA_HOME/config/server.properties
### Keybase proof
I hereby claim:
* I am ciudilo on github.
* I am kiril (https://keybase.io/kiril) on keybase.
* I have a public key whose fingerprint is 0485 9D57 86F4 7314 BCCE BD37 598A 6CEF A674 415D
To claim this, I am signing this object:
//this is what you have
{
"_id" : ObjectId("5acf6394daa25f538ced0bdc"),
"values" : [
"PASSAGE",
29.8,
27.5,
30.14,
NumberInt(0),
function checkDatabase(dbName) {
var database = db.getSisterDB(dbName);
database.getCollectionNames().forEach(function(colName){checkCollection(database, colName)});
};
function checkCollection(database, colName) {
database.getCollection(colName).getIndexes().forEach(function(indexDoc){
if(indexDoc.unique) {
if (Object.keys(indexDoc.key).length > 1) {
printjson("Cannot check compound indexe for uniqness. Sorry...");
connecting to: test
Mongo-Hacker 0.0.14
kiril-mbp(mongod-3.6.1 )[PRIMARY:rs1] test> show collections
arrays → 0.000MB / 0.016MB
compound → 1747.519MB / 578.426MB
fs.chunks → 0.352MB / 0.348MB
fs.files → 0.000MB / 0.016MB
hash → 0.000MB / 0.031MB
movies → 0.000MB / 0.035MB
/*
* Auto-tuning delete that allows for removal of large amounts of data
* without impacting performance. Configurable to a target load amount.
*
* How it works:
* TL;DR: Delete a small slice every second; Vary the size of each slice
* based on how long the previous delete took; sleep; repeat.
*
* Intuition: If target is 100ms but delete took 50ms then
* we'd like to double the window size.
@ciudilo
ciudilo / mongodb_ssl_with_letsencrypt.md
Created May 13, 2016 23:15 — forked from leommoore/mongodb_ssl_with_letsencrypt.md
MongoDB 3.2.x SSL with Letsencrypt

#MongoDB 3.2.x SSL with Letsencrypt Letsencrypt is an initative which aims to increase the use of encryption for websites. It basically allows people to apply for free certificates provided that they prove the they control the requested domain. We will look at the what is needed to secure your MongoDB installation. For more details on setting up a MongoDB server see MongoDB 3.2.x.

##Set the hostname We sould to set the hostname to match the name of the certificate we are going to optain.

sudo hostname mongo0.example.com

Then update the hostname file to set the server name permanently.

### Keybase proof
I hereby claim:
* I am ciudilo on github.
* I am kiril (https://keybase.io/kiril) on keybase.
* I have a public key whose fingerprint is F879 F251 858B 37E4 B4BF 0BDE 14AD AB05 9F01 A396
To claim this, I am signing this object:
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"/>
<script src="http://cmx.io/v/0.1/cmx.js"></script>
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style>
<body>
<div style="max-width:900px; -webkit-transform:rotate(0deg);">
<scene id="scene1">
<label t="translate(0,346)">