Skip to content

Instantly share code, notes, and snippets.

@jedi4ever
jedi4ever / gist:919065
Created April 14, 2011 07:27
AWS Cloudfront : Remarks - Suggestions - Observations

Cloudformation remarks:

  • Idempotent (Re-run of Stack creation) : Currently you can only create/delete a stack. If part of the create fails, default is to rollback all. You can adjust that, but I found no way to re-run the create so that it would create the missing pieces. Also if you destroy an instance by hand, this would come in handy to rebuild part of the stack
  • Slowness: the creation process on paper look as if the dependencies are handled intelligently and possible speedier. I found creating individual instances in parallel faster than creating them in a stack
  • Throttling limit: if you delete, create stack again (f.i. because it failed), I often get errors for throtling limit. I think this limit is not imposed on the regular creation of instances.
  • If a creation fails, you have to delete the stack first. Maybe you need another state, so you don't need to delete it first (like state-terminated)
  • Name limit: this only accepts alphanum , no spaces or dashes to make it more readable in the console.
@jedi4ever
jedi4ever / ruby-1.9.2-to-deb.sh
Created April 14, 2011 11:21 — forked from jtimberman/gist:881058
Ruby 1.9 fp- bash
#!/usr/bin/env bash
sudo apt-get install libssl-dev
sudo gem install fpm
wget ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.2-p180.tar.gz
tar -zxvf ruby-1.9.2-p180.tar.gz
cd ruby-1.9.2-p180
time (./configure --prefix=/usr && make && make install DESTDIR=/tmp/installdir)
cd ..
@jedi4ever
jedi4ever / gist:919537
Created April 14, 2011 14:05
buiding sphinx .deb with fpm
wget http://sphinxsearch.com/files/sphinx-0.9.9.tar.gz
rm -rf sphinx-0.9.9
tar -xzvf sphinx-0.9.9.tar.gz
cd sphinx-0.9.9
./configure --with-pgsql --without-mysql --prefix=/usr
rm -rf /tmp/install-sphinx-0.9.9
mkdir /tmp/install-sphinx-0.9.9
make install DESTDIR=/tmp/install-sphinx-0.9.9
# We need to specify the arch as it not picked up automagically
@jedi4ever
jedi4ever / gist:919605
Created April 14, 2011 14:38
adapted rvm-builder script for better os dependencies
vagrant@maverick:~/rvm-packaging$ cat package-ruby.sh
#!/bin/bash
wantruby=$1
if [ -z "$wantruby" ] ; then
echo "Usage: $0 <ruby>"
echo "Example: $0 jruby"
exit 1
fi
@jedi4ever
jedi4ever / gist:941058
Created April 25, 2011 19:40
Create selfsigned cert in windows - vanilla commands
#run as administrator
#Create the certificate
http://www.jacco2.dds.nl/networking/certutil.html
[NewRequest]
Subject="CN=foo.example.com,C=GB"
KeyLength=2048
MachineKeySet=TRUE
@jedi4ever
jedi4ever / gist:945817
Created April 28, 2011 04:44
snapshot vagrant
require 'vagrant'
env=Vagrant::Environment.new
env.vms[:admin].vm.name
505 VBoxManage snapshot villa-vagrant_1303902657 take sandbox
512 VBoxManage controlvm villa-vagrant_1303902657 poweroff
515 VBoxManage startvm villa-vagrant_1303902657
@jedi4ever
jedi4ever / gist:950798
Created May 1, 2011 19:41
first take on veewee - solaris express 11 install definition
Veewee::Session.declare({
:cpu_count => '1', :memory_size=> '768',
#Disk size needs to be 12Gig +
:disk_size => '15140', :disk_format => 'VDI', :hostiocache => 'off', :use_hw_virt_ext => 'on',
:os_type_id => 'OpenSolaris',
:iso_file => "sol-11-exp-201011-ai-x86.iso",
:iso_src => "",
:iso_md5 => "36527d4d49a645ef6f6d2677c8e0118c",
:iso_download_timeout => 1000,
:boot_wait => "10", :boot_cmd_sequence => [
@jedi4ever
jedi4ever / gist:952098
Created May 2, 2011 18:29
veewee postinstall - solaris 11 - opencsw
# http://projects.puppetlabs.com/projects/1/wiki/Puppet_Solaris
# Add the opencsw package site
export PATH=/usr/bin/:/usr/sbin:$PATH
yes|/usr/sbin/pkgadd -d http://mirror.opencsw.org/opencsw/pkgutil-`uname -p`.pkg all
/opt/csw/bin/pkgutil -U
# We need some header stuff and so on to get gcc going
@jedi4ever
jedi4ever / solaris ai manifest - default.xml
Created May 3, 2011 07:51
solaris 11 - express - i386 - ruby - gcc - chef - puppet - virtualbox - vagrant
falcon-pdb:veewee patrick$ vagrant basebox build mysolaris --force
Verifying the isofile sol-11-exp-201011-ai-x86.iso is ok.
Forcing build by destroying mysolaris machine
VBoxManage unregistervm 'mysolaris' --delete
Deleting vm mysolaris
Creating vm mysolaris : 768M - 1 CPU - OpenSolaris
Creating new harddrive of size 15140
VBoxManage createhd --filename '/Users/patrick/VirtualBox VMs/mysolaris/mysolaris.vdi' --size '15140' --format vdi > /dev/null
Attaching disk: /Users/patrick/VirtualBox VMs/mysolaris/mysolaris.vdi
@jedi4ever
jedi4ever / gist:955604
Created May 4, 2011 17:19
create AMI from instance with fog
>> aws_provider=Fog::Compute.new({ :region => "eu-west-1", :provider => "AWS"})
-> instance (running) = i-c1ac2bb7
>> ami=aws_provider.create_image("i-c1ac2bb7","name","description")
If not yet finished you might see
/Users/patrick/.rvm/gems/ruby-1.8.7-p330@mccloud/gems/excon-0.6.2/lib/excon/connection.rb:178:in `request':
InvalidAMIID.Unavailable => AMI 'ami-796d5b0d' is pending, and cannot be run (Fog::Service::Error)