Skip to content

Instantly share code, notes, and snippets.

Avatar
🦀

Sergei Silnov kumekay

🦀
View GitHub Profile
@AveYo
AveYo / .. MediaCreationTool.bat ..md
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 ..md

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

Preview

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
januszm / change_eb_ruby_version.sh
Last active Mar 7, 2021
Change Ruby minor version in AWS Elastic Beanstalk
View change_eb_ruby_version.sh
# 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
alexanderzobnin / pwned-pass-fast.py
Last active Feb 10, 2021
Script for searching passwords in Pwned Passwords database from haveibeenpwned.com
View pwned-pass-fast.py
#!/usr/bin/python
import os
import hashlib
mypasswords = [
"doors",
"d00rs",
"Morrison",
"Hotel"
@kpheasey
kpheasey / setup.md
Last active Oct 17, 2020
WSL, RVM & RubyMine; ubuntu on windows, bash on windows
View setup.md

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

ConEmu

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
nerdyworm / rename.sh
Created Jul 30, 2016
rename a phoenix project
View rename.sh
#!/bin/bash
set -e
CURRENT_NAME="CurentName"
CURRENT_OTP="current_name"
NEW_NAME="NewName"
NEW_OTP="new_name"
@delemach
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: 'hooks.slack.com',
port: 443,
path: '/services/YOUR/SLACK/HOOK_HERE',
method: 'POST'
};
@henrik
henrik / deploying_phoenix_on_dokku.md
Last active Apr 14, 2021
Deploying Elixir's Phoenix Framework on Dokku.
View deploying_phoenix_on_dokku.md

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
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
timestamps
@Envek
Envek / timezones.ru.rb
Last active Jul 16, 2019
Full list of russian time zones for Ruby on Rails
View timezones.ru.rb
# Full list of Russian Federation time zones with helper to get this list.
# Place this file in config/initializers/timezones.ru.rb
class ActiveSupport::TimeZone
@country_zones = ThreadSafe::Cache.new
def self.country_zones(country_code)
code = country_code.to_s.upcase
@country_zones[code] ||=
TZInfo::Country.get(code).zone_identifiers.select do |tz_id|
View strongswan ikev2 server on ubuntu 14.04
# Basic Strongswan ikev2 server setup
* paltform: atlantic.net ubuntu 14.04 x64
* the commands below are run with root account
## Strongswan
```
apt-get install strongswan
apt-get install iptables iptables-persistent
```