Skip to content

Instantly share code, notes, and snippets.

View merqlove's full-sized avatar

Alexander Merkulov merqlove

View GitHub Profile
@merqlove
merqlove / README.md
Last active March 19, 2023 23:17
ESIA gost certs

Требования

  1. Алгоритм формирования электронной подписи должен быть RS256 (указывается в настройках ИС на технологическом портале).

Как запустить пример

Для ОС Windows 10 необходимо установить Windows Subsystem for Linux и Ubuntu 18.04 в нём.
Действия выполняются внутри терминала этой ОС.
Для ОС Windows Server 2008 R2 необходимо установить OpenSSL 1.1.1g Win64. А также установить библиотеку gost.dll сборка и настройка по инструкции

@merqlove
merqlove / file_io.rb
Created July 25, 2019 08:35
RUBY Buffered File Reader by Char
class FileIO
def initialize(filename, buffer_size: 50)
@filename = filename
@buffer = ""
@buffer_size = buffer_size
end
def each(&block)
File.open(@filename, 'r') do |f|
f.each_char do |c|
@merqlove
merqlove / multilabel_svm.py
Last active October 26, 2017 07:45
NN SVM SCIKIT-LEARN
#!/usr/bin/env python
import numpy as np
from sklearn.pipeline import Pipeline
from sklearn.datasets import fetch_20newsgroups
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.svm import SVC
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.multiclass import OneVsRestClassifier
@merqlove
merqlove / publisher.ex
Last active July 12, 2017 23:28
Elixir AMQP resilent publisher
defmodule Publisher do
use GenServer
use AMQP
require Logger
@amqp [host: "localhost", port: "5682"]
@reconnect_timeout 5000
def start_link() do
@merqlove
merqlove / pip_uninstall_azure.sh
Created June 2, 2017 12:32
Uninstall package list from pip with grep
pip uninstall $(pip list --format json | jq -r ".[]|.name" | grep ^azure | paste -sd ' ' -) -y
@merqlove
merqlove / mounter.rb
Last active May 27, 2017 07:26
Mount all disks, provide selected filesystem & partition type with Chef, works for Azure & co
#
# Cookbook Name:: some
# Definition:: mounter
#
# Copyright (C) 2017 Alexander Merkulov
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
// This will open up a prompt for text to send to a console session on digital ocean
// Useful for long passwords
(function () {
var t = prompt("Enter text to be sent to console, (This wont send the enter keystroke)").split("");
function f() {
var character = t.shift();
var i=[];
var code = character.charCodeAt();
var needs_shift = "!@#$%^&*()_+{}:\"<>?~|".indexOf(character) !== -1
@merqlove
merqlove / phoenix_ng2.ts
Last active March 6, 2017 14:09
Phoenix provider with Angular2
import {Injectable, OpaqueToken, Inject} from '@angular/core';
import * as PhoenixBase from 'phoenix/web/static/js/phoenix.js';
import {Channel, Socket} from 'phoenix/web/static/js/phoenix.js';
import {Observable} from 'rxjs/Observable';
import {isFunction} from 'lodash';
import {Observer} from 'rxjs/Observer';
import {LoggerService} from './';
export declare class Timer {
callback: any;
@merqlove
merqlove / puma.service
Last active February 2, 2017 15:30
SystemD Puma example
[Unit]
Description=MRCR Sites Puma Server
Requires=redis@6379.service mongod.service
Wants=redis@6379.service mongod.service
After=redis@6379.service mongod.service
[Service]
Type=simple
User=merkulov
PIDFile=/srv/apps/sites_mrcr_ru/shared/tmp/pids/puma.pid
@merqlove
merqlove / demo.liquid
Last active January 29, 2017 12:09
Liquid example
<!DOCTYPE html>
<html lang="en">
<head>
<title>{{ site.name }}</title>
<meta charset="utf-8">
<meta name="format-detection" content="telephone=no" />
<link rel="icon" href="{{ 'favicon.ico' | theme_image_url }}">
<link rel="shortcut icon" href="{{ 'favicon.ico' | theme_image_url }}">
{{ 'style.css' | stylesheet_tag }}
{{ 'jquery.js' | javascript_tag }}