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 | |
# upstart-job | |
# | |
# Symlink target for initscripts that have been converted to Upstart. | |
set -e | |
APP_PATH="/var/deploy/app/current" | |
start_job() { | |
echo "Starting delayed job" |
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 | |
# upstart-job | |
# | |
# Symlink target for initscripts that have been converted to Upstart. | |
set -e | |
APP_PATH="/srv/rails/seek" | |
start_job() { | |
echo "Starting delayed job" |
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 | |
# Create Multiple SSH Configurations | |
#1. Clone the script | |
#2. chmod +x no-pass.sh | |
#3. ./no-pass.sh | |
touch ~/.ssh/config || exit | |
echo -e "\e[33m Enter domain/ipaddress which you want to ssh:" | |
read domain_name |
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
<!doctype html> | |
<title>Site Maintenance</title> | |
<style> | |
body { text-align: center; padding: 150px; } | |
h1 { font-size: 50px; } | |
body { font: 20px Helvetica, sans-serif; color: #333; } | |
article { display: block; text-align: left; width: 650px; margin: 0 auto; } | |
a { color: #dc8100; text-decoration: none; } | |
a:hover { color: #333; text-decoration: none; } | |
</style> |
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
sudo apt-get update && / | |
sudo apt-get install byobu && / | |
sudo apt-get install vim && / | |
sudo apt-get install htop && / | |
sudo apt-get install postgresql-9.3 |
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 | |
usage() | |
{ | |
cat << EOF | |
usage: $0 options | |
This script set ownership for all table, sequence and views for a given database | |
Credit: Based on http://stackoverflow.com/a/2686185/305019 by Alex Soto |
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
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo | |
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo | |
sudo yum install -y apache-maven | |
mvn --version |
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 |
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 |
OlderNewer