Skip to content

Instantly share code, notes, and snippets.

View flaccid's full-sized avatar

Chris Fordham flaccid

View GitHub Profile
@flaccid
flaccid / gist:1205515
Created September 9, 2011 04:52
RightScript: Install & configure Jenkins CI Server
#!/bin/bash -e
# RightScript: Install & configure Jenkins CI Server
# this script uses process management techniques to detach parent processes that have childs that don't detach as well as effectively delay events due to the backgrounding
# for verification on the instance, use:
# tail -f /var/log/messages /var/log/jenkins-install.log
log_file="/var/log/jenkins-install.log"
# Cookbook Name:: rs_utils
# Recipe:: setup_timezone
#
# Copyright (c) 2011 RightScale Inc
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
@flaccid
flaccid / gist:1271496
Created October 7, 2011 22:38
some postgresql tuning
#!/opt/rightscale/sandbox/bin/ruby
puts '= postgresql-tune ='
system 'psql --version'
PGDATA = `echo -n /etc/postgresql/*/main`
require 'rubygems'
require 'ohai'
require "ftools"
@flaccid
flaccid / gist:1407099
Created November 29, 2011 23:16
install fog with chef
gem_package "fog"
script "test_fog" do
interpreter "/usr/bin/ruby"
code <<-EOH
require 'fog'
EOH
end
@flaccid
flaccid / PKGBUILD
Created November 3, 2012 07:35
PKGBUILD for rightscale archlinux package from binary deb pkg
# Maintainer: Chris Fordham <chris@xhost.com.au>
pkgname=rightscale
pkgver=5.8.8
pkgrel=1
epoch=
pkgdesc=""
arch=('x86_64')
url="http://rightscale.com/"
license=('RightScale')
groups=()
@flaccid
flaccid / gist:5890243
Last active December 19, 2015 03:29
Play with solution for COOK-2079 providers/passenger_apache2.rb
#
# Cookbook Name:: application_ruby
# Provider:: passenger
#
# Copyright 2012, ZephirWorks
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@flaccid
flaccid / gist:6879889
Created October 8, 2013 05:28
xorg - nvidia driver, 4 displays on 2 cards
Section "Device"
Identifier "Device0"
Driver "nvidia"
BoardName "NVIDIA Corporation GT218 [GeForce 210] (rev a2)"
BusID "PCI:1:0:0"
Screen 0
EndSection
Section "Device"
Identifier "Device1"
@flaccid
flaccid / gist:6893173
Created October 8, 2013 22:52
nvidia-settings generated, 2 cards, 4 screens xorg.conf
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings: version 325.15 (buildmeister@swio-display-x64-rhel04-03) Wed Jul 31 19:04:13 PDT 2013
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 3120 252
Screen 1 "Screen1" 1920 0
Screen 2 "Screen2" 0 0
Screen 3 "Screen3" 5040 601
InputDevice "Keyboard0" "CoreKeyboard"
@flaccid
flaccid / librarian_chef_dsl_parser.rb
Created October 24, 2013 02:01
lightweight ruby class to parse Cheffiles
require 'net/http'
require 'uri'
class LibrarianChefDSLParser
attr_accessor :site, :cookbooks
def initialize(cheffile, &data)
@cheffile = cheffile
@cookbooks = []
data = false
@flaccid
flaccid / gist:7541374
Created November 19, 2013 07:02
RightScale mechanize
# http://mechanize.rubyforge.org/
require 'mechanize'
agent = Mechanize.new
login_page = agent.get("https://my.rightscale.com/")
logged_in_page = login_page.form_with(:action => '/session') do |form|
form.email="bill.gates@microsoft.com"
form.password="bluescreen"
end.click_button