Skip to content

Instantly share code, notes, and snippets.

View Ara4Sh's full-sized avatar

Arash Shams Ara4Sh

View GitHub Profile
@Ara4Sh
Ara4Sh / Vagrantfile
Created November 7, 2015 08:37
Docker Vagrant
Vagrant.require_version ">= 1.6.0"
VAGRANTFILE_API_VERSION = "2"
CNT_NAME = "dckt-bsf"
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'docker'
require 'yaml'
containers = YAML.load_file('containers.yml')
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.ssh.username = "root"
config.ssh.private_key_path = "/home/araax/.ssh/id_rsa"
config.ssh.pty= true
#!/bin/bash
# Copyright (C) 2015 Arash Shams <xsysxpert@gmail.com>.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@Ara4Sh
Ara4Sh / cf-ddns.sh
Created August 28, 2016 08:53 — forked from larrybolt/cf-ddns.sh
Automatically update your CloudFlare DNS record to the IP, Dynamic DNS for Cloudflare
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
# Automatically update your CloudFlare DNS record to the IP, Dynamic DNS
# Can retrieve cloudflare Domain id and list zone's, because, lazy
# Place at:
# /usr/local/bin/cf-ddns.sh
import telegram
def main():
bot = telegram.Bot(token="113351444:AAGmDDOkLqvzCESShVAfzwBgLiT1R9UvUK0")
lui = bot.getUpdates()[-1].update_id
print lui
while True:
for updates in bot.getUpdates(offset=lui,timeout=10):
text = updates.message.text
chat_id = updates.message.chat.id
update_id = updates.update_id
@Ara4Sh
Ara4Sh / gist:4d0c05075d1b956c06f92d70bb384cf7
Created November 26, 2016 06:54
debian-openresty-vts module with create .deb package
#Installing openresty 1.11.2.2 on debian 8
#Install required packages
apt-get -y install build-essential libpcre3-dev libssl-dev libgeoip-dev nginx libpq-dev libxslt1-dev libgd2-xpm-dev luajit git checkinstall
#Download openresty
cd /usr/local/src
wget https://openresty.org/download/openresty-1.11.2.2.tar.gz
tar xzf openresty-1.11.2.2.tar.gz
cd openresty-1.11.2.2
@Ara4Sh
Ara4Sh / gist:96c5513068f750891d23874ec95ef408
Created July 24, 2017 03:37
Using mysql.cnf again in percona 5.7
rm -rf /etc/my.cnf
update-alternatives --install /etc/mysql/my.cnf my.cnf "/etc/mysql/percona-server.cnf" 200
8.2.3. HTTP log format
----------------------
The HTTP format is the most complete and the best suited for HTTP proxies. It
is enabled by when "option httplog" is specified in the frontend. It provides
the same level of information as the TCP format with additional features which
are specific to the HTTP protocol. Just like the TCP format, the log is usually
emitted at the end of the session, unless "option logasap" is specified, which
generally only makes sense for download sites. A session which matches the
"monitor" rules will never logged. It is also possible not to log sessions for
@Ara4Sh
Ara4Sh / gist:90f2813e75c6027e4a04a421373f9933
Created November 22, 2017 17:44
HAProxy TCP log format (1.5)
8.2.2. TCP log format
---------------------
The TCP format is used when "option tcplog" is specified in the frontend, and
is the recommended format for pure TCP proxies. It provides a lot of precious
information for troubleshooting. Since this format includes timers and byte
counts, the log is normally emitted at the end of the session. It can be
emitted earlier if "option logasap" is specified, which makes sense in most
environments with long sessions such as remote terminals. Sessions which match
the "monitor" rules are never logged. It is also possible not to emit logs for
@Ara4Sh
Ara4Sh / route-all-traffic-through-tor.md
Created May 30, 2018 07:07 — forked from numb95/route-all-traffic-through-tor.md
Route all internet traffic through Tor

Add this to torrc ( located on /etc/tor/torrc):

VirtualAddrNetwork 10.192.0.0/10

AutomapHostsOnResolve 1

TransPort 9051 

DNSPort 9053
@Ara4Sh
Ara4Sh / rbd-replication.md
Created November 13, 2018 10:44 — forked from jbernard/rbd-replication.md
Cinder RBD Replication Guide

Replication Notes

Assumption: You have two clusters, access to both, and a pool that exists in both clustsers and you wish to replicate some or all images in that pool to the other cluster.

Mirroring in both directions is required for Cinder to properly implement failover and failback.

Make sure you have the rbd-mirror package installed.