Skip to content

Instantly share code, notes, and snippets.

View krishnamurthydasari's full-sized avatar

Krishna Murthy Dasari krishnamurthydasari

View GitHub Profile
@krishnamurthydasari
krishnamurthydasari / BackupToS3.ps1
Last active January 4, 2018 13:12
Power shell script to copy folders from windows to s3 bucket and then delete from local directory
# ---------------------------------------------------------------------------
# | File : BackuptoS3.ps1
# | Version : 1.0
# | Purpose : Backs up folders on Windows to s3 bucket using power shell
# | Usage : .\BackuptoS3_Snapshots.ps1
# ----------------------------------------------------------------------------
#s3 bucket name
$bucket = "s3BucketName"
@krishnamurthydasari
krishnamurthydasari / Git Notes
Last active March 28, 2024 12:20
Git Notes
Creating new repository:
========================
Create a new repository on GitHub by selecting initialize this repository with README.
Clone repository using below commands,
git clone https://github.com/krishnamurthydasari/TestProject.git
touch NewFile.txt
git add NewFile.txt
git status
@krishnamurthydasari
krishnamurthydasari / Creating Python deployment package for Amazon Lambda
Last active January 29, 2019 14:36
Create Deployment Package Using Python Environment Created with Virtualenv
Below are the steps to Create Deployment Package Using a Python Environment Created with Virtualenv. Below are the 2 examples for pymysql and boto2 modules.
pymysql:
1. Create a directory
2. Create virtual environment
#virtualenv test
3. #cd test
@krishnamurthydasari
krishnamurthydasari / github_to_s3_sync.sh
Last active July 13, 2017 12:34
Github repository to s3 bucket sync and send email with new updates
#!/bin/bash
#Date : 13-07-2017
#Owner : Krishnamurthy Dasari
#Description: Pull the changes from upstreem to local git repository, upload all changes to s3 bucket and send email alert with changed files.
GitLocalRepoDir="/path/to/local/directory"
s3bucket="s3://BucketName"
email_subject="Subject"
email_From="From@domain.com"
@krishnamurthydasari
krishnamurthydasari / Install GNOME and VNC Server on a Red Hat Linux
Last active July 13, 2017 12:26
Install GNOME and VNC Server on a Red Hat Linux
1. Install GNOME and VNC server packages
yum --exclude=nautilus-sendto groupinstall "GNOME Desktop Environment"
yum install vnc-server
2. Create your VNC users. You can use existing users if already have.
#useradd Krishna
#passwd Krishna
@krishnamurthydasari
krishnamurthydasari / Extend root disk size in EC2
Last active December 7, 2017 12:53
Extend root disk size in EC2
Expending root disk size when root device has partition inside it, directly running resize2fs command will not work,
Follow below steps to resolve issue.
Check "lsblk" command output for root device name and filesystem type, these steps works for ext3 and ext4
If root device name is /dev/xvda1, then
growpart /dev/xvda 1 ### Note the space between /dev/xvda and 1
resize2fs /dev/xvda1
partprobe
1. Update security group to allow 5666, ICMP request and SSH protocols from nagios server 34.193.101.102/32
2. Run below commands to install Nagios client
mkdir /opt/Nagios
cd /opt/nagios/
wget https://assets.nagios.com/downloads/nagiosxi/agents/linux-nrpe-agent.tar.gz
tar xvf linux-nrpe-agent.tar.gz
cd linux-nrpe-agent
./fullinstall
x11 server setup:
server side:
yum install xorg-x11-xauth xterm -y
Client side:
install mobaxterm (OR any x server gui tool) and connect from that tool
For this setup:
DNS Master Server 172.31.88.75
DNS Slave Server 172.31.93.71
Host1 172.31.83.52
Host2 172.31.88.91
** Configured only fws zone. Reverse zone setup not tested.
** Reference : https://www.tecmint.com/setup-master-slave-dns-server-in-centos/
If server is used only for forward requests:
options {
.
.
allow-query { localhost; any; };
recursion yes;
forward only;
.