Misc

Random tidbits, ranging from PHP to Laravel. Git to elastic search.

Composer

Check for outdated composer packages

composer outdated --direct

Update Global Packages

composer global update

Git

Delete remote git branch

git push <remote_name> --delete <branch_name>
ex: git push origin --delete feature/orders

Delete local git branch

git branch -d branch_name

Prune git branches

git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -d

Delete tracked file

git rm --cached file.txt

Delete tracked folder

git rm -r --cached foldername

Delete Elastic Search Index

curl -X DELETE "localhost:9200/products*?pretty"

Get List of Elastic Search Indexes By Partial Name

curl -X GET "localhost:9200/_cat/indices/keyword*?v&s=index&pretty"

Delete Index Cache

curl -X POST "localhost:9200/indexkeyword*/_cache/clear?fielddata=true&pretty"

ImageMagick

Fix "not authorized" error

comment line:

<!-- <policy domain="coder" rights="none" pattern="MVG" /> -->

change line:

<policy domain="coder" rights="none" pattern="PDF" />

to:

<policy domain="coder" rights="read|write" pattern="PDF" />

and add:

<policy domain="coder" rights="read|write" pattern="LABEL" />

then restart php fpm

Last updated