CREATE USER
CREATE USER
CREATE DATABASE
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
@media only screen and (max-width: 600px) { | |
.minimum .site-tagline{ | |
display: none; | |
} | |
.home-featured-1, | |
.home-featured-2, | |
.home-featured-3, | |
.home-featured-4 { |
First, check your current config (example output in `homebrew.mxcl.postgresql.plist.xml` lower down in this gist): | |
cat ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist | |
Most importantly, note the `-D /usr/local/var/postgres` argument. | |
Second, shut down your current PostgreSQL. | |
brew services stop postgresql |
from pathlib import Path | |
import subprocess | |
CURRENT_DIR = Path('.') | |
projects = sorted([x for x in CURRENT_DIR.iterdir() if x.is_dir()]) | |
for project in projects: | |
print('*' * 70) |
# usage: create_sftp_user <username> | |
function create_sftp_user() { | |
# create user | |
sudo adduser --disabled-password --gecos "" $1 | |
# prevent ssh login & assign SFTP group | |
sudo usermod -g sftpaccess $1 | |
sudo usermod -s /bin/nologin $1 | |
# chroot user (so they only see their directory after login) |
** Find commmonly accessed tables and their use of indexes: | |
SELECT relname,seq_tup_read,idx_tup_fetch,cast(idx_tup_fetch AS numeric) / (idx_tup_fetch + seq_tup_read) AS idx_tup_pct FROM pg_stat_user_tables WHERE (idx_tup_fetch + seq_tup_read)>0 ORDER BY idx_tup_pct; | |
Returns output like: | |
relname | seq_tup_read | idx_tup_fetch | idx_tup_pct | |
----------------------+--------------+---------------+------------------------ | |
schema_migrations | 817 | 0 | 0.00000000000000000000 | |
user_device_photos | 349 | 0 | 0.00000000000000000000 |
I hereby claim:
To claim this, I am signing this object: