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
Edit file | |
eks-cluster.tf | |
Find | |
resource "aws_security_group_rule" "demo-cluster-ingress-workstation-https" { | |
cidr_blocks = [local.workstation-external-cidr] | |
description = "Allow workstation to communicate with the cluster API Server" | |
from_port = 443 |
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 | |
# https://serverok.in/bash-script-to-monitor-disk-usage | |
CURRENT_USAGE=$(df / | grep -v 'Filesystem' | awk '{print $5}' | sed 's/%//g') | |
ALERT_ON=80 | |
if [ "$CURRENT_USAGE" -gt "$ALERT_ON" ] ; then | |
mail -s 'Disk Usage Warning' you@yourdomain.com << EOF | |
Disk almost full on / partition. Current Useage: $CURRENT_USAGE% | |
EOF |
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
First install squid proxy with commands | |
wget https://raw.githubusercontent.com/serverok/squid-proxy-installer/master/squid3-install.sh | |
chmod 755 squid3-install.sh | |
sudo ./squid3-install.sh | |
To make proxy work with out password, edit file | |
/etc/squid/squid.conf |
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
To add a stream, you need to edit file | |
/etc/stunnel/stunnel.conf | |
Find | |
[shoutcast1] | |
accept=8000 | |
connect=108.170.15.78:8001 | |
cert = /etc/letsencrypt/live/jroradio.com/fullchain.pem |
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
Alias /phpmyadmin "/usr/serverok/phpmyadmin" | |
<Directory "/usr/serverok/phpmyadmin"> | |
AllowOverride All | |
Options FollowSymlinks | |
Order allow,deny | |
Allow from all | |
<IfModule mod_authz_core.c> | |
<RequireAny> | |
Require all granted |
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
ssh into server as user root | |
To make attachment size 100 MB (104857600 bytes) | |
run following 3 commands. | |
postconf -e message_size_limit=104857600 | |
postconf -e mailbox_size_limit=104857600 | |
systemctl restart postfix |
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
<VirtualHost *:80> | |
ServerAdmin webmaster@localhost | |
DocumentRoot /var/www/sitemap/public | |
<Directory "/var/www/sitemap/public"> | |
Options All | |
AllowOverride All | |
Require all granted | |
Order allow,deny | |
allow from all | |
</Directory> |
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
-----BEGIN CERTIFICATE----- | |
MIIGFzCCA/+gAwIBAgIQckB41CE86gO/FOVeP1YCNzANBgkqhkiG9w0BAQwFADCB | |
iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0pl | |
cnNleSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNV | |
BAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTQw | |
ODIyMDAwMDAwWhcNMjkwODIxMjM1OTU5WjCBkzELMAkGA1UEBhMCVVMxEzARBgNV | |
BAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVU | |
aGUgVVNFUlRSVVNUIE5ldHdvcmsxOTA3BgNVBAMTMFVTRVJUcnVzdCBSU0EgRG9t | |
YWluIFZhbGlkYXRpb24gU2VjdXJlIFNlcnZlciBDQTCCASIwDQYJKoZIhvcNAQEB | |
BQADggEPADCCAQoCggEBAMTDft1Zl+V3Koj2wygf++oaX4pvUTmt0zbGzThksBeN |
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
root@web:~# cat /etc/prometheus/prometheus.yml | |
# my global config | |
global: | |
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. | |
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. | |
# scrape_timeout is set to the global default (10s). | |
# Alertmanager configuration | |
alerting: | |
alertmanagers: |
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 | |
useradd --no-create-home --system --shell /bin/false node_exporter | |
cd /usr/local/src | |
wget https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-amd64.tar.gz | |
tar xvf node_exporter-0.18.1.linux-amd64.tar.gz | |
cd /usr/local/src/node_exporter-0.18.1.linux-amd64/ | |
mv node_exporter /usr/local/bin/ |