Skip to content

Instantly share code, notes, and snippets.

View isitavi's full-sized avatar
🎯
Focusing

Avijit Das isitavi

🎯
Focusing
View GitHub Profile
---
- name: This sets up an httpd webserver
hosts: all
tasks:
- name: Install apache packages
yum:
name: httpd
state: present
- name: ensure httpd is running
service:
#!/bin/bash
# Command Structure for use this script,
# Command:
# ./nagios-port-monitoring.sh -p 5999 -w 3 -c 5
# Result:
# CRITICAL- 0 Established connection on PORT 5999 | 'Usage'=0;3;5;0;10
# Status Code
# STATE_OK=0
============================================================================================
Step1) Creating a Prometheus user and group
============================================================================================
useradd -m -s /bin/false prometheus
id prometheus
============================================================================================
Step 2) Creating configuration directories for Prometheus
============================================================================================
mkdir /etc/prometheus
@isitavi
isitavi / Useradd.txt
Created December 11, 2018 13:12
4 Problems
1. sudo useradd -m -s /bin/bash test
2. sudo usermod -a -G sudo test
3. pwd (If the direcotry is on /home/test)
touch .ssh
4. cd .ssh/
touch id_rsa
5. chgrp test /home/test/.ssh/id_rsa
chmod 640 /home/test/.ssh/id_rsa
6. sudo chown test -R /home
@isitavi
isitavi / Useradd.txt
Created December 11, 2018 13:02
Problems
1. sudo useradd -m -s /bin/bash test
2. sudo usermod -a -G sudo test
3. pwd (If the direcotry is on /home/test)
touch .ssh
4. cd .ssh/
touch id_rsa
5. chgrp test /home/test/.ssh/id_rsa
chmod 640 /home/test/.ssh/id_rsa
6. sudo chown test -R /home
FROM ubuntu:16.04
RUN apt-get update
RUN apt-get install -y nginx
RUN apt-get update
COPY nginx.conf /etc/nginx/nginx.conf
@isitavi
isitavi / sql.txt
Created December 6, 2018 05:28
SQL-Problem4
Select Stdt.name
FROM Students Stdt,
Friends Frnd,Packages Pkg1,Packages Pkg2
Where Pkg2.Salary > Pkg1.Salary
and Pkg2.ID = Frnd.Friend_ID and Pkg1.ID = Stdt.ID and Stdt.ID = Frnd.ID
Order by Pkg2.Salary;
@isitavi
isitavi / commands.txt
Created December 6, 2018 05:26
addUser-Problem3
1. sudo useradd -m -s /bin/bash test
2. sudo usermod -a -G sudo test
3. pwd (If the direcotry is on /home/test)
touch .ssh
4. cd .ssh/
touch id_rsa
5. chgrp test /home/test/.ssh/id_rsa
chmod 640 /home/test/.ssh/id_rsa
6. sudo chown test -R /home
@isitavi
isitavi / index.html
Created December 6, 2018 05:25
parseLogs-Problem2
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
@isitavi
isitavi / index.html
Created December 6, 2018 05:22
IP-Problem1
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<title>Document</title>
</head>