Skip to content

Instantly share code, notes, and snippets.

View user.sql
/* create user with password */
CREATE USER xxx WITH ENCRYPTED PASSWORD 'xxxxxxx';
/* set permissions */
GRANT CONNECT ON DATABASE mydb TO xxx;
GRANT USAGE ON SCHEMA public TO xxx;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO xxx;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO xxx;
View Docker setup notes
## Steps to install docker on brand new machine
1. Install docker and docker-compose
* `apt-get install docker docker-compose`
* `yum install docker docker-compose`
2. Add certain user to docker group, `usermod -aG docker $USER`
3. Direct docker to save cache to a specific location, modify `daemon.json` following the `daemon.json` notes.
4. If SElinux is enabled, issue this command to allow docker to access sepecified location `chcon -R -t svirt_sandbox_file_t /SOURCEDIR`
View python_iterrate.py
# pandas dataframe
for index, row in df.iterrows():
print row['c1'], row['c2']
# dictionary
for key, value in d.iteritems():
print(key, value)
@hazelement
hazelement / dropbox_git.md
Created Dec 31, 2015 — forked from trey/dropbox_git.md
Using Dropbox to Share Git Repositories
View dropbox_git.md

Using Dropbox to Share Git Repositories

First, create a Git subfolder inside your Dropbox folder. Then you can share the individual projects inside that folder with whomever you want (or just use it for instant offsite backups).

From inside a Git project:

git clone --bare . ~/Dropbox/Git/gitproject.git
git remote add dropbox ~/Dropbox/Git/gitproject.git

When you're ready to push:

You can’t perform that action at this time.