Skip to content

Instantly share code, notes, and snippets.

View wangwenchao's full-sized avatar
🎯
Focusing

wwc wangwenchao

🎯
Focusing
View GitHub Profile
@wangwenchao
wangwenchao / 1) Install
Last active October 10, 2023 09:02 — forked from nghuuphuoc/1) Install
Install Redis and php-redis on Centos 6
// --- Compiling ---
$ wget http://download.redis.io/releases/redis-2.8.3.tar.gz
$ tar xzvf redis-2.8.3.tar.gz
$ cd redis-2.8.3
$ make
$ make install
// --- or using yum ---
$ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
$ rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
@wangwenchao
wangwenchao / salt-formula-setup.sh
Last active May 28, 2019 10:20 — forked from mortn/formula-setup.sh
Saltstack formula setup and updating
#!/bin/bash
formulas="sudoers timezone ntp openssh resolver iptables salt systemd users vim rsyslog logrotate vsftpd apt locale epel firewalld golang snmp iscsi lvm rsyncd sysctl zabbix dnsmasq haproxy keepalived docker nginx php postfix chrony letsencrypt libvirt nfs powerdns varnish redmine zookeeper postgres mysql kibana openvpn collectd apache tomcat etcd consul memcached django openvswitch bind ufw mongodb elasticsearch fail2ban vault prometheus node"
BASE_DIR=/srv
formula_root=$BASE_DIR/formulas
state_root=$BASE_DIR/states
pillar_root=$BASE_DIR/pillars
# git use git/https
git_url=git@github.com:saltstack-formulas
@wangwenchao
wangwenchao / prometheus-init-file
Last active April 28, 2019 03:05 — forked from JoergM/prometheus
Prometheus init file for RHEL 5 or 6
#!/bin/bash
#
# /etc/rc.d/init.d/prometheus
#
# Prometheus monitoring server
#
# chkconfig: 2345 20 80 Read
# description: Prometheus monitoring server
# processname: prometheus
#!/bin/sh
# Quick start-stop-daemon example, derived from Debian /etc/init.d/ssh
set -e
# Must be a valid filename
NAME=foo
PIDFILE=/var/run/$NAME.pid
#This is the command to be run, give the full pathname
DAEMON=/usr/local/bin/bar
@wangwenchao
wangwenchao / gist:608a8d8b57f93fb1c9d9c8832d7c65d2
Created August 24, 2018 09:01 — forked from mancubus77/gist:447281619be3731461b73dd4a18593c5
Prometheus node exporter init.d (Centos6/RHEL6)
#!/bin/bash
#
# /etc/rc.d/init.d/node_exporter
#
# Prometheus node exporter
#
# description: Prometheus node exporter
# processname: node_exporter
# Source function library.
@wangwenchao
wangwenchao / README.md
Created January 10, 2019 06:40 — forked from sebastianwebber/README.md
Zabbix 3 Install on CEntOS 7 with PostgreSQL 9.5

Zabbix 3 Install on CEntOS 7 with PostgreSQL 9.5

Repo installation

Zabbix repo

yum install http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm

测试平台:DigitalOcean VPS ubuntu14.04 x64, strongswan5.2.2

运行以下命令请使用root权限

一:安装strongswan

由于ubuntu软件仓库中strongswan版本较低,因此从官网源码编译安装

apt-get install build-essential     #编译环境
aptitude install libgmp10 libgmp3-dev libssl-dev pkg-config libpcsclite-dev libpam0g-dev     #编译所需要的软件
@wangwenchao
wangwenchao / install_start_stop_daemon.sh
Created August 27, 2018 02:26 — forked from yuuichi-fujioka/install_start_stop_daemon.sh
install start-stop-daemon to centos, fedora, redhat.
#!/bin/bash
cd /usr/local/src
wget http://developer.axis.com/download/distribution/apps-sys-utils-start-stop-daemon-IR1_9_18-2.tar.gz
tar zxvf apps-sys-utils-start-stop-daemon-IR1_9_18-2.tar.gz
cd apps/sys-utils/start-stop-daemon-IR1_9_18-2
gcc start-stop-daemon.c -o start-stop-daemon
cp start-stop-daemon /usr/sbin/
#!/bin/bash
# /etc/init.d/node_exporter
# config: /etc/prometheus/node_exporter.conf
# pidfile: /var/run/prometheus/node_exporter.pid
#
# preparation:
# - mkdir -p /var/run/prometheus
# - mkdir -p /var/log/prometheus
# - git clone git clone http://github.com/bmc/daemonize.git
#
@wangwenchao
wangwenchao / node_exporter.default
Created August 24, 2018 08:36 — forked from eloo/node_exporter.default
Init.d script for prometheus node exporter
# Set the command-line arguments to pass to the server.
ARGS='-web.listen-address=:9100 -collector.diskstats.ignored-devices="^(ram|loop|fd)\\d+$"'
# Prometheus-node-exporter supports the following options:
# -collector.diskstats.ignored-devices="^(ram|loop|fd|(h|s|v|xv)d[a-z])\\d+$": Regexp of devices to ignore for diskstats.
# -collector.filesystem.ignored-mount-points="^/(sys|proc|dev)($|/)": Regexp of mount points to ignore for filesystem collector.
# -collector.ipvs.procfs="/proc": procfs mountpoint.
# -collector.megacli.command="megacli": Command to run megacli.
# -collector.ntp.server="": NTP server to use for ntp collector.
# -collector.textfile.directory="": Directory to read text files with metrics from.