Skip to content

Instantly share code, notes, and snippets.

View andrey-skat's full-sized avatar

Andrey Skat andrey-skat

View GitHub Profile
@andrey-skat
andrey-skat / kube.sh
Created May 25, 2018 10:40
Kubernetes install script
sudo swapoff -a
apt-get update
apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository "deb https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") $(lsb_release -cs) stable"
apt-get update && apt-get install -y docker-ce=$(apt-cache madison docker-ce | grep 17.03 | head -1 | awk '{print $3}')
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
# Activate the gem you are reporting the issue against.
gem 'activerecord', '4.2.0'
require 'active_record'
require 'minitest/autorun'
require 'logger'
# Ensure backward compatibility with Minitest 4
Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test)
# This connection will do for database-independent bug reports.
@andrey-skat
andrey-skat / deploy.rb
Last active August 5, 2018 12:03
Local assets precompilation on Rails 4 using Capistrano 3
# also you need to uncomment next line in Capfile
# require 'capistrano/rails/assets'
namespace :deploy do
namespace :assets do
Rake::Task['deploy:assets:precompile'].clear_actions
desc 'Precompile assets locally and upload to servers'
task :precompile do
@andrey-skat
andrey-skat / gist:6408385
Created September 2, 2013 01:05
1 11 21 1211
require 'benchmark'
TIMES = 12
Benchmark.bm do |b|
b.report "mine" do
def next_m(m)
r, prev, sum = "", m[0], 0