Skip to content

Instantly share code, notes, and snippets.

View fradee's full-sized avatar

Oleksandr Fradynskyi fradee

  • Lviv, Ukraine
  • 17:26 (UTC +03:00)
  • LinkedIn in/fradee
View GitHub Profile
@fradee
fradee / aws_alb_log_parser.py
Created January 29, 2020 16:00 — forked from jweyrich/aws_alb_log_parser.py
AWS ALB Log Parser written in Python
#!/usr/bin/env python3
# coding=utf8
#
# AUTHOR: Jardel Weyrich <jweyrich at gmail dot com>
#
from __future__ import print_function
import re, sys
def parse_alb_log_file(file_path):
fields = [
@fradee
fradee / 1ACLImportExport.md
Created February 11, 2019 10:24 — forked from vpack/1ACLImportExport.md
Consul ACL - Export/Import.

Use Consulate to export and import ACLs from Consul.

Setup your environment before you run these scripts:

export CONSUL_HOST="localhost"
export MASTER_TOKEN="myMasterToken"

Reference:

@fradee
fradee / opt1_template.j2
Created August 27, 2018 10:35 — forked from halberom/opt1_template.j2
ansible - example of template if else
{# style 1 - long form #}
{% if filepath == '/var/opt/tomcat_1' %}
{% set tomcat_value = tomcat_1_value %}
{% else %}
{% set tomcat_value = tomcat_2_value %}
{% endif %}
{# style 2 - short form #}
{% set tomcat_value = tomcat_1_value if (filepath == '/var/opt/tomcat_1') else tomcat_2_value %}
@fradee
fradee / gitlab-backup.sh
Created August 15, 2018 09:13 — forked from devopstaku/gitlab-backup.sh
A script to backup GitLab repositories.
#!/bin/bash
# A script to backup GitLab repositories.
GLAB_BACKUP_DIR=${GLAB_BACKUP_DIR-"gitlab_backup"} # where to place the backup files
GLAB_TOKEN=${GLAB_TOKEN-"YOUR_TOKEN"} # the access token of the account
GLAB_GITHOST=${GLAB_GITHOST-"gitlab.com"} # the GitLab hostname
GLAB_PRUNE_OLD=${GLAB_PRUNE_OLD-true} # when `true`, old backups will be deleted
GLAB_PRUNE_AFTER_N_DAYS=${GLAB_PRUNE_AFTER_N_DAYS-7} # the min age (in days) of backup files to delete
GLAB_SILENT=${GLAB_SILENT-false} # when `true`, only show error messages
GLAB_API=${GLAB_API-"https://gitlab.com/api/v3"} # base URI for the GitLab API
@fradee
fradee / PostfixMandrill.md
Created November 29, 2017 12:48 — forked from soifou/PostfixMandrill.md
Install Mandrill with Postfix

Postfix / Mandrill

Installation

# apt-get install postfix

Configuration sasl

# vim /etc/postfix/sasl_passwd

With a bit of playing around I've managed to come up with a semi solution (not perfect but good enough)

using 2707974 answer and information I've gained else where I've been able to get what I need.

First you need vsftp and PAM installed

apt-get install vsftpd libpam-pwdfile apache2-utils

Edit /etc/vsftpd.conf

@fradee
fradee / pagespeed.conf
Created November 15, 2017 18:58 — forked from molotovbliss/pagespeed.conf
mod_pagespeed.conf for Magento 1.x
<IfModule mod_pagespeed>
# General Configuration
ModPagespeed on
ModPagespeedDomain *.domain.com
ModPagespeedDomain images.domain.com
ModPagespeedDomain assets.domain.com
ModPagespeedStatistics on
ModPagespeedStatisticsLogging on
ModPagespeedLogDir /home/domain.com/public_html/var/pagespeed
# Add correct content-type for fonts
AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType font/x-woff .woff
AddType image/svg+xml .svg
# Compress compressible fonts
AddOutputFilterByType DEFLATE font/ttf font/otf image/svg+xml
@fradee
fradee / magento unnecessary apache modules
Created October 24, 2017 09:52 — forked from zztimur/magento unnecessary apache modules
magento - apache modules that are not needed
Here is the list of apache modules which we were able to disable safely. This list is published just to give you idea, so be careful and consider your specific needs before disabling these.
Here is the list
proxy
proxy_ajp
proxy_balancer
proxy_connect
proxy_ftp
proxy_http
@fradee
fradee / magento - MINIMUM required apache modules for Magento
Last active October 24, 2017 10:02 — forked from zztimur/magento unnecessary apache modules
magento - apache modules that are not needed
LoadModule expires_module modules/mod_expires.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule mime_module modules/mod_mime.so
LoadModule dir_module modules/mod_dir.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
mod_expires – generates content expiration and cache control headers
mod_deflate - compresses content before it is delivered to the client