Skip to content

Instantly share code, notes, and snippets.


Andrew Zakordonets azakordonets

View GitHub Profile
azakordonets / generate_rsa_ssh_keys.go
Last active Jul 28, 2020 — forked from devinodaniel/gist:8f9b8a4f31573f428f29ec0e884e6673
Generate SSH RSA Private/Public Key pair with Golang
View generate_rsa_ssh_keys.go
// This shows an example of how to generate a SSH RSA Private/Public key pair and save it locally
package main
import (
# private token or personal token authentication
import gitlab
gl = gitlab.Gitlab('', private_token='{your_token}')
# make an API request to create the gl.user object. This is mandatory if you
# use the username/password authentication.
result = []
# if you gonna have more then 500 api gateways, then you gonna need to wrap this into the loop and after first 500 you gonna need to pass position parameter to get_rest_apis method
import boto3
client = boto3.client('apigateway')
response = client.get_rest_apis(
print(f"We have {len(response['items'])} api gateways to process")
for apigateway in response['items']:
print(f"Enabling {apigateway['name']} api gateway tracing")
View Get all logs groups subsciption
import boto3
import json
# Create CloudWatchLogs client
cloudwatch_logs = boto3.client('logs')
paginator = cloudwatch_logs.get_paginator('describe_log_groups')
subscription_details = {}
for response in paginator.paginate():
for logGroup in response['logGroups']:
log_group_name = logGroup['logGroupName']
subscription_filters = cloudwatch_logs.describe_subscription_filters(logGroupName = log_group_name)
azakordonets /
Created Aug 20, 2019
Substring string in the piped command from command line
echo "1234567890" | cut -b 1-6
azakordonets /
Created Aug 20, 2019
Substring string in the piped command from command line
echo "1234567890" | cut -b 1-6
azakordonets / Dockerfile
Created Jul 23, 2019
Standalone Pact running in alpine Docker image
View Dockerfile
FROM alpine:3.9
RUN apk --no-cache add ca-certificates wget bash \
&& wget -q -O /etc/apk/keys/ \
&& wget \
&& apk add glibc-2.29-r0.apk
RUN wget \
&& tar xzf pact-1.69.0-linux-x86_64.tar.gz \
&& rm -rf pact-1.69.0-linux-x86_64.tar.gz
azakordonets / dummyXCUITest.swift
Created Apr 25, 2018
This is an example of how to use XCTContext.runActivity method in page object patter for XCUITest. This allows to get nice reports with Allure in the future.
View dummyXCUITest.swift
class LoginPage {
func login(with userName: String, and password: String): SomeOtherPage {
return XCTContext.runActivity("Login as existing user") {
this.enter(userName: userName)
this.enter(password: password)
return new SomeOtherPage(app:;
View arrayExtension.swift
import Foundation
public extension Array {
public func randomItem() -> Element? {
guard self.count > 0 else {
return nil
let index = Int(arc4random_uniform(UInt32(self.count)))
azakordonets /
Last active Apr 2, 2018
World counties details
import json
capitals = json.load(open('capital.json'))
currency = json.load(open('currency.json'))
iso3 = json.load(open('iso3.json'))
names = json.load(open('names.json'))
phone = json.load(open('phone.json'))
countries = {}
You can’t perform that action at this time.