Skip to content

Instantly share code, notes, and snippets.

@webchi
webchi / ovpn-playbook.yaml
Created March 22, 2022 08:47
Openvpn by ansible
---
- name: Install ovpn
hosts: ovpn
become: true
gather_facts: true
roles:
- kyl191.openvpn
vars:
openvpn_ovpn_dir: /etc/openvpn/client
openvpn_server_hostname: <external-host-ip>
@webchi
webchi / monitoring-role.yaml
Created January 2, 2022 13:38
Ansible all-in-one promethes monitoring setup with node_exporter, blackbox and alertmanager
---
- name: Setup monitoring server
hosts: all
become: true
roles:
- cloudalchemy.prometheus
- cloudalchemy.grafana
- cloudalchemy.alertmanager
- cloudalchemy.blackbox-exporter
vars:
@webchi
webchi / docker-compose.yaml
Created July 15, 2021 14:56
Sonarqube server with caddy proxy and letsencrypt
version: "3"
services:
caddy:
image: caddy:2.4.3-alpine
restart: unless-stopped
command: caddy reverse-proxy --from https:/you-awesome-domain.com:443 --to http://sonarqube:9000
ports:
- 80:80
@webchi
webchi / iptables.sh
Created February 24, 2021 13:18 — forked from Tristor/iptables.sh
Simple IPtables script for an OpenVPN server
#!/bin/bash
# Flushing all rules
iptables -F FORWARD
iptables -F INPUT
iptables -F OUTPUT
iptables -X
# Setting default filter policy
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
@webchi
webchi / iam.tf
Last active June 20, 2020 20:11
Yandex instance group
resource "yandex_iam_service_account" "swarm-group" {
name = "swarm-group"
description = "service account to manage Instance Group"
}
resource "yandex_resourcemanager_folder_iam_binding" "editor" {
folder_id = var.yandex_folder_id
role = "editor"
members = [
"serviceAccount:${yandex_iam_service_account.swarm-group.id}",
@webchi
webchi / Dockerfile
Created October 11, 2019 13:08
Rails Postgre Docker MultiStage
FROM ruby:2.5.5-alpine3.9 as builder
WORKDIR /app
ARG RAILS_MASTER_KEY
ENV BUNDLE_SILENCE_ROOT_WARNING=1 \
BUNDLE_IGNORE_MESSAGES=1 \
BUNDLE_GITHUB_HTTPS=1 \
BUNDLE_FROZEN=1 \
@webchi
webchi / Dockerfile
Created October 3, 2019 13:41
Rails MariaDB Docker MultiStage
FROM ruby:2.5.5-alpine3.9 as builder
WORKDIR /app
ENV BUNDLE_SILENCE_ROOT_WARNING=1 \
BUNDLE_IGNORE_MESSAGES=1 \
BUNDLE_GITHUB_HTTPS=1 \
BUNDLE_FROZEN=1 \
BUNDLE_WITHOUT=development:test
@webchi
webchi / Dockerfile
Created July 23, 2019 20:56
Rails multistage mariadb alpine
FROM ruby:2.5.5-alpine3.9 as builder
WORKDIR /app
ENV BUNDLE_SILENCE_ROOT_WARNING=1 \
BUNDLE_IGNORE_MESSAGES=1 \
BUNDLE_GITHUB_HTTPS=1 \
BUNDLE_FROZEN=1 \
BUNDLE_WITHOUT=development:test
@webchi
webchi / pg-replica.yml
Created March 15, 2019 06:40
PG in docker swarm standalone and with replica
version: '3.5'
networks:
webapp:
driver: overlay
name: webapp
services:
primary:
hostname: 'primary'
version: '3.5'
networks:
plannerix:
name: plannerix
external: true
services:
primary:
hostname: 'primary'