Skip to content

Instantly share code, notes, and snippets.

View stonith's full-sized avatar

Darren Foo stonith

  • Shopify
  • Vancouver
View GitHub Profile
@stonith
stonith / gist:e4979a5fbd732324acd8
Created June 27, 2014 00:10
Change proxy discovery to false
$webConfig = "C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\web.config"
$newConfig = new-item c:\temp\web.config -type file
$doc = new-object System.Xml.XmlDocument
$doc.Load($webConfig)
$doc.get_DocumentElement()."system.net".defaultProxy.proxy.usesystemdefault = "false"
$doc.Save($newConfig)
This file has been truncated, but you can view the full file.
/home/vagrant/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/irb/context.rb:262 IRB::Context#set_last_value
/home/vagrant/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/irb/workspace.rb:85 IRB::WorkSpace#evaluate
/home/vagrant/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/irb.rb:372 IRB#CurrentContext
/home/vagrant/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/irb.rb:353 IRB#conf
/home/vagrant/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/irb.rb:661 IRB::Irb#output_value
/home/vagrant/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/irb/context.rb:385 IRB::Context#inspect_last_value
/home/vagrant/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/irb/inspector.rb:114 IRB::Inspector#inspect_value
/home/vagrant/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/irb/ruby-lex.rb:206 RubyLex#prompt
/home/vagrant/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/irb/context.rb:252 IRB::Context#prompting?
/home/vagrant/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/irb/context.rb:236 IRB::Context#verbose?
@stonith
stonith / fog_clonevm.rb
Created June 10, 2014 20:45
Prototype API for vSphere VM Cloning from Template
#!/usr/bin/env ruby
require 'rubygems'
require 'pp'
require 'fog'
require 'highline/import'
require 'sinatra'
set :bind, '0.0.0.0'
sudo mount -o loop /dev/cdrom /mnt
tar zxf /mnt/VMwareTools-*.tar.gz -C /tmp/
sudo /tmp/vmware-tools-distrib/vmware-install.pl -d
sudo umount /mnt
# Description:
# This script receives pages in the formats
# /usr/bin/curl -d host="$HOSTALIAS$" -d output="$SERVICEOUTPUT$" -d description="$SERVICEDESC$" -d type=service -d notificationtype="$NOTIFICATIONTYPE$ -d state="$SERVICESTATE$" $CONTACTADDRESS1$
# /usr/bin/curl -d host="$HOSTNAME$" -d output="$HOSTOUTPUT$" -d type=host -d notificationtype="$NOTIFICATIONTYPE$" -d state="$HOSTSTATE$" $CONTACTADDRESS1$
#
# Based on a gist by oremj (https://gist.github.com/oremj/3702073)
#
# Configuration:
# HUBOT_NAGIOS_URL - https://<user>:<password>@nagios.example.com/cgi-bin/nagios3
#
@stonith
stonith / gist:10014646
Last active August 29, 2015 13:58
/_stats/fielddata/
{
"_shards" : {
"total" : 3162,
"successful" : 3162,
"failed" : 0
},
"_all" : {
"primaries" : {
"fielddata" : {
"memory_size_in_bytes" : 397361900,
@stonith
stonith / gist:10014637
Last active August 29, 2015 13:58
/_nodes/stats
{
"cluster_name" : "logstash",
"nodes" : {
"XyPGpIHlR2emjOAsvtt8qA" : {
"timestamp" : 1396885317502,
"name" : "es02",
"transport_address" : "inet[/192.168.0.82:9300]",
"host" : "es02.svc.local",
"ip" : [ "inet[/192.168.0.82:9300]", "NONE" ],
"indices" : {
@stonith
stonith / gist:10000602
Created April 6, 2014 02:03
recovery is stuck
curl 'localhost:9200/_cat/recovery?v'
index shard target recovered percent host ip node
.marvel-2014.03.23 0 1532632530 0 0.0% elasticsearch02.stn.local 10.128.112.174 Champion of the Universe
.marvel-2014.03.22 0 1115751636 0 0.0% elasticsearch02.stn.local 10.128.112.174 Champion of the Universe
@stonith
stonith / gist:10000565
Created April 6, 2014 02:00
cluster settings that seems to break replication
{
"persistent" : { },
"transient" : {
"indices" : {
"recovery" : {
"concurrent_streams" : "3",
"max_bytes_per_sec" : "80"
}
}
}
@stonith
stonith / gist:5856057
Created June 25, 2013 05:04
elasticsearch error
[2013-06-25 04:45:47,493][WARN ][indices.cluster ] [Abner Little] [logstash-2013.04.19][4] failed to start shard
org.elasticsearch.index.gateway.IndexShardGatewayRecoveryException: [logstash-2013.04.19][4] shard allocated for local recovery (post api), should exist, but doesn't, current files: [_1q5b.nrm, _1qnq_es090_0.tip, _1qnp_es090_0.pay, _1qnr_es090_0.pos, _1qnu_es090_0.tip, _1q3x.si, _1qnq_es090_0.tim, _1qnu_es090_0.tim, _1pyy.fnm, _1pye.prx, _1qmv.fdt, _1qnp_es090_0.blm, _1q5b.fdx, _1qnn_es090_0.pay, _1qmv.fdx, _1q5b.prx, _1p3a.frq, _1q5b.fdt, _1q5c.nrm, _1k24.nrm, _1lti.fnm, _1qnu.fnm, _1q5c.prx, _1pye.nrm, _1q5d.tii, _1lti.nrm, _1qne.frq, _1qnn.fnm, _1mss.fdt, _1jnx.fnm, _1lti.prx, _1mss.fdx, _1q5d.fdx, _1qnr_es090_0.blm, _1qne_upgraded.si, _1o5y.fnm, _1q5d.fdt, _1q5d.tis, _1mh3.si, _1qnu_es090_0.doc, _1p3a_upgraded.si, _1p3a.tii, _1q4i.frq, _1lti.fdx, _1q5c.frq, _1e6s.frq, _1lti.fdt, _1p3a.tis, _1qnt.si, _1qns_es090_0.pay, _1n6o.fnm, _1q4i.fdt, _1e6s.nrm, _1grn.fnm, _1q4i.nrm, _1qnq.si, _1m