pip install confluent_kafkabrew install librdkafka- Add krb5.conf in /etc/
- keep keytab file on a known path and replace it with <path_to_keytab>
- replace value of <bootsrap_servers>
- change value of principal user@realm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [default] | |
| region=ap-south-1 | |
| output = json | |
| [profile sm-peer-account] | |
| region = ap-south-1 | |
| output = json | |
| role_arn=arn:aws:iam::0000000000:role/my-iam-role | |
| credential_source=Ec2InstanceMetadata or EcsContainer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.atlassian.jira.component.ComponentAccessor | |
| import com.atlassian.jira.issue.IssueFieldConstants | |
| import com.atlassian.jira.issue.fields.IssueLinksSystemField | |
| import com.opensymphony.workflow.InvalidInputException | |
| import webwork.action.ActionContext | |
| def fieldManager = ComponentAccessor.getFieldManager() | |
| def linksSystemField = fieldManager.getField("issuelinks") as IssueLinksSystemField | |
| def request = ActionContext.getRequest() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| from httplib2 import Http | |
| from oauth2client.client import SignedJwtAssertionCredentials | |
| from apiclient.discovery import build | |
| client_email = "user@manifest-device.iam.gserviceaccount.com" | |
| key_json_file = "<gcp_key_of_the_user>" | |
| private_key = json.loads(open(key_json_file).read())['private_key'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from confluent_kafka import Consumer, KafkaError | |
| topics = ['topic_name'] | |
| conf = { | |
| 'bootstrap.servers': '<bootsrap_servers>:9092', | |
| 'security.protocol': 'SASL_PLAINTEXT', | |
| 'sasl.kerberos.service.name': 'kafka', | |
| 'sasl.kerberos.keytab': '<path_to_keytab>', | |
| 'sasl.kerberos.kinit.cmd': 'kinit -k -t <path_to_keytab> <principal>', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from datetime import datetime | |
| from aggregator.tasks import * | |
| n = datetime.strptime("2019-06-20 16:00:00", "%Y-%m-%d %H:%M:%S") | |
| m = datetime.strptime("2019-06-20 17:00:00", "%Y-%m-%d %H:%M:%S") | |
| def datetime_range(start, end, delta): | |
| current = start | |
| while current < end: | |
| yield current |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| client = boto3.Session(profile_name='acc_profile').client('route53') | |
| hosted_zone_id = '********' | |
| resp = client.list_resource_record_sets(HostedZoneId=hosted_zone_id) | |
| for i in resp['ResourceRecordSets']: | |
| print i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import boto3 | |
| instance_id = "i-04aea94******3" | |
| client = boto3.Session(profile_name='default', region_name='ap-south-1').client('ec2') | |
| client.create_image(DryRun=False, InstanceId=instance_id, Name="image_name", Description="description", NoReboot=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import boto3 | |
| from pprint import pformat | |
| autoscaling_client = boto3.client("autoscaling") | |
| lb_client = boto3.client("elbv2") | |
| cloudwatch_client = boto3.client("cloudwatch") | |
| for asg_info in ['asg_name_list']: | |
| p_asg = {} | |
| up_threshold = 0.02 |
Running both HTTPD and Tomcat service inside a single Docker container. A Docker container essentially runs a single service inside a container, however we can tweak this functionality to run multiple service inside a container using SupervisorD. Creating a Docker image using below steps.
![Sample Docker Container] (https://d2mxuefqeaa7sj.cloudfront.net/s_5E4E5D4E7819918F4A7FFC5AD14BA5406AEE511BEF98A38F756ED666B912BEA8_1469036761891_Screen+Shot+2016-07-20+at+11.15.42+PM.png)
- Base image: CentOS6.
NewerOlder