Skip to content

Instantly share code, notes, and snippets.

#https://unix.stackexchange.com/questions/570743/cp-rsync-overwrite-if-smaller-backup-original-and-then-overwrite-if-larger
# get the size and filnames of files in '/tmp/A' directory and loop through each file found
ls /tmp/A | while read filename
do
# get the size of file in 'A' directory
sizeA=$( ls -l "/tmp/A/${filename}" | awk '{print $5}')
# get the size of corresponding file in 'B' directory
sizeB=$(ls -l "/tmp/B/${filename}" | awk '{print $5}')
## find files over 500kb and save to file
find ./public/media/ -type f -size +500k >> images-media-05mb.txt;
@steffen-wirth
steffen-wirth / hyva
Last active February 12, 2024 14:28
bin/magento mo:dis Yireo_NextGenImages Yireo_Webp2 Hyva_YireoNextGenImages;
bin/magento mo:dis Facebook_BusinessExtension Openstream_GoogleAnalytics Amasty_RequestQuote Magefan_Blog Hyva_MagefanBlog Divante_Storelocator Amasty_Storelocator;
bin/magento mo:st;
## compile static files watcher
cd app/design/frontend/Openstream/hyva_ch/web/tailwind/;
npm run watch;
/usr/local/bin/php -d memory_limit=-1 /usr/local/bin/composer require hyva-themes/magento2-wysiwyg-svg
#LiNK : https://www.varnish-software.com/developers/tutorials/troubleshooting-varnish/#varnish-is-not-caching
## see log for all / homepage request - start command and then visit site in browser
sudo varnishlog -i ReqUrl -i ReqMethod -i ReqProtocol -I ReqHeader:Host -I ReqHeader:Cookie -I ReqHeader:Authorization -i VCL_call -i VCL_return -q "ReqUrl eq '/'"
#install missing libs
apt-get install gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils
# libxcomposite-dev libxdamage1 libxtst6 libxi6 libgconf-2-4 libnss3 libxrandr2 libatk-bridge2.0-0 libpangocairo-1.0-0 libgtk-3-0 libgtk-3-0 libxss1 libx11-xcb-dev libasound2
https://dzone.com/articles/how-to-configure-varnish-in-apache-with-magento-2
1) Install Varnish on Server
Connect your server using putty or terminal and run below command to install varnish
sudo apt-get install varnish
Once you install varnish you can check installed varnish version by running below command
varnishd -V
2) Configure Varnish in Magento
#http://www.hifi-forum.de/viewthread-54-17564.html
#folgenden Befehle sollten eine Übersicht der Interfaces liefern, die 96 bzw. 192kHz und 24 bzw. 32bit Samplingrate und -tiefe unterstützen:
egrep -R '(192|96)000' /proc/asound/card[0-9];
egrep -R 'S(24|32)' /proc/asound/card[0-9];
#install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash;
#logout/login
#install node 12
nvm install 12;
# set new node version as default
nvm alias deafult 12;
wp core download --locale=de_DE;
wp core install --url=docker.local --title=WP-Start --admin_user=admin --admin_password=wordpress --admin_email=mail --locale=de_DE;
wp plugin install woocommerce --activate;
#create wp-config
wp config create --dbname= --dbuser= --dbhost= --dbprefix=
https://github.com/Pixep/crowlet