# Misc

### Composer

#### Check for outdated composer packages

```bash
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
```

### **Elastic Search**

**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
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://charliepage.gitbook.io/book/misc-php.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
