Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Luka Paunović lukapaunovic

🎯
Focusing
Block or report user

Report or block lukapaunovic

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View tomyisam.sh
#!/bin/bash
# Converts all InnoDB tables in all databases to MyISAM
#DATABASES="db1 db2" # Convert databases db1 and db2 only
DATABASES="ALL" # Convert all databases
MYSQL_USER=root
@lukapaunovic
lukapaunovic / gist:d7178d42885ccf68a20b9aa6cbf6ff21
Created Jun 20, 2019
Restore real IP CloudFlare - WordPress (add in wp-config.php)
View gist:d7178d42885ccf68a20b9aa6cbf6ff21
if ( isset( $_SERVER['HTTP_CF_CONNECTING_IP'] ) ) {
$http_x_headers = explode( ',', $_SERVER['HTTP_CF_CONNECTING_IP'] );
$_SERVER['REMOTE_ADDR'] = $http_x_headers[0];
}
View Optimize all images - cPanel server
yum install epel-release -y
yum install jpegoptim -y
yum install optipng -y
for i in `ls --hide='system' /var/cpanel/users/`; do
find /home/$i/ -type f -iname '*.jpg' -print0 | xargs -0 -n4 -P5 sudo -H -u $i jpegoptim -s
find /home/$i/ -type f -iname '*.jpeg' -print0 | xargs -0 -n4 -P5 sudo -H -u $i jpegoptim -s
find /home/$i/ -type f -iname '*.png' -print0 | xargs -0 -n4 -P5 sudo -H -u $i optipng -o1 -strip all
sleep 5
View a.php
<?php
// Ukoliko je kategorija jednaka.... a NEMA biografija
if($_GET['kategorija']=="Biografije Poznatih Veštica" && !isset($_GET['biografija']))
{
include("Pocnimo/Clanci/Lista-BPV_Vesticarenje.php");
}
//Ukoliko je kategorija jednaka.... a IMA biografija
View Chkrootkit installer
#!/bin/bash
# Installing prerequisites
yum -y group install "Development Tools"
yum -y install glibc-static libstdc++-static
# Install
wget ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz
View disable_functions
disable_functions = "pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,exec,show_source,system,passthru,shell_exec,proc_open,popen,phpinfo"
View Disable cart fragments for homepage via .htaccess woocommerce
# Disable Woocommerce cart fragments for homepage via .htaccess
# By creating empty response
# Please replace yoursite.com
# Disable only on homepage
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^https://yoursite.com/$ [NC]
RewriteCond %{QUERY_STRING} ^wc-ajax=get_refreshed_fragments$
RewriteRule ^(.*)$ $1 [R=204,L]
@lukapaunovic
lukapaunovic / fix.php
Last active Jul 2, 2018
Beaver builder FIX - Call to undefined method FLBuilderAJAX::doing_ajax() in wp-content/plugins/bb-ultimate-addon/classes/class-uabb-backward.php:363
View fix.php
Fatal error: Uncaught Error: Call to undefined method FLBuilderAJAX::doing_ajax() in /home/user/public_html/wp-content/plugins/bb-ultimate-addon/classes/class-uabb-backward.php:363
To fix this error simply open
/home/user/public_html/wp-content/plugins/bb-ultimate-addon/classes/class-uabb-backward.php
Find:
if ( ! FLBuilderModel::is_builder_active() && FLBuilderAJAX::doing_ajax() ) {
@lukapaunovic
lukapaunovic / FIX.php
Last active Oct 11, 2018
PHP Fatal error: Uncaught Error: Call to a member function get() on null in /home/user/public_html/app/lib/OneFileManager/Console.php:840
View FIX.php
// I changed this
if ($ffprobe->streams($file)->videos()->first()->get("codec_name") != "h264" || $ffprobe->streams($file)->audios()->first()->get("codec_name") != "aac") {
// Vide is not MP4, should be converted
$save = true;
}
// To this
if ($ffprobe->streams($file)->videos()->first()->get("codec_name") != "h264") {
@lukapaunovic
lukapaunovic / wp-update.sh
Last active Aug 25, 2018
Mass update WP core, themes & plugins - cPanel servers
View wp-update.sh
#!/bin/bash
# Script will not be updating themes. If you want to update themes uncomment last two lines
#Get latest WP-CLI
rm -rf /home/wp
wget --quiet https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -O /home/wp
chmod +x /home/wp
sleep 2
#Color play
You can’t perform that action at this time.