Skip to content

Instantly share code, notes, and snippets.

@proppy
proppy / README.md
Last active December 6, 2022 09:32
apk2layer

apk2layer

apk2layer flattens an alpine linux package(s) and its dependencies into a standalone tarball.

Usage

apk2layer [-mirror] PKGNAME... > layer.tar
@ismell
ismell / setup-bridge.sh
Last active October 24, 2022 04:37 — forked from anonymous/setup-bridge.sh
Scripts to re-create the docker0 bridge and setup a different ip subnet
#!/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
@njvitto
njvitto / deploy.rake
Created April 11, 2010 16:56 — forked from RSpace/deploy.rake
Rakefile to deploy and rollback to Heroku in two different environments (staging and production) for the same app
#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
@millisami
millisami / gist:3798773
Created September 28, 2012 09:04 — forked from juanje/gist:3797297
Mount apt cache of a Vagrant box in the host to spin up the packages installation

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)
@ryanlecompte
ryanlecompte / gist:1619490
Created January 16, 2012 06:59
Experimenting with forking and unix sockets in Ruby
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

Preview build: Container grouping and stack composition

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.

The error looks like this?

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.

How to run only the broken integration task:

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
@rafaeldff
rafaeldff / 2013-10-25-144453_954x534_scrot.png
Last active December 26, 2015 13:28
Status overview for multiple git repositories
2013-10-25-144453_954x534_scrot.png