I don't know anything about elasticsearch. All I know is this mongo-connector thing makes life easy. Here are some quick start instructions to follow for setup:
- Follow these instructions to install mongo on 14.04.
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
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
defaults write com.apple.dock static-only -bool TRUE; killall Dock | |
defaults write com.apple.dock showhidden -bool TRUE; killall Dock | |
defaults write com.apple.dock autohide-time-modifier -float 1; killall Dock | |
defaults write com.apple.dock tilesize -int 16; killall Dock |
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
sqs = boto3.resource('sqs', 'us-east-1') # python code | |
sqs_queue = sqs.get_queue_by_name(QueueName=queue_name) | |
msg = json.dumps({'timestamp': time.time(), 'type': 'job', 'data': payload)) # equivalent of JSON.stringify | |
sqs_queue.send_message(MessageBody=fake_message) |
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
#!/bin/bash | |
# Usage: bash find_user_by_aws_access_key.sh SOME_AWS_ACCESS_KEY | |
# This script finds the user in the account who has a given access key | |
ACCESS_KEY=$1 | |
for user in `aws iam list-users | jq -r '.Users[].UserName'`; do | |
USER=`aws iam list-access-keys --user $user | jq '.AccessKeyMetadata[] | select(.AccessKeyId == "'"$ACCESS_KEY"'")'` | |
if [ -n "$USER" ]; then | |
echo "$USER" | |
exit 0 |
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
Fri Nov 11 17:03:17 UTC 2016 |
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
provider "aws" { | |
region = "us-east-1" | |
} | |
data "aws_instances" "boxes" { | |
instance_ids = ["i-########", "i-########"] | |
} | |
data "template_file" "boxes" { | |
template = "$${instance_subnet}" |
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
provider "aws" { | |
region = "us-east-1" | |
} | |
data "aws_route_table" "art" { | |
subnet_id = "subnet-########" | |
} | |
data "template_file" "art" { | |
template = "$${rtb_route}" |
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
provider "aws" { | |
region = "us-east-1" | |
} | |
variable "cidr" { | |
# default = "0.0.0.0/0" | |
default = "" | |
} | |
resource "aws_security_group" "dummy" { |