Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

James Turnbull jamtur01

💭
I may be slow to respond.
View GitHub Profile
View gist:275844
--- !ruby/object:Gem::Specification
name: puppet
version: !ruby/object:Gem::Version
version: 0.25.3
platform: ruby
authors:
- Reductive Labs
autorequire:
bindir: bin
cert_chain: []
View console-csv.rb
# script/console
include IssuesHelper
include CustomFieldsHelper
# All issues and projects
File.open('output-file.csv','w') do |f|
f.puts issues_to_csv(Issue.all)
end
# the "puppet" project
View .vimrc
set background=dark
set showmatch
set showmode
set showcmd
set ruler
set title
set wildmenu
set esckeys
set ignorecase
set smartcase
View gist:865426
file { '/etc/hosts':
type => 'file',
ctime => 'Thu Mar 03 07:23:11 +1100 2011',
ensure => 'file',
content => '{md5}69fd72bb330ebe4211aad6f5aba7bd67',
group => '0',
owner => '0',
mode => '644',
mtime => 'Thu Mar 03 07:23:11 +1100 2011'
}
View gist:865428
ralsh file /etc/hosts
file { '/etc/hosts':
type => 'file',
ctime => 'Thu Mar 03 07:23:11 +1100 2011',
ensure => 'file',
content => '{md5}69fd72bb330ebe4211aad6f5aba7bd67',
group => '0',
owner => '0',
mode => '644',
mtime => 'Thu Mar 03 07:23:11 +1100 2011'
@jamtur01
jamtur01 / middleware.rb
Created Jun 11, 2011 — forked from skippy/middleware.rb
delete vagrant vm's chef client and node from chef server on destroy
View middleware.rb
class OnDestroyMiddleware
def initialize(app, env)
@app = app
end
def call(env)
env["config"].vm.provisioners.each do |provisioner|
env.ui.info "Attempting to remove client #{provisioner.config.node_name}"
`knife client show #{provisioner.config.node_name}`
if $?.to_i == 0
@jamtur01
jamtur01 / Importing posts from Wordpress into Jekyll.rb
Created Aug 8, 2011 — forked from zanshin/Importing posts from Wordpress into Jekyll.rb
The script I used to import posts from my Wordpress blog into a new Jekyll one - modified to add tags and categories and NOT convert to Markdown
View Importing posts from Wordpress into Jekyll.rb
%w(rubygems pp sequel fileutils yaml active_support/inflector).each{|g| require g}
module WordPress
def self.import(database, user, password, table_prefix = "wp", host = 'localhost')
db = Sequel.mysql(database, :user => user, :password => password, :host => host, :encoding => 'utf8')
%w(_posts _drafts images/posts/featured).each{|folder| FileUtils.mkdir_p folder}
query = <<-EOS
View list.txt
jamtur01/bunraku
jamtur01/puppet-rundeck
jamtur01/puppet-datadog-agent
jamtur01/puppet-irc
jamtur01/puppet-datadog
jamtur01/puppet-boxcar
jamtur01/puppet-github-face
jamtur01/puppet-campfire
jamtur01/puppet-noah