This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
from argparse import ArgumentParser | |
from concurrent.futures import ThreadPoolExecutor, as_completed | |
from ipaddress import ip_network | |
from multiprocessing import cpu_count | |
from socket import AF_INET, SOCK_STREAM, socket | |
from time import time | |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "eks_cluster_name" {} | |
provider "aws" {} | |
data "aws_eks_cluster" "this" { | |
name = var.eks_cluster_name | |
} | |
# https://www.terraform.io/docs/providers/aws/r/iam_openid_connect_provider.html | |
resource "aws_iam_openid_connect_provider" "this" { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "eks_cluster_name" {} | |
provider "aws" {} | |
data "aws_eks_cluster" "this" { | |
name = "${var.eks_cluster_name}" | |
} | |
# https://www.terraform.io/docs/providers/aws/r/iam_openid_connect_provider.html | |
resource "aws_iam_openid_connect_provider" "this" { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[test] | |
fn iter_demo() { | |
let v1 = vec![1, 2, 3]; | |
let mut v1_iter = v1.iter(); | |
// iter() returns an iterator of slices. | |
assert_eq!(v1_iter.next(), Some(&1)); | |
assert_eq!(v1_iter.next(), Some(&2)); | |
assert_eq!(v1_iter.next(), Some(&3)); | |
assert_eq!(v1_iter.next(), None); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from json import load, loads | |
from jinja2 import Template | |
template = """data "aws_iam_policy_document" "{{ bucket }}" { | |
{%- for st in statement %} | |
statement { | |
sid = "{{ st.Sid }}" | |
effect = "{{ st.Effect }}" | |
actions = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
buckets=($(aws --region us-east-1 s3api list-buckets --output text --query 'Buckets[].Name')) | |
echo "bucket name,size(Bytes)" > buckets_storage.csv | |
for bucket in "${buckets[@]}"; do | |
size=$(aws cloudwatch get-metric-statistics \ | |
--region us-east-1 \ | |
--metric-name BucketSizeBytes \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# put the list of branches here | |
branches=( | |
branch1 | |
branch1 | |
) | |
prefix=rkh | |
author=Ruslan |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thu Sep 12 22:24:56 UTC 2019 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace student | |
{ | |
public class Student : IComparer<Student>, IComparable<Student> | |
{ | |
private string name; | |
private string lastname; | |
private short year; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void RemoveStudent(string name, string lastname) | |
{ | |
string _name = Student.FirstCapital(name); | |
string _lastname = Student.FirstCapital(lastname); | |
int index = 0; | |
foreach (Student student in Items) | |
{ |
NewerOlder