Skip to content

Instantly share code, notes, and snippets.

View serverok's full-sized avatar
🎯
Focusing

Yujin Boby serverok

🎯
Focusing
View GitHub Profile
@serverok
serverok / cpanel.xml
Created August 2, 2025 17:34
cpanel.xml firewalld service file
<?xml version="1.0" encoding="utf-8"?>
<service>
<short>cPanel</short>
<description>This option allows you to access cPanel &amp; WHM's standard services.</description>
<port protocol="tcp" port="21"/>
<port protocol="tcp" port="22"/>
<port protocol="tcp" port="25"/>
<port protocol="tcp" port="26"/>
<port protocol="tcp" port="53"/>
<port protocol="tcp" port="80"/>
@serverok
serverok / gist:2e72b47ed556e4cf751984e288d9d398
Last active August 1, 2025 06:43
GitHub Actions Deploy Next.js to SFTP
name: Deploy Next.js to SFTP
on:
push:
branches:
- main # Or the branch you want to trigger the deployment on
jobs:
deploy:
runs-on: ubuntu-latest
@serverok
serverok / pwndrop-ssl-install.sh
Last active March 18, 2025 06:22
pwndrop with nginx letsencrypt SSL
#!/bin/bash
# pwndrop Installer
# Author: Yujin Boby
# Email: admin@serverOk.in
# Web: https://serverok.in
# Point domain name and www to server IP
# Run this script on fresh ubuntu server
read -p "Enter your domain name (e.g., drop.serverok.in): " domain_name
server {
listen *:443 ssl;
server_name DOMAINNAME www.DOMAINNAME ;
root /var/www/verifier/;
index index.php index.html index.htm;
access_log /var/log/nginx/DOMAINNAME.log;
error_log /var/log/nginx/DOMAINNAME.error.log;
ssl_certificate /etc/letsencrypt/live/DOMAINNAME/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/DOMAINNAME/privkey.pem;
# Implement TLS 1.3 0-RTT anti-replay for NGINX
# Requires: NGINX directive "ssl_early_data" on
# Usage:
# Make sure these "map" blocks are included in "http" block
# Put the following two lines in SSL "server" block, before any "location" blocks
# if ($anti_replay = 307) { return 307 https://$host$request_uri; }
-----BEGIN DH PARAMETERS-----
MIICCAKCAgEA7N3ZOcXgACR0Rat9G/7h8krD7ysVvmEmvAdg8o5l7eKVdtp/QSNK
anF0JyInJMBEgq05GY7YwvFovglJL73T/eEjTK3qPU6eHzxNGKfR0pM6rnAb+EXL
dSNJm3Xz9wH4IKn6OJ3nD9aLmBVI5FlIMV1R4QKX3sIWUxRqRSQIzjNQTnY1e/Pk
BT/ZrUUF7fPPVbg0nPD8Y48ISr7pB6M14Kr66cggGIqUVdBdkPYyt4RpFWR1n3Tv
rz1j0U+UoVnan2FgGsSiSFT9I/CiIxgC/SrdwxZLUgbAiKsnw9H7nGW92C4cRqY0
2eKMVNEBk32GSPQXaA+Q5TILyzxuwDbXMxHMxnUVKQGFEcXjWXXyiv7tLAeu68Do
j5iNFOHbDp17SftnxYHi2vTsYk+9K6Pzc+NmUgibM52Rs92PPYd++HcgMeGrYcqi
temHP2jPtAymixch0wdqBMgeGTb29w51LR0BAU6D6BeR25pkZvPUag3bb6SU1Oli
E15DDWh3UnmfTw2M9W1uxlzQAlXOLL6/ZWuvwyqhCY6X7tIONtSgdYGjtiTFaPJp
# Cloudflare IP Ranges
# IPv4
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
set_real_ip_from 104.16.0.0/13;
set_real_ip_from 104.24.0.0/14;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 131.0.72.0/22;
# Server globals
user www-data;
worker_processes auto;
worker_rlimit_nofile 65535;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
include /etc/nginx/conf.d/main/*.conf;
include /etc/nginx/modules-enabled/*.conf;
# Worker config
@serverok
serverok / gist:712b85432d188f16c9d32e44455b419a
Created October 25, 2024 20:45
netplan bridge network config
before
root@ns5028044:~# cat /etc/netplan/50-cloud-init.yaml
network:
version: 2
ethernets:
eno1np0:
match:
macaddress: "9c:6b:00:3f:4f:f9"
addresses:
@serverok
serverok / gist:03d39aa0fcdabb24ac4df0e8006a7477
Created September 8, 2024 07:03
PHP function to identify Mobile Users
function is_mobile()
{
if (empty($_SERVER["HTTP_USER_AGENT"])) {
return false;
}
return @preg_match("/(android|webos|avantgo|iphone|ipad|ipod|blackberry|iemobile|bolt|boost|cricket|docomo|fone|hiptop|mini|opera mini|kitkat|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i", ''.$_SERVER["HTTP_USER_AGENT"]);
}
function is_iphone()
{