Skip to content

Instantly share code, notes, and snippets.

@maxivak
maxivak / readme.md
Last active September 5, 2022 18:43
Provisioning Docker containers with Chef

Provisioning Docker container with Chef

Chef provisioning

  • Chef provisioning is a framework that allows clusters to be managed by the chef-client and the Chef server in the same way nodes are managed: with recipes.

  • Chef provisioning is a collection of resources that enable the creation of machines and machine infrastructures using the chef-client.

@voter101
voter101 / Gulpfile.js
Last active October 16, 2024 17:37
Gulpfile for Rails application with replaced Sprockets with Gulp
'use strict'
var gulp, sass, babelify, browserify, watchify, source, util;
gulp = require('gulp');
sass = require('gulp-sass');
babelify = require('babelify')
browserify = require('browserify');
watchify = require('watchify');
source = require('vinyl-source-stream');
@dblock
dblock / capybara_wait_until.rb
Created July 24, 2013 07:38
Re-implementation of Capybara wait_until.
class Capybara::Session
def wait_until(timeout = Capybara.default_wait_time)
Timeout.timeout(timeout) do
sleep(0.1) until value = yield
value
end
end
end
@kenn
kenn / gist:5105175
Last active June 13, 2024 16:37
Unicorn memory usage improvement with Ruby 2.0.0

Unicorn memory usage improvement with Ruby 2.0.0

Here's a preliminary experiment to see how much memory is saved with the new copy-on-write friendly (bitmap marking) GC.

Calculated by memstats.rb https://gist.github.com/kenn/5105061 on Debian x86_64.

Master process:

# ./memstats.rb 20547
#!/usr/bin/env ruby
#------------------------------------------------------------------------------
# Aggregate Print useful information from /proc/[pid]/smaps
#
# pss - Roughly the amount of memory that is "really" being used by the pid
# swap - Amount of swap this process is currently using
#
# Reference:
# http://www.mjmwired.net/kernel/Documentation/filesystems/proc.txt#361
@sethcall
sethcall / gist:4512952
Created January 11, 2013 18:43
starter logback columnar log format
<configuration scan="true">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{MMMdd HH:mm:ss.SSS} %8.8thread %3.-3level %15.-15logger{0} %msg %X %n</pattern>
</encoder>
</appender>
<root level="DEBUG">
<appender-ref ref="STDOUT"/>
</root>
@devicenull
devicenull / gist:3896763
Created October 16, 2012 01:25
Clonezilla Live iPXE config
:imaging
set image_name your-image-name
kernel http://${next-server}/tools/clonezilla-live/vmlinuz initrd=tools/clonezilla-live/initrd.img boot=live live-config noswap nolocales edd=on nomodeset ocs_daemonon="ssh" ocs_live_run="ocs-live-restore" ocs_live_extra_param="--batch -g auto -e1 auto -e2 -r -j2 -p reboot restoredisk ${image_name} sda" ocs_live_keymap="/usr/share/keymaps/i386/qwerty/us.kmap.gz" ocs_live_batch="yes" ocs_lang="en_US.UTF-8" vga=788 nosplash fetch=http://${next-server}/tools/clonezilla-live/filesystem.squashfs ip=eth0:${netX/ip}:${netX/netmask}:${netX/gateway}:8.8.8.8 ocs_prerun="mount -t nfs ${next-server}:/home/partimag /home/partimag"
initrd http://${next-server}/tools/clonezilla-live/initrd.img
boot
@rajeshsegu
rajeshsegu / BrowserDetectProtocol.js
Created September 13, 2012 19:26
Detect Browser Custom Protocols
<html>
<head>
<title>Detect Custome Protocol</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.1.min.js"></script>
</head>
<body>
<input id="protocol" value="" placeholder="custom protocol"/>
<button id="launch">Launch</button>
<!-- Mozilla Only -->
<iframe id="hiddenIframe" src="about:blank" style="display:none"></iframe>
@v1nc3ntlaw
v1nc3ntlaw / rbenv.sh
Created March 30, 2012 13:50
rbenv install ruby 1.9.3-p327 on Ubuntu 12.04 LTS for chef bootstrap
# rbenv setup
export RBENV_ROOT=/usr/local/rbenv
export PATH="$RBENV_ROOT/bin:$PATH"
eval "$(rbenv init -)"
@jnx
jnx / rbenv-install-system-wide.sh
Created October 1, 2011 20:09
rbenv install and system wide install on Ubuntu 10.04 LTS.
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Add rbenv to the path: