Skip to content

Instantly share code, notes, and snippets.

View okram999's full-sized avatar

Niris Okram okram999

View GitHub Profile
@okram999
okram999 / Some commands to provision env
Last active December 16, 2016 21:20
Some commands to provision env
##aws cli command to create an EC2
aws ec2 run-instances --image-id ami-d440a6e7 --security-group-ids sg-1a534363 --count 1 --instance-type t2.micro --key-name aws-hplap --query 'Instances[0].InstanceId'
##knife bootstrap
knife bootstrap ec2-54-202-209-195.us-west-2.compute.amazonaws.com -r "role[jenkinsCI_1]" -x centos -E utilities_dev_1 -N jen --sudo
The default conf file of nginx:
/etc/nginx/nginx.conf
The above file should have an entry like so:
include /etc/nginx/conf.d/*.conf;
The ^above line creates a directive to include any other configuration files. The config files can be for
http and https configuratons.
The conf files for HTTP & HTTPS will have the below directives:
<#--
Copyright 2017 XEBIALABS
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
@okram999
okram999 / docker deletez
Last active May 28, 2017 18:03
blowing up all the dockers
#!/bin/bash
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
@okram999
okram999 / docker cheat-sheet
Last active May 30, 2017 06:55
Some docker commands gathered
#available images
docker images
#active containers
docker ps
#all the containers
docker ps -a
#running docker image
@okram999
okram999 / Some basics
Created August 20, 2017 21:06
Chef Retraining
run the following chef generate cookbook command to generate a cookbook named learn_chef_httpd.
chef generate cookbook cookbooks/learn_chef_httpd
@okram999
okram999 / Notes on AWS revisit
Last active October 18, 2017 19:04
Quick Tips
Subnets do not span accross AZ's.
You are creating a new VPC with 3 subnets in 3 separate availability zones - By default all subnets will be able to communicate with each other using the main route table.
Create VPC
Create Subnets in multiple AZ
Create IGN
Attach IGN to VPC
## launching instances to test the internet connectivity and interconnectivity
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "AWS CloudFormation Sample Template AutoScalingMultiAZWithNotifications: Create a multi-az, load balanced and Auto Scaled sample web site running on an Apache Web Serever. The application is configured to span all Availability Zones in the region and is Auto-Scaled based on the CPU utilization of the web servers. Notifications will be sent to the operator email address on scaling events. The instances are load balanced with a simple health check against the default web page. **WARNING** This template creates one or more Amazon EC2 instances and an Application Load Balancer. You will be billed for the AWS resources used if you create a stack from this template.",
"Parameters" : {
"VpcId" : {
"Type" : "AWS::EC2::VPC::Id",
"Description" : "VpcId of your existing Virtual Private Cloud (VPC)",
@okram999
okram999 / sfdx
Last active November 19, 2017 19:39
salesforce dx
#login and cache credentials
sfdx force:auth:web:login
#Adding the -d flag sets this org as the default Developer Hub. Use the -a to set an alias for the org
#(something catchy like DevHub). An alias is much easier to remember than the unique Dev Hub username
sfdx force:auth:web:login -d -a DevHub
### Only indicate the -d flag for your Dev Hub.
#Log In to Sandboxes
@okram999
okram999 / sfdx command list
Created November 19, 2017 19:32
sfdx force:doc:commands:list
$ sfdx force:doc:commands:list
=== Commands
force:alias:list # list username aliases for the Salesforce CLI
force:alias:set # set username aliases for the Salesforce CLI
force:apex:class:create # create an Apex class
force:apex:execute # execute anonymous Apex code
force:apex:log:get # fetch a debug log
force:apex:log:list # list debug logs
force:apex:test:report # display test results
force:apex:test:run # invoke Apex tests