Data Structures And Algorithms
Data Structures And Algorithms
- Data Structures: A data structure is a technique of storing data in a computer so that it can be accessed and modified efficiently.
- Algorithms: An algorithm is a step-by-step instruction to perform a task.
Why Should I Learn Data Structures And Algorithms?
- Enhance your problem solving skills.
- Write efficient code that is performant and scalable.
- Specialized fields: machine learning, data science, artificial intelligence and other engineering fields deal with complex data and require efficient processing. To delve into such fascinating fields of engineering, having a firm grounding in data structures and algorithms is beneficial and in many cases required.
Can I Develop Applications Without Studying Data Structures And Algorithms?
Yes, sure. A lot of applications just store some data in a datastore, typically a relational database and have some procedures to show this data in a user interface, most commonly the web browser. The crux of such applications can be defined using the acronym CRUD. CRUD stands for Create, Read, Update and Delete. Often you are doing one of these CRUD functions in the context of persistent storage of your application:
AI
Introduction
This is an anchor post about machine learning and artificial intelligence.
Observations On AI
Revolution in Text Generation: Generative AI is making significant strides in text production, promising a surge in the quality and quantity of text-based content. This encompasses everything from blog posts and articles to comprehensive reference books, transforming how information is created and disseminated.
Advancements In AI-Generated Imagery: The evolving capabilities of AI in image generation are noteworthy. These advancements are set to enrich various fields with innovative and creative visual content, offering new dimensions in digital art, marketing, and visual storytelling.
Kubernetes RBAC Objects For Cluster Administration
In a previous series of blog posts, we discussed the Kubernetes objects typically used to run a web application. We covered, Namespace, Pod, ConfigMap, Secret, Service, Deployment, ServiceAccount, Ingress, PDB, HPA, PV, PVC, Job and CronJob.
In this post, we will discuss some fundamental building blocks for the Kubernetes cluster administration: RBAC objects.
In most situations, Kubernetes API server is started with the flag --authorization-mode=RBAC
which enables RBAC in
the cluster.
Automating Virtual Machine Installation Using libvirt, virsh And cloud-init
Introduction
We have the host machine with the OS Ubuntu 22.04. On this PC or server, we will create two virtual machine guests:
myubuntu2204test01
having static IP of192.168.122.146
myubuntu2204test02
having static IP of192.168.122.147
The guest VMs will use the default network created by libvirt
. The gateway IP for the default network
is 192.168.122.1
.
We will achieve automation using libvirt
, qemu
and cloud-init
. To go through the article and exercise,
you should have a rudimentary understanding of Linux system administration and networking.
Writing A Kubernetes Controller: Part I
This is a guide to write a Kubernetes controller. We will kick off by inspecting the Kubernetes API from inside a pod within the cluster. Minikube suffices for this exercise. But you can conduct the exercise to any Kubernetes cluster.
The controller watches events related to Kubernetes pods using the Kubernetes API. When there is a new event, the controller logs the event’s type and the name of the affected pod. This controller can be extended to perform other actions when pod events occur, such as scaling the number of replicas for a deployment, sending notifications, or triggering a custom script or program.
Loading SSH Key Into Memory
So, you have an SSH key pair. The public key has been added on to the server. On the client, ie your laptop/desktop you have your private key. For some reason, your private key has not been loaded into memory.
All you have to do is start the ssh-agent
and then load the key into memory via ssh-add
.
Step 1: Start the agent
eval $(ssh-agent)
Step 2: load the key into memory
Linux KVM Bridge
Using Linux KVM, Expose Virtual Guests On The LAN
Audience: The blog post is for beginner to intermediary Linux system administrators.
- You should have a thorough understanding of the shell commands and
- be comfortable on the command line
- be able to install and configure packages, etc.
- be able to start and stop services using
systemd
- be familiar with Linux configuration files
- be able to set Linux kernel parameters using
sysctl
- be able to enable and disable Kernel modules
- be comfortable installing and using guest VMs using
libvirt
You should have a rudimentary understanding of networking concepts and tooling such as
Ansible Naming Conventions
Purpose Of Having Naming Conventions For An Ansible Project
- Consistency: Adopting a naming convention standardizes naming across the project and organization. This makes it easier for developers to switch between projects. Typically, an organization with an infrastructure team will have several Ansible projects and source code repositories. A developer working on one such Ansible project can seamlessly switch to another given a standard naming convention.
- Error Reduction: With improper naming there can be pitfalls. For instance, using hyphens(
-
) in variable names can cause parsing errors since Ansible might interpret them as the minus operator. Standardizing naming for variables can help avoid collisions. - Readability: With a standard naming convention, it helps developers to find variables, files and tasks quickly.
Naming Conventions For Ansible Roles And Playbooks
- Role name : use lowercase letters and hyphens to separate words: For example,
web-server
ordatabase-backup
. - Task file name: user lowercase letters and underscores to separate words. When statements such as include
are used, it is convenient to have file names without hyphens. For example:
install_web_ubuntu.yml
- YAML file extension:
yml
insteadyaml
. To be consistent and succinct. - Task name: start with a verb: Use an action verb at the beginning of the task name to indicate what the role does. For example, Install Nginx or Configure firewall. Start with a capital letter. No need to end with a period for a few words of task description.
- Variable name: lowercase letters and underscores to separate words. The variable must start with the role
name. For example, if the role name is nginx, the variable name should be
nginx_default_hostname
.
Content Guide
- Always include a README file for the role. Describe in detail how to use the role. Create a table to show the role variables and their defaults.
- Include automated tests using Molecule.
The Ansible Learning Path
Ansible Prerequisites
Before jumping on to learning Ansible, have a firm grounding in Linux system administration and shell scripting. You can use Ansible for a lot of automation projects. The primary target audience for this blog post are DevOps engineers, IT infrastructure engineers and system administrators who create and manage IT infrastructure to run workloads. A good understanding of YAML is required before starting to write Ansible playbooks. A background in at least one programming language helps. Python programing is not a requirement per se. But Python programming familiarity helps put together some automated testing.
DevOps Lab: Create Your Own Kubernetes Cluster
Architecture 1: Kubernetes Control Plane Without HA
Create three Virtual Machine guests on your laptop or workstation.
VM 01
- Kubernetes Control PlaneVM 02, VM 03
- Kubernetes Worker nodes
Architecture 2: Kubernetes Control Plane With HA
Create five Virtual Machine guests on your laptop or workstation.
VM 01, VM 02, VM 03
- Kubernetes Control Plane with HAVM 04, VM 05
- Kubernetes Worker nodes
Use the Kubeadm
tool to create the cluster.