Skip to content

Instantly share code, notes, and snippets.

View maprangzth's full-sized avatar

Komsan Kamsamur maprangzth

View GitHub Profile
@maprangzth
maprangzth / hosts.json
Created February 24, 2018 17:04
Ansible Inventory File JSON Format
{
"centos": {
"hosts": {
"centos1": {
"ansible_port": 2222
},
"centos2": null,
"centos3": null
},
"vars": {
@maprangzth
maprangzth / hosts.yaml
Created February 24, 2018 17:06
Ansible Inventory File YAML Format
---
centos:
hosts:
centos1:
ansible_port: 2222
centos2:
centos3:
vars:
ansible_user: root
ubuntu:
@maprangzth
maprangzth / hosts.ini
Last active February 25, 2018 04:06
Ansible Inventory File INI Format
[centos]
centos1 ansible_port=2222
centos[2:3]
[centos:vars]
ansible_user=root
[ubuntu]
ubuntu[1:3]
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
@maprangzth
maprangzth / coova-chilli.spec
Created May 4, 2018 13:33 — forked from muffycompo/coova-chilli.spec
The SPEC file I use for packaging CoovaChilli as an RPM
Summary: Coova-Chilli is a Wireless LAN Access Point Controller
Name: coova-chilli
Version: 1.3.0
Release: 1
URL: http://www.coova.org/
Source0: %{name}-%{version}.tar.gz
License: GPL
Group: System Environment/Daemons
BuildRoot: %{_tmppath}/%{name}-root
@maprangzth
maprangzth / gfid-resolver.sh
Created May 17, 2018 04:14 — forked from louiszuckerman/gfid-resolver.sh
Glusterfs GFID Resolver Turns a GFID into a real path in the brick
#!/bin/bash
if [[ "$#" < "2" || "$#" > "3" ]]; then
cat <<END
Glusterfs GFID resolver -- turns a GFID into a real file path
Usage: $0 <brick-path> <gfid> [-q]
<brick-path> : the path to your glusterfs brick (required)
@maprangzth
maprangzth / edgepoint-ntp-conf.md
Created June 23, 2018 07:59
Example NTP Configuration for Softnix Edge Point

Example NTP Configuration for Softnix Edge Point

The location for configuration file:

  • Main: /etc/ntp.conf
  • Restriction List: /etc/ntp/conf/restriction.list
  • Service List: /etc/ntp/conf/server.list

Configuration Example

@maprangzth
maprangzth / squid.conf
Created June 28, 2018 10:41 — forked from hardikdangar/squid.conf
squid.conf
# General
http_port 3130
http_port 3128 intercept
https_port 3129 intercept ssl-bump cert=/etc/squid/ssl_cert/srtpl.pem generate-host-certificates=on dynamic_cert_mem_cache_size=4MB
acl DiscoverSNIHost at_step SslBump1
acl NoSSLIntercept ssl::server_name_regex -i "/etc/squid/url.nobump"
ssl_bump splice NoSSLIntercept
ssl_bump peek DiscoverSNIHost
@maprangzth
maprangzth / squid.conf
Created June 28, 2018 11:11 — forked from bogdanr/squid.conf
Squid.conf SSL transparent proxy
visible_hostname vm-gateway
#
# Recommended minimum configuration:
#
# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 10.10.10.0/24
acl localnet src 127.0.0.1
@maprangzth
maprangzth / squid-xff-log.conf
Created June 28, 2018 14:15 — forked from alvarow/squid-xff-log.conf
Sets Squid Proxy to log IP address from X-Forwarded-For header instead of the real client ip address if the X-Forwarded-For header exists.
# Has XFF header with a value
acl has-xff req_header X-Forwarded-For ^(([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)|(\[([0-9a-f]+)?:([0-9a-f:]+)?:([0-9a-f]+|0-9\.]+)?\]))
# default logformat
logformat squid %ts.%03tu %6tr %>a %Ss/%03>Hs %<st %rm %ru %[un %Sh/%<a %mt
# default logformat using XFF instead of client IP address
logformat squid-xff %ts.%03tu %6tr %{X-Forwarded-For}>h %Ss/%03>Hs %<st %rm %ru %[un %Sh/%<a %mt