Skip to content

Instantly share code, notes, and snippets.


Sergei Silnov kumekay

View GitHub Profile

Create Root Certificate Authority and self-signed certificate for your Home Assistant. Compatible with Chrome browser > version 58 and macOS 10.15 Catalina

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
kumekay /
Last active Mar 19, 2019 — forked from januszm/
Change Ruby minor version in AWS Elastic Beanstalk
# Currently (03.2019) it's not possible to change the Ruby 'minor' version (eg. 2.3 => 2.4) using the web console
# However, it's possible using the 'awscli' tool.
# List of available platforms:
brew install awscli # pip install awscli
aws elasticbeanstalk update-environment \
--solution-stack-name "64bit Amazon Linux 2018.03 v2.9.1 running Ruby 2.6 (Puma)" \
--environment-name "***-dev-web" --region "us-east-1" --profile "***-dev"
kumekay /
Last active Jun 23, 2020 — forked from nerdyworm/
rename a phoenix 1.3 project
set -e
kumekay / parser.ex
Last active Mar 29, 2016 — forked from cromwellryan/parser.ex
JSON Parser in Elixir
View parser.ex
defmodule JSON do
import String
def parse( content ) do
case parse_content(content) do
{ value, "" } -> value
{ _, _ } -> raise "crap"
kumekay /
Last active Jan 13, 2016 — forked from anonymous/
Wget download data in background with cookies

Download large files in background with cookies for auth using wget

Sometimes it is necessary to dowload large files to remote server (for example datasets for Kaggle competitions), but download is available only for authenticated users. You can do it in backround task using cookies from your browser for authentication. This note generally copy wget manual


First you have to create cookies.txt file with copy of all your cookies for required site If you use chrome, this extension is useful


View deploy.rake
#Deploy and rollback on Heroku in staging and production
task :deploy_staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
task :deploy_production => ['deploy:set_production_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
namespace :deploy do
task :staging_migrations => [:set_staging_app, :push, :off, :migrate, :restart, :on, :tag]
task :staging_rollback => [:set_staging_app, :off, :push_previous, :restart, :on]
View gist:c91c8b6e0907f140454b
--Bluetooth for VirtualBox
--delay 5
set question to display dialog "Manage Bluetooth for ... " buttons {"VirtualBox", "Cancel", "Mac OS"} default button "Cancel" cancel button "Cancel" with icon caution with title "Bluetooth" giving up after 30
set answer to button returned of question
if answer is equal to "VirtualBox" then
-- delay 30
View 00-button
# based on
. /lib/
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
do_button () {
local button
View 01. Gemfile
gem 'pg'
group :development do
gem 'ruby-debug'
gem 'rake', '~> 0.8.7'
gem 'devise'
gem 'oa-oauth', :require => 'omniauth/oauth'
gem 'omniauth'
gem 'haml'
gem 'dynamic_form'
View 0.
# Nginx+Unicorn best-practices congifuration guide. Now with SPDY!
# We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies.
# Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module
# Deployment structure
# /etc/init.d/nginx (1. nginx)
# /home/app/public_html/app_production/current (Capistrano directory)