Skip to content

Instantly share code, notes, and snippets.

@surajsaini95
surajsaini95 / Blog-Jinja-Templating.md
Created Apr 2, 2020
simple and effective blog focusing on Jinja Templating in Python
View Blog-Jinja-Templating.md

# 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 Apr 3, 2020
A quick intro and hands-on with Bash
View Blog-Bash-Scripting.md

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 Apr 3, 2020
this blog gives an understanding on how package management is done in Ubuntu
View Blog-Package-Management.md

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 Apr 3, 2020
provides an overview on how ip-tables can be used in Linux to implement firewall.
View Blog-IPTables.md

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 Apr 10, 2020
the blog provides an overview of using ad-hoc commands in ansible
View Blog-Ad-Hoc-Ansible.md

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 Apr 10, 2020
this blog provides a brief guide on using variables in ansible
View Blog-Ansible-Vars.md

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.

View Blog-Jenkins-Declarative-Pipeline.md

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
View Blog-Backup-And-Restore-Jenkins.md

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.

View Blog-Persisting-Sharing-Data-Docker.md

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.

View Blog-Init-Containers-K8s.md

Init Containers in Kubernetes

This is the era of containerization and orchestration where majority of the application are following the trend of running on a container which are further deployed in a Kubernetes cluster. It’s sometimes necessary to prepare the main container which will be running our application or the main logic.

There can also be situations where we need to execute a particular utilities or setup scripts that are not present in our main image ( as it would make it heavy and we only need it once in the beginning ).

What are Init Containers ?

Kubernetes provides special type of containers that runs to completion before the main app's container and Kubernetes will repeatedly restarts the Pod until the init container succeeds. Some of its properties are :