понедельник, 13 мая 2024 г.

Bash script for bashrc to user AWS CLI to connect to EC2 (standalone or K8s) over Session Menager from the terminal

 

0) Add to ~/.bashrc

function get-instance-id-by-private-dns-name () {
    aws ec2 describe-instances -- filters "Name=private-dns-name, Values=$1" -- query 'Reservations [] . Instances [] . InstanceId' -- output text
}

function connect-to-ec2-instance () {
    aws ssm start-session -- target $1
}

function connect-to-k8s-node () {
    instance_id=$(get-instance-id-by-private-dns-name $1)
    if [ -z "$instance id" ]; then
        echo "Could not find instance with name $1"
        return 1
    fi
        echo "Instance ID: $instance_id"
        connect-to-ec2-instance $instance_id
}

1) Export AWS Keys to ENV

2) Get the nodes
$ kubectl get nodes
NAME
ip-10-10-10-20.ec2.internal
ip-10-10-10-21.ec2.internal

3) Connect to a node
$ connect-to-k8s-node ip-10-10-10-20.ec2.internal

sh-4.4$

понедельник, 30 октября 2023 г.

Feature Flagging - Implementation Design - Detailed


Introduction and Overview

Feature flagging is needed to decouple the deployment of code from the release of features. This allows teams to deploy code more frequently without having to release new features to all users at once. This can be beneficial for a number of reasons:

  • Reduced risk: Feature flagging allows teams to test new features in production with a small subset of users before releasing them to all users. This can help to reduce the risk of deploying new features that have bugs or other problems.
  • Faster innovation: Feature flagging allows teams to release new features more quickly without having to wait for the entire development cycle to be completed. This can help teams to stay ahead of the competition and meet the needs of their users more quickly.
  • Improved user experience: Feature flagging allows teams to target new features to specific groups of users. This can help to improve the user experience by ensuring that users only see features that are relevant to them.

Feature Flagging - Implementation Design

 

Projects:

Projects represent the different products or applications that your team is developing.
Each project has a unique identifier.

Environments:

Environments represent the different stages of your development lifecycle, such as development, staging, and production.
Each environment has a unique token.

Features:

Features represent the different functionalities that your team is developing or has already developed.
Each feature has a unique identifier.

Usage:

  1. Developers need to create a feature flag for each new feature that they are developing.
  2. When creating a feature flag, developers need to specify the following:
    • The name of the feature
    • The description of the feature
    • The environment(s) where the feature will be available
    • The default state of the feature (enabled/disabled)
  3. Once a feature flag is created, developers can start using it in their code.
  4. To use a feature flag, developers need to check the state of the flag before executing the code that implements the feature.
  5. If the feature flag is enabled, the code will be executed.
  6. If the feature flag is disabled, the code will be skipped.

среда, 25 октября 2023 г.

IT Job Search - Recruiter's Questions

 
Examples....

Questions from recruiters:

- Where are you located?

Los Angeles

- Where is Moldo is located ?

Los Angeles

- How many years you have in AWS/GCP/Python?

вторник, 17 октября 2023 г.

Flagsmith - Setup - Feature Flagging Solution

Flagsmith makes it easy to create and manage features flags across web, mobile, and server side applications. Just wrap a section of code with a flag, and then use Flagsmith to toggle that feature on or off for different Environments, Users or user Segments 

 

*For Windows 11 with WSL enabled.

Install Docker

Download link 

Keep in mind to enable WSL when installing Docker

Setup Flagsmith Server

git clone https://github.com/Flagsmith/flagsmith

cd flagsmith

docker compose up -d

Open Flagsmith UI Console in the browser to log in for the first time: http://localhost:8000/singup

 

Install NodeJS

sudo apt install curl

curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash 

source ~/.bashrc

nvm ls-remote

nvm install 18.18.2 (put the version you need)

npm install flagsmith

npm install xhr2

пятница, 13 октября 2023 г.

Enable WSL on Window 11


Windows Subsystem for Linux is a feature of Windows that allows developers to run a Linux environment without the need for a separate virtual machine or dual booting


Run in PowerShell

wsl --install -d Ubuntu
wsl --update

in case you run into troubles when reinstalling run:
wsl --unregister ubuntu

Unlesh - Setup - Feature Flagging Solution

 

Unleash is an Open source feature flagging solution with built-in javascript which can help you create and manage feature toggles using REST API's.

*For Windows 11 with WSL enabled.

Install Docker

Download link 

Keep in mind to enable WSL when installing Docker

Setup Unleash Server

git clone https://github.com/Unleash/unleash-docker.git

cd unleash-docker

docker compose up -d

Open Unleash UI Console in the browser: http://localhost:4242/

default credentials: admin unleash4all

четверг, 2 февраля 2023 г.

Python Interview Questions



Most frequently asked questions

Data Types in Python

Text Type:str
Numeric Types:intfloatcomplex
Sequence Types:listtuplerange
Mapping Type:dict
Set Types:setfrozenset
Boolean Type:bool
Binary Types:bytesbytearraymemoryview
None Type:NoneType

воскресенье, 22 января 2023 г.

H1B Scan - How to find H1B visa sponsoship companies

 

We're looking for H1B opportunities.
The information below is to help you find right resources and info to achieve your goal.

 The H-1B is a temporary (nonimmigrant) visa category that allows employers to petition for highly educated foreign professionals to work in “specialty occupations” that require at least a bachelor's degree or the equivalent

понедельник, 16 января 2023 г.

QA Automation Interview Questions

 

Most common interview questions.
Those are provided as reference, and are subjective.

Introduce Yourself

I have 7 years of experience in manual and automation testing
Worked with Ubuntu, CentOS, MacOS, Windows 
Experienced in  Clouds: Amazon, Google, Azure

I have strong experience in: 
- automation, regression, functional, smoke testing; 
- write test cases, bug reports. 

I used:
- RobotFramework
- Selenium
- PhantomJS

Experienced in coding:
- Python
- JavaScript, 
- Typescript

Worked with Databases:
- MySQL, Postgres, MS SQL 

I'm good in scripting:
- Bash, PowerShell

Worked:
- Jenkins (including Groovy coding)
- Rundeck
- Grafana

How to get an IT Job - Europe, USA, but not limited...

 


Digest how to get an IT Job in USA, Europe.
We're covering QA, DevOps positions.
To get a job with work authorization will be way easier

RATES

QA rates in USA:
- Manual Testing - $30 - $50/h gross
- Automation Testing - $50 - $85/h gross

DevOps rates in USA:
- DevOps - $50 - $80/h gross
- Sr. DevOps - $80 - $110/h gross

*August 2022

Rates in Europe are usually twice less

воскресенье, 24 июля 2022 г.

Canon MFU Scan over Yandex SMTP

 


Setup your Yandex mail account:

part1:
1. Account > Account Profile
2. Пароли и авторизация > Пароли приложений
3. Создать новый пароль

this link will help

part2:
1. Email Setings (the Gear Icon at top right) >  All settings
2. Enable "С сервера imap.yandex.ru по протоколу IMAP"
3. Enable "Пароли приложений и OAuth-токены"

Setup your Scanner:

1. Find you MFU IP and open it in Browser
2. 
You'll need "System Manager Mode" and PIN you setup when first started (or some default one - google it
3. Settings > TX Settings > Email Settings > Edit
4. SMTP Server: smtp.yandex.ru
5. E-Mail Address: <youremail@yandex.ru>
6. Enable "
Use SMTP Authentication (SMTP AUTH)"
    and enter your password you generated in part1
7. Enable "Use TLS for SMTP"
8. Ok

Try it.



воскресенье, 13 марта 2022 г.

DevOps Tools

 

  1. Windows 11
  2. WSL
  3. VS Code
  4. git (in WSL)
  5. LightShot
  6. Remote Desktop Manager
  7. 2Fast (from Microsoft Store)
  8. AWS CLI (in WSL)
  9. Terraform (in WSL)
  10. DataGrip
  11. Insomnia
  12. PyCharm

вторник, 15 февраля 2022 г.

DevOps Speech

 

An example of DevOps Speech

Well,

I am 13 years in IT.

For the last 7 years in Cloud Engineering, DevOps, Automations

I worked with major cloud providers: AWS, GCP, Azure

I worked on projects like:

- Build infrastructure from scratch, Design, Implementation, Maintenance

- Migration from on-prep to cloud

On building infrastructure I used Infrastructure as Code with Terraform - writing modules, upgrading, importing, troubleshooting, pipeline integrations.

Used Ansible as configuration management tool

On CICD Part I used Jenkins with Groovy - Pipeline as a code.

Worked with Kubernetes - deployed EKS, ECS, GKE clusters with Terraform.

Built pipelines to delivery the code to Kubernetes, deploying new services and updating existing microservices.

On SRE part I setup monitoring with Datadog, deployed and setup Elastic Stack, Grafana, Prometheus.

I do coding on daily basis on Python, Bash, PowerShell - automating processes

That's it shortly.

понедельник, 14 февраля 2022 г.

Git






Objective: Get Basic knowledge of Git

Tasks: https://github.com/kuchuksv/techmaster/tree/main/basic

Theory + Labs: 

1. Git Training Book https://git-scm.com/book/en/v2

2. Online Practice https://learngitbranching.js.org/

3. Video Course 

1. Linux, Bash, Networking

 

Objective:

Get Basic knowledge of Linux Installation, CLI, Bash and networking

Tasks: 

https://github.com/kuchuksv/techmaster/tree/main/basic/linux

LINUX

1. Linux Installation

2. Unix/Linux Command Reference

3. https://www.tecmint.com/linux-networking-commands/

Bash

https://linuxhint.com/30_bash_script_examples/

Networking

https://www.youtube.com/playlist?list=PLF1hDMPPRqGxpYdo0ctaa7MxfOi9vjs1u

  • This video demonstrates the basic fundamentals of Linux



  • Beginner's Guide to the Bash Terminal


  • Networking commands


четверг, 10 февраля 2022 г.

DevOps Start

 


DevOps learning path

  1. Linux, Bash, Networking
  2. Git
  3. AWS
  4. Docker
  5. Terraform
  6. Databases, SQL
  7. Jenkins, Groovy
  8. Kubernetes, Helm
  9. Python
  10. DevOps Speech


четверг, 21 октября 2021 г.

вторник, 12 октября 2021 г.

US DevOps Job

 


Guide to quickly find a DevOps Job

пятница, 23 апреля 2021 г.

Recover Credentials in Jeknins


1. Find the name of the Credential: 

2. Jenkins > Credentials

3. Find the hash of the Credential: 

    cat /etc/jenkins/home/credentials.xml

4. Decrypt the hash in Jenkins: 

    Go to Jenkins > Manage Jenkins > Script Console

    Execute println(hudson.util.Secret.decrypt("{YOUR_HASH}")) 

четверг, 25 марта 2021 г.

понедельник, 22 марта 2021 г.

Google API - User Get/Create/Delete Automation

 


How to Manage users with Google API calls.

понедельник, 1 февраля 2021 г.

DevOps Interview Questions (RU)

 

Вопросы на собеседовании