This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# by Paul Colby (http://colby.id.au), no rights reserved ;) | |
# https://github.com/pcolby/scripts/blob/master/cpu.sh | |
PREV_TOTAL=0 | |
PREV_IDLE=0 | |
while true; do | |
# Get the total CPU statistics, discarding the 'cpu ' prefix. | |
CPU=(`sed -n 's/^cpu\s//p' /proc/stat`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get install software-properties-common | |
add-apt-repository ppa:vbernat/haproxy-1.9 | |
apt-get update | |
apt-get install haproxy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
limit_req_zone $request_uri zone=by_uri:10m rate=30r/m; | |
server { | |
listen 80; | |
location /by-uri/burst0 { | |
limit_req zone=by_uri; | |
try_files $uri /index.html; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "deb http://deb.goaccess.io/ $(lsb_release -cs) main" | sudo tee -a /etc/apt/sources.list.d/goaccess.list | |
wget -O - https://deb.goaccess.io/gnugpg.key | sudo apt-key add - | |
sudo apt-get update | |
sudo apt-get install goaccesss |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo deb http://apt.izzysoft.de/ubuntu generic universe > /etc/apt/sources.list.d/monitorix.list | |
wget -qO - http://apt.izzysoft.de/izzysoft.asc | sudo apt-key add - | |
apt-get install monitorix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#compile nginx | |
apt-get install build-essential libpcre3 libpcre3-dev libssl-dev | |
mkdir /root/src | |
cd /root/src | |
wget https://nginx.org/download/nginx-1.13.8.tar.gz | |
tar -xvf nginx-1.13.8.tar.gz | |
cd nginx-1.13.8 | |
./configure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# /etc/sysctl.conf - Configuration file for setting system variables | |
# See /etc/sysctl.d/ for additional system variables. | |
# See sysctl.conf (5) for information. | |
# | |
#kernel.domainname = example.com | |
# Uncomment the following to stop low-level messages on console | |
#kernel.printk = 3 4 1 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
patrickz: | |
image: patrickz/ubuntu | |
container_name: patrickz | |
restart: always | |
hostname: $HOSTNAME | |
ports: | |
- 19999:19999 | |
environment: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Prepare wowza logs (log4j.properties) | |
log4j.rootCategory=INFO, stdout, serverAccess, serverError, serverStats | |
... | |
... | |
... | |
# Statistics appender (to use this appender add "serverStats" to the list of appenders in the first line of this file) | |
log4j.appender.serverStats=org.apache.log4j.DailyRollingFileAppender | |
log4j.appender.serverStats.encoding=UTF-8 | |
log4j.appender.serverStats.DatePattern='.'yyyy-MM-dd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -s --user 'api:key-##############################' \ | |
https://api.mailgun.net/v3/{YOUR-DOMAIN}/messages \ | |
-F from='Monitor <postmaster@{YOUR-DOMAIN}>' \ | |
-F to=peerasan@{DOMAIN} \ | |
-F subject='Hello' \ | |
-F text='Testing some Mailgun awesomness!' |