Skip to content

Instantly share code, notes, and snippets.


Sergei Silnov kumekay

View GitHub Profile
AveYo / .. MediaCreationTool.bat
Last active Jun 15, 2021
Universal MediaCreationTool wrapper for all MCT Windows 10 versions from 1507 to 21H1 with business (Enterprise) edition support
View .. MediaCreationTool.bat

use download ZIP button or pastebin link to get the script, as saving the Raw file breaks line endings


Dialogs to pick version, then to pick Default (vanilla MCT) and Auto-Upgrade or Create-Media (enhanced)

Enhanced script name args parsing - just rename the script with:
auto MediaCreationTool.bat to auto upgrade 21H1 - unattended, usually straight to desktop
auto update 1909 MediaCreationTool.bat to auto upgrade 1909 with Dynamic Update (latest LCU)
pro auto 20H2 MediaCreationTool.bat to auto upgrade 20H2 and force Professional edition

januszm /
Last active Mar 7, 2021
Change Ruby minor version in AWS Elastic Beanstalk
# Currently (2017/2018) 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.
brew install awscli # pip install awscli
aws elasticbeanstalk update-environment \
--solution-stack-name "64bit Amazon Linux 2017.09 v2.6.1 running Ruby 2.4 (Puma)" \
--environment-name "myappenv1" --region "us-east-2"
# For Amazon Linux 2
aws elasticbeanstalk update-environment \
--solution-stack-name "64bit Amazon Linux 2 v3.2.3 running Ruby 2.7" \
alexanderzobnin /
Last active Feb 10, 2021
Script for searching passwords in Pwned Passwords database from
import os
import hashlib
mypasswords = [
kpheasey /
Last active Oct 17, 2020
WSL, RVM & RubyMine; ubuntu on windows, bash on windows

Add inbound firewall rule for TCP 2222

  • Windows 10 has 2 new services, SSH Server Proxy and SSH Server Broker which will already be bound to port 22
  • Do not allow public connection on this rule, WSL is not proven safe


Add as cmd startup with bash.exe --login

Install the SSH server and some Rails essentials libraries in bash

sudo apt-get update && sudo apt-get upgrade -y
nerdyworm /
Created Jul 30, 2016
rename a phoenix project
set -e
delemach / slackNotify.js
Last active Nov 1, 2018 — forked from turret-io/slackNotify.js
Parse SNS notification from Elastic Beanstalk and publish to Slack channel
View slackNotify.js
var http = require('https');
var querystring = require('querystring');
// set the post request options
var reqOptions = {
hostname: '',
port: 443,
path: '/services/YOUR/SLACK/HOOK_HERE',
method: 'POST'
henrik /
Last active Apr 14, 2021
Deploying Elixir's Phoenix Framework on Dokku.

Deploying Phoenix on Dokku

Worked 2015-09-08 for Phoenix 1.0.1 on Dokku 0.3.25.

These instructions assume you've set up Dokku. If not, go find a tutorial for that part. My notes for setting it up on Digital Ocean.

On your local machine, in the app's repo

Create a Dokku app:

stevedomin / create_post.exs
Last active Apr 3, 2021
Using UUIDs as primary key with Ecto
View create_post.exs
defmodule MyBlog.Repo.Migrations.CreatePost do
use Ecto.Migration
def change do
create table(:posts, primary_key: false) do
add :id, :uuid, primary_key: true
add :body, :string
add :word_count, :integer
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|
View strongswan ikev2 server on ubuntu 14.04
# Basic Strongswan ikev2 server setup
* paltform: ubuntu 14.04 x64
* the commands below are run with root account
## Strongswan
apt-get install strongswan
apt-get install iptables iptables-persistent