Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@surajsaini95
surajsaini95 / Blog-Jinja-Templating.md
Created April 2, 2020 20:40
simple and effective blog focusing on Jinja Templating in Python

# Jinja Templating with Python

Jinja : What and Why

Jinja is a web template engine for the Python programming language which is fast, expressive and extensible.Special placeholders in the template allow writing code similar to Python syntax which renders the final document when the data in passed (if needed).

Features

  • Template inheritance
@surajsaini95
surajsaini95 / Blog-Bash-Scripting.md
Created April 3, 2020 05:53
A quick intro and hands-on with Bash

Let's talk with Bash !

Scripting

It basically involves writing a series of commands that are interpreted one by one at runtime unlike programming languages that are compiled first before running.

So yes we will be talking with bash through scripts.

Bash ( Bourne-Again SHell )

@surajsaini95
surajsaini95 / Blog-Package-Management.md
Created April 3, 2020 09:27
this blog gives an understanding on how package management is done in Ubuntu

How Ubuntu manage packages

Past

In the early day software was provided either via FTP or mailing lists as source code, along with the required man pages, the necessary configuration files and only a few small files contained the instructions to create a binary (normally in a tar file).

Evolution

@surajsaini95
surajsaini95 / Blog-IPTables.md
Created April 3, 2020 10:18
provides an overview on how ip-tables can be used in Linux to implement firewall.

Iptables in Linux Firewall

Intro

Managing network traffic is one of the toughest jobs a system administrators has to deal with. He must configure the firewall in such a way that it will meet the system and users requirements for both incoming and outgoing connections, without leaving the system vulnerable to attacks.

This is where iptables come in handy as they are Linux command line firewall that allows system administrators to manage incoming and outgoing traffic via set of configurable table rules.

@surajsaini95
surajsaini95 / Blog-Ad-Hoc-Ansible.md
Created April 10, 2020 04:49
the blog provides an overview of using ad-hoc commands in ansible

Going Ad-Hoc With Ansible

Ansible came to the market as a Simple IT automation tool for server/infrastructure management. Being Simple, agentless, pythonic and many more features to count on it also supports ad-hoc commands.

The Ad-Hoc command is the one-liner ansible command that performs one task on one or more managed nodes. Ad-hoc commands are quick and easy, but they are not reusable.

Why use ad-hoc commands?

Ad-hoc commands are great for a very particular task or for the tasks you repeat rarely.For example doing SCP on server/machine in aws group.

@surajsaini95
surajsaini95 / Blog-Ansible-Vars.md
Last active April 10, 2020 06:33
this blog provides a brief guide on using variables in ansible

Ansible Variables

While automation makes it easier to do things which are repeatable but all systems are not exactly alike as some may require configuration that is slightly different from others.

For example, you might need to find out the IP address of a system and use it as a configuration value on another system.

Ansible uses variables to help deal with differences between systems.

Backup & Restoring Jenkins

The purpose of the backup is to create a copy of data that can be restored in the event of a primary data failure which can be the result of hardware or software failure, data corruption, or a human-caused event, or accidental deletion of data.

Backup copies allow data to be restored from an earlier point in time to help the business recover from an unplanned event.

Why Jenkins needs B & R ?

In Jenkins, all the settings, build logs and archives of the artifacts are stored under the JENKINS_HOME directory as Jenkins don't use any database . Setting access rights, selecting the necessary plugins and jobs configuration is quite a laborious process, so it’s a good idea to organize regular backups of all the necessary settings and parameters.

Going Declarative in Jenkins

Jenkins pipeline plugin version 2.5 introduces support for Declarative pipelines.

Declarative pipeline contains a predefined hierarchy to create Jenkins pipelines but it still uses the DSL steps as its base with a well-defined structure around the steps. It gives you the ability to control all aspects of a pipeline execution in a simple, straight-forward manner.

Declarative Pipeline is a more recent feature of Jenkins Pipeline which:

  • provides richer syntactical features over Scripted Pipeline syntax, and

Persisting & Sharing Data in Docker

In this blog we will look at various ways in which storage from host machine can be mounted to containers. Also it can be seen as a way of communication in case the networking is disabled for your containers.

A quick intro

Docker is a popular containerization tool used for packaging, deploying, and running applications.

Containers are supposed to be light-weighted but by default all files created inside a container are stored on its writable-layer making it heavy to create and run.

Namespaces in Kubernetes

Being a container-orchestration system for automating application deployment, Kubernetes is adopted and highly practised by many teams while some prefer to explore it till depths.

So it becomes important for a cluster manager or a cluster admin to split numerous cluster components or objects or resources into smaller distinct groups. It enables smooth management and effective usage of isolated resources without overlapping.

What is a Namespace?

A namespace can be considered as a virtual cluster inside your Kubernetes cluster which are logically isolated from each other.

Each Kubernetes namespace provides a different scope which means that using the combination of an object name and a Namespace, each object gets an unique identity across the cluster.