Skip to content

Instantly share code, notes, and snippets.

View zekefast's full-sized avatar
🇺🇦

Zeke Fast zekefast

🇺🇦
View GitHub Profile
@zekefast
zekefast / spec_helper.rb
Created September 30, 2014 22:36
Output example file during time execution. spec/spec_helper.rb
Rspec.configure do |config|
current_file_path = nil
config.before(:each) do
file_path = example.metadata[:example_group][:file_path]
puts "\n#{file_path}" if file_path != current_file_path
current_file_path = file_path
end
end
@zekefast
zekefast / install-puppet_agent.sh
Last active November 16, 2015 12:13
Enable official puppet repository and install puppet agent on freshly setuped Debian Wheezy systems.
#!/bin/bash
# Before installation read puppet requirements at
# http://docs.puppetlabs.com/puppet/latest/reference/system_requirements.html
#
# Script is based on documentation at follow locations:
# - Links:
# - http://docs.puppetlabs.com/puppet/4.0/reference/install_linux.html
set -e
@zekefast
zekefast / .rvmrc
Last active May 23, 2018 09:01
Tune Ruby garbage collector to improve test speed. This is also lead to enormous memory usage. More information about GC parameters tuning could be found in follow articles: [Chapter 4.2: "Garbage collector performance tuning" in Ruby Enterprise Edition (1.8.7)](http://www.rubyenterpriseedition.com/documentation.html) ["Ruby’s GC Configuration" …
# Allows to run GC less frequently which is significantly speed up specs running.
# Look for more detailed description in follow articles:
# - http://www.rubyenterpriseedition.com/documentation.html (Chapter 4.2: "Garbage collector performance tuning")
# - http://snaprails.tumblr.com/post/241746095/rubys-gc-configuration
# Initial number of heap slots. It also represents the minimum number of slots, at all times (default: 10000)
#export RUBY_HEAP_MIN_SLOTS=1000000 # for Rubies < 2.1
export RUBY_GC_HEAP_INIT_SLOTS=1000000 # for Rubies >= 2.1.0
# The number of new slots to allocate when all initial slots are used (default: 10000)
@zekefast
zekefast / keybase.md
Created August 7, 2018 15:38
keybase.md

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@zekefast
zekefast / install-ansible
Created July 15, 2020 16:51
Install Ansible on Debian system as described in Ansible's documentation https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#installing-ansible-on-debian . Version of Ansible installed using this method usually fresher than the one may find in official's Debian's repositories.
#!/usr/bin/env bash
##
# Ansible installation script.
#
# See for more details: https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#installing-ansible-on-debian
#
# TODO:
# Stop immediately if any external program returns a non-zero exit status.
@zekefast
zekefast / postgresql.conf
Last active December 31, 2022 19:04
PostgreSQL configuration tuning to improve tests performance of database interactions.
# PostgreSQL configuration tuning to improve tests performance of database interactions.
# Look for more detailed description in follow articles:
# - http://rhaas.blogspot.com/2010/06/postgresql-as-in-memory-only-database_24.html
#
# ATTENTION:
# Before appling those settings ensure that you have no important data in your cluster, because those settings
# could cause problems on your production database in case of appliance.
#
# Ensure follow settings have given values.
@zekefast
zekefast / move_postgres_data_to_ram.bash
Last active September 26, 2023 14:37
Move Postgres data_directory to RAM to improve IO speed and test performance. Run as root/sudo.
#!/bin/bash
# It is probably redundant if you set settings mentioned in https://gist.github.com/zekefast/42273658939724ba7c7a .
# But anyway it will not hurt anybody (sure if you are not putting your production database to RAM :)).
#
# Look for more detailed description in follow articles:
# - http://blog.vergiss-blackjack.de/2011/02/run-postgresql-in-a-ram-disk/
#
# ATTENTION:
# DO NOT apply this approach if you store important data in postgresql cluster, because that could cause