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
# Reference http://stackoverflow.com/a/18490935/2037928 | |
# Login as root | |
# Install needed packages | |
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev | |
cd /tmp | |
# Download appropriate ruby version https://www.ruby-lang.org/en/downloads/ |
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 | |
# Takes one parameter: a remote git repository URL. | |
# | |
# This is the stuff this script does: | |
# | |
# 1. Clones the repository | |
# 2. Fetches all remote branches | |
# 3. Compresses the folder | |
# 4. Deletes the cloned folder. |
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
class ZendeskTicketsJob | |
extend Resque::Plugins::ExponentialBackoff | |
@queue = :low | |
FIELDS = ['zendesk_id', 'requester_id', 'assignee_id', 'group', 'subject', 'tags', 'status', 'priority', 'via', 'ticket_type', 'created_at', 'assigned_at', 'solved_at', 'resolution_time', 'satisfaction', 'group_stations', 'assignee_stations', 'reopens', 'replies', 'first_reply_time_in_minutes', 'first_reply_time_in_minutes_within_business_hours', 'first_resolution_time_in_minutes', 'first_resolution_time_in_minutes_within_business_hours', 'full_resolution_time_in_minutes', 'full_resolution_time_in_minutes_within_business_hours', 'agent_wait_time_in_minutes', 'agent_wait_time_in_minutes_within_business_hours', 'requester_wait_time_in_minutes', 'requester_wait_time_in_minutes_within_business_hours', 'reservation_code', 'requires_manual_closing'] | |
def self.perform(url) | |
`rm /tmp/zendesk_tickets*` | |
`wget #{url} -O /tmp/zendesk_tickets.csv.zip` | |
`unzip -p /tmp/zendesk_tickets.csv.zip > /tmp/zendesk_tickets.csv` | |
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 | |
# | |
# This script starts and stops the Resque daemon | |
# This script belongs in /engineyard/bin/resque | |
# | |
PATH=/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH | |
CURDIR=`pwd` | |
usage() { |
- This creates a 560mb ramdisk. Adjust the size accordingly. I think the number at the end of the command is the number of disk blocks. They are 2kb in size for me.
- Restarting postgres is not necessary; you can create the ramdisk and tablespace while postgres is running.
- You will lose all data in the ramdisk tablespace when you shut your machine down
$ diskutil erasevolume HFS+ "postgres_ramdisk" `hdiutil attach -nomount ram://1165430`
Started erase on disk1
Unmounting disk
Erasing
Initialized /dev/rdisk1 as a 569 MB HFS Plus volume
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
set :rails_env, :production | |
set :unicorn_binary, "/usr/bin/unicorn" | |
set :unicorn_config, "#{current_path}/config/unicorn.rb" | |
set :unicorn_pid, "#{current_path}/tmp/pids/unicorn.pid" | |
namespace :deploy do | |
task :start, :roles => :app, :except => { :no_release => true } do | |
run "cd #{current_path} && #{try_sudo} #{unicorn_binary} -c #{unicorn_config} -E #{rails_env} -D" | |
end | |
task :stop, :roles => :app, :except => { :no_release => true } do |