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 | |
# | |
# Install nginx on Debian. | |
# | |
# Author : Scott Barr | |
# Date : 7 Jan 2010 | |
# | |
VERSION=0.8.53 | |
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 | |
# Enables and disables static routes required to access COMPANY resources | |
# over the VPN. These routes are required because the resources are hosted | |
# on public IP addresses, but restricted to access coming from specific | |
# networks. | |
enableroutes() { | |
route -nv add -net 4.2.2.1 -interface ppp0 |
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
require 'socket' | |
# Base on answer from http://stackoverflow.com/questions/42566/getting-the-hostname-or-ip-in-ruby-on-rails | |
# return an array of local IP addresses | |
def local_ip | |
orig, Socket.do_not_reverse_lookup = Socket.do_not_reverse_lookup, true # turn off reverse DNS resolution temporarily | |
UDPSocket.open do |s| | |
s.connect '4.2.2.1', 1 # as this is UDP, no connection will actually be made |
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
# modified from http://colloquy.info/extras/details.php?file=8 | |
property prefs : missing value | |
property prefsPath : missing value | |
script prefsTemplate | |
property knownNames : {} | |
property allowedRooms : {} | |
end script |
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 | |
require 'bcrypt' | |
def time | |
start = Time.now | |
yield | |
puts "That took #{Time.now - start} seconds" | |
end |
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 | |
require 'digest/sha2' | |
def time | |
start = Time.now | |
yield | |
puts "That took #{Time.now - start} seconds" | |
end |
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
Method for testing for network errors | |
===================================== | |
Background | |
---------- | |
A WAN link is suspected of error in transport. Evidence of this is | |
suggested by periodic warnings of errors from our NetApp replication | |
jobs and intermittent failures in SIP messaging. These errors are | |
occurring on separate VLANs that pass data over separate equipment as | |
they move deeper in to the LAN infrastructure. The only common link is |
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
require 'net/scp' | |
Net::SCP.start("10.0.38.110", "root") do |scp| | |
# synchronous (blocking) upload; call blocks until upload completes | |
scp.upload! "./test.txt", "~/" | |
end |
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 | |
# Text Analyzer | |
# Author: Zach | |
# Purpose: Utilize Ruby to analyze Text files | |
# and generate statistical information therein. | |
require 'cgi' | |
STOPWORDS = IO.readlines('conf/stop_words.txt').map{|x| x.chomp} |
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
module Sprinkle | |
module Verifiers | |
# = Process Verifier | |
# | |
# Contains a verifier to check that a process is running. | |
# | |
# == Example Usage | |
# | |
# verify { has_user 'nginx' } | |
# |
OlderNewer