Skip to content

Instantly share code, notes, and snippets.

@oinopion
oinopion / read-access.sql
Created October 5, 2016 13:00
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
@wppurking
wppurking / sidekiq.conf
Created February 3, 2016 07:40
supervisor handle sidekiq
[program:sidekiq]
; ---- point the sidekiq folder
directory=/var/www/<app>/
; ---- point binary execute file (use rbenv)
command=/root/.rbenv/shims/bundle exec sidekiq -e production
autostart=true
autorestart=true
; redirect stderr to stdout (like: 1>&2 or >&2)
redirect_stderr=true
stdout_logfile=/var/log/supervisor/sidekiq.log
@seyhunak
seyhunak / sidekiq.conf
Last active January 18, 2020 02:02
Sidekiq - Supervisord Configuration
/etc/supervisor/conf.d/sidekiq.conf
[program:sidekiq]
command=/usr/local/bin/sidekiq.sh
directory=/usr/local/bin/
user=ubuntu
startsecs=10
autostart=true
autorestart=true
stdout_logfile=/var/log/supervisor/sidekiq.log