Skip to content

Instantly share code, notes, and snippets.

View okram999's full-sized avatar

Niris Okram okram999

View GitHub Profile
@okram999
okram999 / parse_cwlogs_sns_notification
Created February 11, 2019 18:25
parse_cwlogs_sns_notification
import json
import boto3
import time
# recieve the event
# Contruct the log_stream
# pull the log
# send notification
@okram999
okram999 / Chef.md
Created February 9, 2019 20:45
Chef

Things to revisit

  • Ohai
@okram999
okram999 / Linux Core
Last active February 8, 2019 21:05
Linux Core
Process:
- instance of a computer prg in execution
- while running a code, the code is loaded from disk to memory
Threads:
- A process can run the program parrallely executing various instructions parallely
- Each thread have their own stacks
- But shares - Text, heap, etc
A process in memory is divided as :
@okram999
okram999 / docker-compose notes
Last active January 23, 2019 15:30
docker-compose notes
depends_on :
- db # This makes the service to restart on the service that its depending on restarts. But not vice-versa
restart: always # This tells the service to restart when a fault occurs
## some commands
$ docker network ls
$ docker network inspect <network_name>
$ docker-compose exec <service_name> sh
$ docker-compose scale <service_name>=3 # here 3 is the desired count

Lamda

More like an annonymous function

even_num = lambda x: x%2 == 0

Map

Takes a functions/lambda and an iterable, and returns a map object. So convert to list

square = map(lambda x: x*2, [1,2,3,4,5,6]) #[2, 4, 6, 8, 10, 12]

Filters

@okram999
okram999 / Check if a fields is referenced anywhere in a sandbox.md
Last active January 16, 2019 21:00
Check if a fields is referenced anywhere in a sandbox

Check if a fields is referenced anywhere in a sandbox

Tools:

  • Ant
  • bash
  • DOS2Unix converter
  • IDE (e.g. VSCode/Atom)
  1. Create a directory structure as
@okram999
okram999 / Enforce SSL in RDS Postgres DB instance.md
Last active February 15, 2019 15:19
Enforce SSL in RDS Postgres DB instance

Requiring SSL in AWS RDS Postgres DB instance

SSL Certificate:

  1. Obtain the root cert from: https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem . This cert will be used for connecting to the db instance when SSL is enforced

Create the new parameter group:

  1. Create a new parameter grp based on the DB engine version, as all the db instances are in default parameter grp [Default parameter grps cannot be modified]
  2. Change the rds.force_ssl to 1 from 0
@okram999
okram999 / Things to do better
Created January 11, 2019 20:10
Things to do better
Cloudformation Templates:
- Improve security
Cloudform the below:
1. CW Alerts
2. Elastic Search
3.
RDS:
@okram999
okram999 / List of kafka commands
Created December 18, 2018 16:47
List of kafka commands
#List the consumer grps
kafka-consumer-groups.bat --bootstrap-server x.x.x.x:9092 -list
@okram999
okram999 / AR - pain
Created December 5, 2018 17:47
AR - pain
Issue with some customFields deployment where the tags were missed and reports were disabled
Merges involving Huge objects (e.g: Opportunity, Account). No assistance from the tool to either help the merge operation / validate the file post merge
Metadata back-up issue
Data backup not available
No sandbox clone/refresh out of the box from the tool
No room to customise the CI/Automated jobs
Unstable platform