This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ruby '2.1.0' | |
source 'https://rubygems.org' | |
gem 'rack', '~>1.5.2' | |
gem 'actionpack', '~> 4.1.0.beta1' | |
gem 'railties', '~> 4.1.0.beta1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'socket' | |
# From bits/ioctls.h | |
SIOCGIFNETMASK = 0x891b # Netmask address | |
SIOCGIFHWADDR = 0x8927 # hardware address | |
SIOCGIFADDR = 0x8915 # PA address | |
SIOCGIFCONF = 0x8912 # iface list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load 'rake/helper.rb' | |
desc "Set up the VM" | |
task :up do | |
vm = VM.new | |
vm.cli('up') | |
end | |
desc "Shutdown the VM" | |
task :graceful_down do |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run this as CoreOS user at home folder | |
set -e | |
toolbox dnf -y install bash-completion wget \ | |
&& toolbox wget https://raw.githubusercontent.com/docker/docker/master/contrib/completion/bash/docker -O /usr/share/bash-completion/completions/docker \ | |
&& toolbox cp /usr/share/bash-completion /media/root/var/ -R \ | |
&& source /var/bash-completion/bash_completion | |
cp $(readlink .bashrc) .bashrc.new && mv .bashrc.new .bashrc | |
echo "source /var/bash-completion/bash_completion" >> ~/.bashrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'msgpack' | |
require 'thread' | |
class ProcessPool | |
def initialize(num_process, args={}) | |
queue_size, worker_class = parse_args([ | |
:queue_size, nil, | |
:worker_class, Worker, | |
], args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def execute(cmd, flag_file=None, msg_id='', debug=False): | |
""" | |
# http://stackoverflow.com/questions/1606795/catching-stdout-in-realtime-from-subprocess | |
:param cmd: should never inlcude pipe or redirection, which would requires | |
a new shell process | |
This execute logs all stdout and stderr, which could look funny, especially | |
when it comes to tools like aspc and wget | |
""" | |
logger.info('executing: {0}'.format(cmd)) | |
# todo: should check whether cmdsp includes pipe or redirection here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
################################################################################## | |
# 1 - Create the base container | |
SUITE=squeeze | |
RELEASE=$SUITE | |
sudo lxc-create -n ${RELEASE}-base -t debian | |
rootfs="/var/lib/lxc/${RELEASE}-base/rootfs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The latest version of this script is now available at | |
# https://github.com/jasoncodes/dotfiles/blob/master/aliases/rbenv.sh | |
VERSION=1.9.3-p286 | |
brew update | |
brew install rbenv ruby-build rbenv-vars readline ctags | |
if [ -n "${ZSH_VERSION:-}" ]; then | |
echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.zshrc | |
else | |
echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.bash_profile |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer