Skip to content

Instantly share code, notes, and snippets.

View vmpartner's full-sized avatar

Musin Vitaly vmpartner

  • Russia
View GitHub Profile
@vmpartner
vmpartner / read-access.sql
Created August 5, 2019 07:18 — forked from oinopion/read-access.sql
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;
@vmpartner
vmpartner / convert.sh
Last active August 29, 2015 14:18 — forked from akost/convert.sh
#!/bin/bash
# Recursive file convertion utf-8 --> windows-1251
# Place this file in the root of your site, add execute permission and run
# Converts *.php, *.html, *.css, *.js files.
# To add file type by extension, e.g. *.cgi, add '-o -name "*.cgi"' to the find command
find ./ -name "*.php" -o -name "*.html" -o -name "*.css" -o -name "*.js" -type f |
while read file
do