Skip to content

Instantly share code, notes, and snippets.

@pccowboy
pccowboy / gist:1208814
Created September 10, 2011 21:26
Weird behavior using step
var nouvelle_conn;
Step(
function ha2() {
if (client._path != null) {
nouvelle_conn = tcp.createConnection(client._path);
} else {
nouvelle_conn = tcp.createConnection(client._port, client._host);
}
var self = this;
var window = new DOMWindow(options);
Contextify(window);
// We need to set up self references using Contextify's getGlobal() so that
// the global object identity is correct (window === this).
// See Contextify README for more info.
var global = window.getGlobal();
// Set up the window as if it's a top level window.
@pccowboy
pccowboy / gist:2871640
Created June 5, 2012 00:15
Error when trying to save a new compute host.
ESC[1mESC[36mImage Load (0.2ms)ESC[0m ESC[1mSELECT `images`.* FROM `images` WHERE `images`.`uuid` = 'ami-0d32e364' LIMIT 1ESC[0m
ESC[1mESC[35mSQL (0.2ms)ESC[0m SELECT 1 FROM `architectures` INNER JOIN `architectures_operatingsystems` ON `architectures`.id = `architectures_ope
ratingsystems`.architecture_id WHERE `architectures`.`id` = 1 AND (`architectures_operatingsystems`.operatingsystem_id = 1 ) LIMIT 1
Adding Compute instance for test-das-1.int.sugarinc.com
ESC[1mESC[36mKeyPair Load (0.4ms)ESC[0m ESC[1mSELECT `key_pairs`.* FROM `key_pairs` WHERE (`key_pairs`.compute_resource_id = 2) LIMIT 1ESC[0m
Rolling back due to a problem: Settings up compute instance test-das-1.int.sugarinc.com 1 failed test-das-1.int.sugarinc.comsetCompute
ESC[1mESC[35mSQL (0.2ms)ESC[0m ROLLBACK
Failed to save:
Rendered hosts/_progress.erb (0.2ms)
@pccowboy
pccowboy / gist:2881402
Created June 6, 2012 11:34
error trying to starup
Current task: test-das-1.ec2.internalsetSSHWaitForResponse
Starting SSH provisioning script - waiting for 23.21.33.152 to respond
establishing connection to 23.21.33.152:22
Failed to login via SSH to test-das-1.ec2.internal: No route to host - connect(2)/usr/share/foreman/has_many_polymorphs/ruby/1.8/gems/net-ssh-2.5.1/lib/net/ssh/transport/session.rb:66:in `initialize'
/usr/share/foreman/has_many_polymorphs/ruby/1.8/gems/net-ssh-2.5.1/lib/net/ssh/transport/session.rb:66:in `open'
/usr/share/foreman/has_many_polymorphs/ruby/1.8/gems/net-ssh-2.5.1/lib/net/ssh/transport/session.rb:66:in `initialize'
/usr/lib/ruby/1.8/timeout.rb:67:in `timeout'
/usr/lib/ruby/1.8/timeout.rb:101:in `timeout'
/usr/share/foreman/has_many_polymorphs/ruby/1.8/gems/net-ssh-2.5.1/lib/net/ssh/transport/session.rb:66:in `initialize'
/usr/share/foreman/has_many_polymorphs/ruby/1.8/gems/net-ssh-2.5.1/lib/net/ssh.rb:186:in `new'
@pccowboy
pccowboy / gist:2881640
Created June 6, 2012 12:50
tracerte from latest attempt
traceroute to 23.20.167.244 (23.20.167.244), 30 hops max, 60 byte packets
1 ip-10-19-80-193.ec2.internal (10.19.80.193) 11.825 ms 15.039 ms 15.358 ms
2 ip-10-0-69-85.ec2.internal (10.0.69.85) 0.989 ms 1.380 ms 5.920 ms
3 ip-10-0-78-142.ec2.internal (10.0.78.142) 0.739 ms ip-10-0-78-150.ec2.internal (10.0.78.150) 0.796 ms 1.121 ms
4 ip-10-130-28-193.ec2.internal (10.130.28.193) 0.539 ms 0.528 ms ip-10-130-92-193.ec2.internal (10.130.92.193) 0.491 ms
5 ip-10-1-136-195.ec2.internal (10.1.136.195) 0.442 ms ip-10-1-136-67.ec2.internal (10.1.136.67) 0.512 ms 0.499 ms
6 216.182.224.206 (216.182.224.206) 0.627 ms 216.182.224.192 (216.182.224.192) 0.492 ms 216.182.224.194 (216.182.224.194) 0.571 ms
7 216.182.224.199 (216.182.224.199) 0.980 ms 216.182.224.197 (216.182.224.197) 1.127 ms 216.182.224.195 (216.182.224.195) 1.167 ms
8 ip-10-1-136-192.ec2.internal (10.1.136.192) 0.865 ms 1.072 ms ip-10-1-136-68.ec2.internal (10.1.136.68) 8.629 ms
9 ip-10-1-0-33.ec2.internal (10.1.0.3
@pccowboy
pccowboy / gist:2881681
Created June 6, 2012 12:59
failure while waiting for it to come online
generating template to upload to test-das-1.ec2.internal
ESC[1mESC[35mSetting Load (0.3ms)ESC[0m SELECT `settings`.* FROM `settings` WHERE `settings`.`name` = '
safemode_render' ORDER BY LOWER(settings.name) LIMIT 1
ESC[1mESC[36mConfigTemplate Load (0.3ms)ESC[0m ESC[1mSELECT `config_templates`.* FROM `config_templates
` WHERE `config_templates`.`snippet` = 1 AND `config_templates`.`name` = 'puppet.conf' ORDER BY LOWER(conf
ig_templates.name) LIMIT 1ESC[0m
rendering snippet puppet.conf
ESC[1mESC[35mCACHE (0.0ms)ESC[0m SELECT `settings`.* FROM `settings` WHERE `settings`.`name` = 'safemod
e_render' ORDER BY LOWER(settings.name) LIMIT 1
Starting SSH provisioning script - waiting for 10.90.221.230 to respond
@pccowboy
pccowboy / gist:3373063
Created August 16, 2012 19:52
puppet agent conf for foreman
[agent]
pluginsync = true
report = true
ignoreschedules = true
daemon = false
ca_server = <%= @host.puppet_ca_server %>
certname = <%= @host.certname %>
environment = <%= @host.environment %>
server = <%= @host.puppetmaster %>
@pccowboy
pccowboy / gist:3709651
Created September 12, 2012 20:29
Weird behavior of facter in a custom fact
[root@ops-jenkins01-use1 facter]# facter --puppet operatingsystemrelease
6.3
[root@ops-jenkins01-use1 facter]# facter --puppet operatingsystem
CentOS
[root@ops-jenkins01-use1 facter]# facter --puppet operatingsystemmajor
2.6.32-279.5.2.el6.x86_64
[root@ops-jenkins01-use1 facter]# cat operatingsystemmajor.rb
#
# Custom fact to:
# return the major release number of the client OS
@pccowboy
pccowboy / stunnel-4.54-xforwarded-for.diff
Created October 19, 2012 21:37
stunnel 4.54 X-Forwarded-For patch, manually modified from the 4.53 gist to compile cleanly on 4.54
diff --git a/doc/stunnel.8 b/doc/stunnel.8
index 589d968..f56f5c0 100644
--- a/doc/stunnel.8
+++ b/doc/stunnel.8
@@ -693,6 +693,10 @@ This options has been renamed to \fInone\fR.
.RE
.RS 4
.RE
+.IP "\fBxforwardedfor\fR = yes | no" 4
+.IX Item "xforwardedfor = yes | no"
#!/bin/sh
##
## Redhat / Linux / LSB
##
# chkconfig: 345 85 15
# description: Startup script for Express / Node.js application with the \
## forever module.
##
## A modification of https://gist.github.com/1339289
##