View visual_password_check.js
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
$("#new_user #user_password").passwordCheck(); | |
jQuery.fn.passwordCheck = function() { | |
var pass = $(this[0]) // It's your element | |
var noofchar=/^.*(?=.{6,}).*$/; | |
var checkspace=/\s/; | |
var best=/^.*(?=.{6,})(?=.*[A-Z])(?=.*[\d])(?=.*[\W]).*$/; | |
var strong=/^[a-zA-Z\d\W_]*(?=[a-zA-Z\d\W_]{6,})(((?=[a-zA-Z\d\W_]*[A-Z])(?=[a-zA-Z\d\W_]*[\d]))|((?=[a-zA-Z\d\W_]*[A-Z])(?=[a-zA-Z\d\W_]*[\W_]))|((?=[a-zA-Z\d\W_]*[\d])(?=[a-zA-Z\d\W_]*[\W_])))[a-zA-Z\d\W_]*$/; | |
var weak=/^[a-zA-Z\d\W_]*(?=[a-zA-Z\d\W_]{6,})(?=[a-zA-Z\d\W_]*[A-Z]|[a-zA-Z\d\W_]*[\d]|[a-zA-Z\d\W_]*[\W_])[a-zA-Z\d\W_]*$/; | |
var bad=/^((^[a-z]{6,}$)|(^[A-Z]{6,}$)|(^[\d]{6,}$)|(^[\W_]{6,}$))$/; |
View .bashrc
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
export PATH=$HOME/.gems/bin:$HOME/opt/bin:$PATH | |
export GEM_HOME=$HOME/.gems | |
export GEM_PATH="$GEM_HOME" | |
export RUBYLIB="$HOME/opt/lib:$RUBYLIB" | |
alias gem="nice -n19 ~/opt/bin/gem" |
View cronjob.text
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
# create a new cron job at panel.dreamhost.com and run it daily (which will be midnight) | |
/home/account/opt/bin/logrotate -f -s /home/account/opt/lib/logrotate.status /home/account/opt/etc/logrotate.conf |
View snippet.rb
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 find_for_curation(conditions, user_id) | |
RedisConnection.db.sadd('curators', user_id) | |
RedisConnection.db.del("curator-#{user_id}") | |
curator_ids = RedisConnection.db.smembers('curators') | |
curator_keys = curator_ids.map { |id| "curator-#{id}" } | |
active_annotation_ids = RedisConnection.db.sunion(*curator_keys) | |
annotations = Annotation.where(conditions).where("annotations.id NOT IN (#{active_annotation_ids.to_in_query_string})").joins(:ontology_term).joins(:ontology).limit(15).order('ontology_terms.name') | |
annotations.each do |annotation| | |
RedisConnection.db.sadd("curator-#{user_id}", annotation.id) | |
end |
View install-redis.sh
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 | |
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/ | |
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server | |
############################################### | |
# To use: | |
# wget https://gist.githubusercontent.com/dfetterman/cf7bc4aa53c47fb546c6/raw/e11cd22f41e6cab71fe621b1f5a1377ff3af01ab/install-redis.sh | |
# chmod 777 install-redis.sh | |
# ./install-redis.sh | |
############################################### | |
echo "*****************************************" |
View redis-server-for-init.d-startup
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 | |
# | |
# redis - this script starts and stops the redis-server daemon | |
# | |
# chkconfig: - 85 15 | |
# description: Redis is a persistent key-value database | |
# processname: redis-server | |
# config: /etc/redis/redis.conf | |
# config: /etc/sysconfig/redis | |
# pidfile: /var/run/redis.pid |
View redis.conf
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
# Redis configuration file example | |
# Note on units: when memory size is needed, it is possible to specify | |
# it in the usual form of 1k 5GB 4M and so forth: | |
# | |
# 1k => 1000 bytes | |
# 1kb => 1024 bytes | |
# 1m => 1000000 bytes | |
# 1mb => 1024*1024 bytes | |
# 1g => 1000000000 bytes |
View redis-server.conf
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
description "Redis Server" | |
author "Thomas Woolford <thomas@urpages.com.au>" | |
# run when the local FS becomes available | |
start on local-filesystems | |
stop on shutdown | |
# The default redis conf has `daemonize = yes` and will naiively fork itself. | |
expect fork |
View monit.conf
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
description "Monit service manager" | |
limit core unlimited unlimited | |
start on runlevel [2345] | |
stop on runlevel [!2345] | |
expect daemon | |
respawn |
View monitrc
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
############################################################################### | |
## Monit control file | |
############################################################################### | |
## | |
## Start Monit in the background (run as a daemon): | |
set daemon 60 # check services at 1-minute intervals | |
set logfile syslog facility log_daemon |
OlderNewer