Skip to content

Instantly share code, notes, and snippets.

@werkshy
Last active January 11, 2017 16:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save werkshy/11387849 to your computer and use it in GitHub Desktop.
Save werkshy/11387849 to your computer and use it in GitHub Desktop.
Heroku plugin that installs busybox onto a dynos before dropping you into a bash shell.
#!/usr/bin/env ruby
# Put this file at ~/.heroku/plugins/busybox/init.rb
# Call it with 'heroku busybox'
require 'heroku/helpers'
require 'heroku/command'
require 'heroku/command/run'
class Heroku::Command::Busybox < Heroku::Command::Run
# Run bash on heroku with busybox
#
def index
run_attached(busybox_cmd)
end
protected
def busybox_cmd
<<-CMD
mkdir busybox
curl http://busybox.net/downloads/binaries/latest/busybox-x86_64 --location --silent > busybox/busybox
chmod a+x busybox/busybox
export PATH=$PATH:/app/busybox
busybox --install -s busybox
bash
CMD
end
end
@irubnich
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment