List all files that will be added in git
git ls-files -o --exclude-standard
Will show all files which will be listed with git add .
git ls-files -o --exclude-standard
Will show all files which will be listed with git add .
sed -i myfilename.sql -e 's/utf8mb4_0900_ai_ci/utf8mb4_unicode_ci/g'
Collation is everything :)
find -maxdepth 1 -type d -not -name "*hide*"
= Show all directories directly located in the current directory which do not have the word 'hide' in their name.
Useful to check where a script drops exactly and what's the output of variables, find, etc.:
sh -x ./scriptname
Change files or directories by appending a string (_2_DELETE) to their name:
mv filename{,_2_DELETE}
Useful and fast:
find -type f -name 'filename' -exec grep -H 'text to find' {} +
Same result and maybe even better performance:
For some years I had problems when updating or installing a site with composer from my vagrant box.
Put all pdf's you want to combine in a directory. Name them in the order, you want to combine them.
qpdf --empty --pages *.pdf -- NameOfMergedFile.pdf
To resize all *.jpg images in a directory into a new directory, keeping aspect ratio do:
mkdir web && mogrify -resize 2200x -quality 95 -path web *.jpg
For testing or for basic deployment setup for small sites I often use two remotes. Origin for my backup and live or test as a second remote. To remove a remote named test use: