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
# This gist assumes you have a cherrypy server configured with name "powwow-webapp" | |
# and two celery queues -- all running on the same machine | |
# In production you'd want the webserver and celery should be on different machines | |
#Allow powwow user to restart apache and cherrypy (webapp) | |
Cmnd_Alias POWWOW_WEB=/bin/systemctl restart httpd, /bin/systemctl restart powwow-webapp, /bin/systemctl stop httpd, /bin/systemctl start httpd, /bin/systemctl stop powwow-webapp, /bin/systemctl start powwow-webapp | |
Cmnd_Alias POWWOW_CELERY=/bin/systemctl start celeryd, /bin/systemctl start long-job-celeryd, /bin/systemctl stop celeryd, /bin/systemctl stop long-job-celeryd,/bin/systemctl restart celeryd,/bin/systemctl restart long-job-celeryd | |
# we allow the powwow user to execute these as root without entering passwords, so they can be called from a fab script | |
powwow ALL=(root) NOPASSWD: POWWOW_WEB, POWWOW_CELERY |
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
-- locate all table names (relname) with a company_id column: | |
-- extracted from http://www.postgresonline.com/journal/archives/215-Querying-table,-view,-column-and-function-descriptions.html | |
select n.nspname, t.spcname, c.relname | |
FROM pg_class As c | |
INNER JOIN pg_attribute As a ON c.oid = a.attrelid | |
LEFT JOIN pg_namespace n ON n.oid = c.relnamespace | |
LEFT JOIN pg_tablespace t ON t.oid = c.reltablespace | |
where a.attname = 'company_id' | |
and c.relkind='r' | |
order by c.relname; |
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
# Settings for Screen to allow better use of emacs | |
# | |
# Most important: rebind ctrl-A | |
## Control-^ (usually Control-Shift-6) is traditional and the only key not used by emacs | |
escape ^^^^ | |
# | |
## do not trash BackSpace, usually DEL | |
bindkey -k kb | |
bindkey -d -k kb | |
# |