Skip to content

Instantly share code, notes, and snippets.

@tgmerritt
tgmerritt / watermark_with_image.rb
Created September 25, 2017 21:03 — forked from adityashedge/watermark_with_image.rb
Watermark images with ImageMagick 'convert' using 'composite', 'watermark' and 'dissolve' in Ruby
# Watermarking image with another image using Imagemagick 'composite', 'watermark' and 'dissolve'.
require "rubygems"
require "RMagick"
require "pry"
include Magick
# Read the image in the memory with RMagick
puts "What is the image file you want to watermark?"
puts "Drag and drop the file here or enter the full path to the image"
path = gets.chomp
@tgmerritt
tgmerritt / 01_elastic_beanstalk_install_packages.config
Created February 11, 2020 18:49 — forked from hanhdt/01_elastic_beanstalk_install_packages.config
Setup additional linux packages on AWS Elastic Beanstalk that need to build Rails 5
# Setup linux packages
option_settings:
- option_name: BUNDLE_DISABLE_SHARED_GEMS
value: "1"
- option_name: BUNDLE_PATH
value: "vendor/bundle"
packages:
yum:
curl: []
@tgmerritt
tgmerritt / AWS_Single_LetsEncrypt.yaml
Created February 13, 2020 22:07 — forked from tony-gutierrez/AWS_Single_LetsEncrypt.yaml
AWS Elastic Beanstalk .ebextensions config for single instance free SSL using letsencrypt certbot and nginx. http://bluefletch.com/blog/domain-agnostic-letsencrypt-ssl-config-for-elastic-beanstalk-single-instances/
# Dont forget to set the env variable "certdomain", and either fill in your email below or use an env variable for that too.
# Also note that this config is using the LetsEncrypt staging server, remove the flag when ready!
Resources:
sslSecurityGroupIngress:
Type: AWS::EC2::SecurityGroupIngress
Properties:
GroupId: {"Fn::GetAtt" : ["AWSEBSecurityGroup", "GroupId"]}
IpProtocol: tcp
ToPort: 443
@tgmerritt
tgmerritt / 01_nginx.config
Created February 19, 2020 02:00 — forked from luisacarrion/01_nginx.config
AWS Elastic Beanstalk .ebextensions - get S3 file with commands key
commands:
01_get_nginx_conf_file:
command: aws s3 cp s3://your-bucket-name/shared_config/an_nginx_http.conf /home/ec2-user
container_commands:
01_move_nginx_conf_file:
command: mv -f /home/ec2-user/an_nginx_http.conf /etc/nginx/conf.d/an_nginx_http.conf
02_reload_nginx:
command: "sudo service nginx reload"