git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
<?php | |
/** | |
* Assumes https://github.com/Spomky-Labs/jose library is installed and autoloading is set up | |
* Decode and verify token guide: https://github.com/Spomky-Labs/jose/blob/master/doc/operation/Verify.md | |
*/ | |
use Jose\Factory\JWKFactory; | |
use Jose\Loader; | |
// We load the key set from a URL | |
// JSON Key URL (JKU) - https://cognito-idp.{region}.amazonaws.com/{userPoolId}/.well-known/jwks.json. |
{ | |
"Version": "2012–10–17", | |
"Statement": [ | |
{ | |
"Sid": "VisualEditor0", | |
"Effect": "Allow", | |
"Action": "s3:ListBucket", | |
"Resource": "arn:aws:s3:::<bucket-name>", | |
"Condition": { | |
"StringLike": { |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>AWS Cognito + Facebook Login JavaScript Example</title> | |
<meta charset="UTF-8"> | |
</head> | |
<body> | |
<script src="https://sdk.amazonaws.com/js/aws-sdk-2.1.41.min.js"></script> | |
<script> | |
#!/bin/bash | |
instance_profile=`curl http://169.254.169.254/latest/meta-data/iam/security-credentials/` | |
aws_access_key_id=`curl http://169.254.169.254/latest/meta-data/iam/security-credentials/${instance_profile} | grep AccessKeyId | cut -d':' -f2 | sed 's/[^0-9A-Z]*//g'` | |
aws_secret_access_key=`curl http://169.254.169.254/latest/meta-data/iam/security-credentials/${instance_profile} | grep SecretAccessKey | cut -d':' -f2 | sed 's/[^0-9A-Za-z/+=]*//g'` | |
token=`curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/${instance_profile} | sed -n '/Token/{p;}' | cut -f4 -d'"'` | |
file="somefile.deb" | |
bucket="some-bucket-of-mine" | |
date="`date +'%a, %d %b %Y %H:%M:%S %z'`" |
[plugins] | |
cwlogs = cwlogs | |
[default] | |
region = ap-southeast-2 |
input { | |
file { | |
#if you are reading files that syslog-ng has written to. | |
path => ["/var/log/syslog-ng.log"] | |
type => "syslog" | |
tags => [ "network" ] | |
} | |
tcp { | |
#if syslog-ng is relaying to logstash on TCP/514 | |
port => 514 |
# A part of the Halyard config file declaring the ECR registries. | |
# There can be multiple registries, each in different AWS account. | |
# In this example there are 3 "stages" accounts - dev, stage & live. | |
# NOTE: The declared password files must exist and provide valid base64 encoded values, | |
# otherwise Halayrd will endup with an exception during deployment. | |
# The values can be fake, they will be updated later by the Kubernetes Job (see 2-nd attached file). | |
# NOTE: replace ${YOUR_DEV_AWS_ACCOUNT_ID} ${YOUR_DEV_AWS_REGION} | |
# with appropriate values (same for STAGE & LIVE). | |
dockerRegistry: |
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
#!/bin/sh | |
# Make sure to: | |
# 1) Name this file `backup.sh` and place it in /home/ubuntu | |
# 2) Run sudo apt-get install awscli to install the AWSCLI | |
# 3) Run aws configure (enter s3-authorized IAM user and specify region) | |
# 4) Fill in DB host + name | |
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket) | |
# 6) Run chmod +x backup.sh | |
# 7) Test it out via ./backup.sh |
#/bin/bash | |
########################################################## | |
### INTRODUCTION | |
########################################################## | |
: ' | |
Install and configure R (Redis) + ELK server from scratch on CentOS 6.5. | |
* Logstash version 1.4.2 | |
* Elasticsearch version 1.3.2 |