Skip to content

Instantly share code, notes, and snippets.

View Ara4Sh's full-sized avatar

Arash Shams Ara4Sh

View GitHub Profile
@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
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.

@Ara4Sh
Ara4Sh / kubernetes_commands.md
Created January 10, 2019 08:25 — forked from edsiper/kubernetes_commands.md
Kubernetes Useful Commands
@Ara4Sh
Ara4Sh / complex_salt_orchestrate.sls
Created July 21, 2019 06:07 — forked from whiteinge/complex_salt_orchestrate.sls
An example of a complex, multi-host Salt Orchestrate state that performs status checks as it goes
# /srv/salt/upgrade_the_app.sls
# Example of a complex, multi-host Orchestration state that performs status checks as it goes.
# Note, this is untested and is meant to serve as an example.
# Run via: salt-run state.orch upgrade_the_app pillar='{nodes: [nodeA, nodeB], version: 123}'
{% set nodes = salt.pillar.get('nodes', []) %}
{% set all_grains = salt.saltutil.runner('cache.grains',
tgt=','.join(nodes), tgt_type='list') %}
{# Default version if not given at the CLI. #}
@Ara4Sh
Ara4Sh / access.lua
Created August 9, 2019 07:11 — forked from josegonzalez/access.lua
Simple lua file enabling oauth support for nginx via nginx-lua and access_by_lua.
- certain endpoints are always blocked
if nginx_uri == "/_access_token" or nginx_uri == "/_me" then
ngx.exit(403)
end
-- import requirements
local cjson = require "cjson"
-- setup some app-level vars
local app_id = "APP_ID"
@Ara4Sh
Ara4Sh / nginx.conf
Created August 28, 2019 18:01 — forked from justincormack/nginx.conf
Using Lua and Nginx to proxy Amazon web services example
# example location parts of nginx.conf
# add your own AWS keys, server lines etc, and set your aws domains, paths
http {
# you will need the luacrypto in the cpath, download from http://luacrypto.luaforge.net/
lua_package_cpath "/home/justin/lua/luacrypto-0.2.0/src/l?.so.0.2.0;;";
server {
listen 80;
@Ara4Sh
Ara4Sh / disable-hyperthreading.sh
Created January 30, 2020 11:32 — forked from johanburati/disable-hyperthreading.sh
Disable hyperthreading
#!/bin/bash
for cpu in $(cat /sys/devices/system/cpu/cpu*/topology/thread_siblings_list)
do
echo 0 > /sys/devices/system/cpu/cpu${cpu}/online
done