Skip to content

Instantly share code, notes, and snippets.

@refs
Last active November 18, 2018 12:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save refs/d9e731cf1907f740d4c9a17413022096 to your computer and use it in GitHub Desktop.
Save refs/d9e731cf1907f740d4c9a17413022096 to your computer and use it in GitHub Desktop.

Postgres

init / stop postgres daemon (9.6)

# 1. prepare the destination directory
sudo mkdir /usr/local/pgsql
sudo chmod 775 /usr/local/pgsql
sudo chown $(whoami) /usr/local/pgsql

# 2. initialize postgres daemon. By setting $PGDATA to `/usr/local/pgsql' the -D option is not needed
pg_ctl start -D /usr/local/pgsql

# 2.1 If the initializer failed to create the {$user} database, run:
createdb

# 3. Start psql
psql

# 4. stop the daemon
pg_ctl stop -D /usr/local/pgsql

Tools

Kubernetes

show current context:

kubectl config current-context

Linux

How to find out which distribution I'm in?

Sometimes when running a docker image one is not sure which distro it's running on, for that:

cat /etc/*-release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment