apk2layer
flattens an alpine linux package(s) and its dependencies into a standalone tarball.
apk2layer [-mirror] PKGNAME... > layer.tar
apk2layer
flattens an alpine linux package(s) and its dependencies into a standalone tarball.
apk2layer [-mirror] PKGNAME... > layer.tar
#!/bin/bash -e | |
IFADDR="192.168.3.1/24" | |
if [[ ! ip link show docker0 ]]; then | |
ip link add docker0 type bridge | |
ip addr add "$IFADDR" dev docker0 | |
ip link set docker0 up | |
iptables -t nat -A POSTROUTING -s "$IFADDR" ! -d "$IFADDR" -j MASQUERADE | |
fi |
#Deploy and rollback on Heroku in staging and production | |
task :deploy_staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag'] | |
task :deploy_production => ['deploy:set_production_app', 'deploy:push', 'deploy:restart', 'deploy:tag'] | |
namespace :deploy do | |
PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU' | |
STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU' | |
task :staging_migrations => [:set_staging_app, :push, :off, :migrate, :restart, :on, :tag] | |
task :staging_rollback => [:set_staging_app, :off, :push_previous, :restart, :on] |
#!/usr/bin/env bash | |
curl https://s3.amazonaws.com/heroku-jvm-buildpack-vi/vim-7.3.tar.gz --output vim.tar.gz | |
mkdir vim && tar xzvf vim.tar.gz -C vim | |
export PATH=$PATH:/app/vim/bin |
This is a little trick I use to spin up the packages instalation on Debian/Ubuntu boxes in Vagrant.
I add a simple function that checks if a directory named something similar to ~/.vagrant.d/cache/apt/opscode-ubuntu-12.04/partial
(it may have another path in Windows or MacOS) and create the directory if it doesn't already exist.
def local_cache(box_name)
cache_dir = File.join(File.expand_path(Vagrant::Environment::DEFAULT_HOME),
'cache',
'apt',
box_name)
require 'base64' | |
require 'socket' | |
require 'fileutils' | |
# UnixSocketForker is an experiment of inter-process communication using | |
# plain unix sockets to communicate between forked processes and the | |
# parent process. This can also be done via IO.pipe. In this experiment, | |
# the jobs are simply random arrays whose sums are calculated in the forked | |
# worker processes. | |
class UnixSocketForker |
NOTE: this is out of date - refer to moby/moby#9694
Here is a preview build of two new features we’re working on concurrently: container grouping (docker groups
) and stack composition (docker up
). Together, they will eventually form a complete replacement for Fig.
Bundler::GemNotFound: Could not find jumpup-heroku-0.0.1.gem for installation
An error occurred while installing jumpup-heroku (0.0.1), and Bundler cannot continue.
Make sure that `gem install jumpup-heroku -v '0.0.1'` succeeds before bundling.
outdated_gems = `gem outdated` | |
regex = %r((?<gem>[\w-]+) \((?<old>[\d\.]+) < (?<new>[\d\.]+)\)) | |
gemfile = File.read("./Gemfile") | |
outdated_gems.each_line do |line| | |
data = line.match(regex) | |
gemfile.gsub!(%r(gem '#{data[:gem]}',(\s+)'[^']+'), "gem '#{data[:gem]}',\\1'#{data[:new]}'") | |
end |