2014-08-18 10:38:52 +00:00
|
|
|
## Database
|
|
|
|
|
|
|
|
### postgres
|
|
|
|
|
2014-08-18 11:34:22 +00:00
|
|
|
- Host: postgres
|
|
|
|
|
2014-08-18 10:40:34 +00:00
|
|
|
```bash
|
2014-08-18 12:30:06 +00:00
|
|
|
$ create-postgres-user-and-database foo bar # create user `foo` and give him access to database `bar`
|
2014-08-18 10:40:34 +00:00
|
|
|
```
|
2014-08-18 10:38:52 +00:00
|
|
|
|
2014-08-18 11:34:22 +00:00
|
|
|
Administration shell:
|
|
|
|
|
|
|
|
```bash
|
2014-08-18 12:39:40 +00:00
|
|
|
$ sudo psql -h postgres -U postgres
|
|
|
|
psql> \l # list databases
|
|
|
|
psql> \c <database> # connect to database
|
|
|
|
psql> \d # show tables
|
2014-08-18 12:40:11 +00:00
|
|
|
$ sudo pg_dump -h postgres -U postgres <dbname> > dump.sql # backup
|
|
|
|
$ sudo psql -h postgres -U postgres < dump.sql # restore
|
2014-08-18 11:34:22 +00:00
|
|
|
```
|
|
|
|
|
2014-08-18 12:39:40 +00:00
|
|
|
|
2014-08-18 10:38:52 +00:00
|
|
|
### mysql
|
|
|
|
|
2014-08-18 11:34:22 +00:00
|
|
|
- Host: mysql
|
|
|
|
|
2014-08-18 10:40:34 +00:00
|
|
|
```bash
|
2014-08-18 12:30:06 +00:00
|
|
|
$ create-mysql-user-and-database foo # create database and user `foo`
|
2014-08-18 11:34:22 +00:00
|
|
|
```
|
|
|
|
|
2014-08-18 12:31:12 +00:00
|
|
|
## List zfs snapshots
|
2014-08-18 12:09:12 +00:00
|
|
|
|
|
|
|
```bash
|
2014-08-20 18:56:38 +00:00
|
|
|
$ cd /data/containers/<name>/rootfs/.zfs # .zfs directory is hidden and will not be shown by `ls -a`
|
2014-08-18 12:09:12 +00:00
|
|
|
$ ls
|
|
|
|
```
|
|
|
|
|
2014-08-27 07:38:20 +00:00
|
|
|
## Backups
|
|
|
|
|
|
|
|
* located in /backup/rsync
|
|
|
|
* mysql dumps: /backup/rsync/mysqldbs
|
|
|
|
* postgres dumps: /backup/rsync/postgresdbs
|
|
|
|
* zfs snapshosts: /backup/rsync/.zfs/snapshot
|
|
|
|
* default backup location for containers: home, srv, etc, usr/local
|
2014-08-27 07:39:16 +00:00
|
|
|
* systemd service files: backup-daily.{timer,service}, backup-weekly.{timer,service}
|
2014-08-27 07:38:20 +00:00
|
|
|
|
2014-08-18 11:38:26 +00:00
|
|
|
## Ldap
|
|
|
|
|
2014-08-18 12:03:05 +00:00
|
|
|
Administration: https://ldap.higgsboson.tk
|
|
|
|
|
|
|
|
| objectclass | description |
|
|
|
|
| ----------- | ---------------------------- |
|
|
|
|
| mailaccount | access imap/smtp |
|
|
|
|
| owncloud | https://cloud.higgsboson.tk |
|
|
|
|
| gitlab | https://git.higgsboson.tk |
|
2014-08-21 06:28:15 +00:00
|
|
|
| ttrss | https://rss.higgsboson.tk |
|
2014-08-23 15:01:22 +00:00
|
|
|
| jabber | xmpp |
|
2014-08-18 12:03:05 +00:00
|
|
|
|
2014-08-18 11:38:26 +00:00
|
|
|
## Mail
|
|
|
|
|
2014-08-18 11:48:24 +00:00
|
|
|
| Key | Value |
|
|
|
|
| ----------- |----------------------------- |
|
|
|
|
| Imap | imap.higgsboson.tk, Port 143 |
|
|
|
|
| Smtp | smtp.higgsboson.tk, Port 567 |
|
2014-08-26 06:11:04 +00:00
|
|
|
| Sieve | imap.higgsboson.tk, Port 4190|
|
2014-08-18 11:53:54 +00:00
|
|
|
| Webmail | https://mail.higgsboson.tk |
|
2014-08-18 11:48:24 +00:00
|
|
|
| Encryption | STARTTLS or TLS |
|
2014-08-18 11:50:14 +00:00
|
|
|
| MX-Record | mail.higgsboson.tk |
|
|
|
|
| SRV-Record | v=spf1 a:mail.higgsboson.tk ip6:2a01:4f8:210:31fd:1::10 -all |
|
2014-08-18 12:30:06 +00:00
|
|
|
|
|
|
|
## LXC
|
|
|
|
|
2014-08-18 12:30:30 +00:00
|
|
|
```bash
|
2014-08-18 12:30:06 +00:00
|
|
|
$ lxc-attach -n <name> # login
|
|
|
|
$ systemctl start lxc@<name> # start container
|
|
|
|
$ systemctl stop lxc@<name> # stop container
|
|
|
|
```
|
2014-08-20 18:55:11 +00:00
|
|
|
|
|
|
|
## Get logs
|
|
|
|
|
2014-08-20 18:55:36 +00:00
|
|
|
`lxc-log <CONTAINER> <SERVICE>`
|
2014-08-20 18:55:11 +00:00
|
|
|
|
|
|
|
example:
|
|
|
|
```bash
|
|
|
|
$ lxc-log mail postfix # get logs of postfix service in the mail container
|
|
|
|
$ lxc-log mail postfix -f # Additional parameter are passed to journalctl
|
|
|
|
```
|