Skip to content

Instantly share code, notes, and snippets.

View rashkur's full-sized avatar
:octocat:

Roman S rashkur

:octocat:
View GitHub Profile
-- Хаос во всей инфраструктуре Майл Ру (вспомнить только колхоз при правке зон и мониторинга. мониторинг - отдельная грустная песня)
-- Монотонный неавтоматизированный труд. Большинство операций делается вручную или какими-то скриптами, которые каждый админ сам себе пишет. Даже нет интерфейсов для заведения админов. Это следствие следующего пункта
-- Расхождение интересов эксплуатации с интересами программистов:они работают чтобы сдать побольше тасков, реализующих новую бизнес-логику и ляпают нежизнеспособный код, который помимо плачевной стабильности ещё и в рабочем состоянии управляется инструментальным образом. Это выглядит, как если бы каналы на телевизоре можно было бы переключать только перемкнув отвёрткой нужные контакты под кожухом вместо удалённого управления пультом. Контакты тоже нужно знать или спрашивать у коллег, потому что документация неполна или отсутствует. Мы работаем, чтобы его эксплуатировать, нам выгоднее, чтобы он был стабильным и легко управляемым.
-- Непродвижение интересов руководств
$def[1] .= "".
# incoming
"DEF:inbytes=$RRDFILE[1]:$DS[1]:MAX ".
"CDEF:intraffic=inbytes,$unit_multiplier,* ".
"CDEF:inmb=intraffic,1048576,/ ".
"VDEF:consumed=intraffic,TOTAL ".
"AREA:inmb#00e060:\"in \" ".
"GPRINT:intraffic:LAST:\"%7.1lf %s$unit/s last\" ".
"GPRINT:intraffic:AVERAGE:\"%7.1lf %s$unit/s avg\" ".
"GPRINT:intraffic:MAX:\"%7.1lf %s$unit/s max\\n\" ".
@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];
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 / 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() {
#!/usr/bin/env python3
import asyncio
import socket
async def handle_echo(reader, writer):
addr = writer.get_extra_info('peername')
while True:
data = await reader.read(4096)