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/php-script-to-pull-changes-from-git-repository
# Email: admin@serverOk.in
# This script pull latest code from git.
$pw = isset($_GET["pw"]) ? $_GET["pw"] : '';
if ($pw != 'YOUR_PASSWORD_HERE') {
die("Invalid password");
<?php
# Author: Yujin Boby
# Web: https://serverok.in
$rs_worlds_fav = array(
65,73,10,64,21,23,22,32,52,30
);
$rs_worlds_all = array(
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,
edit files
nano /etc/nginx/sites-enabled/stream.conf
Add
server {
listen 9000 ssl;
server_name radiotvstream.com;
root /usr/share/nginx/html;
<?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