Skip to content

Instantly share code, notes, and snippets.

View kceb's full-sized avatar
👨‍💻

Kevin C kceb

👨‍💻
View GitHub Profile
@fupslot
fupslot / beanstalk node command
Created February 6, 2018 13:25
elastic beanstalk node command not found
# Amazon Elastic Beanstalk
## Grand the access to node command
1. sudo su
2. vipw
3. nodejs:x:496:494::/tmp:/bin/bash (":wq" to save changes)
4. sudo su nodejs
5: PATH=$PATH:`ls -td /opt/elasticbeanstalk/node-install/node-* | head -1`/bin
6: node -v (enjoy :)
@humpok
humpok / reset_sidekiq.rb
Created September 13, 2018 13:38
Delete All Sidekiq Batches and Jobs
Sidekiq::BatchSet.new.each { |batch| Sidekiq::Batch::Status.new(batch.bid).delete }
Sidekiq::Queue.all.each(&:clear)
@bookmebus
bookmebus / pumaconf.conf
Created November 25, 2018 03:15
ElasticBeanStalk custom puma config for multiprocess x workers.
container_commands:
# directory '/var/app/current'
# threads 8, 32
# workers %x(grep -c processor /proc/cpuinfo)
# bind 'unix:///var/run/puma/my_app.sock'
# pidfile '/var/run/puma/puma.pid'
# stdout_redirect '/var/log/puma/puma.log', '/var/log/puma/puma.log', true
# daemonize false
01backup_config:
@sethwebster
sethwebster / README.md
Last active April 12, 2023 19:06
Make Docker Cache Gem Installs to speed up Bundle Install

Gem Install Dockerfile Hack

If you're hacking on your Gemfile and using Docker, you know the pain of having the bundle install command run after you've added or removed a gem. Using docker-compose you could mount a volume and stage your gems there, but this adds additional complexity and doesn't always really solve the problem.

Enter this imperfect solution:

What if we installed every gem into it's own Docker layer which would be happily cached for us?

gem-inject-docker does just that. It takes the list of gems used by your app via bundle list and transforms it into a list of RUN gem install <your gem> -v <gem version> statements and injects them into the Dockerfile at a point of your choosing.