(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
#!/usr/bin/env bash | |
# | |
# Get the value of a tag for a running EC2 instance. | |
# | |
# This can be useful within bootstrapping scripts ("user-data"). | |
# | |
# Note the EC3 instance needs to have an IAM role that lets it read tags. The policy | |
# JSON for this looks like: | |
# | |
# { |
sudo yum install byobu -y --enablerepo=epel-testing |
""" | |
Publish the function to S3: | |
cd $DIR_WITH_THIS_SCRIPT | |
zip find_latest_ami_name.zip find_latest_ami_name.py | |
aws s3 cp find_latest_ami_name.zip s3://$YOUR_S3_BUCKET/find_latest_ami_name.zip | |
""" | |
import json |
# AWS S3 bucket for static hosting | |
resource "aws_s3_bucket" "website" { | |
bucket = "${var.website_bucket_name}" | |
acl = "public-read" | |
tags { | |
Name = "Website" | |
Environment = "production" | |
} |
# Javascript Node 8 simple CircleCI 2.0 configuration file | |
# Eduardo San Martin Morote | |
# Check https://circleci.com/docs/2.0/language-javascript/ for more details | |
# Put this file in a .circleci/ folder | |
version: 2 | |
jobs: | |
build: | |
docker: |
#!/usr/bin/env bash | |
if [ "$AWS_PROFILE" = "" ]; then | |
echo "No AWS_PROFILE set" | |
exit 1 | |
fi | |
for region in $(aws ec2 describe-regions --region eu-west-1 | jq -r .Regions[].RegionName); do |
Ever had that typo where you wrote cd..
instead of cd ..
— well this tip not only addresses that typo but also adds a couple other aliases to help you easily navigate through your systems directories. #OneDevMinute
################################################
# 🔥 #OneDevMinute
#
# Daily one minute developer tips.
# Ahmad Awais (https://twitter.com/MrAhmadAwais)
version: 2 | |
workflows: | |
version: 2 | |
build: | |
jobs: | |
- test | |
jobs: | |
test: |
@export ENIS=$$(aws ec2 describe-network-interfaces --filters "Name=status,Values=available" | jq ".NetworkInterfaces[] | select(.VpcId == \"$${VPC_ID}\") | .NetworkInterfaceId"); \ | |
if [[ ! -z $${DRY_RUN} ]]; then \ | |
echo "Running in dry run mode! No changes will be made. The following ENIs would be deleted:"; \ | |
echo $${ENIS}; \ | |
exit 0; \ | |
else \ | |
for eni in $$(echo $${ENIS}| tr -d "\""); \ | |
do \ | |
aws ec2 delete-network-interface --network-interface-id $${eni}; \ | |
done; \ |