Skip to content

Instantly share code, notes, and snippets.

Andrey Novikov Envek

Block or report user

Report or block Envek

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
Envek / Dockerfile
Created Feb 13, 2019
Minimal image to be used as Kubernetes default backend as maintenance page
View Dockerfile
FROM nginx:stable-alpine
COPY default.conf /etc/nginx/conf.d/default.conf
COPY maintenance.html /usr/share/nginx/html/
View .rubocop.yml
TargetRubyVersion: 2.5
Enabled: false
Max: 120
Envek /
Last active Aug 9, 2019
Откат ошибочной команды git push --force

Откат ошибочной команды git push --force

Иногда при работе с несколькими удалёнными репозиториями в git, может произойти страшное: git push --force в не тот remote и/или не в ту ветку.

Такое может случиться, например, если вы используете [Deis], в котором деплой запускается при git push нужного коммита в сборщик, когда при отладке деплоя после очередного git commit --amend по запарке вместо git push deis master --force делается просто git push --force. Упс.

Как результат, последние коммиты коллег безвозвратно потеряны, и вы чувствуете неотвратимость их ярости…

Но это git, а значит всё можно починить!

Envek / rails_time_with_offset_test.rb
Last active Sep 2, 2015
Bug report of incorrect parsing of time when assigning to time attributes.
View rails_time_with_offset_test.rb
# For Ruby on Rails master branch
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
gemfile(true) do
Envek /
Created May 26, 2015
Identity proof for

Keybase proof

I hereby claim:

  • I am Envek on github.
  • I am envek ( on keybase.
  • I have a public key whose fingerprint is 5439 E3DC F03F 4317 524E E679 301A D540 0512 05A2

To claim this, I am signing this object:

Envek /
Last active Aug 12, 2017
Updates A and/or AAAA DNS records in DNS Master provider of Dynamic DNS. Works on Linux and OS X.
usage() {
echo "DNS Master DynDNS update script. Updates A and/or AAAA records with public IPs that you have on your interfaces."
echo "Usage: $0 -h hostname[,hostname…] -u username -p password"
if [ $# -eq 0 ]; then usage; exit 1; fi
Envek / Gemfile
Created Feb 3, 2015
Temporary script to get GLONASS/GPS data from Skuapso PSQL module:
View Gemfile
source ""
gem "pg"
gem "activesupport"
Envek /
Last active Jul 16, 2019
Full list of russian time zones for Ruby on Rails
# Full list of Russian Federation time zones with helper to get this list.
# Place this file in config/initializers/
class ActiveSupport::TimeZone
@country_zones =
def self.country_zones(country_code)
code = country_code.to_s.upcase
@country_zones[code] ||=
TZInfo::Country.get(code) do |tz_id|
Envek / pg_interval_support_4_1.rb
Last active Nov 17, 2017
Enables PostgreSQL interval datatype support (as ActiveSupport::Duration) in Ruby on Rails 4.1 and 4.2
View pg_interval_support_4_1.rb
# Enables PostgreSQL interval datatype support (as ActiveSupport::Duration) in Ruby on Rails 4.1.
# Based on
require 'active_support/duration'
# add a native DB type of :interval
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::NATIVE_DATABASE_TYPES[:interval] = { name: 'interval' }
# add the interval type to the simplified_type list. because this method is a case statement
# we can't inject anything into it, so we create an alias around it so calls to it will call
Envek / ruby_enable_gost.patch
Created Jul 26, 2014
Enable GOST cryptoalgorithms support in Ruby, patch for Rbenv
View ruby_enable_gost.patch
--- ext/openssl/ossl.c
+++ ext/openssl/ossl.c
@@ -1048,6 +1048,7 @@ Init_openssl()
/* CRYPTO_malloc_init(); */
/* ENGINE_load_builtin_engines(); */
+ OPENSSL_config(NULL); /* Makes Ruby respect system OpenSSL config */
You can’t perform that action at this time.