Skip to content

Instantly share code, notes, and snippets.

@jedi4ever
jedi4ever / gist:4954727
Last active December 13, 2015 18:19
vm building with veewee CI tuning notes

CPU

  • OK - introduced VEEWEE_CPU_COUNT to override the number of cpus

problem(s):

  • multiple CPU's don't get passed to compiles so only CPU is busy

MEMORY

  • introduced VEEWEE_MEMORY_SIZE to override the memory size
@jedi4ever
jedi4ever / gist:4731314
Created February 7, 2013 14:41
intermittent - rubygems resolver failures
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://production.s3.rubygems.org/latest_specs.4.8.gz [following]
--2013-02-07 14:38:52-- http://production.s3.rubygems.org/latest_specs.4.8.gz
Resolving production.s3.rubygems.org (production.s3.rubygems.org)... 176.32.98.234
Connecting to production.s3.rubygems.org (production.s3.rubygems.org)|176.32.98.234|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 425199 (415K) [binary/octet-stream]
@jedi4ever
jedi4ever / creation example
Created January 23, 2013 18:12
thoughts on veewee && openvz
# Export from an (vagrant) image
# http://wiki.openvz.org/Physical_to_container#Disable_old_network_interface
# Ubuntu - http://wiki.openvz.org/Ubuntu_Gutsy_template_creation
# Ubuntu guest networking - http://blog.hostonnet.com/openvz-ubuntu-guest-have-not-networking
#(ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 7222 -l vagrant 127.0.0.1 "sudo tar --numeric-owner -cjpf - -X /home/vagrant/excludes /" ) > u10.tgz
VID=123
VZ_DIR=/vz
IP=192.168.8.$VID
Handle<Value> params[2] = {
String::New("child"), // event name
String::New("somevalue") // event name
};
v8::Local<v8::Object> ctx = Context::GetCurrent()->Global();
MakeCallback(ctx, "emit", 2, params);
@jedi4ever
jedi4ever / gist:4177532
Created November 30, 2012 18:20
Trello for devopsdays setup
require 'trello'
include Trello
include Trello::Authorization
public_key= "your public_key"
secret = "your secret"
# https://trello.com/1/authorize?key=your_public_key&name=yourappname&response_type=token&scope=read,write,account&expiration=never
key='your key'
if platform?(%w{debian ubuntu})
# Nagios package requires to enter the admin password
# We generate it randomly as it's overwritten later in the config templates
random_initial_password = rand(36**16).to_s(36)
%w{adminpassword adminpassword-password}.each do |setting|
execute "preseed nagiosadmin password" do
command "echo nagios3-cgi nagios3/#{setting} password '#{random_initial_password}' | debconf-set-s
@jedi4ever
jedi4ever / gist:3698451
Created September 11, 2012 13:26
Puppet loop over hash and pass array of args to sysctl
Exec { path => '/usr/bin:/usr/sbin/:/bin:/sbin' }
$sysctl_settings = {
# On Hardware Node we generally need
# packet forwarding enabled and proxy arp disabled
"net.ipv4.ip_forward" => 1 ,
"net.ipv6.conf.default.forwarding" => 1 ,
"net.ipv6.conf.all.forwarding" => 1 ,
"net.ipv4.conf.default.proxy_arp" => 0 ,
# Enables source route verification
@jedi4ever
jedi4ever / gist:3612278
Created September 3, 2012 18:55
Puppet faces experiment - from within ruby
require 'puppet'
require 'puppet/face'
# List available faces
Puppet::Face.faces
# >>> => [:status, :plugin, :man, :help, :resource, :catalog, :node, :file, :config, :certificate_revocation_list, :resource_type, :parser, :module, :instrumentation_data, :facts, :certificate, :key, :certificate_request, :report, :instrumentation_probe, :ca, :secret_agent, :instrumentation_listener]
# List possible actions
Puppet::Face[:module,:current].actions
# >>> [:build, :changes, :generate, :install, :list, :search, :uninstall, :upgrade]
@jedi4ever
jedi4ever / gist:2980013
Created June 23, 2012 21:12
# Relocating hiera directory within a pp file
# Relocating hiera directory within a pp file
$hiera_configdir = inline_template('<%= File.join(File.dirname(scope.lookupvar("settings::manifest")), "..", "hieradata") -%>')
$hiera_yaml_datadir = inline_template('<%= File.join(File.dirname(scope.lookupvar("settings::manifest")), "..", "hieradata") -%>')
@jedi4ever
jedi4ever / gist:2925812
Created June 13, 2012 19:03
Puppet - hash - inline template
# This works
#$snippet = { 'index' => { 'configDir' => 'haha'}}
# This not..
# snippet is not an hash or array when accessing it with index
$snippet = inline_template("<%= { 'index' => { 'configDir' => 'haha'}} %>")
notice("${snippet['index']['configDir']}")