Skip to content

Instantly share code, notes, and snippets.

View madAndroid's full-sized avatar
🏠
Working from home

Andrew Stangl madAndroid

🏠
Working from home
View GitHub Profile
@madAndroid
madAndroid / gem-fetch-dependencies
Created July 28, 2012 15:45 — forked from Milly/gem-fetch-dependencies
Extend 'gem fetch' command. Fetch all dependencies.
#!/usr/bin/ruby
require 'rubygems'
require 'rubygems/commands/fetch_command'
class Gem::Commands::FetchCommand
def add_version_option_with_fetch_depends
add_version_option_without_fetch_depends
add_option('-y', '--[no-]dependencies',
"Fetch dependent gems") do |value, options|
@madAndroid
madAndroid / psqlfix.txt
Created September 5, 2012 13:21
Change postgres default template0 to UTF8 encoding
mike@rbci:~$ psql -U postgres
psql (9.0.3)
Type "help" for help.
postgres=# update pg_database set datallowconn = TRUE where datname = 'template0';
UPDATE 1
postgres=# \c template0
You are now connected to database "template0".
template0=# update pg_database set datistemplate = FALSE where datname = 'template1';
UPDATE 1
@madAndroid
madAndroid / gist:3658631
Created September 6, 2012 17:09
hiera not working as expected under vagrant
vagrant@sf-precise-64:~$ cat /vagrant/infrastructure/vagrant/hiera.yaml
---
:backends: - yaml
- puppet
:logger: console
:hierarchy: - environments/%{sf_environment}/%{host}
- environments/%{sf_environment}/common
- common
@madAndroid
madAndroid / gist:3866941
Created October 10, 2012 17:04
Fix Price vs. T&M (Time and Material) Contracts

Some time ago the development team at my firm staged a revolt against the sales team and senior management: our demand was that no SOW* (Statement of Work) was to be sent to a customer without first being reviewed by a member of the development team. The message was clear “We refuse to be held responsible to deliver on terms in which we had no say”. Today it's not uncommon for a senior member of the development team to author an SOW in its entirety. IT people are good with documents and detail oriented. They are good at breaking down large ideas into small, manageable chunks and great at finding loopholes. In many ways IT people are better equipped than sales staff to write an SOW.  However, today I would like to explore an important aspect of any Statement of Work: the pricing model.

Though there are countless pricing models in use throughout the world, the two that are most prevalent in the IT world are:

Fixed Price (also referred to as Fixed Fee): Here both the price and the scope of wor

path /file_metadata/files
auth yes
allow_ip 127.0.0.1/8
allow_ip 10.0.0.0/8
allow_ip 10.0.0.0/8
path /file_content/files
auth yes
allow_ip 127.0.0.1/8
allow_ip 10.0.0.0/8
@madAndroid
madAndroid / gist:4757824
Created February 11, 2013 21:34
Whiting out / on vagrant box
erial-sf_vm_28431: ++ df --sync -kP /
serial-sf_vm_28431:
serial-sf_vm_28431: + count=35770252
serial-sf_vm_28431:
serial-sf_vm_28431: + let count--
serial-sf_vm_28431:
serial-sf_vm_28431: + dd if=/dev/zero of=/tmp/whitespace bs=1024 count=35770251
serial-sf_vm_28431:
serial-sf_vm_28431: 35770251+0 records in
serial-sf_vm_28431:
@madAndroid
madAndroid / deploy.rb
Created February 13, 2013 07:40 — forked from nathany/deploy.rb
set :user, 'vagrant'
set :run_method, :sudo
role :app, '33.33.33.10'
ssh_options[:keys] = `vagrant ssh_config | grep IdentityFile`.split.last
# I got tired of uploading to /tmp then moving to the correct location, so these two convenience methods will save you a lot of time in the long run.
# Helper method to upload to /tmp then use sudo to move to correct location.
def put_sudo(data, to)
filename = File.basename(to)
to_directory = File.dirname(to)
put data, "/tmp/#{filename}"
run "#{sudo} mv /tmp/#{filename} #{to_directory}"
end
#
# Automatically generated by blueprint(7). Edit at your own risk.
#
class laptop {
Exec {
path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
Class['sources'] -> Class['files'] -> Class['packages']
class files {
file {
diff --git a/scalefactory.com/modules/sf_nodeless/lib/facter/sf_nodeless.rb b/scalefactory.com/modules/sf_nodeless/lib/facter/sf_nodeless.rb
index dbbbe3b..45842de 100644
--- a/scalefactory.com/modules/sf_nodeless/lib/facter/sf_nodeless.rb
+++ b/scalefactory.com/modules/sf_nodeless/lib/facter/sf_nodeless.rb
@@ -40,7 +40,8 @@ if ec2_userdata
end
#################################################################################
-# Cloudstack fact finding
+# JSON http response fact finding