Skip to content

Instantly share code, notes, and snippets.

### Unicorn ###
check process unicorn
with pidfile "/home/deployer/qna/current/tmp/pids/unicorn.pid"
start program = "/bin/su - deployer -c 'cd /home/deployer/qna/current && ( RAILS_ENV=production ~/.rvm/bin/rvm default do bundle exec unicorn -c /home/deployer/qna/current/config/unicorn/production.rb -E deployment -D )'"
stop program = "/bin/su - deployer -c 'cd /home/deployer/qna/current && /usr/bin/env kill -s QUIT `cat /home/deployer/qna/current/tmp/pids/unicorn.pid`'"
if memory usage > 90% for 3 cycles then restart
if cpu > 90% for 2 cycles then restart
if 5 restarts within 5 cycles then timeout
### Puma ###
@EugeneKey
EugeneKey / s3_uploader.rb
Created March 26, 2020 15:48
Sharetribe update Amazon S3 signature_version to v4
class S3Uploader
def initialize()
@aws_access_key_id = APP_CONFIG.aws_access_key_id
@aws_secret_access_key = APP_CONFIG.aws_secret_access_key
@bucket = APP_CONFIG.s3_upload_bucket_name
@acl = "public-read"
@expiration = 10.hours.from_now
@s3_region = APP_CONFIG.s3_region
@current_dt = DateTime.now
# Ring the bell if any background window rang a bell
set -g bell-action any
# Default termtype. If the rcfile sets $TERM, that overrides this value.
set -g default-terminal screen-256color
# Keep your finger on ctrl, or don't
bind-key ^D detach-client
# Create splits and vertical splits
@EugeneKey
EugeneKey / directory
Last active July 13, 2024 03:32
Synolody Drive: exclude from sync folders for MacOS
cd ~/Library/Application\ Support/SynologyDrive/SynologyDrive.app/Contents/Resources/conf