Skip to content

Instantly share code, notes, and snippets.

@maxivak
maxivak / readme.md
Last active October 19, 2017 08:37
Backups

Backups

Backup strategy

Storage

Store backups

  • Local disk
  • Remote storage - copy by scp
  • Remote storage - sync using Rsync
@maxivak
maxivak / readme.md
Created October 20, 2016 08:12
Run Chef recipes on test kitchen

Run Chef recipes on test kitchen

  • Installing Chef Client with Test Kitchen

  • Node is a test kitchen

  • Create kitchen

@maxivak
maxivak / readme.md
Last active January 4, 2017 16:14
Install Chef, Chefdk
@maxivak
maxivak / readme.md
Last active September 14, 2016 12:23
Ubuntu 16.04 network rules for interfaces

Ubuntu 16.04 network rules for interfaces

/etc/udev/rules.d/70-persistent-net.rules

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:25:90:24:6b:ec", ATTR{dev_id}=="0x0", ATTR{type}=="1", NAME="eth0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:25:90:24:6b:ed", ATTR{dev_id}=="0x0", ATTR{type}=="1", NAME="eth1"
@maxivak
maxivak / nginx_php.md
Created September 13, 2016 20:56
Nginx rewrite for php sites

Nginx server configuration for PHP sites

 server {
      listen       80;
      server_name  www.mysite.com;
      return       301 http://mysite.com$request_uri;
  }

@maxivak
maxivak / readme.md
Last active November 21, 2022 21:16
Multiple networks in LXC container

Network for LXC container

Host device as bridge

  • persisted in host's /etc/network/interfaces the container's veth virtual ethernet interface can share the network link on the physical interface of the host (eth0). So the container resides on the same ethernet segment and talks to the same dhcp server as the host does.

Additonal bridge device

  • setup manually with brctl
@maxivak
maxivak / readme.md
Last active June 8, 2020 15:38
LXC containers in Ubuntu 16.04

Install LXC

Config LXC

~/.config/lxc/default.conf

lxc.network.type = veth
lxc.network.link = lxcbr0
@maxivak
maxivak / readme.md
Last active July 19, 2025 17:44
Install PowerDNS with recursor and MySQL backend

PowerDNS

PowerDNS is not designed to provide recursive results. It is intended to act only as an authoritative server for the domains it serves. This implies it will be serving domain data to other hosts.

Install pdns and pdns-recursor

sudo apt-get install pdns-server pdns-recursor
@maxivak
maxivak / readme.md
Last active September 2, 2016 09:43
Sensu - history for metrics counters

Add history for Sensu metrics with Kafka

  • Sensu stores in Redis only last check results and history of exit codes for that check.

  • there is log file in Sensu where history of ALL checks is written. It can be used for extracting data, but it is not intended for user log.

  • We will use Sensu handler, which is triggered after every check (metric handler is triggered after every run, but other handler types are triggered after exit code changes value from previous execution!) run and provided with check results.

  • It is up to user to decide what to do with results, should he add data to log file, store data to Redis, or something else.

  • Our handler will store data in Kafka

@maxivak
maxivak / readme.md
Last active August 30, 2016 12:29
Writing better code in Chef recipes

Writing better code in Chef recipes

Libraries are Ruby files placed in /libraries directory for the cookbook: .../cookbooks/mycookbook/libraries/

Helpers

Custom Resources