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
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
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
#!/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
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
# 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
- 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
redis-cli FLUSHDB | |
redis-cli FLUSHALL |
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
def fizzbuzz(range, triggers) | |
range.each do |i| | |
result = '' | |
triggers.each do |(text, divisor)| | |
result << text if i % divisor == 0 | |
end | |
puts result == '' ? i : result | |
end | |
end |