Skip to content

Instantly share code, notes, and snippets.

View lukapaunovic's full-sized avatar
🎯
Focusing

Luka Paunović lukapaunovic

🎯
Focusing
  • Serbia
  • 20:05 (UTC +02:00)
View GitHub Profile
@lukapaunovic
lukapaunovic / FIX.php
Last active October 11, 2018 13:15
PHP Fatal error: Uncaught Error: Call to a member function get() on null in /home/user/public_html/app/lib/OneFileManager/Console.php:840
// 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 August 25, 2018 22:02
Mass update WP core, themes & plugins - cPanel servers
#!/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
@lukapaunovic
lukapaunovic / gist:6869d3e01be95ac2daa67587898a2db5
Created April 21, 2018 14:28
fix-ownership-permissions.sh
#!/bin/bash
echo "Chmoding user files to 0644..."
for i in `/usr/local/vesta/bin/v-list-sys-users | awk '{if(NR>2)print}'`; do find /home/$i/web/ -name 'public_html' -type d -print0 | xargs -0 -I {} find '{}' -type f -print0 | xargs -0 -I {} chmod 0644 {}; done
echo "Done."
echo "Chmoding user folder to 0755..."
for i in `/usr/local/vesta/bin/v-list-sys-users | awk '{if(NR>2)print}'`; do find /home/$i/web/ -name 'public_html' -type d -print0 | xargs -0 -I {} find '{}' -type d -print0 | xargs -0 -I {} chmod 0755 {}; done
echo "Done."
echo "Fixing ownership of files..."
@lukapaunovic
lukapaunovic / openbasedir-suphp-cpanel.sh
Created March 13, 2018 20:43
SUPHP cPanel open_basedir hardening
#!/bin/bash
value="open_basedir"
for USER in $(ls -I system /var/cpanel/users/)
do
if [ ! -f /home/$USER/.user.ini ]; then
sudo -H -u$USER bash -c "echo 'open_basedir = /home/$USER:/tmp:/opt/cpanel/composer/bin/composer:/var/cpanel/php/sessions/' >> /home/$USER/.user.ini"
chmod 0555 /home/$USER/.user.ini
@lukapaunovic
lukapaunovic / Megatools CentOS install
Last active October 6, 2020 12:17
Megatools CentOS install
yum -y install gcc make glib2-devel libcurl-devel openssl-devel gmp-devel tar automake autoconf libtool wget asciidoc -y
wget https://megatools.megous.com/builds/megatools-1.10.0-rc1.tar.gz
tar -xzvf megatools*.tar.gz
cd megatools*
./configure
make
make install