diff --git a/8-10am--commands b/8-10am--commands new file mode 100644 index 0000000..40d478a --- /dev/null +++ b/8-10am--commands @@ -0,0 +1,289 @@ +ls -- it shows list of you files +mkdir -- to create a directory (mkdir meesho) +touch -- to create a file (touch file.txt) +cd -- change directoy +cd .. -- come back to previous dir +pwd -- present woking directory +cat -- to read your cntent +rm -rf -- to remove files and dir +lsblk-- list block storage it shows all storages +df -h -- it shows usage storage + +new vol +mkfs.ext4 /dev/xvdb +create mountpoint mkdir meesho +sudo mount /dev/xvdb meesho/ + + + + + +editors + +nano --- nano file.txt (ente the cntent) + +to save -- ctl+x = y + + +vi +vi file.txt +to save -- :wq press enter + +to insert content =i + +vim + +vim file.txt +to save -- :wq press enter + +t insert content = i + +ll -- it shows lon list of your files + +permissions + +read -- 4 + +write --2 4+2=6 + +execute --1 4+2+1=7 + +4+2=6 + +4_+2+1=7 +chmod -- change modiifcations + +sudo -- supe user do + +sudo find / -name meesho54 + +root user -- sudo -i (admin privilages) + + + +task -- 1 + +launch ec2 instance + +create 10 dir +create 10 files +give read permissions to files + + +task --2 + +launch ec2 instance +create 5 dir +insdie every dir create 10 files and give all files to write permissions +for dir give execute permissions fo all dir. + + +AWS + +vpc + +task --3 + +create vpc 10.0.0.0/20 +ceate igw attach to vpc + +launch ec2 instance + +create a file name meesho + ente the total pocess of creation of vpc in that file + + cidr.xyz + + + task --3 + +create a vpc with 30000ips +create subnets +create rt +create igw +create sg + +launch server with vpc +create 25dir +for 7 dir take executable permissions remaining write pemissions + +https://www.solarwinds.com/free-tools/advanced-subnet-calculator +cidr.xyz + + + +ec2 + +task --4 + +create vpc 18000 ips +launch ec2 instance with amazonlinux and ubuntu +install java in both instances + +create 20dir create in each dir with 2 files all files should be have a execute permissions +dir be a write permissions + + + +task --5 + +create vpc with 18 netmask id +launch ec2 instance with 28 vol +create 100dir and create 140 files + +copy the 40 files to 10 dir + +all dir should have executable permissions +all files should have write permissions + +create vol and mount to facebook +create snap and launch instance with snap + + +resizing volume + +launch ec2instance + +select instance and select storage +select volume and click on action select modify optin +change the vlume size and save it + +connce ec2 instance to terminl +check with lsblk + +growpart /dev/xvda 1 + +xfs_gowfs -d / + +df -h resizing is completed + + +task -- 6 + +create vpc 60000 ip's +launch instance with42gb /t3.medium +create eip and associate eip to instance + +create volume 22gb and mount it +modify default vlume 45gb + +create snapshot of default volume and copy to us-east-2 + + + +task -- 7 + +create vpc 4000 ip's + +launch instance with 40gb volume/t2.medium + +copy snapshot mumbai to north viginia + +create ami in noth vigenia +launch instance modify volume to 45gb + +create alb and target goup in n.v + + +task --8 + +create vpc 22 + +create asg with alb and tg + +GITHUB + + 1 ls + 2 sudo yum -y install git + 3 git --version + 4 ls + 5 mkdir github + 6 ls + 7 cd github/ + 8 ls + 9 touch file{1..10}.txt + 10 ls + 11 git init + 12 ls + 13 git add * + 14 git commit -m "i am commiting files" * + 15 git branch + 16 git branch -M main + 17 git branch + 18 git remote add origin https://github.com/Mani137/newep.git + 19 git push -u origin main + 20 history + +task -- 9 + +create vpc 10000 ips +create asg and alb and tg +create 100 files and pusht that files to gihub +create snap shot convert to ami and ami to launch ec2 +add 20 files and push all files to github + + + +task -- 10 + +create vpc 5000 ip's +and create rds using vpc +create s3 bucket and uplad objects + + +deploy + +httpd + + 48 sudo yum -y install httpd + 49 sudo systemctl start httpd + 50 sudo systemctl enable httpd + 51 sudo systemctl status httpd + 52 ls + 53 sudo yum -y install git + 54 git --version + 55 ls + + 57 sudo git clone https://github.com/Mani137/food.git + 58 ls + 59 cd food/ + 60 ls + 61 cp -R * /var/www/html/ + 62 sudo cp -R * /var/www/html/ + 63 cd /var/www/html/ + 64 ls + 65 cd + 66 sudo systemctl restart httpd + 67 history +nginx + + 1 ls + 2 sudo yum -y install nginx + 3 sudo systemctl start nginx + 4 sudo systemctl enable nginx + 5 sudo yum -y install git + + 7 sudo git clone https://github.com/Akiranred/mario.git + 8 ls + 9 cd mario/ + 10 ls + 11 cp -R * /usr/share/nginx/html/ + 12 sudo cp -R * /usr/share/nginx/html/ + 13 ls + 14 sudo systemctl restart ngninx + 15 sudo systemctl start ngninx + 16 sudo systemctl status ngninx + 17* sudo yum -y install nginxs + 18 sudo systemctl start ngninx + 19 cd + 20 sudo systemctl restart ngninx + 21 history + + +task -- 10 + +create vpc 10000 ip's + +create asg alb tg + +deploy the project with nginx and httpd in ubuntu suse amazon linux redhat diff --git a/GIT COMMANDS.jpeg b/GIT COMMANDS.jpeg new file mode 100644 index 0000000..6f6ae48 Binary files /dev/null and b/GIT COMMANDS.jpeg differ diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..2b761dd --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,101 @@ +trigger: + branches: + include: + - "BDKPB-1164--Estabilsh-Build-Pipeline-for-Mobile-Application-(Development)" + paths: + include: + - "Bradken/bdk-insite/BDKPB-1164--Estabilsh-Build-Pipeline-for-Mobile-Application-(Development)/.devops" + +pr: + branches: + include: + - "BDKPB-1164--Estabilsh-Build-Pipeline-for-Mobile-Application-(Development)" + paths: + include: + - "Bradken/bdk-insite/BDKPB-1164--Estabilsh-Build-Pipeline-for-Mobile-Application-(Development)/.devops" + +variables: + projectName: 'bdk-mobile-flutter' + tag: $(Build.BuildId) + +stages: + + # The first stage is to build the flutter application + - stage: Build + displayName: "Build Flutter Application" + jobs: + - job: "Build" + steps: + + # Add Flutter setup and build steps here + - task: CmdLine@2 + displayName: 'Download and Install Flutter' + inputs: + # @Shannon - is there a better way to download Flutter? + script: | + wget https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.13.9-stable.tar.xz + tar -xf flutter_linux_3.13.9-stable.tar.xz + echo "##vso[task.setvariable variable=PATH]$(pwd)/flutter/bin:$PATH" + + # This step runs the flutter doctor tool + - task: CmdLine@2 + displayName: 'Run Flutter Doctor' + inputs: + script: flutter doctor + + # download all the flutter dependencies here + - task: CmdLine@2 + displayName: 'Install Flutter' + inputs: + script: /bdk-insite/ranch name/.devops/flutter pub get + +# build the flutter app for web + - task: CmdLine@2 + displayName: 'Build Flutter App' + inputs: + script: flutter build web --release + +# copy the .devops folder to the build directory + - task : PublishPipelineArtifact@1 + displayName: Copy .devops and Publish it as artifact + condition: always() + inputs: + targetPath: '$(Pipeline.Workspace)/s/.devops' + artifactType: 'pipeline' + artifactName: '.devops' + + + +- stage: Slack + dependsOn: Build + condition: failed() + displayName: Push Build Logs to Slack + jobs: + -template: ../templates/slack.yaml + + # This stage will deploy the application to the development environment (as an Azure static website) + - stage: Deploy + displayName: "Deploy Flutter to Azure Static Website" + dependsOn: Build + condition: succeeded() + jobs: + - job: "Deploy" + steps: + - task: DownloadBuildArtifacts@0 + displayName: 'Download Artifacts' + inputs: + buildType: 'current' + downloadType: 'single' + artifactName: 'flutter-web-app' + downloadPath: '$(System.ArtifactsDirectory)' + + - task: AzureCLI@2 + displayName: 'Deploy to Azure Static Website' + inputs: + azureSubscription: 'bdkdvdataappserve-sp' + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: | + az storage blob upload-batch -s $(System.ArtifactsDirectory)/flutter-web-app -d '$web' --account-name + + diff --git a/cyybe.pdf b/cyybe.pdf new file mode 100644 index 0000000..d21a5c2 Binary files /dev/null and b/cyybe.pdf differ diff --git a/faeed.yaml b/faeed.yaml new file mode 100644 index 0000000..dbcd159 --- /dev/null +++ b/faeed.yaml @@ -0,0 +1,222 @@ +AWSTemplateFormatVersion: '2010-09-09' +Description: Create full VPC environment with ALB, Launch Template, and Auto Scaling Group + +Resources: + + # Create the VPC + NewProject1VPC: + Type: AWS::EC2::VPC + Properties: + CidrBlock: 10.0.0.0/18 + EnableDnsSupport: true + EnableDnsHostnames: true + Tags: + - Key: Name + Value: NewProject1VPC + + # Create the Internet Gateway + NewProject1InternetGateway: + Type: AWS::EC2::InternetGateway + Properties: + Tags: + - Key: Name + Value: NewProject1InternetGateway + + # Attach the Internet Gateway to the VPC + AttachGateway: + Type: AWS::EC2::VPCGatewayAttachment + Properties: + VpcId: !Ref NewProject1VPC + InternetGatewayId: !Ref NewProject1InternetGateway + + # Create Public Subnet 1 + PublicSubnet1: + Type: AWS::EC2::Subnet + Properties: + VpcId: !Ref NewProject1VPC + CidrBlock: 10.0.0.0/20 + AvailabilityZone: ap-south-1a + MapPublicIpOnLaunch: true + Tags: + - Key: Name + Value: PublicSubnet1 + + # Create Public Subnet 2 + PublicSubnet2: + Type: AWS::EC2::Subnet + Properties: + VpcId: !Ref NewProject1VPC + CidrBlock: 10.0.16.0/20 + AvailabilityZone: ap-south-1b + MapPublicIpOnLaunch: true + Tags: + - Key: Name + Value: PublicSubnet2 + + # Create Private Subnet + PrivateSubnet: + Type: AWS::EC2::Subnet + Properties: + VpcId: !Ref NewProject1VPC + CidrBlock: 10.0.32.0/20 + AvailabilityZone: ap-south-1c + MapPublicIpOnLaunch: false + Tags: + - Key: Name + Value: PrivateSubnet + + # Create the Public Route Table + PublicRouteTable: + Type: AWS::EC2::RouteTable + Properties: + VpcId: !Ref NewProject1VPC + Tags: + - Key: Name + Value: PublicRouteTable + + # Create the Private Route Table + PrivateRouteTable: + Type: AWS::EC2::RouteTable + Properties: + VpcId: !Ref NewProject1VPC + Tags: + - Key: Name + Value: PrivateRouteTable + + # Attach Public Subnet 1 to the Public Route Table + PublicSubnet1RouteTableAssociation: + Type: AWS::EC2::SubnetRouteTableAssociation + Properties: + SubnetId: !Ref PublicSubnet1 + RouteTableId: !Ref PublicRouteTable + + # Attach Public Subnet 2 to the Public Route Table + PublicSubnet2RouteTableAssociation: + Type: AWS::EC2::SubnetRouteTableAssociation + Properties: + SubnetId: !Ref PublicSubnet2 + RouteTableId: !Ref PublicRouteTable + + # Attach Private Subnet to the Private Route Table + PrivateSubnetRouteTableAssociation: + Type: AWS::EC2::SubnetRouteTableAssociation + Properties: + SubnetId: !Ref PrivateSubnet + RouteTableId: !Ref PrivateRouteTable + + # Create Security Group with Inbound Rules + NewProject1SecurityGroup: + Type: AWS::EC2::SecurityGroup + Properties: + GroupDescription: Allow SSH, HTTP, and MySQL access from anywhere + VpcId: !Ref NewProject1VPC + SecurityGroupIngress: + - IpProtocol: tcp + FromPort: 22 + ToPort: 22 + CidrIp: 0.0.0.0/0 + - IpProtocol: tcp + FromPort: 80 + ToPort: 80 + CidrIp: 0.0.0.0/0 + - IpProtocol: tcp + FromPort: 3306 + ToPort: 3306 + CidrIp: 0.0.0.0/0 + Tags: + - Key: Name + Value: NewProject1SecurityGroup + + # Create EC2 Launch Template + NewProject1LaunchTemplate: + Type: AWS::EC2::LaunchTemplate + Properties: + LaunchTemplateName: NewProject1LaunchTemplate + VersionDescription: "Initial Version" + LaunchTemplateData: + InstanceType: t2.micro + ImageId: ami-0f1dcc636b69a6438 # Replace with valid AMI ID + KeyName: cloudfomat # Replace with your actual key name + SecurityGroupIds: + - !Ref NewProject1SecurityGroup + TagSpecifications: + - ResourceType: instance + Tags: + - Key: Name + Value: NewProject1Instance + + # Create Application Load Balancer (ALB) + NewProject1ALB: + Type: AWS::ElasticLoadBalancingV2::LoadBalancer + Properties: + Name: NewProject1ALB + Subnets: + - Ref: PublicSubnet1 + - Ref: PublicSubnet2 + SecurityGroups: + - !Ref NewProject1SecurityGroup + Scheme: internet-facing + LoadBalancerAttributes: + - Key: idle_timeout.timeout_seconds + Value: '60' + Type: application + Tags: + - Key: Name + Value: NewProject1ALB + + # Create Target Group for ALB + NewProject1TargetGroup: + Type: AWS::ElasticLoadBalancingV2::TargetGroup + Properties: + Name: NewProject1TargetGroup + VpcId: !Ref NewProject1VPC + Protocol: HTTP + Port: 80 + HealthCheckProtocol: HTTP + HealthCheckPort: '80' + HealthCheckPath: / + Matcher: + HttpCode: 200 + TargetType: instance + Tags: + - Key: Name + Value: NewProject1TargetGroup + + # Create Listener for ALB and associate with Target Group + NewProject1Listener: + Type: AWS::ElasticLoadBalancingV2::Listener + Properties: + DefaultActions: + - Type: forward + TargetGroupArn: !Ref NewProject1TargetGroup + LoadBalancerArn: !Ref NewProject1ALB + Port: 80 + Protocol: HTTP + + # Create Auto Scaling Group (ASG) + NewProject1ASG: + Type: AWS::AutoScaling::AutoScalingGroup + Properties: + AutoScalingGroupName: NewProject1ASG + MinSize: '1' + MaxSize: '2' + DesiredCapacity: '1' + LaunchTemplate: + LaunchTemplateId: !Ref NewProject1LaunchTemplate + Version: !GetAtt NewProject1LaunchTemplate.LatestVersionNumber + VPCZoneIdentifier: + - Ref: PublicSubnet1 + - Ref: PublicSubnet2 + HealthCheckType: EC2 + HealthCheckGracePeriod: 300 + TargetGroupARNs: + - Ref: NewProject1TargetGroup + Tags: + - Key: Name + Value: NewProject1ASGInstance + PropagateAtLaunch: true + +Outputs: + LoadBalancerDNSName: + Description: "DNS Name of the Load Balancer" + Value: !GetAtt NewProject1ALB.DNSName diff --git a/man/ne b/man/ne new file mode 100644 index 0000000..5ff8578 --- /dev/null +++ b/man/ne @@ -0,0 +1 @@ +this is a creating diectory diff --git a/mani b/mani new file mode 100644 index 0000000..a469076 --- /dev/null +++ b/mani @@ -0,0 +1 @@ +this is my new file diff --git a/rds.yaml b/rds.yaml new file mode 100644 index 0000000..c4bcfac --- /dev/null +++ b/rds.yaml @@ -0,0 +1,258 @@ +AWSTemplateFormatVersion: '2010-09-09' +Description: Create a VPC with public and private subnets, internet gateway, and routing + +Resources: + + task15: + Type: AWS::EC2::VPC + Properties: + CidrBlock: 10.0.0.0/18 + EnableDnsSupport: true + EnableDnsHostnames: true + Tags: + - Key: Name + Value: task15VPC + + task15InternetGateway: + Type: AWS::EC2::InternetGateway + Properties: + Tags: + - Key: Name + Value: task15InternetGateway + + AttachInternetGateway: + Type: AWS::EC2::VPCGatewayAttachment + Properties: + VpcId: !Ref task15 + InternetGatewayId: !Ref task15InternetGateway + + task15PublicSubnet1: + Type: AWS::EC2::Subnet + Properties: + VpcId: !Ref task15 + CidrBlock: 10.0.0.0/20 + MapPublicIpOnLaunch: true + AvailabilityZone: ap-south-1a + Tags: + - Key: Name + Value: task15-Public-Subnet1 + + task15PublicSubnet2: + Type: AWS::EC2::Subnet + Properties: + VpcId: !Ref task15 + CidrBlock: 10.0.16.0/20 + MapPublicIpOnLaunch: true + AvailabilityZone: ap-south-1b + Tags: + - Key: Name + Value: task15-Public-Subnet2 + + task15PublicSubnet3: + Type: AWS::EC2::Subnet + Properties: + VpcId: !Ref task15 + CidrBlock: 10.0.32.0/20 + MapPublicIpOnLaunch: true + AvailabilityZone: ap-south-1c + Tags: + - Key: Name + Value: task15-Public-Subnet3 + + task15PrivateSubnet: + Type: AWS::EC2::Subnet + Properties: + VpcId: !Ref task15 + CidrBlock: 10.0.48.0/20 + MapPublicIpOnLaunch: false + AvailabilityZone: ap-south-1c + Tags: + - Key: Name + Value: task15-Private-Subnet + + PublicRouteTable: + Type: AWS::EC2::RouteTable + Properties: + VpcId: !Ref task15 + Tags: + - Key: Name + Value: task15-PublicRouteTable + + PrivateRouteTable: + Type: AWS::EC2::RouteTable + Properties: + VpcId: !Ref task15 + Tags: + - Key: Name + Value: task15-PrivateRouteTable + + PublicRoute: + Type: AWS::EC2::Route + DependsOn: AttachInternetGateway + Properties: + RouteTableId: !Ref PublicRouteTable + DestinationCidrBlock: 0.0.0.0/0 + GatewayId: !Ref task15InternetGateway + + PublicSubnet1RouteTableAssociation: + Type: AWS::EC2::SubnetRouteTableAssociation + Properties: + SubnetId: !Ref task15PublicSubnet1 + RouteTableId: !Ref PublicRouteTable + + PublicSubnet2RouteTableAssociation: + Type: AWS::EC2::SubnetRouteTableAssociation + Properties: + SubnetId: !Ref task15PublicSubnet2 + RouteTableId: !Ref PublicRouteTable + + PublicSubnet3RouteTableAssociation: + Type: AWS::EC2::SubnetRouteTableAssociation + Properties: + SubnetId: !Ref task15PublicSubnet3 + RouteTableId: !Ref PublicRouteTable + + PrivateSubnetRouteTableAssociation: + Type: AWS::EC2::SubnetRouteTableAssociation + Properties: + SubnetId: !Ref task15PrivateSubnet + RouteTableId: !Ref PrivateRouteTable + + PublicSecurityGroup: + Type: AWS::EC2::SecurityGroup + Properties: + GroupDescription: Allow SSH and HTTP from anywhere + VpcId: !Ref task15 + SecurityGroupIngress: + - IpProtocol: tcp + FromPort: 22 + ToPort: 22 + CidrIp: 0.0.0.0/0 + - IpProtocol: tcp + FromPort: 80 + ToPort: 80 + CidrIp: 0.0.0.0/0 + Tags: + - Key: Name + Value: task15-PublicSG + + ALBTargetGroup: + Type: AWS::ElasticLoadBalancingV2::TargetGroup + Properties: + Name: ALBTargetGroup + VpcId: !Ref task15 + Protocol: HTTP + Port: 80 + TargetType: instance + HealthCheckProtocol: HTTP + HealthCheckPort: traffic-port + HealthCheckPath: / + Matcher: + HttpCode: 200 + Tags: + - Key: Name + Value: task15-TG + + LoadBalancer: + Type: AWS::ElasticLoadBalancingV2::LoadBalancer + Properties: + Name: task15-ALB + Subnets: + - !Ref task15PublicSubnet1 + - !Ref task15PublicSubnet2 + - !Ref task15PublicSubnet3 + SecurityGroups: + - !Ref PublicSecurityGroup + Scheme: internet-facing + LoadBalancerAttributes: + - Key: idle_timeout.timeout_seconds + Value: '60' + Tags: + - Key: Name + Value: task15-ALB + Type: application + + ALBListener: + Type: AWS::ElasticLoadBalancingV2::Listener + Properties: + DefaultActions: + - Type: forward + TargetGroupArn: !Ref ALBTargetGroup + LoadBalancerArn: !Ref LoadBalancer + Port: 80 + Protocol: HTTP + + MyLaunchTemplate: + Type: AWS::EC2::LaunchTemplate + Properties: + LaunchTemplateName: MyLaunchTemplate + LaunchTemplateData: + ImageId: ami-002f6e91abff6eb96 + InstanceType: t3.micro + + MyAutoScalingGroup: + Type: AWS::AutoScaling::AutoScalingGroup + Properties: + VPCZoneIdentifier: + - !Ref task15PublicSubnet1 + - !Ref task15PublicSubnet2 + - !Ref task15PublicSubnet3 + LaunchTemplate: + LaunchTemplateId: !Ref MyLaunchTemplate + Version: !GetAtt MyLaunchTemplate.LatestVersionNumber + MinSize: '1' + MaxSize: '1' + DesiredCapacity: '1' + TargetGroupARNs: + - !Ref ALBTargetGroup + Tags: + - Key: Name + Value: MyASGInstance + PropagateAtLaunch: true + + MyDBSubnetGroup: + Type: AWS::RDS::DBSubnetGroup + Properties: + DBSubnetGroupDescription: Subnet group for task15 RDS + SubnetIds: + - !Ref task15PublicSubnet1 + - !Ref task15PublicSubnet2 + + Tags: + - Key: Name + Value: task15-DBSubnetGroup + + MyDBSecurityGroup: + Type: AWS::EC2::SecurityGroup + Properties: + GroupDescription: Allow RDS access from public instances + VpcId: !Ref task15 + SecurityGroupIngress: + - IpProtocol: tcp + FromPort: 3306 + ToPort: 3306 + SourceSecurityGroupId: !Ref PublicSecurityGroup + Tags: + - Key: Name + Value: task15-RDSSG + + MyRDSInstance: + Type: AWS::RDS::DBInstance + Properties: + DBInstanceIdentifier: task15-db + AllocatedStorage: 20 + DBInstanceClass: db.t3.micro + Engine: mysql + EngineVersion: 8.0.32 + MasterUsername: admin + MasterUserPassword: Task15SecurePwd123 # Use SecretsManager for real apps! + VPCSecurityGroups: + - !Ref MyDBSecurityGroup + DBSubnetGroupName: !Ref MyDBSubnetGroup + MultiAZ: false + PubliclyAccessible: false + StorageType: gp2 + BackupRetentionPeriod: 7 + Tags: + - Key: Name + Value: task15-RDSInstance