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
- Stop delayed jobs (canvas_init stop) | |
- Shut down canvas | |
- Remove the 'queue' section from database.yml | |
- Import the necessary functions from the queue DB into the main one. I have them in a gist here: https://gist.github.com/grahamb/4ac964d9e40de7ca9559. You can also get them by doing a full dump of the queue DB. To import them, save to a file (e.g. functions.sql) and do 'cat functions.sql | psql -h yourdbserverhostname -U canvas canvas_production' (assuming you're using the default username and DB name) | |
- Dump the delayed and failed jobs tables to a file: 'dump -h yourdbserverhostname -U canvas -C -t delayed_jobs -t failed_jobs > jobs.sql' | |
- Import the dump file into the main canvas DB: 'cat jobs.sql | psql -h yourdbserverhostname U canvas canvas_production' | |
- Assuming no errors above, restart delayed jobs (canvas_init start) and Canvas. | |
- Check your delayed jobs log and /jobs to make sure everything is working. |
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
# MySQL. Versions 4.1 and 5.0 are recommended. | |
# | |
# Install the MySQL driver: | |
# gem install mysql2 | |
# | |
# And be sure to use new-style password hashing: | |
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html | |
development: | |
adapter: mysql2 | |
encoding: utf8 |
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
server { | |
listen 80; | |
server_name example.com; | |
rewrite ^ https://$server_name$request_uri? permanent; | |
} | |
server { | |
listen 443; | |
server_name example.com; | |
root /var/deploy/code/current/public; | |
charset utf-8; |
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 | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the nginx web server | |
# Description: starts nginx using start-stop-daemon |
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
DeveloperKey.all.each do |d| | |
d.trusted=true | |
d.force_token_reuse=false | |
d.auto_expire_tokens=false | |
d.save! | |
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
mount /dev/sda2 /mnt | |
chroot /mnt |
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
Setting.get("show_feedback_link", "false") |
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
(function () { | |
var chrome = { | |
string: navigator.userAgent.match(/Chrome\/(\d+)/) | |
}; | |
chrome.version = chrome.string ? parseInt(chrome.string[1], 10) : null; | |
currentUrl = window.location.href; | |
Domain = "https://domain"; | |
yDomainWithoutSSL = "http://domain"; |
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
old_logger = ActiveRecord::Base.logger | |
ActiveRecord::Base.logger = nil | |
logins = Pseudonym.where("last_request_at > ? and last_request_at < ? and current_login_at IS NOT NULL", DateTime.yesterday.beginning_of_day,DateTime.yesterday.end_of_day) | |
account_pseudonyms = {} | |
logins.each do |pseudonym| | |
course=pseudonym.user.courses.first | |
if course | |
course_account_id = course.account_id | |
unless account_pseudonyms[course_account_id] | |
account_pseudonyms[course_account_id] = [] |
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
course_ids=[1,2] | |
puts course_ids.size | |
course_ids.each do |course_id| | |
course=Course.find(course_id) | |
puts course.enrollments.where(workflow_state: 'invited').count | |
course.enrollments.where(workflow_state: 'invited').each do |enrollment| | |
enrollment.workflow_state='deleted' | |
enrollment.save! | |
end | |
end |