Skip to content

Instantly share code, notes, and snippets.

View rashkur's full-sized avatar
:octocat:

Roman S rashkur

:octocat:
View GitHub Profile
@rashkur
rashkur / mongodb_collection_sizes.js
Last active October 7, 2016 16:20 — forked from joeyAghion/mongodb_collection_sizes.js
List mongodb collections in descending order of size. Helpful for finding largest collections. First number is "size," second is "storageSize."
function getReadableFileSizeString(fileSizeInBytes) {
var i = -1;
var byteUnits = [' kB', ' MB', ' GB', ' TB', 'PB', 'EB', 'ZB', 'YB'];
do {
fileSizeInBytes = fileSizeInBytes / 1024;
i++;
} while (fileSizeInBytes > 1024);
return Math.max(fileSizeInBytes, 0.1).toFixed(1) + byteUnits[i];
@rashkur
rashkur / keybase.md
Last active May 12, 2017 02:14
keybase.md

Keybase proof

I hereby claim:

  • I am rashkur on github.
  • I am rashkur (https://keybase.io/rashkur) on keybase.
  • I have a public key ASDuU7_KlnHUUJeCdNA4fXxsdPavMZnzZSy5YiwdwqWexAo

To claim this, I am signing this object:

zend_extension=/usr/lib64/php/modules/xdebug.so
xdebug.trace_enable_trigger=1
xdebug.trace_output_dir=/var/traces
xdebug.collect_params=4
xdebug.overload_var_dump=0
xdebug.profiler_enable_trigger=1
xdebug.profiler_output_dir=/var/profiles
zend_extension=/usr/lib64/php/modules/xdebug.so
xdebug.trace_enable_trigger=1
xdebug.trace_output_dir=/var/traces
xdebug.collect_params=4
xdebug.overload_var_dump=0
xdebug.profiler_enable_trigger=1
xdebug.profiler_output_dir=/var/profiles
mkdir /var/{traces,profiles}
@rashkur
rashkur / as.bash
Last active December 19, 2019 10:47
Autonomous system (ASN) lookup
#!/usr/bin/expect
#"AS61119,AS60863,AS51286,AS49988,AS49797,AS47764,AS21051,AS206494,AS47764":"mailru,odnoklassniki", "AS47541,AS47542,AS28709":"vkontakte", "AS43247,AS207207,AS202611,AS13238":"yandex"
set timeout 60
log_user 0
spawn telnet route-server.he.net
foreach as {61119 60863 51286 49988 49797 47764 21051 206494 47764 47541 47542 28709 43247 207207 202611 13238 1} {
expect {
"route-server> " {
@rashkur
rashkur / 1.json
Created March 10, 2018 00:08
java jakson json read subnodes
{
"address" : { "street" : "2940 5th Ave", "zip" : 980021 },
"dimensions" : [ 10.0, 20.0, 15.0 ]
}
@rashkur
rashkur / word_country_data.sql
Created March 28, 2018 08:48 — forked from jaconza/word_country_data.sql
MySQL script for creation and population of country, city and countryLanguage tables with the most popular cities and countries already inserted.
-- MySQL dump 10.13 Distrib 5.1.51, for pc-linux-gnu (i686)
--
-- Host: 127.0.0.1 Database: world
-- ------------------------------------------------------
-- Server version 5.1.51-debug-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
@rashkur
rashkur / golang-tls.md
Created March 29, 2018 18:37 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@rashkur
rashkur / SimpleHTTPServerWithUpload.py
Created April 2, 2018 08:22 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
@rashkur
rashkur / limitConcurrentGoroutines.go
Created October 5, 2018 12:07 — forked from AntoineAugusti/limitConcurrentGoroutines.go
Limit the maximum number of goroutines running at the same time
package main
import (
"flag"
"fmt"
"time"
)
// Fake a long and difficult work.
func DoWork() {