Skip to content

Instantly share code, notes, and snippets.

View Sahu-Ayush's full-sized avatar
🏠
Working from home

Ayush Sahu Sahu-Ayush

🏠
Working from home
View GitHub Profile
@Sahu-Ayush
Sahu-Ayush / GitCommitBestPractices.md
Created March 9, 2023 06:53 — forked from luismts/GitCommitBestPractices.md
Git Tips and Git Commit Best Practices

Git Commit Best Practices

Basic Rules

Commit Related Changes

A commit should be a wrapper for related changes. For example, fixing two different bugs should produce two separate commits. Small commits make it easier for other developers to understand the changes and roll them back if something went wrong. With tools like the staging area and the ability to stage only parts of a file, Git makes it easy to create very granular commits.

Commit Often

Committing often keeps your commits small and, again, helps you commit only related changes. Moreover, it allows you to share your code more frequently with others. That way it‘s easier for everyone to integrate changes regularly and avoid having merge conflicts. Having large commits and sharing them infrequently, in contrast, makes it hard to solve conflicts.

variable regions_as_objects {
type = list(object({
zone = string
region = string
}))
default = [
{
zone = "us-east1-c"
region = "us-east1"
@Sahu-Ayush
Sahu-Ayush / warning target packages
Created August 26, 2022 10:32 — forked from nimeshpahadi/warning target packages
main/binary-amd64/Packages -> configured multiple times in /etc/apt/sources.list.d
# Navigated to /etc/apt/sources.list.d/
cd /etc/apt/sources.list.d/
# Edited google.list by invoking
eg: sudo nano google.list
# Commented out the source with a '#'
# Save and run
sudo apt-get update
@Sahu-Ayush
Sahu-Ayush / groovy-create-user.md
Created August 18, 2022 07:32 — forked from hayderimran7/groovy-create-user.md
Jenkins Groovy enable security and create a user in groovy script

This is a snippet that will create a new user in jenkins and if security has been disabled , it will enable it :)

import jenkins.model.*
import hudson.security.*

def instance = Jenkins.getInstance()

def hudsonRealm = new HudsonPrivateSecurityRealm(false)
hudsonRealm.createAccount("MyUSERNAME","MyPASSWORD")
instance.setSecurityRealm(hudsonRealm)
@Sahu-Ayush
Sahu-Ayush / managing_software_with _yum.md
Last active August 21, 2021 08:20
Managing Software Packages with YUM

YUM

  • Yum is the Red Hat package manager that is able to query for information about available packages, fetch packages from repositories, install and uninstall them, and update an entire system to the latest available version.
  • Yum performs automatic dependency resolution when updating, installing, or removing packages, and thus is able to automatically determine, fetch, and install all available dependent packages.
  • YUM stands for Yellowdog update manager.
  • Yum is designed to work with repositories, which are online depots of available software packages.

CHECKING FOR AND UPDATING PACKAGES

@Sahu-Ayush
Sahu-Ayush / Terminal-shortcuts-for-Linux.md
Last active August 18, 2022 09:44
Terminal shortcuts for Linux. Blog

In this article, I share some shortcuts that I believe are useful to the broadest range of the sysadmin community. They are a vital part of my life and allow me to save time and focus better on what I enjoy doing. I also provide a quick tip at the end to help you master any Linux shortcuts.

Shortcuts are a key or combination of keys that provide quick access to a specific task or command. Almost everyone uses computer shortcuts in some form or fashion, but they are particularly critical for Linux sysadmins.

Note, most of these tricks assume you are using a Bash shell. They may be similar in other shells, but be aware there could be subtle differences.

Let's have a look at some basic and most useful commands:

Key Description

Computational complexity is a field from computer science that analyzes algorithms based on the amount of resources required for running it. The amount of required resources varies based on the input size, so the complexity is generally expressed as a function of n, where n is the size of the input.

Space complexity:

The space complexity is the amount of memory space required to solve a problem concerning the input size.

Time Complexity:

The time complexity is the computational complexity that describes the amount of time it takes to run an algorithm. Time complexity is commonly estimated by counting the number of elementary operations performed by the algorithm, supposing that each elementary operation takes a fixed amount of time to perform.

@Sahu-Ayush
Sahu-Ayush / git.md
Last active August 8, 2021 19:26
This "git.md" gist using on blog

Git Cheat Sheet

Initial Setup

Create an empty git repo or reinitialize an existing one

git init