Skip to content

Instantly share code, notes, and snippets.

View fnzv's full-sized avatar
🌐

Sami fnzv

🌐
View GitHub Profile
@fnzv
fnzv / 20130416-todo.md
Created January 29, 2017 16:17 — forked from mrflip/20130416-todo.md
Elasticsearch Tuning Plan

Next Steps

  • Measure time spend on index, flush, refresh, merge, query, etc. (TD - done)
  • Take hot threads snapshots under read+write, read-only, write-only (TD - done)
  • Adjust refresh time to 10s (from 1s) and see how load changes (TD)
  • Measure time of a rolling restart doing disable_flush and disable_recovery (TD)
  • Specify routing on query -- make it choose same node for each shard each time (MD)
  • GC new generation size (TD)
  • Warmers
  • measure before/after of client query time with and without warmers (MD)
@fnzv
fnzv / haproxy-parse.sh
Created March 9, 2017 21:43
Parsing HAProxy Logs with goaccess
goaccess -f haproxy.log --log-format='%^ %^ %^:%^:%^ %^ %^[%^]: %h:%^ [%d:%t.%^] %^ %^ %^/%^/%^/%^/%L %s %b %^ %^ %^ %^/%^/%^/%^/%^ %^/%^ "%r"' --date-format='%d/%b/%Y' --time-format='%H:%M:%S' -q
@fnzv
fnzv / main.yml
Last active August 8, 2017 10:32 — forked from bjallen/main.yml
ansible mysql percona task
---
- name: Add Percona apt signing key
sudo: yes
apt_key: keyserver=keys.gnupg.net id=8507EFA5 state=present
- name: Add Percona repository
sudo: yes
apt_repository: repo='deb http://repo.percona.com/apt trusty main' state=present
- name: Add Percona source repository
@fnzv
fnzv / ipa_mail_passexpiration.sh
Created January 22, 2018 14:21 — forked from miticojo/ipa_mail_passexpiration.sh
send email for password expiration
#!/bin/bash
# Source: http://vmhacks.com/freeipa-password-expiry-notification-script-for-red-hat-identity-management/
# notifies people a set number of days before expiry, once via email
# open a kerberos ticket using keytab authentication
# the following keytab file was made using ktutil with rc4-hmac
/usr/bin/kinit admin@YOURDOMAIN.COM -k -t /sextoys/admin.keytab
@fnzv
fnzv / haproxy.cfg
Created February 22, 2018 09:37 — forked from thisismitch/haproxy.cfg
Let's Encrypt Auto-Renewal script for HAProxy
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
maxconn 2048
@fnzv
fnzv / gist:f375fe897ec935b1f3dd284edb6d7c85
Last active May 9, 2018 19:21 — forked from jmn/gist:4de857259b1dfc54ab80b5682af935ad
Building h2load (of nghttp2) on Ubuntu 16.04
#! /bin/bash
# https://nghttp2.org/documentation/h2load-howto.html
sudo apt-get update
sudo apt-get install -y g++ make binutils autoconf automake autotools-dev libtool pkg-config zlib1g-dev libcunit1-dev libssl-dev libxml2-dev libev-dev libevent-dev libjansson-dev libc-ares-dev libjemalloc-dev cython python3-dev python-setuptools libjemalloc-dev libspdylay-dev
git clone https://github.com/nghttp2/nghttp2.git && cd nghttp2 && autoreconf -i && automake && autoconf && ./configure --enable-app && make && make install
./src/h2load --help
@fnzv
fnzv / gist:b44c9737506f8b6892c33af6f4c29436
Created June 26, 2018 08:59 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@fnzv
fnzv / install.sh
Created July 17, 2018 13:26 — forked from popstas/install.sh
Install LAMP with ansible from geerlingguy
sudo apt-get install -y python-dev python-pip
sudo pip install ansible
sudo ansible-galaxy install geerlingguy.apache geerlingguy.mysql geerlingguy.php
wget https://gist.githubusercontent.com/popstas/61a5ddce08fe1a269f62576808cee54e/raw/de7bceea261f5a76fd88d8673046e5e18be7e35a/lamp.yml
ansible-playbook -i 'localhost,' -c local lamp.yml
@fnzv
fnzv / dynamic-nginx-module-ubuntu-18.04.sh
Created January 12, 2019 12:08 — forked from excid3/dynamic-nginx-module-ubuntu-18.04.sh
How to compile a dynamic nginx module for Ubuntu 18.04
# Install dependencies that nginx was originally compiled with
sudo apt install libperl-dev libgeoip-dev libgd-dev
# Get the nginx source
wget https://nginx.org/download/nginx-1.14.0.tar.gz
tar zxf nginx-1.14.0.tar.gz
# Get the module source
wget https://github.com/fdintino/nginx-upload-module/archive/master.zip
unzip master.zip
@fnzv
fnzv / ec2.ini
Created April 10, 2019 19:32 — forked from parzonka/ec2.ini
Configuration for ansibles dynamic ec2 inventory. Forked from https://github.com/ansible/ansible/tree/devel/contrib/inventory/ec2.ini and configured for eu-central-1 and performance.
# Ansible EC2 external inventory script settings
#
[ec2]
# to talk to a private eucalyptus instance uncomment these lines
# and edit edit eucalyptus_host to be the host name of your cloud controller
#eucalyptus = True
#eucalyptus_host = clc.cloud.domain.org