This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class WindowsLogWatcher < Scout::Plugin | |
needs 'win32/file' | |
OPTIONS = <<-EOS | |
log_path | |
name: Log path | |
notes: Full path to the log file | |
term: | |
default: "[Ee]rror" | |
name: Search Term |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cidr2mask() { | |
local mask="" | |
local netaddr="" | |
local bcast="" | |
local gateway="" | |
local full_octets=$(($2/8)) | |
local partial_octet=$(($2%8)) | |
ipparts=($(echo $1 | tr "." "\n")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 def step_down(host, seconds) | |
80 connection = connect(host) | |
81 if is_master?(connection) | |
82 admin = connection['admin'] | |
83 cmd = BSON::OrderedHash.new | |
84 cmd['replSetStepDown'] = seconds | |
85 begin | |
86 admin.command(cmd, :check_response => true) | |
87 rescue Mongo::OperationFailure => e | |
88 raise "Could not step down. Perhaps MongoDB isn't healthy? (server said: #{e})" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Customize this | |
domain="indigobio.com" | |
ns1="8.8.8.8" | |
ns2="4.2.2.2" | |
ndots="2" | |
usage() { | |
echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DEBUG: Using configuration from /Users/gswallow/.chef/knife.rb | |
DEBUG: value for config item bootstrap: | |
DEBUG: value for config item vsphere_host: localhost | |
DEBUG: value for config item vshere_path: | |
DEBUG: value for config item vsphere_port: 8443 | |
DEBUG: value for config item vsphere_nossl: | |
DEBUG: value for config item vsphere_user: gswallow | |
DEBUG: value for config item vsphere_pass: fffff | |
DEBUG: value for config item vsphere_insecure: true | |
DEBUG: value for config item vsphere_dc: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmd /c powershell.exe -command "$webClient = New-Object System.Net.WebClient ; $webClient.DownloadFile('https://www.itefix.no/i2/sites/default/files/Copssh_3.1.4_Installer.zip', $env:TEMP + '\Copssh_3.1.4_Installer.zip')" | |
cd %TEMP% | |
cmd /c powershell.exe -command "$shell = new-object -com shell.application ; $zip = $shell.NameSpace($env:TEMP + '\Copssh_3.1.4_Installer.zip') ; foreach($item in $zip.items()) { $shell.Namespace($env:TEMP).copyhere($item) }" | |
cmd /c copssh_3.1.4_Installer.exe /u=SVCCopSSH /p="user" /S | |
cmd /c "%PROGRAMFILES(x86)%\icw\bin\copsshadm.exe" --command activateuser --user user --shell /bin/bash | |
cmd /c netsh advfirewall firewall add rule name="SSH" protocol=TCP dir=in localport=22 action=allow enable=yes | |
c:\program files(x86)\icw\bin\sh.exe | |
export PATH=/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set up LVM on the first/only disk. | |
d-i partman-auto/method string lvm | |
d-i partman-auto/choose_recipe select boot-root | |
d-i partman-lvm/device_remove_lvm boolean true | |
d-i partman-md/device_remove_md boolean true | |
# Set the name of the created volume group. | |
d-i partman-auto-lvm/new_vg_name string vg00 | |
# being thrown into partman's guided size dialog. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
REM http://webcache.googleusercontent.com/search?q=cache:SjoPPpuQxuoJ:www.tcm.phy.cam.ac.uk/~mr349/cygwin_install.html+install+cygwin+ssh+commandline&cd=2&hl=nl&ct=clnk&gl=be&source=www.google.be | |
cmd /c powershell.exe -command "$webClient = New-Object System.Net.WebClient ; $webClient.DownloadFile('http://cygwin.com/setup-x86_64.exe', $env:TEMP + '/cygwin-setup-x86_64.exe')" | |
REM go to a temp directory | |
cd %TEMP% | |
REM run the installation | |
cmd /c cygwin-setup-x86_64.exe -N -n -q -P openssh,openssl,cygrunsrv,rebase,libintl8,libiconv2,libcygncursesw -s http://cygwin.mirrors.pair.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Passing along a search query with string interpolation from a role doesn't work. | |
# Try setting it here, instead. | |
env = "chef_environment:#{node.chef_environment}" | |
if node['elasticsearch'].has_key?('discovery') | |
role = "role:#{node['elasticsearch']['discovery']['role']}" unless node['elasticsearch']['discovery']['role'].nil? | |
end | |
if node['elasticsearch'].has_key?('cluster') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# == Simple Daemon | |
# | |
# A simple ruby daemon that you copy and change as needed. | |
# | |
# === How does it work? | |
# | |
# All this program does is fork the current process (creates a copy of | |
# itself) then exits, the fork (child process) then goes on to run your | |
# daemon code. In this example we are just running a while loop with a |
OlderNewer