Skip to content

Instantly share code, notes, and snippets.

Kir Shatrov kirs

Block or report user

Report or block kirs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View omg.rb
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source ""
git_source(:github) { |repo| "{repo}.git" }
gem "rails", github: "rails/rails"
kirs / dance
Last active Jul 6, 2019
Docker snapshot (CRIU) experiments with Rails app and Redmine
View dance
# The script to run actual benchmark
set -e -x
kirs / notes
Created Jun 24, 2019 — forked from justincormack/notes
criu setup Ubuntu 18.04
View notes
apt update
apt upgrade
apt install build-essential
apt install pkg-config
apt install libnet-dev python-yaml libaio-dev
apt install libprotobuf-dev libprotobuf-c0-dev protobuf-c-compiler protobuf-compiler python-protobuf libnl-3-dev libcap-dev python-future
# criu install
curl -O -sSL
tar xjf criu-3.10.tar.bz2
View measure-aws.rb
require 'bundler/inline'
gemfile do
source ''
gem "aws-sdk", "~> 3.0"
require 'aws-sdk'
ec2 = 'us-east-1')
View measure-gcloud.rb
require 'bundler/inline'
gemfile do
source ''
gem 'google-api-client', '~> 0.11'
require 'google/apis/compute_v1'
Google::Apis.logger =
Google::Apis.logger.level = Logger::INFO
View gist:b2cc6aa66874d68e4137470c98e12537
iter = do |yielder|
yielder.yield "start"
3.times { |n| yielder.yield(n) }
yielder.yield "end"
# iter.each do |n|
# puts n
# end
View gist:79f56d9075dc83a06f5f609cc6b40de2
$ curl -v
* Trying
* Connected to ( port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /etc/ssl/cert.pem
CApath: none
View sigint.rb
require 'active_support/callbacks'
class Job
include ActiveSupport::Callbacks
define_callbacks :perform
set_callback :perform, :after, :save_omg
def perform
kirs /
Created Sep 3, 2017 — forked from csfrancis/
Dump an MRI call stack from gdb
# Updated for Ruby 2.3
string_t = None
def get_rstring(addr):
s = addr.cast(string_t.pointer())
if s['basic']['flags'] & (1 << 13):
return s['as']['heap']['ptr'].string()
return s['as']['ary'].string()
View includes.rb
require 'bundler/setup'
require 'active_support/all'
module Feature
extend ActiveSupport::Concern
included do |base|
puts "#{base} included Feature"
You can’t perform that action at this time.