Skip to content

Instantly share code, notes, and snippets.

View jamtur01's full-sized avatar
💭
I may be slow to respond.

James Turnbull jamtur01

💭
I may be slow to respond.
View GitHub Profile
--- !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: []
# 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
set background=dark
set showmatch
set showmode
set showcmd
set ruler
set title
set wildmenu
set esckeys
set ignorecase
set smartcase
ralsh file /etc/hosts
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'
}
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 June 11, 2011 03:19 — forked from skippy/middleware.rb
delete vagrant vm's chef client and node from chef server on destroy
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 August 8, 2011 02:00 — 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
%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
@jamtur01
jamtur01 / list.txt
Created August 9, 2011 05:16
Project list
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