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 | |
# calculates average qtime and counts errors from a Tomcat log file ($CATALINA_HOME/logs/catalina.out) | |
if [ -z "$1" ] ; then | |
echo "requires a Tomcat log path" | |
exit 1 | |
fi | |
grep -v "^map entry" $1 | paste - - | | |
awk -v start="$2" -v end="$3" 'BEGIN{ |
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
netstat -ano #general for linux and windows | |
sudo netstat -anop #linux gets PID/Program name | |
netstat -anob #windows gets PID |
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
# corrected app/models/book.rb | |
class Book < ActiveFedora::Base | |
has_metadata 'descMetadata', type: Datastreams::BookMetadata | |
has_attributes :title, datastream: 'descMetadata', multiple: false | |
has_attributes :author, datastream: 'descMetadata', multiple: false | |
# within app/models/book.rb | |
has_many :pages, :property=> :is_part_of | |
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
execute_program &> /dev/null > file.log 2>&1 |
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
python -m SimpleHTTPServer |
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
# --spider only do HEAD request | |
# --no-verbose gives minimal output (~1/4 the lines) | |
# -o send output to file | |
# -e robots=off ignores robots.txt (but you should play nice -- so don't use this) | |
# -w 1 waits for a second between requests | |
# --random-wait uses -w to vary between 0.5 and 1.5 * wait seconds | |
# -r recursive (this is the crawler part) | |
# -nd don't create a hierarchy of directories when retrieving recursively (prevent inode issues) | |
# -p all page requisites |
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
# lsof lists open files (with user and size) | |
sudo lsof -s | grep deleted | |
# files that belong to users, processes | |
fuser -uvcf . |
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
def load_models_in_development | |
if Rails.env == "development" | |
load_models_for(Rails.root) | |
Rails.application.railties.engines.each do |r| | |
load_models_for(r.root) | |
end | |
end | |
end | |
def load_models_for(root) |
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
## Status | |
Resque.info | |
Resque.queues | |
Resque.redis | |
Resque.size(queue_name) | |
# check out what's coming next in the queue | |
# Resque.peek(archive_queue) | |
# Resque.peek(archive_queue, 1, 5) |
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/sh -x | |
yum install -y sqlite-devel | |
rm -Rf sufia | |
git clone https://github.com/projecthydra/sufia.git | |
cd sufia | |
git checkout -t origin/v6.1.0 | |
service redis_6379 restart | |
rm -Rf spec/internal # removes any existing test app | |
bundle update | |
killall java # kill any running jetties |
OlderNewer