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
$ vagrant up | |
Bringing machine 'default' up with 'virtualbox' provider... | |
==> default: Importing base box 'ubuntu/trusty64'... | |
==> default: Matching MAC address for NAT networking... | |
==> default: Checking if box 'ubuntu/trusty64' is up to date... | |
==> default: Setting the name of the VM: reddit-vagrant_default_1446339977960_21381 | |
==> default: Clearing any previously set forwarded ports... | |
==> default: Clearing any previously set network interfaces... | |
==> default: Preparing network interfaces based on configuration... | |
default: Adapter 1: nat |
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
vagrant@reddit:~$ set -e | |
vagrant@reddit:~$ | |
vagrant@reddit:~$ apt_get=/usr/bin/apt-get | |
vagrant@reddit:~$ ln=/bin/ln | |
vagrant@reddit:~$ wget=/usr/bin/wget | |
vagrant@reddit:~$ service=/usr/sbin/service | |
vagrant@reddit:~$ reddit_run=/usr/local/bin/reddit-run | |
vagrant@reddit:~$ init_ctl=/sbin/initctl | |
vagrant@reddit:~$ | |
vagrant@reddit:~$ export REDDIT_USER=vagrant |
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
vagrant@reddit:~$ sudo reddit-stop | |
vagrant@reddit:~$ sudo reddit-start | |
vagrant@reddit:~$ ps -ef | grep reddit | |
rabbitmq 1408 1400 1 02:11 ? 00:00:30 /usr/lib/erlang/erts-5.10.4/bin/beam.smp -W w -K true -A30 -P 1048576 -- -root /usr/lib/erlang -progname erl -- -home /var/lib/rabbitmq -- -pa /usr/lib/rabbitmq/lib/rabbitmq_server-3.2.4/sbin/../ebin -noshell -noinput -s rabbit boot -sname rabbit@reddit -boot start_sasl -kernel inet_default_connect_options [{nodelay,true}] -sasl errlog_type error -sasl sasl_error_logger false -rabbit error_logger {file,"/var/log/rabbitmq/rabbit@reddit.log"} -rabbit sasl_error_logger {file,"/var/log/rabbitmq/rabbit@reddit-sasl.log"} -rabbit enabled_plugins_file "/etc/rabbitmq/enabled_plugins" -rabbit plugins_dir "/usr/lib/rabbitmq/lib/rabbitmq_server-3.2.4/sbin/../plugins" -rabbit plugins_expand_dir "/var/lib/rabbitmq/mnesia/rabbit@reddit-plugins-expand" -os_mon start_cpu_sup false -os_mon start_disksup false -os_mon start_memsup false -mnesia dir "/var/lib/rabbitmq/mnesi |
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
# Another attempt using the built in Rails.cache.fetch (better serialization/deserialization) | |
class ActiveSupport::Cache::DalliStore | |
def fast_fetch(name, options=nil) | |
options ||= {} | |
name = expanded_key name | |
dupe_name = name+'_dupe' | |
if block_given? | |
unless options[:force] |
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` | |
OlderNewer