Skip to content

Instantly share code, notes, and snippets.

@edwardsharp
edwardsharp / bucket_sync_service.rb
Created May 10, 2016 23:18
ruby class to copy from one aws s3 bucket to another based on bantic/bucket_sync_service.rb
require 'aws-sdk'
class BucketSyncService
attr_reader :from_bucket, :to_bucket, :logger
attr_accessor :debug
DEFAULT_ACL = "public-read"
def initialize(from_bucket, to_bucket)
@maxdbn
maxdbn / sidekiq.config
Last active May 23, 2021 12:05
Gracefully restarting Sidekiq on Elasticbeanstalk, only after it's done with the running jobs. Tested on: 64bit Amazon Linux 2016.09 v2.3.0 running Ruby 2.3 (Puma). Thanks to ssaunier for the original gist! https://gist.github.com/ssaunier/44bbebb9c0fa01953860
# Sidekiq interaction and startup script
commands:
create_post_dir:
command: "mkdir -p /opt/elasticbeanstalk/hooks/appdeploy/post"
ignoreErrors: true
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/50_restart_sidekiq.sh":
mode: "000755"
owner: root
group: root
@januszm
januszm / change_eb_ruby_version.sh
Last active January 6, 2025 15:46
Change Ruby minor version in AWS Elastic Beanstalk
# Currently (2017/2018) it's not possible to change the Ruby 'minor' version (eg. 2.3 => 2.4) using the web console
# However, it's possible using the 'awscli' tool.
brew install awscli # pip install awscli
AWS_PROFILE=profile_from_credentials_file AWS_REGION=us-east-2 aws elasticbeanstalk update-environment \
--platform-arn "arn:aws:elasticbeanstalk:us-east-2::platform/Ruby 3.3 running on 64bit Amazon Linux 2023/4.3.0" \
--environment-name "myappenv1" --region us-east-2 \
--version-label "app-1234-210000_120123"
# older awscli using --solution-stack-name
@hanxue
hanxue / ffmpeg.txt
Created March 11, 2019 18:42
youtube-dl ffmpeg post processor not found
$ ffmpeg
dyld: Library not loaded: /usr/local/opt/x265/lib/libx265.165.dylib
Referenced from: /usr/local/bin/ffmpeg
Reason: image not found
Abort trap: 6