Skip to content

Instantly share code, notes, and snippets.

@gmcinnes
gmcinnes / gist:3354390
Created August 15, 2012 00:57
Chef Log
[Wed, 15 Aug 2012 00:24:32 +0000] INFO: *** Chef 10.12.0 ***
[Wed, 15 Aug 2012 00:24:32 +0000] DEBUG: Loading plugin os
[Wed, 15 Aug 2012 00:24:32 +0000] DEBUG: Loading plugin kernel
[Wed, 15 Aug 2012 00:24:32 +0000] DEBUG: Loading plugin ruby
[Wed, 15 Aug 2012 00:24:32 +0000] DEBUG: Loading plugin languages
[Wed, 15 Aug 2012 00:24:32 +0000] DEBUG: ---- Begin ruby -e "require 'rbconfig'; puts %Q(platform=#{RUBY_PLATFORM},version=#{RUBY_VERSION},release_date=#{RUBY_RELEASE_DATE},target=#{::Config::CONFIG['target']},target_cpu=#{::Config::CONFIG['target_cpu']},target_vendor=#{::Config::CONFIG['target_vendor']},target_os=#{::Config::CONFIG['target_os']},host=#{::Config::CONFIG['host']},host_cpu=#{::Config::CONFIG['host_cpu']},host_os=#{::Config::CONFIG['host_os']},host_vendor=#{::Config::CONFIG['host_vendor']},bin_dir=#{::Config::CONFIG['bindir']},ruby_bin=#{::File.join(::Config::CONFIG['bindir'], ::Config::CONFIG['ruby_install_name'])},)" STDOUT ----
[Wed, 15 Aug 2012 00:24:32 +0000] DEBUG: platform=x86_64-linu
@gmcinnes
gmcinnes / gist:3300860
Created August 9, 2012 04:06
Sample vagrantfile
Vagrant::Config.run do |config|
config.vm.define :chef_server do |chef_server_config|
chef_server_config.vm.box = "a"
chef_server_config.vm.network :hostonly, "192.168.17.2"
chef_server_config.vm.host_name = "host0"
chef_server_config.vm.provision :shell do |shell|
shell.path = "provision_chef_server.sh"
end
end
@gmcinnes
gmcinnes / lastx
Created July 6, 2012 20:44
unexpected reboot
root@app1:/var/log# last -x
web-tech pts/0 10.91.0.161 Fri Jul 6 11:24 still logged in
web-tech pts/1 10.91.0.161 Thu Jul 5 16:51 - 17:25 (00:34)
web-tech pts/0 10.91.0.161 Thu Jul 5 15:00 - 17:25 (02:24)
web-tech pts/0 10.91.0.161 Thu Jul 5 14:46 - 14:54 (00:08)
runlevel (to lvl 2) 3.2.0-26-generic Thu Jul 5 14:33 - 16:39 (1+02:05)
reboot system boot 3.2.0-26-generic Thu Jul 5 14:33 - 16:39 (1+02:05)
shutdown system down 3.2.0-24-generic Thu Jul 5 14:33 - 14:33 (00:00)
runlevel (to lvl 6) 3.2.0-24-generic Thu Jul 5 14:33 - 14:33 (00:00)
web-tech pts/1 10.91.0.161 Tue Jul 3 17:36 - 17:42 (00:05)
require 'thread'
collection = (0..100).to_a
t = collection.length - 1
cpus = 4
segment = t / cpus
queue = Queue.new
producer = Thread.new do
@gmcinnes
gmcinnes / incomplete_validation.js
Created June 13, 2012 23:08
Incomplete Validation
function handleOnSubmit() {
var formObject = document.getElementById('discovery-document');
if (submitted) {
alert('Form has already been submitted. Please wait for a response.');
return false;
} else {
var errors = false;
var message = 'The form cannot be submitted until the following errors are corrected:n';
var practiceSelection = document.getElementById('00N50000002PT2j');
if (practiceSelection.selectedIndex == 0) {
root@app1:/home/web-tech-lead# wget --post-data='user=123' https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF8
--2012-06-11 15:16:46-- https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF8
Resolving www.salesforce.com (www.salesforce.com)... 204.14.232.33
Connecting to www.salesforce.com (www.salesforce.com)|204.14.232.33|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 0 [text/html]
Saving to: `servlet.WebToLead?encoding=UTF8.3'
[ <=> ] 0 --.-K/s in 0s
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
a { text-decoration:none } </style>
<title>MaRS News</title>
<style type="text/css">
a { text-decoration:none; color:#0369b3; } </style>
<meta content="text/html;charset=UTF-8" http-equiv="content-type" />
</head>
<?php
ini_set('display_errors', 'On');
error_reporting(E_ALL);
include dirname(__FILE__) . "/wp-blog-header.php";
include dirname(__FILE__) . "/wp-content/mu-plugins/wp-search-mu.php";
ini_set('display_errors', 'On');
error_reporting(E_ALL);
wpSearch_buildFullIndex();
auto eth0
iface eth0 inet static
address 192.168.2.117
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
gateway 192.168.2.1
require 'digest/md5'
CURRENT_DIR = File.dirname(__FILE__)
PRESEED_MD5 = "#{Digest::MD5.file("#{CURRENT_DIR}/preseed.cfg").hexdigest}"
Veewee::Session.declare( {
:boot_cmd_sequence => [
"<Esc><Esc><Enter>",
"/install/vmlinuz ",
"noapic ",
"auto-install/enable",