To use lv_LV.UTF-8 locale your unix system should have it, check it:
$ locale -a
If it's not here, then on linux as root uncomment it in /etc/locale.gen and
run locale-gen. Then restart PostgreSQL server.
Open postgres shell:
| check process elasticsearch with pidfile /var/run/elasticsearch.pid | |
| start program = "/etc/init.d/elasticsearch start" | |
| stop program = "/etc/init.d/elasticsearch stop" | |
| if 5 restarts within 5 cycles then timeout | |
| if failed host 127.0.0.1 port 9200 type http then restart |
| check process resque-worker-production | |
| with pidfile /home/webmaster/production/shared/pids/resque_worker.pid | |
| start program = "/usr/bin/env HOME=/home/webmaster PATH=/usr/local/bin:/usr/local/ruby/bin:/usr/bin:/bin:$PATH /bin/sh -l -c 'cd /home/webmaster/production/current; nohup bundle exec rake environment resque:work RAILS_ENV=production PIDFILE=/home/webmaster/production/shared/pids/resque_worker.pid >> log/resque_worker.log 2>&1'" as uid webmaster and gid webmaster | |
| stop program = "/bin/sh -c 'cd /home/webmaster/production/current && kill $(cat /home/webmaster/production/shared/pids/resque_worker.pid) && rm -f /home/webmaster/production/shared/pids/resque_worker.pid; exit 0;'" | |
| if totalmem is greater than 300 MB for 10 cycles then | |
| exec "/bin/kill -9 $(cat /home/webmaster/production/shared/pids/resque_worker.pid) && rm -f /home/webmaster/production/shared/pids/resque_worker.pid" | |
| if 5 restarts within 5 cycles then timeout | |
| group resque_workers | |
| check process resque-worker-staging |
| #!/usr/bin/env bash | |
| apt-get -y update | |
| apt-get -y upgrade | |
| apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-gplv2-dev libyaml-dev libffi-dev | |
| apt-get -y install autoconf curl git-core bzip2 | |
| apt-get -y autoremove | |
| apt-get -y clean | |
| cd /usr/local/src | |
| wget ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz | |
| tar -xvzf ruby-2.0.0-p247.tar.gz |
| rails_env = ENV['RAILS_ENV'] || 'development' | |
| rails_root = File.expand_path("../", File.dirname(__FILE__)) | |
| # threads | |
| threads 0,1 | |
| # workers | |
| case rails_env | |
| when 'staging' | |
| workers 1 |
| location @web { | |
| proxy_redirect off; | |
| proxy_set_header X-FORWARDED_PROTO http; | |
| proxy_set_header Host $host; | |
| proxy_set_header X-Real-IP $remote_addr; | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| proxy_pass http://web; | |
| } |
| #!/usr/bin/env ruby | |
| require 'timeout' | |
| members = %w(Gatis Jānis Anna Ilze Ieva Kaspars Juris Klāvs Pēteris) | |
| takers = [] | |
| givers = [] | |
| exceptions = { 'Gatis' => 'Jānis'} | |
| begin | |
| Timeout::timeout(2) do |
| #!/bin/sh | |
| export DISPLAY=:0.0 | |
| xset s off | |
| xset s noblank | |
| xset -dpms |
| (2..5).reduce(1){|m,o|y=10**o;m*((1..y).to_a.join[y-1].to_i)} |
| find ./ -name *.rb | xargs -I{} ruby -i -ne 'print unless /^#\s?encoding:\s?utf-8/i' {} |