Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

$h@R@n sharanpeetani

🏠
Working from home
View GitHub Profile
@sharanpeetani
sharanpeetani / ssh_uptime_check.sh
Last active February 17, 2022 18:40
script to check ssh connection and uptime
View ssh_uptime_check.sh
#!/bin/sh
USR='username'
for host in $(cat host_list)
do
sshpass -f pd_file ssh -q -o BatchMode=yes -o StrictHostKeyChecking=no -o ConnectTimeout=5 ${USR}@${host} exit
let ret_code=$?
if [ $ret_code -eq 5 ]; then
echo "${i} Connection Refused!" $ret_code
@sharanpeetani
sharanpeetani / package_check.yml
Created September 1, 2021 19:04
To check installed package status
View package_check.yml
---
- hosts: all
become: yes
vars:
package_name: "rabbitmq-server"
tasks:
## with package_facts ##
@sharanpeetani
sharanpeetani / swapfile_configure.yml
Created August 27, 2021 17:29
Swapfile creation on Debian servers
View swapfile_configure.yml
## PLaybook is used to create or delete swapfile
## Author: Maithili Peetani
---
- hosts: all
gather_facts: yes
become: yes
vars_files:
- swapfile_vars.yml
@sharanpeetani
sharanpeetani / os_update_docker.yml
Last active May 27, 2021 14:58
sample playbook to update os and install docker
View os_update_docker.yml
---
- name: OS update and install docker
hosts: localhost
become: yes
tasks:
- name: Remove useless packages from the cache
apt:
autoclean: yes
- name: remove unrequired packages
apt:
View bumpme
Sun Feb 7 18:57:19 UTC 2021