View template.yaml
This file contains 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
AWSTemplateFormatVersion: '2010-09-09' | |
Transform: AWS::Serverless-2016-10-31 | |
Resources: | |
ServerlessRestApi: | |
Type: 'AWS::Serverless::Api' | |
Properties: | |
StageName: Prod | |
DefinitionBody: | |
info: |
View Dockerfile
This file contains 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 centos:7 | |
RUN yum install -y centos-release-scl https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm && \ | |
yum install -y rh-python36 rh-python36-mod_wsgi httpd24 postgresql10 && \ | |
echo "source scl_source enable rh-python36" > /etc/profile.d/scl_python.sh && \ | |
echo "source scl_source enable httpd24" > /etc/profile.d/scl_httpd.sh && \ | |
source /etc/profile && \ | |
pip3 install --no-cache-dir -U pip setuptools wheel virtualenv && yum clean all && rm -rf /var/cache/yum |
View gist:2381ca5f8136f72b3718ca8353a7d5cc
- Elasticsearch Internals
- Lucene Indexing
- Java Library
- Shard
- A shard is an instance of Lucene
- max # of documents in a shard is Integer.MAX_VALUE - 128
- clients do not refer to shards directly (use index instead
- What's in a shard?
- indexed document gets analyzed, put in buffer
- Lucene Indexing
- buffer defaults to 10% of node heap (set with indices.memory.index_buffer_size)
View gist:0f6f7529a5ab819a0975041e495de124
This file contains 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
[root@d1e2b187-78bb-4979-4a61-ead7 ~]# ps ax | |
PID TTY STAT TIME COMMAND | |
1 ? Ss 0:00 /tmp/garden-init | |
6 ? Ss 0:01 httpd (mod_wsgi-express) -f /tmp/mod_wsgi-localhost:8000:0/httpd.conf -DMOD_WSGI_MPM_ENABLE_EVENT_MODULE -DMOD_WSGI_MPM_EXISTS_EVENT_MODULE -DMOD_WSGI_MPM_EXISTS_WOR | |
13 ? Ssl 0:00 /tmp/lifecycle/diego-sshd --allowedKeyExchanges= --address=0.0.0.0:2222 --allowUnauthenticatedClients=false --inheritDaemonEnv=true --allowedCiphers= --allowedMACs= | |
56 ? Sl 0:02 (wsgi:localhost:8000:0) -f /tmp/mod_wsgi-localhost:8000:0/httpd.conf -DMOD_WSGI_MPM_ENABLE_EVENT_MODULE -DMOD_WSGI_MPM_EXISTS_EVENT_MODULE -DMOD_WSGI_MPM_EXISTS_WOR | |
57 ? Sl 0:00 httpd (mod_wsgi-express) -f /tmp/mod_wsgi-localhost:8000:0/httpd.conf -DMOD_WSGI_MPM_ENABLE_EVENT_MODULE -DMOD_WSGI_MPM_EXISTS_EVENT_MODULE -DMOD_WSGI_MPM_EXISTS_WOR | |
72 ? Ssl 0:00 /etc/cf-assets/healthcheck/healthcheck -port=8000 -timeout=1000ms -liveness-interval=30 |
View index.py
This file contains 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 botocore.vendored import requests | |
client = boto3.client('cloudfront') | |
def handler(event, context): | |
for record in event['Records']: | |
key = record['s3']['object']['key'] | |
items = [key] | |
View survey.py
This file contains 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 csv | |
def format_name(response): | |
email_address = response['Email Address'] | |
name = email_address.split('@')[0].replace('.', ' ').title() | |
return "%s (%s)" % (name, response['What is your role?']) | |
def response_id(field_index, response): |
View EMPLOYMENT OFFER 2019.eml
This file contains 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
Return-Path: <careers.us@shell.com> | |
Received: from shell.com ([37.120.146.95]) by | |
inbound-smtp.us-east-1.amazonaws.com with SMTP id | |
d8j5m6dfae652tfcrm9gpnmhp8lnv79c5re4ss01 for ross@karchner.com; Sun, 20 Jan | |
2019 22:55:43 +0000 | |
Received-SPF: fail (spfCheck: domain of shell.com does not designate | |
37.120.146.95 as permitted sender) client-ip=37.120.146.95; | |
envelope-from=careers.us@shell.com; helo=37.120.146.95; | |
Subject: EMPLOYMENT OFFER 2019 | |
From: =?windows-1252?Q?JAMIE_WILLIAMS_-_=28HR_Dept-_SHELL_OIL_COMPANY=29?= |
View after.yaml
This file contains 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
AWSTemplateFormatVersion: 2010-09-09 | |
Outputs: | |
HelloWorldApi: | |
Description: API Gateway endpoint URL for Prod stage for Hello World function | |
Value: !Sub >- | |
https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/hello/ | |
HelloWorldFunctionIamRole: | |
Description: Implicit IAM Role created for Hello World function | |
Value: !GetAtt | |
- HelloWorldFunctionRole |
View export.py
This file contains 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 csv | |
import requests | |
auth = ('username', 'password') | |
API_URL = 'http://jenkins.host/credentials/store/system/api/json?depth=3&pretty=1' | |
response = requests.get(API_URL, auth=auth) | |
data = response.json() |
NewerOlder