Skip to content

Instantly share code, notes, and snippets.

View maprangzth's full-sized avatar

Komsan Kamsamur maprangzth

View GitHub Profile
@maprangzth
maprangzth / sysctl.conf
Created November 3, 2017 07:12 — forked from sokratisg/sysctl.conf
Tuned sysctl.conf for use by CentOS/RHEL 6.x or later
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.
# Turn on execshield
# 0 completely disables ExecShield and Address Space Layout Randomization
# 1 enables them ONLY if the application bits for these protections are set to “enable”
# 2 enables them by default, except if the application bits are set to “disable”
# 3 enables them always, whatever the application bits
@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 / Ansible-Inventory-File-YAML-JSON.md
Last active February 25, 2018 04:03
มาลองเขียน Ansible Inventory File ให้อยู่ในรูปแบบ YAML/JSON กันเถอะ

Ansible Logo

สำหรับท่านที่ศึกษาและใช้งาน Ansible ก็คงจะรู้จักและคุ้นเคยกับ INI Inventory file กันเป็นอย่างดีอยู่แล้ว หน้าตามันก็จะประมาณนี้:

[centos]
centos1 ansible_port=2222
centos[2:3]

[centos:vars]
@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 / zabbix-alert-smtp.sh
Created January 19, 2017 07:12 — forked from superdaigo/zabbix-alert-smtp.sh
Zabbix SMTP Alert script for gmail
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Zabbix SMTP Alert script for gmail.
"""
import sys
import smtplib
from email.MIMEText import MIMEText
from email.Header import Header
@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