Skip to content

Instantly share code, notes, and snippets.

@lokeshjawane
lokeshjawane / S3-to-GCS.js
Created September 25, 2018 12:43
Script to sync s3 obj to GCS in realtime
//This script is to copy S3 object to GCS in asynchronously using Lambda function
//set var "gcp_proj_id" with value of you GCP project ID
//set var "gcp_client_email" with value of your client email address from JSON key file & make sure that user has GCS create object permission
//set var "cred_bucket", here provode a s3 bucket from where lambsa will fetch the JSON creds file to GCP auth
//Set vat "cred_s3_obj", here you provide a json keyfile name which is uploaded in "cred_bucket" s23 bucket
//**NOTE**: set HOME env var with value "/tmp" in lambda function, because google-cloud/storage create file locally & in lambda only /tmp is writable. Run lambda function on S3 create object event based.
//
'use strict';
@lokeshjawane
lokeshjawane / supervisord.sh
Created January 19, 2020 18:22
initi.d script to start supervisord on amazon linux
#!/bin/bash
#
# supervisord This scripts turns supervisord on
#
# Author: Mike McGrath <mmcgrath@redhat.com> (based off yumupdatesd)
# Jason Koppe <jkoppe@indeed.com> adjusted to read sysconfig,
# use supervisord tools to start/stop, conditionally wait
# for child processes to shutdown, and startup later
# Mikhail Mingalev <mingalevme@gmail.com> Merged
# redhat-init-jkoppe and redhat-sysconfig-jkoppe, and