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/ruby | |
require 'rubygems' | |
require 'nagios-probe' | |
require 'snmp' | |
require 'optparse' | |
class NagiosDiskCheck < Nagios::Probe | |
attr_reader :perfdata | |
def initialize(opts = {}) |
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 Player | |
@@health = 0 | |
@@direction = :forward | |
@@mode = :attack | |
def taking_damage(warrior) | |
@@health > warrior.health | |
end | |
def next_thingy(spaces) |
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 'rubygems' | |
require 'gdata' | |
MAX_RETRIES = 5 | |
LOGIN_USER = "[email protected]" | |
LOGIN_PASSWORD = "administratorpassword" | |
# Login and use version 3 of the api (only v3 allows admin access to files) | |
client = GData::Client::DocList.new |
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
[puppetlabs] | |
name=Puppet Labs | |
baseurl=http://yum.puppetlabs.com/el/$releasever/products/$basearch | |
enabled=1 | |
gpgcheck=1 | |
gpgkey=http://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs |
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
for i in `ipcs -m | awk '{ print $2 }'`; do ipcs -m -i $i | grep '\snattch=0$'; if [ $? -eq 0 ]; then ipcrm -m $i; fi; done |
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
Index: controller.php | |
=================================================================== | |
--- controller.php (revision 1931) | |
+++ controller.php (working copy) | |
@@ -56,6 +56,23 @@ | |
header('Location: '.BASEURL); | |
} | |
+function is_valid_callback($subject) | |
+{ |
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
use String::Random qw(random_regex); | |
sub encrypt { | |
my $password = shift; | |
my $salt = random_regex('[0-9A-Za-z./]{16}'); | |
return crypt($password,'$6$'.$salt); | |
} |
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
<?php | |
// validate our inputs | |
try { | |
// check to ensure we are passed the correct parameters | |
if ( empty($id) ) | |
throw new Exception('id not defined'); | |
if ( empty($uname) ) | |
throw new Exception('uname not defined'); |
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
find -type f -exec ls -E {} \; | awk '{ print $9 " " $6 " " $7 }' | awk -F/ '{ print $3 " " $2 }' | sort -n > s ; for i in `awk '{ print $1 }' < s | uniq`; do cp -p `grep "^$i" s | awk '{ print $2 " " $3 " " $4 }' | sort -n | tail -1 | awk '{ print $3 }'`/$i out/; done |
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
$body = http.getResponseBody(); | |
$newBody = string.regexsub ( $body , | |
'<img([^>]+)src=([\'"])([^\'"]+)', | |
'<img$1src=$2http://mustachify.me/?src=http://www.shef.ac.uk/$3', | |
'gi' ); | |
http.setResponseBody($newBody); |
OlderNewer