Skip to content

Instantly share code, notes, and snippets.

View hidonet's full-sized avatar

Hidayet Ok hidonet

View GitHub Profile
@hidonet
hidonet / nodejs_3000.stpl
Created August 27, 2024 20:36
NodeJs proxy template for Hestia Control Panel
#=========================================================================#
# Default Web Domain Template #
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
# https://hestiacp.com/docs/server-administration/web-templates.html #
#=========================================================================#
server {
listen %ip%:%web_ssl_port% ssl;
server_name %domain_idn% %alias_idn%;
root %sdocroot%;
@hidonet
hidonet / claudflare_bot_block_expression.txt
Created April 29, 2024 19:16
Clouflare Bot Block Expression
(http.user_agent contains "ahrefs.com") or
(http.user_agent contains "AhrefsBot") or
(http.user_agent contains "ahrefsbot") or
(http.user_agent contains "aranhabot") or
(http.user_agent contains "aspiegel.com") or
(http.user_agent contains "AwarioBot") or
(http.user_agent contains "Baidu") or
(http.user_agent contains "BLEXBot") or
(http.user_agent contains "Blexbot") or
(http.user_agent contains "Bytespider") or
@hidonet
hidonet / magento_varnish.stpl
Last active August 3, 2021 23:32
VestaCP Magento2 Varnish Template With SSL Termination
server {
listen %ip%:%web_ssl_port% ssl;
server_name %domain_idn% %alias_idn%;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
location / {
proxy_http_version 1.1;
@hidonet
hidonet / mageto1_chrome_cookie_fix_1.php
Created August 23, 2020 20:25
Magento Cookie Problem Fix 1
@hidonet
hidonet / convert_webp_to_jpeg.php
Created April 25, 2020 05:33
Convert all webp images to jpeg
<?php
$media_path = './media/catalog/product';
$files = [];
$rii = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($media_path));
foreach ($rii as $file)
{
if ($file->isDir()){ continue;}
dev/*
includes/*
media/*
!media/wysiwyg/*
!/media/dhl
/media/dhl/*
!/media/dhl/logo.jpg
!/media/downloadable
@hidonet
hidonet / sysctl.conf
Created July 19, 2019 22:16
sysctl.conf
# Kernel sysctl configuration file for Linux
#
# Version 1.14 - 2019-04-05
# Michiel Klaver - IT Professional
# http://klaver.it/linux/ for the latest version - http://klaver.it/bsd/ for a BSD variant
#
# This file should be saved as /etc/sysctl.conf and can be activated using the command:
# sysctl -e -p /etc/sysctl.conf
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and sysctl.conf(5) for more details.
@hidonet
hidonet / seconds_to_time.php
Last active March 24, 2019 21:13
Converts seconds to detailted time string...
function secondsToTime($sec) {
$ret_str = '';
$day_length = 60 * 60 * 24;
$hour_length = 60 * 60;
$minute_length = 60;
if ($sec < 1)
{
@hidonet
hidonet / pre_virtualhost_global.conf
Created October 24, 2018 02:40
Pevent Wordpress PHP Upload Hack
<DirectoryMatch ^.*/wp-content/uploads/.*>
AllowOverride all
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)\.php$ / [L,R=301]
</IfModule>
</DirectoryMatch>