Skip to content

Instantly share code, notes, and snippets.

View pareddy113's full-sized avatar

Avinash Penugonda pareddy113

View GitHub Profile
@pareddy113
pareddy113 / virtualbox.sh
Created December 7, 2017 17:19
mount windows desktop to the VirutalBox ubuntu VM
sudo mkdir /media/windows-share
sudo mount -t vboxsf Desktop /media/windows-share
Node InsertNth(Node head, int data, int position) {
if(position == 0){
Node node = new Node();
node.data = data;
node.next = head;
return node;
}
head.next = InsertNth(head.next, data, position-1);
return head;
}
@pareddy113
pareddy113 / ansible commands
Created November 2, 2017 19:34
Ansible commands
-i :inventory file
-u list_of_server :username for remote login for the list_of_servers
-m :runs the moudle name and gives the output
-a :shell arguments to run on the remote machine ex: ls, docker ps, etc
-f : specify the number of parallel process to run\
-B : run asynchronously, failing after X
Modules:
@pareddy113
pareddy113 / docker.cron.supervisord
Created October 4, 2017 15:35
manage multiple process in docker using supervisord and start cron using supervisord and schedule each job using cron
http://mattharris.org/2016/12/01/docker-cron-jobs-supervisord/
@pareddy113
pareddy113 / EC2-Instance-autostart.js
Created October 4, 2017 15:03
Lambda function to start and stop ec2 instance based on schedule using Scheduled Events. Event names: name-name-instanceStart / name-name-instanceStop
'use strict';
console.log('Loading the function...');
const AWS = require('aws-sdk');
const ec2 = new AWS.EC2({apiVersion: '2016-11-15'});
exports.handler = (event, context, callback) => {
var eventData = event.resources[0].split('/')[1];
console.log('Event name currently triggerd is = ',eventData);
var unprocessedEventArray = eventData.split('-');
@pareddy113
pareddy113 / node
Last active July 17, 2017 21:02
Node tips
//find he url of the loaded module
node -pe "require.resolve('Node')"
//to download a dependency and add it to package.json
npm install --save request
@pareddy113
pareddy113 / callbacks.js
Last active July 17, 2017 19:13
node js callbacks - multiple callbacks - multiple versions
//different version of same multiple callback function
//a b c in the order
//version 1 (not elegant way)
var fs = require('fs');
function asyncRead(callback){
fs.readFile('sample.txt','utf8',function(err, data){
if (err) raise ("no output file");
var numberOfNewLines = data.split("\n");
callback(numberOfNewLines);
@pareddy113
pareddy113 / node.js
Last active July 17, 2017 18:57
learnyounode
/* Write a program that accepts one or more numbers as command-line arguments
and prints the sum of those numbers to the console (stdout).*/
var array = process.argv;
var sum = 0;
for(var i = 2; i < array.length ; i++){
sum+= Number(array[i]);
}
console.log(sum);
@pareddy113
pareddy113 / README.md
Created May 26, 2017 20:58 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

For more about AWS and AWS Certifications and updates to this Gist you should follow me @leonardofed


@pareddy113
pareddy113 / AWS Solutions Architect Associate
Last active April 1, 2024 08:03
AWS Solutions Architect Associate 2017- ACloud Guru course
----- Interested Reads------
+ Interesting Read (Serverless Architecture of Acloud guru)
https://read.acloud.guru/serverless-the-future-of-software-architecture-d4473ffed864
----- Getting Started-------
+ Requirements
+ AWS Free Tier Account
+ PC with putty and putty keygen/ Mac
+ Optional
+ IoS/ Android App $20