Skip to content

Instantly share code, notes, and snippets.

View vanzhiganov's full-sized avatar

Vyacheslav Anzhiganov vanzhiganov

View GitHub Profile
@vanzhiganov
vanzhiganov / .ansible.cfg
Last active June 9, 2024 00:47 — forked from wbcurry/.ansible.cfg
Ansible: .ansible.cfg
# config file for ansible -- http://ansible.com/
# ==============================================
# nearly all parameters can be overridden in ansible-playbook
# or with command line flags. ansible will read ANSIBLE_CONFIG,
# ansible.cfg in the current working directory, .ansible.cfg in
# the home directory or /etc/ansible/ansible.cfg, whichever it
# finds first
[defaults]
#! /bin/sh
set -e
# This script originates from http://www.debian.org/mirror/anonftpsync
# CVS: cvs.debian.org:/cvs/webwml - webwml/english/mirror/anonftpsync
# Version: $Id: anonftpsync,v 1.43 2008-06-15 18:16:04 spaillar Exp $
# Note: You MUST have rsync 2.6.4 or newer, which is available in sarge
# and all newer Debian releases, or at http://rsync.samba.org/
@vanzhiganov
vanzhiganov / docker-nfs-volumes.md
Created May 5, 2023 08:18 — forked from ruanbekker/docker-nfs-volumes.md
NFS Volumes with Docker Swarm

Create NFS Volumes:

Creating the NFS Volume:

$ docker volume create --driver local \
  --opt type=nfs \
  --opt o=addr=192.168.1.115,uid=1000,gid=1000,rw \
  --opt device=:/mnt/volumes/mysql-test \
  mysql-test-1
@vanzhiganov
vanzhiganov / README.md
Created February 5, 2023 07:02 — forked from magnetikonline/README.md
BIND - delegate a sub domain for a zone.

BIND - delegate a sub domain for a zone

The scenario:

  • DNS zone myzone.com defined in BIND.
  • Authoritative name server at 123.16.123.1.
  • Subzone sub.myzone.com with an authoritative name server at 123.16.123.10.
  • Wishing to forward sub-zone to authoritative name server.

Config

@vanzhiganov
vanzhiganov / mysql_query_log.md
Created February 3, 2023 07:24 — forked from joseluisq/mysql_query_log.md
How to enable the MySQL/MariaDB general query logs

How to enable the MySQL/MariaDB general query logs

  1. Enter to MySQL/MariaDB server command-line tool (change root with your username and password):
mysql -u root -proot
  1. Set the general log file path:
SET GLOBAL general_log_file='/var/log/mysql/mycustom.log';
@vanzhiganov
vanzhiganov / README.md
Created January 5, 2023 05:47 — forked from denji/README.md
Simple Sentry docker-compose.yml
  1. Download docker-compose.yml to dir named sentry
  2. Change SENTRY_SECRET_KEY to random 32 char string
  3. Run docker-compose up -d
  4. Run docker-compose exec sentry sentry upgrade to setup database and create admin user
  5. (Optional) Run docker-compose exec sentry pip install sentry-slack if you want slack plugin, it can be done later
  6. Run docker-compose restart sentry
  7. Sentry is now running on public port 9000
#!/usr/bin/env bash
for port in 7000 7001 7002 7003 7004 7005
do
mkdir ${port}
cd ${port}
cat >redis.conf << EOF
port ${port}
cluster-enabled yes
cluster-config-file nodes.conf
1. Clone the repository
2. Install go 1.11 or later with Go modules enabled
3. Install binaries to $GOPATH/bin
go install github.com/drone/drone/cmd/drone-agent
go install github.com/drone/drone/cmd/drone-controller
go install github.com/drone/drone/cmd/drone-server
4. Start the server at localhost:8080
#!/bin/sh
rm -rf /home/project/*
FOLDER=/home/project
cp ./*.php $FOLDER
cp -r css img js $FOLDER
FILES=$(find css js templates -type f -regex '.*.\(js\|css\|twig\)')
for f in $FILES; do
def get_arg_int(name: str, pattern: str, default=None):
value = request.args.get(name)
if not value:
return default
pattern = re.compile(pattern).match(value)
return int(pattern.group(0)) if pattern else None