Skip to content

Instantly share code, notes, and snippets.

View schaternik's full-sized avatar

Anastasia schaternik

  • Berlin, Germany
  • 08:27 (UTC +02:00)
View GitHub Profile
@schaternik
schaternik / pg_hba.conf
Last active February 12, 2018 13:22
Postgresql setup
# Database administrative login by Unix domain socket
local all postgres peer
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
@schaternik
schaternik / mysql.md
Last active February 12, 2018 13:25
Mysql CLI
  • check my sql installation mysql -V

  • login as root mysql -u root -p

  • SELECT User FROM mysql.user; - get list of the all database users

  • CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password'; - create new use with specified password

  • GRANT ALL PRIVILEGES ON * . * TO 'aska'@'localhost'; - grant the all privileges

  • vim /etc/mysql/my.cnf - mysql config file

  • sudo /etc/init.d/mysql restart

@schaternik
schaternik / whatis_whereis_which.md
Last active September 2, 2024 13:23
Linux: where vs whereis vs which vs whatis

whatis

  • whatis - display one-line manual page descriptions
  • whatis -w 'ab*' - search using wildcards
  • whatis -r '^ab' - search using regexps

whereis

  • whereis - locate the binary, source, and manual page files for a command
  • whereis -b vagrant - locate binary
  • whereis -m vagrant - locate man pages
  • whereis -s vagrant - locate source