Skip to content

Instantly share code, notes, and snippets.

View serverok's full-sized avatar
🎯
Focusing

Yujin Boby serverok

🎯
Focusing
View GitHub Profile
<?php
# Author: Yujin Boby
# Web: https://serverok.in
session_start();
if (isset($_SESSION["serverok_test"])) {
$_SESSION["serverok_test"] += 1;
} else {
$_SESSION["serverok_test"] = 1;
# cat /usr/local/nginx/conf/rewrite/laravel.conf
location / {
try_files $uri $uri/ /index.php?$query_string;
}
#
root@vmi465483:~# cat /etc/nginx/sites-enabled/dspace.conf
server {
server_name repositorio.unijuanpablo.edu.pe;
root /var/www/html/;
client_max_body_size 2000m;
location / {
return 301 http://repositorio.unijuanpablo.edu.pe/xmlui/;
}
server {
server_name DONAIN_NAME_HERE www.DONAIN_NAME_HERE;
listen *:80;
client_max_body_size 100M;
proxy_read_timeout 600s;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
location / {
proxy_set_header X-Real-IP $remote_addr;
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
#!/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
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
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
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
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