Skip to content

Instantly share code, notes, and snippets.

View ilyash-b's full-sized avatar
😄
Working on Next Generation Shell

Ilya Sher ilyash-b

😄
Working on Next Generation Shell
View GitHub Profile

Keybase proof

I hereby claim:

  • I am ilyash-b on github.
  • I am ilyash (https://keybase.io/ilyash) on keybase.
  • I have a public key ASDDysA6bcqbdBNtdDORxY6hS9QhJxk6cKVzeY6e5KaW0go

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am ilyash-b on github.
  • I am ilyash (https://keybase.io/ilyash) on keybase.
  • I have a public key ASDDysA6bcqbdBNtdDORxY6hS9QhJxk6cKVzeY6e5KaW0go

To claim this, I am signing this object:

@ilyash-b
ilyash-b / aws-tags.txt
Created May 25, 2018 06:58
AWS tags operations
# Format: API-commands-for-manipulating-tags SPACE services,with,that,set,of,operations
# In the end of the file there is a script that generated the output
AddTags-DeleteTags-DescribeTags machinelearning
AddTags-DeleteTags-ListTags sagemaker
AddTags-DescribeTags-RemoveTags elb,elbv2
AddTags-ListTags-RemoveTags cloudtrail,es
AddTags-RemoveTags emr,datapipeline
AddTagsToCertificate-ListTagsForCertificate-RemoveTagsFromCertificate acm
AddTagsToOnPremisesInstances-RemoveTagsFromOnPremisesInstances codedeploy
@ilyash-b
ilyash-b / find-key.elv
Last active November 15, 2018 07:29
find key at any level of a tree and collect the associated value
# By zzamboni
fn find-key [tree key]{
if (eq (kind-of $tree) map) {
keys $tree | each [k]{
if (eq $k $key) {
put $tree[$k]
} else {
find-key $tree[$k]
}
}
@ilyash-b
ilyash-b / trello-tag.ngs
Last active January 11, 2021 15:25
[trello] Add prefix to all cards on personal board in given list
#!/usr/bin/env ngs
F main(list_name:Str) {
AUTH = "?key=${ENV.TRELLO_API_KEY}&token=${ENV.TRELLO_API_TOKEN}"
board = ``curl -s "https://api.trello.com/1/members/me/boards${AUTH}"``.the_one({"name": /personal/})
list = ``curl -s "https://api.trello.com/1/boards/${board.id}/lists${AUTH}&cards=open"``.the_one({"name": list_name})
tag = list.name.split(' ')[0]
pfx = "[${tag}] "
list.cards.reject({'name': Pfx('[')}).each(F(card) {
echo("${card.name} -> ${pfx}${card.name}")
@ilyash-b
ilyash-b / gist:037583905ae2be333c990cd22f47ee75
Created April 14, 2019 07:28
brew install -s -d ~/Downloads/ngs.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FromPathLoader): loading /Users/ilya/Downloads/ngs.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/awk.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/bdw-gc.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/libatomic_ops.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/pkg-config.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/cmake.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew
@ilyash-b
ilyash-b / ngs.rb
Created April 26, 2019 19:50
WIP brew packaging
class Ngs < Formula
desc "Next Generation Shell"
homepage "https://ngs-lang.org"
# url "https://github.com/ngs-lang/ngs/archive/v0.2.6.tar.gz"
url "https://github.com/ngs-lang/ngs/archive/69d761c84f45072e439e31b8cd70271e0862d406.tar.gz"
version "0.2.7-alpha"
# sha256 "22b8c371dcb6d55d0ff4f227b66523cdb07a15ff8ede72ff05cc9c478e67f1ca"
depends_on "bdw-gc" => :build
depends_on "cmake" => :build
depends_on "gnu-sed" => :build
#!/usr/bin/env ngs
# This script is rough translation of https://gist.github.com/shokoe/e7b4d80b63ea5931ba23bcad1c7684d4
# The translation was made as part of thinking about scripting by both parties: @shokoe, @ilyash-b
# Syntax: ec2_kamino.ngs <source instance 'Name' tag> [target new instance 'Name' tag].
# If target name is not given <source name>-clone is used.
# Description: Builds a temporary template from a given instance and runs the latest found ami from that template.
# New instance settings can be overriden by OVERRIDES.
# AMI selection is filtered by AMI_SELECT_TAGS.
#!/usr/bin/env ngs
# This script is rough translation of https://gist.github.com/shokoe/e7b4d80b63ea5931ba23bcad1c7684d4
# The translation was made as part of thinking about scripting by both parties: @shokoe, @ilyash-b
# The script was changed to match @ilyash-b's environment
# Starts new instance with same settings as given instances from backup AMI of the given instance
# Syntax: ec2_kamino.ngs <ENV> <ROLE>
# Syntax: ec2_kamino.ngs <INSTNACE_ID>
# If ENV and ROLE are given, finds the latest instance which has backup AMI
@ilyash-b
ilyash-b / gist:d7f03561235941f59d3eec921b06346f
Created March 5, 2020 15:03
Converge to iptables rules given in CSV files
#!/usr/bin/env ngs
# Turn rules parsing debugging with "DEBUG=rules" environment variable setting
COMMENT_PREFIX = 'aws-migration-'
INT_NUMBER_REGEX = /^[0-9]+$/
F is_ip(x:Str) {
octets = x.split('.')