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
package com.pulselive.cms.api.common.session; | |
import javax.annotation.PostConstruct; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.beans.factory.annotation.Value; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.context.annotation.Profile; | |
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory; |
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 | |
for image in *.png | |
do | |
width=$(identify -format '%w' $image) | |
height=$(identify -format '%h' $image) | |
cp $image $image.original | |
if [ $width -gt 350 ] | |
then | |
echo "$image - width: $width height: $height" | |
# Resize to 350px width keeping aspect ratio |
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
aws s3 ls s3://mybucket/ --recursive | awk '{print $4}' | parallel 'echo {}; if [ "$(aws s3api head-object --bucket mybucket --output json --key {} | jq .ContentType -r)" = "binary/octet-stream" ]; then echo {} >> dodgy.txt; fi' | |
cat dodgy.txt | grep png | parallel 'echo {}; aws s3 cp --content-type="image/png" --metadata-directive="REPLACE" s3://mybucket/{} s3://mybucket/{}' |
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
# | |
# Configuration for Autoscaling group. | |
# | |
resource "aws_launch_template" "eks-cluster-worker-nodes" { | |
iam_instance_profile = { name = "${aws_iam_instance_profile.eks-cluster-worker-nodes.name}" } | |
image_id = "${data.aws_ami.eks-worker.id}" | |
name = "${var.cluster-name}-eks-cluster-worker-nodes" | |
vpc_security_group_ids = ["${aws_security_group.eks-cluster-worker-nodes.id}"] | |
key_name = "${var.ssh-key-name}" | |
instance_type = "${local.host-types[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
#!/bin/bash -ex | |
dnf install -y thrift-devel libtool m4 automake byacc flex | |
mkdir thriftbuild | |
cd thriftbuild | |
wget https://github.com/apache/thrift/archive/0.9.1.tar.gz | |
tar xvf 0.9.1.tar.gz thrift-0.9.1/ | |
cd thrift-0.9.1/ | |
curl http://cdn-fastly.deb.debian.org/debian/pool/main/t/thrift-compiler/thrift-compiler_0.9.1-2.1.debian.tar.xz -o thrift-debian-patches.tar.xz | |
tar xvf thrift-debian-patches.tar.xz | |
cd compiler/ |
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 | |
# Get directory of script | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
if [[ $# -ne 1 ]] | |
then | |
echo "ERROR: This script expects the namespace name to be given as an argument" | |
echo "e.g. ./ecr-cred-updater.sh my-namespace" | |
exit 1 |
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
Processing Instance Type List from https://www.ec2instances.info/ | |
Getting Current Spot Prices from AWS | |
Processing AZ eu-west-1a | |
You will pay $0.0047 per core for m1.small. It has 1 cores and 1.7GB RAM. Spot price is $0.0047 per hour or $3.384 per month. | |
You will pay $0.0073 per core for m3.medium. It has 1 cores and 3.75GB RAM. Spot price is $0.0073 per hour or $5.256 per month. | |
You will pay $0.0074 per core for c1.medium. It has 2 cores and 1.7GB RAM. Spot price is $0.0148 per hour or $10.656 per month. | |
You will pay $0.0085 per core for c1.xlarge. It has 8 cores and 7.0GB RAM. Spot price is $0.0678 per hour or $48.816 per month. | |
You will pay $0.0095 per core for m1.xlarge. It has 4 cores and 15.0GB RAM. Spot price is $0.0379 per hour or $27.288 per month. | |
You will pay $0.0095 per core for m1.medium. It has 1 cores and 3.75GB RAM. Spot price is $0.0095 per hour or $6.84 per month. |